|
@@ -11,6 +11,7 @@ import com.ruoyi.common.constant.UserConstants; |
|
@@ -11,6 +11,7 @@ import com.ruoyi.common.constant.UserConstants; |
|
11
|
import com.ruoyi.common.core.domain.TreeSelect;
|
11
|
import com.ruoyi.common.core.domain.TreeSelect;
|
|
12
|
import com.ruoyi.common.core.domain.entity.SysDept;
|
12
|
import com.ruoyi.common.core.domain.entity.SysDept;
|
|
13
|
import com.ruoyi.common.core.domain.entity.SysRole;
|
13
|
import com.ruoyi.common.core.domain.entity.SysRole;
|
|
|
|
14
|
+import com.ruoyi.common.core.text.Convert;
|
|
14
|
import com.ruoyi.common.exception.CustomException;
|
15
|
import com.ruoyi.common.exception.CustomException;
|
|
15
|
import com.ruoyi.common.utils.StringUtils;
|
16
|
import com.ruoyi.common.utils.StringUtils;
|
|
16
|
import com.ruoyi.system.mapper.SysDeptMapper;
|
17
|
import com.ruoyi.system.mapper.SysDeptMapper;
|
|
@@ -211,7 +212,7 @@ public class SysDeptServiceImpl implements ISysDeptService |
|
@@ -211,7 +212,7 @@ public class SysDeptServiceImpl implements ISysDeptService |
|
211
|
if (UserConstants.DEPT_NORMAL.equals(dept.getStatus()))
|
212
|
if (UserConstants.DEPT_NORMAL.equals(dept.getStatus()))
|
|
212
|
{
|
213
|
{
|
|
213
|
// 如果该部门是启用状态,则启用该部门的所有上级部门
|
214
|
// 如果该部门是启用状态,则启用该部门的所有上级部门
|
|
214
|
- updateParentDeptStatus(dept);
|
215
|
+ updateParentDeptStatusNormal(dept);
|
|
215
|
}
|
216
|
}
|
|
216
|
return result;
|
217
|
return result;
|
|
217
|
}
|
218
|
}
|
|
@@ -221,12 +222,11 @@ public class SysDeptServiceImpl implements ISysDeptService |
|
@@ -221,12 +222,11 @@ public class SysDeptServiceImpl implements ISysDeptService |
|
221
|
*
|
222
|
*
|
|
222
|
* @param dept 当前部门
|
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
|
/**
|