|  |  | @ -48,7 +48,8 @@ public class ResiServiceImpl implements ResiService { | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         // 2.用户至少配置了house和stat规则的一个,那么就先查询房屋出来,然后根据房屋去找居民
 | 
			
		
	
		
			
				
					|  |  |  |         int housePageNo = 0; | 
			
		
	
		
			
				
					|  |  |  |         int housePageNo = 1; | 
			
		
	
		
			
				
					|  |  |  |         int total = 0; | 
			
		
	
		
			
				
					|  |  |  |         do { | 
			
		
	
		
			
				
					|  |  |  |             // 拿到房屋id列表,去查询居民列表
 | 
			
		
	
		
			
				
					|  |  |  |             List<IcHouseEntity> houseEntities = govOrgService.listHousesByRules(customerId, orgId, orgType, neighborHoodId, buildingId, unitId, | 
			
		
	
	
		
			
				
					|  |  | @ -60,19 +61,22 @@ public class ResiServiceImpl implements ResiService { | 
			
		
	
		
			
				
					|  |  |  |                 break; | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |             // 查询居民
 | 
			
		
	
		
			
				
					|  |  |  |             List<ResiByPolicyInfoResultDTO> resis = epmetUserService.listByPolicyRules( | 
			
		
	
		
			
				
					|  |  |  |                     customerId, orgId, orgType, neighborHoodId, buildingId, unitId, | 
			
		
	
		
			
				
					|  |  |  |                     houseId, idCard, name, pageNo, pageSize, resiRule, houseIds); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |             resultResis.addAll(resis); | 
			
		
	
		
			
				
					|  |  |  |             // 查询居民,满了20个,不再查询数据,只查询数量
 | 
			
		
	
		
			
				
					|  |  |  |             if (resultResis.size() < pageSize) { | 
			
		
	
		
			
				
					|  |  |  |                 List<ResiByPolicyInfoResultDTO> resis = epmetUserService.listByPolicyRules( | 
			
		
	
		
			
				
					|  |  |  |                         customerId, orgId, orgType, neighborHoodId, buildingId, unitId, | 
			
		
	
		
			
				
					|  |  |  |                         houseId, idCard, name, pageNo, pageSize, resiRule, houseIds); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |             // 满了20个,或者查不到居民和房屋了(数据空了),则跳出
 | 
			
		
	
		
			
				
					|  |  |  |             // 没有用house的条件,没有循环的必要,查一次居民信息即可,跳出
 | 
			
		
	
		
			
				
					|  |  |  |             if (resultResis.size() >= pageSize) { | 
			
		
	
		
			
				
					|  |  |  |                 break; | 
			
		
	
		
			
				
					|  |  |  |                 resultResis.addAll(resis); | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |             // 查询数量
 | 
			
		
	
		
			
				
					|  |  |  |             Integer count = epmetUserService.getTotalByPolicyRules( | 
			
		
	
		
			
				
					|  |  |  |                     customerId, orgId, orgType, neighborHoodId, buildingId, unitId, | 
			
		
	
		
			
				
					|  |  |  |                     houseId, idCard, name, resiRule, houseIds); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |             total += count; | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |             housePageNo ++; | 
			
		
	
		
			
				
					|  |  |  |         } while (true); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
	
		
			
				
					|  |  | @ -83,8 +87,7 @@ public class ResiServiceImpl implements ResiService { | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         // 补充额外信息
 | 
			
		
	
		
			
				
					|  |  |  |         fillResisExtraInfoForPolicy(resultResis); | 
			
		
	
		
			
				
					|  |  |  |         // todo
 | 
			
		
	
		
			
				
					|  |  |  |         return new PageData<>(resultResis, 100); | 
			
		
	
		
			
				
					|  |  |  |         return new PageData<>(resultResis, total); | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     /** | 
			
		
	
	
		
			
				
					|  |  | @ -92,6 +95,10 @@ public class ResiServiceImpl implements ResiService { | 
			
		
	
		
			
				
					|  |  |  |      * @param resultResis | 
			
		
	
		
			
				
					|  |  |  |      */ | 
			
		
	
		
			
				
					|  |  |  |     private void fillResisExtraInfoForPolicy(List<ResiByPolicyInfoResultDTO> resultResis) { | 
			
		
	
		
			
				
					|  |  |  |         if (CollectionUtils.isEmpty(resultResis)) { | 
			
		
	
		
			
				
					|  |  |  |             return; | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         List<String> gridIds = new ArrayList<>(); | 
			
		
	
		
			
				
					|  |  |  |         List<String> neighborhoodIds = new ArrayList<>(); | 
			
		
	
		
			
				
					|  |  |  |         resultResis.stream().forEach((r) -> { | 
			
		
	
	
		
			
				
					|  |  | 
 |