From a61fd17deb0679dee3d4b3af7333b8988bd6e3f0 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 2 Sep 2021 17:10:12 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=84=E7=BB=87=E4=B8=8B=E4=B8=8D=E5=85=81?= =?UTF-8?q?=E8=AE=B8=E7=9C=8B=E5=88=B0=E9=9D=9E=E7=BB=84=E7=BB=87=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=9A=84=E4=BA=BA=E5=91=98=E3=80=81=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E7=BD=91=E6=A0=BC=E4=B8=8B=E6=B7=BB=E5=8A=A0=E7=9A=84=E4=BA=BA?= =?UTF-8?q?=E4=B8=8D=E5=85=81=E8=AE=B8=E5=86=8D=E9=83=A8=E9=97=A8=E7=BD=91?= =?UTF-8?q?=E6=A0=BC=E4=B8=8B=E7=A7=BB=E9=99=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/epmetuser/result/ListStaffResultDTO.java | 2 ++ .../service/govorg/impl/GovOrgServiceImpl.java | 14 ++++++++------ .../mapper/govorg/CustomerStaffAgencyDao.xml | 12 +++++++----- 3 files changed, 17 insertions(+), 11 deletions(-) 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