Browse Source

部门人员查询接口Bug修复

dev_shibei_match
sunyuchao 5 years ago
parent
commit
888364acbf
  1. 16
      epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java

16
epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerAgencyServiceImpl.java

@ -198,12 +198,15 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
//2.1:查询组织下部门列表
List<DepartmentListResultDTO> listDept = customerDepartmentDao.selectDepartmentList(canTick.getAgencyId());
List<DeptListResultDTO> departmentList = ConvertUtils.sourceToTarget(listDept, DeptListResultDTO.class);
List<CustomerStaffDepartmentDTO> deptStaffs = new ArrayList<>();
if (null != departmentList && departmentList.size() > NumConstant.ZERO) {
//2.2:查询每一个部门下人员列表
List<String> deptIdList = departmentList.stream().map(DeptListResultDTO::getDepartmentId).collect(Collectors.toList());
List<CustomerStaffDepartmentDTO> deptStaffs = customerStaffDepartmentDao.selectDeptStaffs(deptIdList);
deptStaffs = customerStaffDepartmentDao.selectDeptStaffs(deptIdList);
List<CustomerStaffDepartmentDTO> finalDeptStaffs = deptStaffs;
departmentList.forEach(dept->{
List<StaffListResultDTO> departmentStaffList = new ArrayList<>();
deptStaffs.forEach(ds->{
finalDeptStaffs.forEach(ds->{
if (dept.getDepartmentId().equals(ds.getDepartmentId())) {
if (!"project".equals(canTick.getType()) || "".equals(canTick.getDeptOrGridId()) || !dept.getDepartmentId().equals(canTick.getDeptOrGridId())) {
StaffListResultDTO sf = new StaffListResultDTO();
@ -214,15 +217,19 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
});
dept.setDepartmentStaffList(departmentStaffList);
});
}
//3:根据组织Id查询该组织下网格、人员列表
//3.1:查询组织下网格列表
List<GridListResultDTO> gridList = customerGridDao.selectGridList(canTick.getAgencyId());
List<CustomerStaffGridDTO> gridStaffs = new ArrayList<>();
if (null != gridList && gridList.size() > NumConstant.ZERO) {
//3.2:查询每一个网格下人员列表
List<String> gridIdList = gridList.stream().map(GridListResultDTO::getGridId).collect(Collectors.toList());
List<CustomerStaffGridDTO> gridStaffs = customerStaffGridDao.selectGridStaffs(gridIdList);
gridStaffs = customerStaffGridDao.selectGridStaffs(gridIdList);
List<CustomerStaffGridDTO> finalGridStaffs = gridStaffs;
gridList.forEach(grid->{
List<StaffListResultDTO> gridStaffList = new ArrayList<>();
gridStaffs.forEach(gs->{
finalGridStaffs.forEach(gs->{
if(grid.getGridId().equals(gs.getGridId())){
if (!"project".equals(canTick.getType()) || "".equals(canTick.getDeptOrGridId()) || !grid.getGridId().equals(canTick.getDeptOrGridId())) {
StaffListResultDTO sf = new StaffListResultDTO();
@ -233,6 +240,7 @@ public class CustomerAgencyServiceImpl extends BaseServiceImpl<CustomerAgencyDao
});
grid.setGridStaffList(gridStaffList);
});
}
//4:汇总组织下人员、组织下部门下人员、组织下网格下人员Id集合,调用epmet-user服务查询工作人员基本信息
List<String> staffIdList1 = agencyStaffList.stream().map(StaffListResultDTO::getStaffId).collect(Collectors.toList());
List<String> staffIdList2 = deptStaffs.stream().map(CustomerStaffDepartmentDTO::getUserId).collect(Collectors.toList());

Loading…
Cancel
Save