作者 RuoYi

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

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