| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -29,7 +29,7 @@ import com.epmet.commons.tools.exception.RenException; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.feign.ResultDataResolver; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.page.PageData; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.redis.RedisKeys; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.redis.common.bean.GridInfoCache; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.redis.RedisUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.utils.ConvertUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.constant.FieldConstant; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.commons.tools.utils.Result; | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -47,7 +47,6 @@ import com.epmet.resi.group.dto.group.result.GroupPointDetailResultDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.dto.result.GroupPointRankingResultDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.entity.BizPointTotalDetailEntity; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.resi.group.dto.group.ResiGroupDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.resi.group.dto.group.result.RankingResultDTO; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.resi.group.enums.SearchScopeTypeEnum; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.resi.group.feign.ResiGroupOpenFeignClient; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					import com.epmet.service.BizPointTotalDetailService; | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -88,6 +87,8 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl<BizPointTota | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private RedisTemplate<String, ?> redisTemplate; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Autowired | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private GovOrgOpenFeignClient govOrgOpenFeignClient; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Autowired | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    private RedisUtils redisUtils; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Override | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public PageData<BizPointTotalDetailDTO> page(Map<String, Object> params) { | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -320,8 +321,8 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl<BizPointTota | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                ranking ++; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            GridInfoCache gridInfo = getGridInfo(g.getGridId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            g.setGridId(g.getGridId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            CustomerGridDTO gridInfo = getGridInfo(g.getGridId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            //g.setGridId(g.getGridId());
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (gridInfo != null) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                g.setGridNamePath(gridInfo.getGridNamePath()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } else { | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -441,28 +442,19 @@ public class BizPointTotalDetailServiceImpl extends BaseServiceImpl<BizPointTota | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @author wxz | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     * @date 2021.09.08 11:17:17 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					     */ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public GridInfoCache getGridInfo(String gridId) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        HashOperations<String, String, Object> ope = redisTemplate.opsForHash(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String, Object> entries = ope.entries(RedisKeys.getGridInfoKey(gridId)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (entries.size() != 0) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            return BeanUtil.mapToBean(entries, GridInfoCache.class, true); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public CustomerGridDTO getGridInfo(String gridId) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        String redisKey = RedisKeys.getGridInfoKey(gridId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String, Object> gridCache = redisUtils.hGetAll(redisKey); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (gridCache != null && gridCache.size() > 0) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            // 直接取缓存中的
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            CustomerGridDTO gridInfo = BeanUtil.mapToBean(gridCache, CustomerGridDTO.class, true); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            return gridInfo; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        CustomerGridFormDTO form = new CustomerGridFormDTO(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        form.setGridId(gridId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Result<CustomerGridDTO> result = govOrgOpenFeignClient.getCustomerGridByGridId(form); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        if (result == null || !result.success() || result.getData() == null) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            return null; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        GridInfoCache cache = new GridInfoCache(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        cache.setCustomerId(result.getData().getCustomerId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        cache.setGridId(result.getData().getId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        cache.setGridNamePath(result.getData().getGridName()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        cache.setPid(result.getData().getPid()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        cache.setPids(result.getData().getPids()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        ope.putAll(RedisKeys.getGridInfoKey(gridId), BeanUtil.beanToMap(cache)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return cache; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Result<CustomerGridDTO> result = govOrgOpenFeignClient.getGridBaseInfoByGridId(form); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return getResultDataOrThrowsException(result, ServiceConstant.GOV_ORG_SERVER, EpmetErrorCode.SERVER_ERROR.getCode(), "【小组排名】查询网格信息失败"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    @Override | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |