|
|
@@ -8,6 +8,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
8
|
8
|
import org.springframework.stereotype.Service;
|
|
9
|
9
|
import com.ruoyi.common.core.constant.UserConstants;
|
|
10
|
10
|
import com.ruoyi.common.core.exception.CustomException;
|
|
|
11
|
+import com.ruoyi.common.core.text.Convert;
|
|
11
|
12
|
import com.ruoyi.common.core.utils.StringUtils;
|
|
12
|
13
|
import com.ruoyi.common.datascope.annotation.DataScope;
|
|
13
|
14
|
import com.ruoyi.system.api.domain.SysDept;
|
|
|
@@ -211,7 +212,7 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|
211
|
212
|
if (UserConstants.DEPT_NORMAL.equals(dept.getStatus()))
|
|
212
|
213
|
{
|
|
213
|
214
|
// 如果该部门是启用状态,则启用该部门的所有上级部门
|
|
214
|
|
- updateParentDeptStatus(dept);
|
|
|
215
|
+ updateParentDeptStatusNormal(dept);
|
|
215
|
216
|
}
|
|
216
|
217
|
return result;
|
|
217
|
218
|
}
|
|
|
@@ -221,12 +222,11 @@ public class SysDeptServiceImpl implements ISysDeptService
|
|
221
|
222
|
*
|
|
222
|
223
|
* @param dept 当前部门
|
|
223
|
224
|
*/
|
|
224
|
|
- private void updateParentDeptStatus(SysDept dept)
|
|
|
225
|
+ private void updateParentDeptStatusNormal(SysDept dept)
|
|
225
|
226
|
{
|
|
226
|
|
- String updateBy = dept.getUpdateBy();
|
|
227
|
|
- dept = deptMapper.selectDeptById(dept.getDeptId());
|
|
228
|
|
- dept.setUpdateBy(updateBy);
|
|
229
|
|
- deptMapper.updateDeptStatus(dept);
|
|
|
227
|
+ String ancestors = dept.getAncestors();
|
|
|
228
|
+ Long[] deptIds = Convert.toLongArray(ancestors);
|
|
|
229
|
+ deptMapper.updateDeptStatusNormal(deptIds);
|
|
230
|
230
|
}
|
|
231
|
231
|
|
|
232
|
232
|
/**
|