| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -226,9 +226,15 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<IndexInputVO> indexInputVOS = new ArrayList<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String, String> pid = new HashMap<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //下属所有网格的党建能力平均值
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // 计算党建能力平均分时候的样本量
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String, Integer> gridPartyScoreSampleCountMap = new HashMap<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        detailListByParentCode.forEach(detail -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (IndexCodeEnum.XIA_SHU_SUO_YOU_WGDDJNLPJZ.getCode().equals(detail.getIndexCode())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                List<SubGridAvgResultDTO> subGridPartyAvgScore = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                subGridPartyAvgScore.stream().forEach(s -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.XIA_SHU_SUO_YOU_WGDDJNLPJZ.getCode()), s.getSampleCount()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    log.warn(IndexCalConstant.GRID_PARTY_AVG_NULL); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } else { | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -281,6 +287,10 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        log.info("communityPartyCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        CommunityCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        deleteOldRecord(customerId,monthId); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        result.getFiveLevel().forEach(s -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Integer sampleCount = gridPartyScoreSampleCountMap.get(s.getAgencyId().concat(":").concat(s.getIndexCode())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            s.setSampleCount(sampleCount == null ? 0 : sampleCount); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        deleteAndInsert(result); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return true; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -300,9 +310,15 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<IndexInputVO> indexInputVOS = new ArrayList<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String, String> pid = new HashMap<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // key:agencyId,value:sampleCount样本量
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String, Integer> gridPartyScoreSampleCountMap = new HashMap<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        detailListByParentCode.forEach(detail -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (IndexCodeEnum.SHE_QU_XIA_SHU_SYWGZLNLHZPJZ.getCode().equals(detail.getIndexCode())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                List<SubGridAvgResultDTO> subGridGovernAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                subGridGovernAvg.forEach(s -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.SHE_QU_XIA_SHU_SYWGZLNLHZPJZ.getCode()), s.getSampleCount()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (CollectionUtils.isEmpty(subGridGovernAvg)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    log.warn("社区下级治理能力平均分集合为空"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                }else{ | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -353,6 +369,10 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        HashMap<String, CalculateResult> scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        log.info("communityGovernAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        CommunityCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        result.getFiveLevel().forEach(s -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Integer sampleCount = gridPartyScoreSampleCountMap.get(s.getAgencyId().concat(":").concat(s.getIndexCode())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            s.setSampleCount(sampleCount == null ? 0 : sampleCount); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        deleteAndInsert(result); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return true; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -372,10 +392,16 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<IndexInputVO> indexInputVOS = new ArrayList<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String, String> pid = new HashMap<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        // key:agencyId,value:sampleCount样本量
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String, Integer> gridPartyScoreSampleCountMap = new HashMap<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        detailListByParentCode.forEach(detail -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            String indexCode = detail.getIndexCode(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (IndexCodeEnum.SHE_QU_XIA_JI_SYWGFWNLDFPJZ.getCode().equals(indexCode)) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                List<SubGridAvgResultDTO> subGridServiceAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                subGridServiceAvg.forEach(s -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    gridPartyScoreSampleCountMap.put(s.getAgencyId().concat(":").concat(IndexCodeEnum.SHE_QU_XIA_JI_SYWGFWNLDFPJZ.getCode()), s.getSampleCount()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (CollectionUtils.isEmpty(subGridServiceAvg)) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    log.warn("查询社区下级所有网格服务能力得分平均值集合为空"); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } else { | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -425,6 +451,10 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        HashMap<String, CalculateResult> scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        log.info("communityServiceAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        CommunityCalResultDTO result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        result.getFiveLevel().forEach(s -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            Integer sampleCount = gridPartyScoreSampleCountMap.get(s.getAgencyId().concat(":").concat(s.getIndexCode())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            s.setSampleCount(sampleCount == null ? 0 : sampleCount); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        deleteAndInsert(result); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return true; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -662,6 +692,9 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        log.info("communityPartyCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        CommunityCalResultDTO result = getResultB(scoreTotalOfSampleId, form.getCustomerId(), form.getMonthId(), NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        deleteOldRecord(form.getCustomerId(),form.getMonthId()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        result.getFiveLevel().forEach(s->{ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            s.setSampleCount(0); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        deleteAndInsert(result); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return true; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -734,6 +767,9 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        HashMap<String, CalculateResult> scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        log.info("communityGovernAbilityCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        CommunityCalResultDTO result = getResultB(scoreTotalOfSampleId, form.getCustomerId(), form.getMonthId(), NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        result.getFiveLevel().forEach(s->{ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            s.setSampleCount(0); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        deleteAndInsert(result); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return true; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -806,6 +842,9 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        HashMap<String, CalculateResult> scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        log.info("communityServiceAbilityCalculateExistsSub getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        CommunityCalResultDTO result = getResultB(scoreTotalOfSampleId, form.getCustomerId(), form.getMonthId(), NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        result.getFiveLevel().forEach(s->{ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            s.setSampleCount(0); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        }); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        deleteAndInsert(result); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        return true; | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    } | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |