| 
						
						
							
								
							
						
						
					 | 
					@ -3,6 +3,7 @@ package com.epmet.dataaggre.service.impl; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; | 
					 | 
					 | 
					import com.epmet.commons.tools.dto.result.CustomerStaffInfoCacheResult; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.exception.EpmetErrorCode; | 
					 | 
					 | 
					import com.epmet.commons.tools.exception.EpmetErrorCode; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.exception.EpmetException; | 
					 | 
					 | 
					import com.epmet.commons.tools.exception.EpmetException; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					import com.epmet.commons.tools.page.PageData; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.redis.common.CustomerStaffRedis; | 
					 | 
					 | 
					import com.epmet.commons.tools.redis.common.CustomerStaffRedis; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.redis.common.bean.BuildingInfoCache; | 
					 | 
					 | 
					import com.epmet.commons.tools.redis.common.bean.BuildingInfoCache; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.utils.EpmetRequestHolder; | 
					 | 
					 | 
					import com.epmet.commons.tools.utils.EpmetRequestHolder; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -75,7 +76,7 @@ public class CoverageServiceImpl implements CoverageService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					     * @return | 
					 | 
					 | 
					     * @return | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					     */ | 
					 | 
					 | 
					     */ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    @Override | 
					 | 
					 | 
					    @Override | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					    public List<CoverageAnalisisDataListResultDTO> analysisDataList(List<String> coverageTypes, List<String> categoryKeys, | 
					 | 
					 | 
					    public PageData<CoverageAnalisisDataListResultDTO> analysisDataList(List<String> coverageTypes, List<String> categoryKeys, | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                                     String search, Integer pageNo, Integer pageSize, Boolean isPage) { | 
					 | 
					 | 
					                                     String search, Integer pageNo, Integer pageSize, Boolean isPage) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        String customerId = EpmetRequestHolder.getLoginUserCustomerId(); | 
					 | 
					 | 
					        String customerId = EpmetRequestHolder.getLoginUserCustomerId(); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -109,8 +110,16 @@ public class CoverageServiceImpl implements CoverageService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        // 总共查询了多少个了
 | 
					 | 
					 | 
					        // 总共查询了多少个了
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        int lastTotalCount = 0; | 
					 | 
					 | 
					        int lastTotalCount = 0; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        int totalCount = 0; | 
					 | 
					 | 
					        int totalCount = 0; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        // 是否出现要展示的数据
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        boolean dataAppear = false; | 
					 | 
					 | 
					        boolean dataAppear = false; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        // 是否是第一次出现需要展示的数据
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        boolean firstTimeDataAppear = false; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        // 数据是否够了,够了就不再查询数据
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        boolean isDataEnough = false; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        // 结果集
 | 
					 | 
					 | 
					        // 结果集
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        List<CoverageAnalisisDataListResultDTO> rls = new ArrayList<>(); | 
					 | 
					 | 
					        List<CoverageAnalisisDataListResultDTO> rls = new ArrayList<>(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        for (String coverageType : coverageTypes) { | 
					 | 
					 | 
					        for (String coverageType : coverageTypes) { | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -119,7 +128,11 @@ public class CoverageServiceImpl implements CoverageService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                continue; | 
					 | 
					 | 
					                continue; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            } | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            for (GovOrgCoverageService.CategoryCoverageMapping e : ccm) { | 
					 | 
					 | 
					            for (GovOrgCoverageService.CategoryCoverageMapping e : ccm) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                boolean firstTimeDataAppear = false; | 
					 | 
					 | 
					
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                Integer tempCount = doDataListCount(EpmetRequestHolder.getLoginUserCustomerId(), agencyId, staffPids, e.getPlaceType(), | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                        e.getCategoryKey(), search); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                lastTotalCount = totalCount; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                totalCount += tempCount; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                if (!isPage) { | 
					 | 
					 | 
					                if (!isPage) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    // 不分页,查询所有
 | 
					 | 
					 | 
					                    // 不分页,查询所有
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -131,19 +144,18 @@ public class CoverageServiceImpl implements CoverageService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    continue; | 
					 | 
					 | 
					                    continue; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                } | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                // 查询当前category有多少个
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                if (!dataAppear) { | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    Integer tempCount = doDataListCount(EpmetRequestHolder.getLoginUserCustomerId(), agencyId, staffPids, e.getPlaceType(), | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                            e.getCategoryKey(), search); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    lastTotalCount = totalCount; | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    totalCount += tempCount; | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                if (totalCount > start) { | 
					 | 
					 | 
					                if (totalCount > start) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    if (!dataAppear) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        dataAppear = true; | 
					 | 
					 | 
					                        dataAppear = true; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        firstTimeDataAppear = true; | 
					 | 
					 | 
					                        firstTimeDataAppear = true; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                } else { | 
					 | 
					 | 
					                } else { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    continue; | 
					 | 
					 | 
					                    continue; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                } | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                if (isDataEnough) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    // 数据够了,则不再查询数据列表,只检索数量,用于分页条显示
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    continue; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                } | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                // 检索数据
 | 
					 | 
					 | 
					                // 检索数据
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -153,19 +165,23 @@ public class CoverageServiceImpl implements CoverageService { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                if (firstTimeDataAppear) { | 
					 | 
					 | 
					                if (firstTimeDataAppear) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    rls.addAll(dataSegment.subList(start - lastTotalCount, dataSegment.size())); | 
					 | 
					 | 
					                    rls.addAll(dataSegment.subList(start - lastTotalCount, dataSegment.size())); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    firstTimeDataAppear = false; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                } else { | 
					 | 
					 | 
					                } else { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    rls.addAll(dataSegment); | 
					 | 
					 | 
					                    rls.addAll(dataSegment); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                } | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                firstTimeDataAppear = false; | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                // 最后,将多余的数据裁剪掉
 | 
					 | 
					 | 
					                // 最后,将多余的数据裁剪掉
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                if (rls.size() >= pageSize) { | 
					 | 
					 | 
					                if (rls.size() >= pageSize) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    return rls.subList(0, pageSize); | 
					 | 
					 | 
					                    isDataEnough = true; | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                } | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            } | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        return rls; | 
					 | 
					 | 
					
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        if (isPage && rls.size() >= pageSize) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            return new PageData<>(rls.subList(0, pageSize), totalCount); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        } else { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            return new PageData<>(rls, totalCount); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    /** | 
					 | 
					 | 
					    /** | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |