更新deptLevel字段

This commit is contained in:
2023-10-30 15:09:33 +08:00
parent 7298f9b81f
commit 0168f7af51

View File

@@ -209,6 +209,11 @@ public class SysDeptServiceImpl implements SysDeptService {
String oldAncestors = oldDept.getAncestors();
dept.setAncestors(newAncestors);
updateDeptChildren(dept.getDeptId(), newAncestors, oldAncestors);
// 更新deptLevel字段
if (StringUtils.isNotBlank(newParentDept.getDeptLevel())) {
dept.setDeptLevel(String.valueOf(Integer.parseInt(newParentDept.getDeptLevel()) + 1));
}
}
int result = deptMapper.updateDept(dept);
if (UserConstants.DEPT_NORMAL.equals(dept.getStatus()) && StringUtils.isNotEmpty(dept.getAncestors())