fix 修复 开启子部门 父部门未关联开启问题

This commit is contained in:
疯狂的狮子Li 2024-09-02 14:12:02 +08:00
parent 37f89f560f
commit 83dd98faf3

View File

@ -275,6 +275,8 @@ public class SysDeptServiceImpl implements ISysDeptService, DeptService {
dept.setAncestors(newAncestors); dept.setAncestors(newAncestors);
updateDeptChildren(dept.getDeptId(), newAncestors, oldAncestors); updateDeptChildren(dept.getDeptId(), newAncestors, oldAncestors);
} }
} else {
dept.setAncestors(oldDept.getAncestors());
} }
int result = baseMapper.updateById(dept); int result = baseMapper.updateById(dept);
if (UserConstants.DEPT_NORMAL.equals(dept.getStatus()) && StringUtils.isNotEmpty(dept.getAncestors()) if (UserConstants.DEPT_NORMAL.equals(dept.getStatus()) && StringUtils.isNotEmpty(dept.getAncestors())