|  |  | @ -40,6 +40,7 @@ import com.epmet.commons.tools.redis.common.CustomerOrgRedis; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.redis.common.CustomerStaffRedis; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.redis.common.bean.AgencyInfoCache; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.redis.common.bean.GridInfoCache; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.security.dto.TokenDto; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.utils.ConvertUtils; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.commons.tools.utils.Result; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.constant.CustomerGridConstant; | 
			
		
	
	
		
			
				
					|  |  | @ -210,6 +211,32 @@ public class IcNeighborHoodServiceImpl extends BaseServiceImpl<IcNeighborHoodDao | 
			
		
	
		
			
				
					|  |  |  |         }).collect(Collectors.toList()); | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     public List<OptionResultDTO> getNeighborhoodList(TokenDto tokenDto, IcNeighborHoodDTO dto) { | 
			
		
	
		
			
				
					|  |  |  |         if (StringUtils.isBlank(dto.getAgencyId()) && StringUtils.isEmpty(dto.getGridId())) { | 
			
		
	
		
			
				
					|  |  |  |             log.info("agencyId与gridId都为空时,默认查询当前工作人员所属组织下的小区"); | 
			
		
	
		
			
				
					|  |  |  |             CustomerStaffInfoCacheResult result= CustomerStaffRedis.getStaffInfo(tokenDto.getCustomerId(), tokenDto.getUserId()); | 
			
		
	
		
			
				
					|  |  |  |             if (null == result || StringUtils.isBlank(result.getAgencyId())) { | 
			
		
	
		
			
				
					|  |  |  |                 log.error(String.format("staffId:%s,工作人员缓存信息查询异常")); | 
			
		
	
		
			
				
					|  |  |  |                 return Collections.emptyList(); | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |             dto.setAgencyId(result.getAgencyId()); | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |         LambdaQueryWrapper<IcNeighborHoodEntity> wrapper = new LambdaQueryWrapper<>(); | 
			
		
	
		
			
				
					|  |  |  |         wrapper.eq(StringUtils.isNotBlank(dto.getAgencyId()),IcNeighborHoodEntity::getAgencyId, dto.getAgencyId()); | 
			
		
	
		
			
				
					|  |  |  |         wrapper.eq(StringUtils.isNotBlank(dto.getGridId()), IcNeighborHoodEntity::getGridId, dto.getGridId()); | 
			
		
	
		
			
				
					|  |  |  |         wrapper.last("ORDER BY CONVERT ( NEIGHBOR_HOOD_NAME USING gbk ) ASC"); | 
			
		
	
		
			
				
					|  |  |  |         List<IcNeighborHoodEntity> list = baseDao.selectList(wrapper); | 
			
		
	
		
			
				
					|  |  |  |         if(CollectionUtils.isEmpty(list)) { | 
			
		
	
		
			
				
					|  |  |  |             return Collections.emptyList(); | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  |         return list.stream().map(item -> { | 
			
		
	
		
			
				
					|  |  |  |             OptionResultDTO result = new OptionResultDTO(); | 
			
		
	
		
			
				
					|  |  |  |             result.setValue(item.getId()); | 
			
		
	
		
			
				
					|  |  |  |             result.setLabel(item.getNeighborHoodName()); | 
			
		
	
		
			
				
					|  |  |  |             return result; | 
			
		
	
		
			
				
					|  |  |  |         }).collect(Collectors.toList()); | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     /** | 
			
		
	
		
			
				
					|  |  |  |      * @param ids | 
			
		
	
		
			
				
					|  |  |  |      * @Description 通过ID查询小区信息 | 
			
		
	
	
		
			
				
					|  |  | 
 |