From 47eb773af3ea6e6ade68faa6f7f95e5121cc9f0d Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Wed, 16 Mar 2022 13:53:39 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BD=91=E6=A0=BC=E5=BC=83=E7=94=A8=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/ResiMineGridServiceImpl.java | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/service/impl/ResiMineGridServiceImpl.java b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/service/impl/ResiMineGridServiceImpl.java index 49195ea8e0..754a1e2e87 100644 --- a/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/service/impl/ResiMineGridServiceImpl.java +++ b/epmet-module/resi-mine/resi-mine-server/src/main/java/com/epmet/modules/grid/service/impl/ResiMineGridServiceImpl.java @@ -113,7 +113,21 @@ public class ResiMineGridServiceImpl implements ResiMineGridService { @Override public LatestGridInfoResultDTO latestGridInfo(LatestGridInfoFormDTO formDTO) { logger.info(String.format("居民端获取用户最近访问网格入参%s", JSON.toJSONString(formDTO))); - //1.调用third服务,根据appId获取客户Id + + // 查询注册网格的弃用状态 + LatestGridInfoResultDTO result = new LatestGridInfoResultDTO(); + Result> userBaseInfo = epmetUserOpenFeignClient.queryUserBaseInfo(Arrays.asList(formDTO.getUserId())); + if (!userBaseInfo.success()){ + throw new EpmetException("查询用户基本信息失败"); + } + String registeredGridId = userBaseInfo.getData().get(NumConstant.ZERO).getRegisteredGridId(); + if (StringUtils.isNotBlank(registeredGridId)){ + GridInfoCache grid = CustomerOrgRedis.getGridInfo(registeredGridId); + if (grid != null) { + result.setRegisterGridStatus(grid.getAbandonFlag()); + } + } + //1.调用third服务,根据appId获取客户Id JSONObject jsonObject = new JSONObject(); String customerMsgUrl = "https://epmet-cloud.elinkservice.cn/api/third/customermp/getcustomermsg/"; String data = HttpClientManager.getInstance().sendPostByJSON(customerMsgUrl + formDTO.getAppId(), JSON.toJSONString(jsonObject)).getData(); @@ -140,16 +154,8 @@ public class ResiMineGridServiceImpl implements ResiMineGridService { logger.error(String.format("居民端获取用户最近访问网格失败,接口入参客户Id->%s,appId->%s,调用epmet-user-server服务返回->%s", formDTO.getCustomerId(), formDTO.getAppId(), JSON.toJSONString(userResult))); return null; } - // 查询注册网格的弃用状态 - LatestGridInfoResultDTO result = userResult.getData(); - Result> userBaseInfo = epmetUserOpenFeignClient.queryUserBaseInfo(Arrays.asList(formDTO.getUserId())); - if (!userBaseInfo.success()){ - throw new EpmetException("查询用户基本信息失败"); - } - GridInfoCache grid = CustomerOrgRedis.getGridInfo(userBaseInfo.getData().get(NumConstant.ZERO).getRegisteredGridId()); - if (grid != null) { - result.setRegisterGridStatus(grid.getAbandonFlag()); - } + result.setGridId(userResult.getData().getGridId()); + result.setCustomerId(userResult.getData().getCustomerId()); return result; }