|  |  | @ -42,6 +42,7 @@ import com.epmet.enums.*; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.feign.*; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.model.HouseInfoModel; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.model.ImportHouseInfoListener; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.redis.CustomerAgencyRedis; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.redis.IcHouseRedis; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.service.*; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.stats.UserHouseStatsResultDTO; | 
			
		
	
	
		
			
				
					|  |  | @ -1392,5 +1393,43 @@ public class HouseServiceImpl implements HouseService, ResultDataResolver { | 
			
		
	
		
			
				
					|  |  |  |         return new PageData<>(list, pageInfo.getTotal()); | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     @Override | 
			
		
	
		
			
				
					|  |  |  |     public List<SubUserHouseListResultDTO> communityUserHouseStats(String orgId, String orgType, Integer pageNo, Integer pageSize) { | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         PageHelper.startPage(pageNo, pageSize); | 
			
		
	
		
			
				
					|  |  |  |         List<String> communityIds = customerAgencyDao.getCommunitysByOrgIdPath(orgId, CustomerOrgRedis.getOrgIdPath(orgId, orgType)); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         // 填充组织信息
 | 
			
		
	
		
			
				
					|  |  |  |         Map<String, String> communityMap = communityIds.stream().collect(Collectors.toMap(id -> id, id -> concatAgencyNamePath(id))); | 
			
		
	
		
			
				
					|  |  |  |         List<SubUserHouseListResultDTO> communityUserHouseStats = houseUserChartList(communityIds, communityMap, "agency"); | 
			
		
	
		
			
				
					|  |  |  |         return communityUserHouseStats; | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |     public String concatAgencyNamePath(String agencyId) { | 
			
		
	
		
			
				
					|  |  |  |         List<String> agencyNamePathList = new ArrayList(); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         AgencyInfoCache agencyInfo = CustomerOrgRedis.getAgencyInfo(agencyId); | 
			
		
	
		
			
				
					|  |  |  |         if (agencyInfo == null) { | 
			
		
	
		
			
				
					|  |  |  |             return null; | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         agencyNamePathList.add(0, agencyInfo.getOrganizationName()); | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         String pidsStr = agencyInfo.getPids(); | 
			
		
	
		
			
				
					|  |  |  |         if (StringUtils.isBlank(pidsStr)) { | 
			
		
	
		
			
				
					|  |  |  |             // 没有pids,是顶级,直接返回
 | 
			
		
	
		
			
				
					|  |  |  |             return String.join("-", agencyNamePathList); | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         String[] pidList = pidsStr.split(":"); | 
			
		
	
		
			
				
					|  |  |  |         for (String pAgencyId : pidList) { | 
			
		
	
		
			
				
					|  |  |  |             AgencyInfoCache pAgencyInfo = CustomerOrgRedis.getAgencyInfo(pAgencyId); | 
			
		
	
		
			
				
					|  |  |  |             if (pAgencyInfo == null) { | 
			
		
	
		
			
				
					|  |  |  |                 continue; | 
			
		
	
		
			
				
					|  |  |  |             } | 
			
		
	
		
			
				
					|  |  |  |             agencyNamePathList.add(pAgencyInfo.getOrganizationName()); | 
			
		
	
		
			
				
					|  |  |  |         } | 
			
		
	
		
			
				
					|  |  |  | 
 | 
			
		
	
		
			
				
					|  |  |  |         return String.join("-", agencyNamePathList); | 
			
		
	
		
			
				
					|  |  |  |     } | 
			
		
	
		
			
				
					|  |  |  | } | 
			
		
	
	
		
			
				
					|  |  | 
 |