|
|
@ -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<List<UserBaseInfoResultDTO>> 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<List<UserBaseInfoResultDTO>> 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; |
|
|
|
} |
|
|
|
|
|
|
|