|  |  | @ -14,9 +14,7 @@ import com.epmet.dao.evaluationindex.screen.FactIndexCommunityScoreDao; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dao.evaluationindex.screen.FactIndexGridScoreDao; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.screen.FactIndexCommunityScoreDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.screen.result.MaxAndMinBigDecimalResultDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.screen.result.SubGridGovernAvgResultDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.screen.result.SubGridPartyAvgResultDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.screen.result.SubGridServiceAvgResultDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.dto.screen.result.SubGridAvgResultDTO; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.entity.evaluationindex.screen.IndexGroupDetailEntity; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.eum.IndexCodeEnum; | 
			
		
	
		
			
				
					|  |  |  | import com.epmet.service.evaluationindex.indexcal.IndexCalculateCommunityService; | 
			
		
	
	
		
			
				
					|  |  | @ -84,7 +82,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni | 
			
		
	
		
			
				
					|  |  |  |         //下属所有网格的党建能力平均值
 | 
			
		
	
		
			
				
					|  |  |  |         detailListByParentCode.forEach(detail -> { | 
			
		
	
		
			
				
					|  |  |  |             if (IndexCodeEnum.XIA_SHU_SUO_YOU_WGDDJNLPJZ.getCode().equals(detail.getIndexCode())) { | 
			
		
	
		
			
				
					|  |  |  |                 List<SubGridPartyAvgResultDTO> subGridPartyAvgScore = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); | 
			
		
	
		
			
				
					|  |  |  |                 List<SubGridAvgResultDTO> subGridPartyAvgScore = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); | 
			
		
	
		
			
				
					|  |  |  |                 if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { | 
			
		
	
		
			
				
					|  |  |  |                     log.error("查询下属所有网格的党建能力平均值集合为空"); | 
			
		
	
		
			
				
					|  |  |  |                     return; | 
			
		
	
	
		
			
				
					|  |  | @ -95,10 +93,10 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni | 
			
		
	
		
			
				
					|  |  |  |                 }else if (subGridPartyAvgScore.size() > NumConstant.ONE) { | 
			
		
	
		
			
				
					|  |  |  |                     MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); | 
			
		
	
		
			
				
					|  |  |  |                     Integer indexEnd = NumConstant.TEN; | 
			
		
	
		
			
				
					|  |  |  |                     List<List<SubGridPartyAvgResultDTO>> partition = ListUtils.partition(subGridPartyAvgScore, indexEnd); | 
			
		
	
		
			
				
					|  |  |  |                     partition.forEach(publish -> { | 
			
		
	
		
			
				
					|  |  |  |                     List<List<SubGridAvgResultDTO>> subPartyAvgList = ListUtils.partition(subGridPartyAvgScore, indexEnd); | 
			
		
	
		
			
				
					|  |  |  |                     subPartyAvgList.forEach( party -> { | 
			
		
	
		
			
				
					|  |  |  |                         List<SampleValue> index1SampleValues = new ArrayList<>(); | 
			
		
	
		
			
				
					|  |  |  |                         publish.forEach(c -> { | 
			
		
	
		
			
				
					|  |  |  |                         party.forEach(c -> { | 
			
		
	
		
			
				
					|  |  |  |                             pid.put(c.getAgencyId(),c.getParentId()); | 
			
		
	
		
			
				
					|  |  |  |                             SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); | 
			
		
	
		
			
				
					|  |  |  |                             index1SampleValues.add(s); | 
			
		
	
	
		
			
				
					|  |  | @ -110,8 +108,8 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni | 
			
		
	
		
			
				
					|  |  |  |                 } | 
			
		
	
		
			
				
					|  |  |  |             } else { | 
			
		
	
		
			
				
					|  |  |  |                 // 社区名义发文数量
 | 
			
		
	
		
			
				
					|  |  |  |                 List<Map<String, Object>> mapList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId,IndexCalConstant.COMMUNITY_LEVEL); | 
			
		
	
		
			
				
					|  |  |  |                 if (CollectionUtils.isEmpty(mapList)) { | 
			
		
	
		
			
				
					|  |  |  |                 List<Map<String, Object>> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId,IndexCalConstant.COMMUNITY_LEVEL); | 
			
		
	
		
			
				
					|  |  |  |                 if (CollectionUtils.isEmpty(publishArticleCountList)) { | 
			
		
	
		
			
				
					|  |  |  |                     log.error("查询社区名义发文数量集合为空"); | 
			
		
	
		
			
				
					|  |  |  |                     return; | 
			
		
	
		
			
				
					|  |  |  |                 } | 
			
		
	
	
		
			
				
					|  |  | @ -119,15 +117,15 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni | 
			
		
	
		
			
				
					|  |  |  |                 if (StringUtils.isEmpty(fieldNameByIndexCode)) { | 
			
		
	
		
			
				
					|  |  |  |                     log.error("指标Code未查询出对应字段 【" + detail.getIndexCode() + "】"); | 
			
		
	
		
			
				
					|  |  |  |                     return; | 
			
		
	
		
			
				
					|  |  |  |                 }else if (mapList.size() == NumConstant.ONE){ | 
			
		
	
		
			
				
					|  |  |  |                     pid.put(mapList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),mapList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); | 
			
		
	
		
			
				
					|  |  |  |                     sizeOne(mapList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); | 
			
		
	
		
			
				
					|  |  |  |                 }else if (publishArticleCountList.size() == NumConstant.ONE){ | 
			
		
	
		
			
				
					|  |  |  |                     pid.put(publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.PARENT_ID).toString()); | 
			
		
	
		
			
				
					|  |  |  |                     sizeOne(publishArticleCountList.get(NumConstant.ZERO).get(IndexCalConstant.AGENCY_ID).toString(),customerId,monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),pid); | 
			
		
	
		
			
				
					|  |  |  |                     return; | 
			
		
	
		
			
				
					|  |  |  |                 }else if (mapList.size() > NumConstant.ONE) { | 
			
		
	
		
			
				
					|  |  |  |                     List<BigDecimal> decimalList = mapList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); | 
			
		
	
		
			
				
					|  |  |  |                 }else if (publishArticleCountList.size() > NumConstant.ONE) { | 
			
		
	
		
			
				
					|  |  |  |                     List<BigDecimal> decimalList = publishArticleCountList.stream().map(m -> new BigDecimal(m.get(fieldNameByIndexCode).toString())).collect(Collectors.toList()); | 
			
		
	
		
			
				
					|  |  |  |                     MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(decimalList); | 
			
		
	
		
			
				
					|  |  |  |                     List<List<Map<String, Object>>> publishArticleList = ListUtils.partition(mapList, 10); | 
			
		
	
		
			
				
					|  |  |  |                     publishArticleList.forEach(publish -> { | 
			
		
	
		
			
				
					|  |  |  |                     List<List<Map<String, Object>>> publishArticleList = ListUtils.partition(publishArticleCountList, 10); | 
			
		
	
		
			
				
					|  |  |  |                     publishArticleList.forEach( publish -> { | 
			
		
	
		
			
				
					|  |  |  |                         ScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); | 
			
		
	
		
			
				
					|  |  |  |                         List<SampleValue> index1SampleValues = new ArrayList<>(); | 
			
		
	
		
			
				
					|  |  |  |                         publish.forEach(c -> { | 
			
		
	
	
		
			
				
					|  |  | @ -166,14 +164,14 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni | 
			
		
	
		
			
				
					|  |  |  |         Map<String,String> pid = new HashMap<>(); | 
			
		
	
		
			
				
					|  |  |  |         detailListByParentCode.forEach(detail -> { | 
			
		
	
		
			
				
					|  |  |  |             if (IndexCodeEnum.SHE_QU_XIA_SHU_SYWGZLNLHZPJZ.getCode().equals(detail.getIndexCode())) { | 
			
		
	
		
			
				
					|  |  |  |                 List<SubGridPartyAvgResultDTO> subGridGovernAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); | 
			
		
	
		
			
				
					|  |  |  |                 List<SubGridAvgResultDTO> subGridGovernAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); | 
			
		
	
		
			
				
					|  |  |  |                 if (subGridGovernAvg.size() == NumConstant.ONE) { | 
			
		
	
		
			
				
					|  |  |  |                     pid.put(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),subGridGovernAvg.get(NumConstant.ZERO).getParentId()); | 
			
		
	
		
			
				
					|  |  |  |                     sizeOne(subGridGovernAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); | 
			
		
	
		
			
				
					|  |  |  |                     return; | 
			
		
	
		
			
				
					|  |  |  |                 } else if (subGridGovernAvg.size() > NumConstant.ONE) { | 
			
		
	
		
			
				
					|  |  |  |                     MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); | 
			
		
	
		
			
				
					|  |  |  |                     List<List<SubGridPartyAvgResultDTO>> governAvg = ListUtils.partition(subGridGovernAvg, 10); | 
			
		
	
		
			
				
					|  |  |  |                     List<List<SubGridAvgResultDTO>> governAvg = ListUtils.partition(subGridGovernAvg, 10); | 
			
		
	
		
			
				
					|  |  |  |                     governAvg.forEach(avg -> { | 
			
		
	
		
			
				
					|  |  |  |                         List<SampleValue> index1SampleValues = new ArrayList<>(); | 
			
		
	
		
			
				
					|  |  |  |                         avg.forEach(c -> { | 
			
		
	
	
		
			
				
					|  |  | @ -245,14 +243,14 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni | 
			
		
	
		
			
				
					|  |  |  |         detailListByParentCode.forEach(detail -> { | 
			
		
	
		
			
				
					|  |  |  |             String indexCode = detail.getIndexCode(); | 
			
		
	
		
			
				
					|  |  |  |             if (IndexCodeEnum.SHE_QU_XIA_JI_SYWGFWNLDFPJZ.getCode().equals(indexCode)) { | 
			
		
	
		
			
				
					|  |  |  |                 List<SubGridPartyAvgResultDTO> subGridServiceAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); | 
			
		
	
		
			
				
					|  |  |  |                 List<SubGridAvgResultDTO> subGridServiceAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); | 
			
		
	
		
			
				
					|  |  |  |                 if (subGridServiceAvg.size() == NumConstant.ONE) { | 
			
		
	
		
			
				
					|  |  |  |                     pid.put(subGridServiceAvg.get(NumConstant.ZERO).getAgencyId(),subGridServiceAvg.get(NumConstant.ZERO).getParentId()); | 
			
		
	
		
			
				
					|  |  |  |                     sizeOne(subGridServiceAvg.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); | 
			
		
	
		
			
				
					|  |  |  |                     return; | 
			
		
	
		
			
				
					|  |  |  |                 } else if (subGridServiceAvg.size() > NumConstant.ONE) { | 
			
		
	
		
			
				
					|  |  |  |                     MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); | 
			
		
	
		
			
				
					|  |  |  |                     List<List<SubGridPartyAvgResultDTO>> serviceAvgList = ListUtils.partition(subGridServiceAvg, 10); | 
			
		
	
		
			
				
					|  |  |  |                     List<List<SubGridAvgResultDTO>> serviceAvgList = ListUtils.partition(subGridServiceAvg, 10); | 
			
		
	
		
			
				
					|  |  |  |                     serviceAvgList.forEach(serviceAvg -> { | 
			
		
	
		
			
				
					|  |  |  |                         BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.POSITIVE); | 
			
		
	
		
			
				
					|  |  |  |                         List<SampleValue> index1SampleValues = new ArrayList<>(); | 
			
		
	
	
		
			
				
					|  |  | 
 |