| | |
| | | int result = baseMapper.updateById(dept); |
| | | if (UserConstants.DEPT_NORMAL.equals(dept.getStatus())) { |
| | | // 如果该部门是启用状态,则启用该部门的所有上级部门 |
| | | updateParentDeptStatus(dept); |
| | | updateParentDeptStatusNormal(dept); |
| | | } |
| | | return result; |
| | | } |
| | |
| | | /** |
| | | * 修改子元素关系 |
| | | * |
| | | * @param deptId 被修改的部门ID |
| | | * @param deptId 被修改的部门ID |
| | | * @param newAncestors 新的父ID集合 |
| | | * @param oldAncestors 旧的父ID集合 |
| | | */ |
| | |
| | | child.setAncestors(child.getAncestors().replaceFirst(oldAncestors, newAncestors)); |
| | | } |
| | | if (children.size() > 0) { |
| | | updateBatchById(children); |
| | | baseMapper.updateDeptChildren(children); |
| | | } |
| | | } |
| | | |