From 1bce7e8d49a3dcb3b4d4a3e96c453138f2d4c9b0 Mon Sep 17 00:00:00 2001 From: liushaowen <565850092@qq.com> Date: Wed, 18 Nov 2020 15:55:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E5=BB=BA=E8=AE=AEbug?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/epmet/dto/CustomerGridDTO.java | 12 +++++++- .../epmet/feign/GovOrgOpenFeignClient.java | 11 ++++++++ .../GovOrgOpenFeignClientFallback.java | 6 ++++ .../main/resources/mapper/CustomerGridDao.xml | 6 ++-- .../service/impl/UserAdviceServiceImpl.java | 28 ++++++++----------- 5 files changed, 43 insertions(+), 20 deletions(-) diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerGridDTO.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerGridDTO.java index a3c62138e1..39a0968121 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerGridDTO.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/dto/CustomerGridDTO.java @@ -113,4 +113,14 @@ public class CustomerGridDTO implements Serializable { * 所有上级组织ID */ private String pids; -} \ No newline at end of file + + /** + * 所属组织机构名 + */ + private String agencyName; + + /** + * 所有上级组织名 + */ + private String allParentName; +} diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java index e0e5cb9608..ffc0721596 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/GovOrgOpenFeignClient.java @@ -3,6 +3,7 @@ package com.epmet.feign; import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerAgencyDTO; +import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.CustomerPartyBranchDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; @@ -294,4 +295,14 @@ public interface GovOrgOpenFeignClient { @PostMapping("/gov/org/customergrid/getgridlistbygridids") Result> getGridListByGridIds(List gridIdList); + /** + * @Description 根据网格Id查询用户数据 + * @param customerGridFormDTO + * @return com.epmet.commons.tools.utils.Result + * @Author liushaowen + * @Date 2020/11/18 15:34 + */ + @PostMapping("/gov/org/customergrid/getcustomergridbygridid") + Result getCustomerGridByGridId(CustomerGridFormDTO customerGridFormDTO); + } diff --git a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java index 0a5cab1af6..477ed6ea6f 100644 --- a/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java +++ b/epmet-module/gov-org/gov-org-client/src/main/java/com/epmet/feign/fallback/GovOrgOpenFeignClientFallback.java @@ -4,6 +4,7 @@ import com.epmet.commons.tools.constant.ServiceConstant; import com.epmet.commons.tools.utils.ModuleUtils; import com.epmet.commons.tools.utils.Result; import com.epmet.dto.CustomerAgencyDTO; +import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.CustomerPartyBranchDTO; import com.epmet.dto.form.*; import com.epmet.dto.result.*; @@ -171,4 +172,9 @@ public class GovOrgOpenFeignClientFallback implements GovOrgOpenFeignClient { public Result> getGridListByGridIds(List gridIdList) { return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getGridListByGridIds", gridIdList); } + + @Override + public Result getCustomerGridByGridId(CustomerGridFormDTO customerGridFormDTO) { + return ModuleUtils.feignConError(ServiceConstant.GOV_ORG_SERVER, "getCustomerGridByGridId", customerGridFormDTO); + } } diff --git a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml index d121ad399f..99f24e8b85 100644 --- a/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml +++ b/epmet-module/gov-org/gov-org-server/src/main/resources/mapper/CustomerGridDao.xml @@ -16,7 +16,9 @@ gr.pids, gr.longitude, gr.latitude, - gr.area_code + gr.area_code, + ag.all_parent_name AS allParentName, + ag.ORGANIZATION_NAME AS agencyName FROM customer_grid gr LEFT JOIN customer_agency ag ON gr.PID = ag.ID @@ -541,4 +543,4 @@ ID = #{orgId} - \ No newline at end of file + diff --git a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java index be97e8ae21..d7b1a19bd9 100644 --- a/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java +++ b/epmet-user/epmet-user-server/src/main/java/com/epmet/service/impl/UserAdviceServiceImpl.java @@ -39,11 +39,9 @@ import com.epmet.constant.UserAdviceConstant; import com.epmet.dao.UserAdviceDao; import com.epmet.dto.CustomerAgencyDTO; import com.epmet.dto.CustomerDTO; +import com.epmet.dto.CustomerGridDTO; import com.epmet.dto.UserAdviceDTO; -import com.epmet.dto.form.AdviceListFormDTO; -import com.epmet.dto.form.ReplyAdviceFormDTO; -import com.epmet.dto.form.SubmitAdviceFormDTO; -import com.epmet.dto.form.UserResiInfoFormDTO; +import com.epmet.dto.form.*; import com.epmet.dto.result.*; import com.epmet.entity.UserAdviceEntity; import com.epmet.entity.UserAdviceImgEntity; @@ -322,7 +320,7 @@ public class UserAdviceServiceImpl extends BaseServiceImpl gridInfoResultDTOResult = govOrgOpenFeignClient.queryGridInfo(dto.getGridId()); + CustomerGridFormDTO customerGridFormDTO = new CustomerGridFormDTO(); + customerGridFormDTO.setGridId(dto.getGridId()); + Result gridInfoResultDTOResult = govOrgOpenFeignClient.getCustomerGridByGridId(customerGridFormDTO); if (gridInfoResultDTOResult.success()){ userAdviceDTO.setGridName(gridInfoResultDTOResult.getData().getGridName()); - userAdviceDTO.setAgencyId(gridInfoResultDTOResult.getData().getParentAgencyId()); - //获取agencyName - Result agencyById = govOrgOpenFeignClient.getAgencyById(gridInfoResultDTOResult.getData().getParentAgencyId()); - if (agencyById.success()){ - userAdviceDTO.setAgencyName(agencyById.getData().getAllParentName()); - userAdviceDTO.setAgencyAllParentName(agencyById.getData().getAllParentName()); - userAdviceDTO.setAgencyPids(agencyById.getData().getPids()); - }else { - logger.error("agencyId:{},获取组织详情失败",gridInfoResultDTOResult.getData().getParentAgencyId()); - } + userAdviceDTO.setAgencyId(gridInfoResultDTOResult.getData().getPid()); + userAdviceDTO.setAgencyPids(gridInfoResultDTOResult.getData().getPids()); + userAdviceDTO.setAgencyName(gridInfoResultDTOResult.getData().getAgencyName()); + userAdviceDTO.setAgencyAllParentName(gridInfoResultDTOResult.getData().getAllParentName()); }else { - logger.error("gridId:{},获取网格详情失败",dto.getGridId()); + logger.error("gridId:{},获取网格和所属组织详情失败",dto.getGridId()); } //获取userName,regPhone