启用父部门状态排除顶级节点

This commit is contained in:
RuoYi 2021-07-30 11:28:04 +08:00
parent f6bc28000e
commit 2de5cc52d1
1 changed files with 2 additions and 1 deletions

View File

@ -209,7 +209,8 @@ public class SysDeptServiceImpl implements ISysDeptService
updateDeptChildren(dept.getDeptId(), newAncestors, oldAncestors); updateDeptChildren(dept.getDeptId(), newAncestors, oldAncestors);
} }
int result = deptMapper.updateDept(dept); int result = deptMapper.updateDept(dept);
if (UserConstants.DEPT_NORMAL.equals(dept.getStatus())) if (UserConstants.DEPT_NORMAL.equals(dept.getStatus()) && StringUtils.isNotEmpty(dept.getAncestors())
&& !StringUtils.equals("0", dept.getAncestors()))
{ {
// 如果该部门是启用状态则启用该部门的所有上级部门 // 如果该部门是启用状态则启用该部门的所有上级部门
updateParentDeptStatusNormal(dept); updateParentDeptStatusNormal(dept);