|
|
@@ -114,20 +114,6 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
|
|
|
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- @Transactional
|
|
|
- public HttpResult batchLeader(SysDeptVo sysDeptVo) {
|
|
|
- // 更新每个部门的负责人
|
|
|
- for (String id : sysDeptVo.getDeptIds()) {
|
|
|
- SysDept sysDept = getById(id);
|
|
|
- if (sysDept == null) {
|
|
|
- throw new SystemException("机构不存在");
|
|
|
- }
|
|
|
- sysDept.setLeaderId(sysDeptVo.getLeaderId());
|
|
|
- sysDeptMapper.updateById(sysDept);
|
|
|
- }
|
|
|
- return HttpResult.ok("批量设置负责人成功。");
|
|
|
- }
|
|
|
|
|
|
@Override
|
|
|
@Transactional
|
|
|
@@ -199,6 +185,12 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
|
|
|
if(areaString.length()>0) {
|
|
|
item.setDivision(areaString.substring(0, areaString.length() - 1));
|
|
|
}
|
|
|
+ if(!Objects.isNull(item.getLeaderId())){
|
|
|
+ SysUserJzgInfo userByUserId = sysUserJzgInfoService.getUserByUserId(item.getLeaderId());
|
|
|
+ if(!Objects.isNull(userByUserId)){
|
|
|
+ item.setLeaderName(userByUserId.getName());
|
|
|
+ }
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
Map<String, List<SysDeptVo>> map = voDept.stream().collect(Collectors.groupingBy(SysDeptVo::getParentId));
|