| | |
| | | } |
| | | UmsDepart depart = new UmsDepart(); |
| | | BeanUtils.copyProperties(addDepartVO, depart); |
| | | if (sccgDepartMapper.insert(depart) <= 0) { |
| | | if (sccgDepartMapper.insert(depart) != 1) { |
| | | throw new ApiException(ResultCode.RECORD_SAVE_FAIL); |
| | | } |
| | | } |
| | |
| | | umsAdminDepartService.save(adminDepart); |
| | | }); |
| | | } |
| | | if (sccgDepartMapper.updateById(depart) <= 0) { |
| | | if (sccgDepartMapper.updateById(depart) != 1) { |
| | | throw new ApiException(ResultCode.RECORD_UPDATE_FAIL); |
| | | } |
| | | } |
| | |
| | | return griddingEntities; |
| | | } |
| | | |
| | | /** |
| | | * 递归查找所有网格的子网格 |
| | | * |
| | | * @param root 当前网格 |
| | | * @param all 所有网格 |
| | | * @return |
| | | */ |
| | | public List<UmsDepart> getChildrens(UmsDepart root, List<UmsDepart> all) { |
| | | List<UmsDepart> collect = all.stream().filter(griddingEntity -> { |
| | | return griddingEntity.getParentId().equals(root.getId()); |