diff --git a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/ListStaffResultDTO.java b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/ListStaffResultDTO.java index b465f8ec3e..ae926bd6ee 100644 --- a/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/ListStaffResultDTO.java +++ b/epmet-module/data-aggregator/data-aggregator-client/src/main/java/com/epmet/dataaggre/dto/epmetuser/result/ListStaffResultDTO.java @@ -31,5 +31,7 @@ public class ListStaffResultDTO implements Serializable { private String orgName = ""; //职责名称列表 private List roles; + //工作人员添加入口类型(组织:agency;部门:dept;网格:gridId) + private String orgType = ""; } diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java index 5a56be39c6..b7b23299ab 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/java/com/epmet/dataaggre/service/govorg/impl/GovOrgServiceImpl.java @@ -1,7 +1,6 @@ package com.epmet.dataaggre.service.govorg.impl; import com.alibaba.fastjson.JSON; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.epmet.commons.dynamic.datasource.annotation.DataSource; import com.epmet.commons.tools.constant.NumConstant; import com.epmet.commons.tools.exception.EpmetErrorCode; @@ -12,11 +11,6 @@ import com.epmet.dataaggre.dao.govorg.*; import com.epmet.dataaggre.dto.epmetuser.result.ListStaffResultDTO; import com.epmet.dataaggre.dto.epmetuser.result.StaffRoleListResultDTO; import com.epmet.dataaggre.dto.govorg.*; -import com.epmet.dataaggre.dto.govorg.form.*; -import com.epmet.dataaggre.dto.govorg.CustomerAgencyDTO; -import com.epmet.dataaggre.dto.govorg.CustomerDepartmentDTO; -import com.epmet.dataaggre.dto.govorg.CustomerGridDTO; -import com.epmet.dataaggre.dto.govorg.CustomerStaffAgencyDTO; import com.epmet.dataaggre.dto.govorg.form.NextAreaCodeFormDTO; import com.epmet.dataaggre.dto.govorg.form.OrgStaffListFormDTO; import com.epmet.dataaggre.dto.govorg.form.StaffDetailV2FormDTO; @@ -38,6 +32,7 @@ import java.util.ArrayList; import java.util.HashSet; import java.util.Iterator; import java.util.List; +import java.util.stream.Collectors; /** * @Author zxc @@ -401,6 +396,13 @@ public class GovOrgServiceImpl implements GovOrgService { //2.分页查询工作人员基础信息、角色信息【组织人员单位领导角色人员在前;部门人员部门领导角色人员在前;网格人员网格长角色人员在前】 List staffList = epmetUserService.getStaffInfoList(formDTO); + //3.查询工作人员注册组织关系信息 + List staffIdList = staffList.stream().map(ListStaffResultDTO::getStaffId).collect(Collectors.toList()); + if (!CollectionUtils.isEmpty(staffIdList)){ + List 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)); diff --git a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml index 65afdbabdd..55c4d7789c 100644 --- a/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml +++ b/epmet-module/data-aggregator/data-aggregator-server/src/main/resources/mapper/govorg/CustomerStaffAgencyDao.xml @@ -77,14 +77,16 @@ SELECT - user_id + csa.user_id FROM - customer_staff_agency + customer_staff_agency csa + INNER JOIN staff_org_relation sor ON csa.user_id = sor.staff_id WHERE - del_flag = '0' - AND agency_id = #{orgId} + csa.del_flag = '0' + AND sor.org_type = 'agency' + AND csa.agency_id = #{orgId} ORDER BY - created_time ASC + csa.created_time ASC