| 
						
						
							
								
							
						
						
					 | 
					@ -121,57 +121,34 @@ public class ResiMineGridServiceImpl implements ResiMineGridService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							JSONObject toResult = JSON.parseObject(data); | 
					 | 
					 | 
							JSONObject toResult = JSON.parseObject(data); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							Result mapToResult = ConvertUtils.mapToEntity(toResult, Result.class); | 
					 | 
					 | 
							Result mapToResult = ConvertUtils.mapToEntity(toResult, Result.class); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							if (null != toResult.get("code")) { | 
					 | 
					 | 
							if (null != toResult.get("code")) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
								mapToResult.setCode((Integer) toResult.get("code")); | 
					 | 
					 | 
								mapToResult.setCode(((Integer) toResult.get("code")).intValue()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
							} | 
					 | 
					 | 
							} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							if (!mapToResult.success()) { | 
					 | 
					 | 
							if (!mapToResult.success()) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								logger.error(String.format("根据appId查询客户信息失败,对应appId->" + formDTO.getAppId())); | 
					 | 
					 | 
								logger.error(String.format("根据appId查询客户信息失败,对应appId->" + formDTO.getAppId())); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								throw new RenException(mapToResult.getMsg()); | 
					 | 
					 | 
								throw new RenException(mapToResult.getMsg()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							} | 
					 | 
					 | 
							} | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
							Object publicCustomerResultDTO = mapToResult.getData(); | 
					 | 
					 | 
							Object PublicCustomerResultDTO = mapToResult.getData(); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
							JSONObject json = JSON.parseObject(publicCustomerResultDTO.toString()); | 
					 | 
					 | 
							JSONObject json = JSON.parseObject(PublicCustomerResultDTO.toString()); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
							Map map = (Map) json.get("customer"); | 
					 | 
					 | 
							Map<String, Object> map = (Map) json.get("customer"); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
							PaCustomerDTO customer = ConvertUtils.mapToEntity(map, PaCustomerDTO.class); | 
					 | 
					 | 
							PaCustomerDTO customer = ConvertUtils.mapToEntity(map, PaCustomerDTO.class); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							logger.info("小程序登陆third服务获取客户用户信息PaCustomerDTO->" + customer); | 
					 | 
					 | 
							logger.info("小程序登陆third服务获取客户用户信息PaCustomerDTO->" + customer); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							//2.调用epmet-user服务,根据客户Id和用户Id查询最后一次访问记录
 | 
					 | 
					 | 
							//2.调用epmet-user服务,根据客户Id和用户Id查询最后一次访问记录
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							LatestGridInfoResultDTO result = null; | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							formDTO.setCustomerId(customer.getId()); | 
					 | 
					 | 
							formDTO.setCustomerId(customer.getId()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
							Result<List<LatestGridInfoResultDTO>> userResult = epmetUserOpenFeignClient.latestGridList(formDTO); | 
					 | 
					 | 
							Result<LatestGridInfoResultDTO> userResult = epmetUserOpenFeignClient.latestGridInfo(formDTO); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
							if (!userResult.success()) { | 
					 | 
					 | 
							if (!userResult.success()) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								logger.error(String.format("居民端获取用户最近访问网格失败,接口入参客户Id->%s,appId->%s,调用epmet-user-server服务返回->%s", formDTO.getCustomerId(), formDTO.getAppId(), JSON.toJSONString(userResult))); | 
					 | 
					 | 
								logger.error(String.format("居民端获取用户最近访问网格失败,接口入参客户Id->%s,appId->%s,调用epmet-user-server服务返回->%s", formDTO.getCustomerId(), formDTO.getAppId(), JSON.toJSONString(userResult))); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
								return result; | 
					 | 
					 | 
								return null; | 
				
			
			
				
				
			
		
	
		
		
			
				
					 | 
					 | 
							} | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							for (LatestGridInfoResultDTO girdInfo : userResult.getData()) { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								try { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
									GridInfoCache grid = CustomerOrgRedis.getGridInfo(girdInfo.getGridId()); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
									if (grid == null) { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
										logger.warn("latestGridInfo get gridInfo return null,gridId:{}", girdInfo.getGridId()); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
										continue; | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
									} else { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
										Integer abandonFlag = grid.getAbandonFlag(); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
										if (NumConstant.ONE == abandonFlag) { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
											logger.warn("latestGridInfo gridId:{} has abandoned", girdInfo.getGridId()); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
											continue; | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
										} else { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
											result = girdInfo; | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
											//匹配到了未弃用的网格 跳出
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
											break; | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
										} | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
									} | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								} catch (Exception e) { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
									logger.warn("latestGridInfo get gridInfo exception,gridId:{}", girdInfo.getGridId()); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								} | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
							} | 
					 | 
					 | 
							} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							// 查询注册网格的弃用状态
 | 
					 | 
					 | 
							// 查询注册网格的弃用状态
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
							LatestGridInfoResultDTO result = userResult.getData(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							Result<List<UserBaseInfoResultDTO>> userBaseInfo = epmetUserOpenFeignClient.queryUserBaseInfo(Arrays.asList(formDTO.getUserId())); | 
					 | 
					 | 
							Result<List<UserBaseInfoResultDTO>> userBaseInfo = epmetUserOpenFeignClient.queryUserBaseInfo(Arrays.asList(formDTO.getUserId())); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							if (!userBaseInfo.success()){ | 
					 | 
					 | 
							if (!userBaseInfo.success()){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
								throw new EpmetException("查询用户基本信息失败"); | 
					 | 
					 | 
								throw new EpmetException("查询用户基本信息失败"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							} | 
					 | 
					 | 
							} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							GridInfoCache grid = CustomerOrgRedis.getGridInfo(userBaseInfo.getData().get(NumConstant.ZERO).getRegisteredGridId()); | 
					 | 
					 | 
							GridInfoCache grid = CustomerOrgRedis.getGridInfo(userBaseInfo.getData().get(NumConstant.ZERO).getRegisteredGridId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							if (grid != null) { | 
					 | 
					 | 
							if (grid != null) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
								result.setRegisterGridStatus(grid.getAbandonFlag().compareTo(NumConstant.ONE) == NumConstant.ZERO ? true : false); | 
					 | 
					 | 
								result.setRegisterGridStatus(grid.getAbandonFlag()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
							} | 
					 | 
					 | 
							} | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
							return result; | 
					 | 
					 | 
							return result; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
						} | 
					 | 
					 | 
						} | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |