|
|
@ -416,6 +416,41 @@ public class GovOrgServiceImpl implements GovOrgService { |
|
|
|
return resultDTO; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Param formDTO |
|
|
|
* @Description 【通讯录】组织/部门/网格下人员列表 |
|
|
|
* @author sun |
|
|
|
*/ |
|
|
|
@Override |
|
|
|
public OrgStaffListResultDTO getCurrentOrgStafflist(OrgStaffListFormDTO formDTO) { |
|
|
|
OrgStaffListResultDTO resultDTO = new OrgStaffListResultDTO(); |
|
|
|
//1.按类型查询组织、部门、网格下所有工作人员Id列表[需要按角色排序 所以这里不能分页]
|
|
|
|
List<String> staffIds = customerStaffAgencyDao.selectStaffList(formDTO.getOrgId(), formDTO.getOrgType()); |
|
|
|
if (org.springframework.util.CollectionUtils.isEmpty(staffIds)) { |
|
|
|
return resultDTO; |
|
|
|
} |
|
|
|
formDTO.setStaffIds(staffIds); |
|
|
|
//是否包含自己
|
|
|
|
if("0".equals(formDTO.getIncludeMe())){ |
|
|
|
staffIds.removeIf(s->s.equals(formDTO.getStaffId())); |
|
|
|
} |
|
|
|
|
|
|
|
//2.分页查询工作人员基础信息、角色信息【组织人员单位领导角色人员在前;部门人员部门领导角色人员在前;网格人员网格长角色人员在前】
|
|
|
|
List<ListStaffResultDTO> staffList = epmetUserService.selectStaffList(staffIds); |
|
|
|
|
|
|
|
//3.查询工作人员注册组织关系信息
|
|
|
|
List<String> staffIdList = staffList.stream().map(ListStaffResultDTO::getStaffId).collect(Collectors.toList()); |
|
|
|
if (!CollectionUtils.isEmpty(staffIdList)){ |
|
|
|
List<StaffOrgNameResultDTO> list = customerAgencyDao.selelctStaffOrg(staffIdList); |
|
|
|
staffList.forEach(re -> list.stream().filter(l -> re.getStaffId().equals(l.getStaffId())).forEach(s -> re.setOrgType(s.getOrgType()))); |
|
|
|
} |
|
|
|
|
|
|
|
//3.封装数据并返回
|
|
|
|
resultDTO.setStaffCount(staffIds.size()); |
|
|
|
resultDTO.setStaffList((null == staffList ? new ArrayList<>() : staffList)); |
|
|
|
return resultDTO; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Param formDTO |
|
|
|
* @Description 【通讯录】人员详情v2 |
|
|
|