From 2e8d2ac5fa6205e42eaf92cafe8f456b9c2d6ccc Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Fri, 17 Sep 2021 14:45:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B1=85=E6=B0=91=E7=AB=AFentergrid=E3=80=81?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E7=AB=AFprofile=E6=8E=A5=E5=8F=A3=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E8=BF=94=E5=8F=82=E4=BE=9B=E8=B0=83=E6=9F=A5=E9=97=AE?= =?UTF-8?q?=E5=8D=B7=E6=8F=90=E4=BA=A4=E9=97=AE=E5=8D=B7=E6=97=B6=E4=BD=BF?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/result/StaffOrgNameResultDTO.java | 45 +++++++++++ .../com/epmet/dao/StaffOrgRelationDao.java | 11 ++- .../service/impl/CustomerGridServiceImpl.java | 8 +- .../epmet/service/impl/StaffServiceImpl.java | 15 ++++ .../resources/mapper/StaffOrgRelationDao.xml | 77 ++++++++++++++++++- .../result/UserInfoOnEnterGridResultDTO.java | 7 ++ .../impl/RegisterRelationServiceImpl.java | 3 + 7 files changed, 163 insertions(+), 3 deletions(-) create mode 100644 epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffOrgNameResultDTO.java diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffOrgNameResultDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffOrgNameResultDTO.java new file mode 100644 index 0000000000..58424f63f0 --- /dev/null +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/result/StaffOrgNameResultDTO.java @@ -0,0 +1,45 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.dto.result; + +import lombok.Data; + +import java.io.Serializable; + + +/** + * 查询工作人员注册组织信息 + * @author sun + */ +@Data +public class StaffOrgNameResultDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + //工作人员所属组织Id + private String agencyId = ""; + //人员Id + private String staffId = ""; + //人员注册时所属组织名【组织-组织,组织-部门,组织-网格】 + private String orgName = ""; + //工作人员添加入口Id(agencyId;deptId;gridId) + private String orgId = ""; + //工作人员添加入口类型(组织:agency;部门:dept;网格:gridId) + private String orgType = ""; + +} \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/StaffOrgRelationDao.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/StaffOrgRelationDao.java index a4d6610658..97c4e875b7 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/StaffOrgRelationDao.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/dao/StaffOrgRelationDao.java @@ -18,8 +18,12 @@ package com.epmet.dao; import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.dto.result.StaffOrgNameResultDTO; import com.epmet.entity.StaffOrgRelationEntity; import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +import java.util.List; /** * 工作人员注册组织关系表 @@ -29,5 +33,10 @@ import org.apache.ibatis.annotations.Mapper; */ @Mapper public interface StaffOrgRelationDao extends BaseDao { - + /** + * @Description 批量查询工作人员注册组织信息 + * @author sun + */ + List selelctStaffOrg(@Param("staffIdList") List staffIdList); + } \ No newline at end of file diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java index fd8be5cdbd..dae768cbf9 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/CustomerGridServiceImpl.java @@ -36,6 +36,7 @@ import com.epmet.dao.CustomerStaffGridDao; import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.result.*; +import com.epmet.entity.CustomerAgencyEntity; import com.epmet.entity.CustomerGridEntity; import com.epmet.feign.EpmetUserFeignClient; import com.epmet.feign.OperCrmOpenFeignClient; @@ -712,7 +713,12 @@ public class CustomerGridServiceImpl extends BaseServiceImpl getBaseInfo(CustomerGridFormDTO customerGridFormDTO) { - return new Result().ok(ConvertUtils.sourceToTarget(baseDao.selectById(customerGridFormDTO.getGridId()), CustomerGridDTO.class)); + CustomerGridDTO restltDTO = ConvertUtils.sourceToTarget(baseDao.selectById(customerGridFormDTO.getGridId()), CustomerGridDTO.class); + if (null != restltDTO) { + CustomerAgencyEntity entity = customerAgencyService.selectById(restltDTO.getPid()); + restltDTO.setAgencyName(null != entity ? entity.getOrganizationName() : ""); + } + return new Result().ok(restltDTO); } /** diff --git a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java index 9d6504d673..06e41fbbc2 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java +++ b/epmet-module/gov-org/gov-org-server/src/main/java/com/epmet/service/impl/StaffServiceImpl.java @@ -15,6 +15,7 @@ import com.epmet.constant.CustomerAgencyConstant; import com.epmet.constant.OrgInfoConstant; import com.epmet.dao.CustomerAgencyDao; import com.epmet.dao.CustomerStaffAgencyDao; +import com.epmet.dao.StaffOrgRelationDao; import com.epmet.dto.*; import com.epmet.dto.form.*; import com.epmet.dto.result.*; @@ -75,6 +76,8 @@ public class StaffServiceImpl implements StaffService { private StaffOrgRelationService staffOrgRelationService; @Resource private CustomerStaffRedis customerStaffRedis; + @Resource + private StaffOrgRelationDao staffOrgRelationDao; @Override public Result getStaffInfoForHome(StaffsInAgencyFromDTO fromDTO) { @@ -243,6 +246,18 @@ public class StaffServiceImpl implements StaffService { result.setRootAgencyName(agency.getOrganizationName()); } //2021.08.27 zhaoqf end + //2021.9.17 sun 添加工作人员注册组织、类型、id返参 start + List staffIdList = new ArrayList<>(); + staffIdList.add(result.getStaffId()); + List list = staffOrgRelationDao.selelctStaffOrg(staffIdList); + list.forEach(l->{ + if(l.getStaffId().equals(result.getStaffId())){ + result.setOrgId(l.getOrgId()); + result.setOrgName(l.getOrgName()); + result.setOrgType(l.getOrgType()); + } + }); + //2021.9.17 sun 添加工作人员注册组织、类型、id返参 end return result; } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffOrgRelationDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffOrgRelationDao.xml index 350dae73ac..76f749c00a 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffOrgRelationDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/StaffOrgRelationDao.xml @@ -3,6 +3,81 @@ - + \ No newline at end of file diff --git a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoOnEnterGridResultDTO.java b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoOnEnterGridResultDTO.java index 0bada1c5ee..64f790c115 100644 --- a/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoOnEnterGridResultDTO.java +++ b/epmet-user/epmet-user-client/src/main/java/com/epmet/dto/result/UserInfoOnEnterGridResultDTO.java @@ -58,4 +58,11 @@ public class UserInfoOnEnterGridResultDTO implements Serializable{ * XX街道-YYY 如果是未认证居民,这一列为空 */ private String userStreetTrueName; + + //工作人员添加入口Id(agencyId;deptId;gridId) + private String orgId = ""; + //人员注册时所属组织名【组织-组织,组织-部门,组织-网格】 + private String orgName = ""; + //工作人员添加入口类型(组织:agency;部门:dept;网格:gridId) + private String orgType = ""; } diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java index e2aaae2963..efafe3a963 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/RegisterRelationServiceImpl.java @@ -301,6 +301,9 @@ public class RegisterRelationServiceImpl extends BaseServiceImpl gridDTOResult = govOrgFeignClient.getGridBaseInfoByGridId(customerGridFormDTO); if(gridDTOResult.success() && null != gridDTOResult.getData()){ resultObj.setCurrentGridName(gridDTOResult.getData().getGridName()); + resultObj.setOrgId(resultObj.getCurrentGridId()); + resultObj.setOrgName(gridDTOResult.getData().getAgencyName()+"-"+gridDTOResult.getData().getGridName()); + resultObj.setOrgType("grid"); }else{ //查询网格名称失败 log.warn(String.format("查找网格信息失败,网格Id:【%s】",gridId));