| 
						
						
							
								
							
						
						
					 | 
					@ -26,6 +26,7 @@ import com.epmet.support.normalizing.Correlation; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.support.normalizing.ScoreCalculator; | 
					 | 
					 | 
					import com.epmet.support.normalizing.ScoreCalculator; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.support.normalizing.ScoreConstants; | 
					 | 
					 | 
					import com.epmet.support.normalizing.ScoreConstants; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.support.normalizing.batch.BatchScoreCalculator; | 
					 | 
					 | 
					import com.epmet.support.normalizing.batch.BatchScoreCalculator; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					import com.epmet.support.normalizing.batch.CalculateResult; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.support.normalizing.batch.IndexInputVO; | 
					 | 
					 | 
					import com.epmet.support.normalizing.batch.IndexInputVO; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.support.normalizing.batch.SampleValue; | 
					 | 
					 | 
					import com.epmet.support.normalizing.batch.SampleValue; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import lombok.extern.slf4j.Slf4j; | 
					 | 
					 | 
					import lombok.extern.slf4j.Slf4j; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -102,7 +103,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                            index1SampleValues.add(s); | 
					 | 
					 | 
					                            index1SampleValues.add(s); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        }); | 
					 | 
					 | 
					                        }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); | 
					 | 
					 | 
					                        BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                        IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); | 
					 | 
					 | 
					                        IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                        indexInputVOS.add(index1VO); | 
					 | 
					 | 
					                        indexInputVOS.add(index1VO); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    }); | 
					 | 
					 | 
					                    }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                } | 
					 | 
					 | 
					                } | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -133,7 +134,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                            SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); | 
					 | 
					 | 
					                            SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                            index1SampleValues.add(s); | 
					 | 
					 | 
					                            index1SampleValues.add(s); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        }); | 
					 | 
					 | 
					                        }); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                        IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); | 
					 | 
					 | 
					                        IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                        indexInputVOS.add(index1VO); | 
					 | 
					 | 
					                        indexInputVOS.add(index1VO); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    }); | 
					 | 
					 | 
					                    }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                } | 
					 | 
					 | 
					                } | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -141,9 +142,10 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        }); | 
					 | 
					 | 
					        }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); | 
					 | 
					 | 
					        BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        log.info("communityPartyCalculate getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); | 
					 | 
					 | 
					        log.info("communityPartyCalculate getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        HashMap<String, BigDecimal> scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); | 
					 | 
					 | 
					        HashMap<String, CalculateResult> scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        log.info("communityPartyCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreCountOfSampleId)); | 
					 | 
					 | 
					        log.info("communityPartyCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        List<FactIndexCommunityScoreDTO> result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), pid); | 
					 | 
					 | 
					        List<FactIndexCommunityScoreDTO> result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        factIndexCommunityScoreDao.deleteOldRecord(customerId, monthId); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        deleteAndInsert(customerId, monthId, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), result); | 
					 | 
					 | 
					        deleteAndInsert(customerId, monthId, IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(), result); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        return true; | 
					 | 
					 | 
					        return true; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -185,7 +187,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                            index1SampleValues.add(s); | 
					 | 
					 | 
					                            index1SampleValues.add(s); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        }); | 
					 | 
					 | 
					                        }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); | 
					 | 
					 | 
					                        BigDecimalScoreCalculator sc = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                        IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); | 
					 | 
					 | 
					                        IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                        indexInputVOS.add(index1VO); | 
					 | 
					 | 
					                        indexInputVOS.add(index1VO); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    }); | 
					 | 
					 | 
					                    }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                } | 
					 | 
					 | 
					                } | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -216,7 +218,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                            SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); | 
					 | 
					 | 
					                            SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                            index1SampleValues.add(s); | 
					 | 
					 | 
					                            index1SampleValues.add(s); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        }); | 
					 | 
					 | 
					                        }); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                        IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); | 
					 | 
					 | 
					                        IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                        indexInputVOS.add(index1VO); | 
					 | 
					 | 
					                        indexInputVOS.add(index1VO); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    }); | 
					 | 
					 | 
					                    }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                } | 
					 | 
					 | 
					                } | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -224,9 +226,10 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        }); | 
					 | 
					 | 
					        }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); | 
					 | 
					 | 
					        BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        log.info("communityGovernAbilityCalculate getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); | 
					 | 
					 | 
					        log.info("communityGovernAbilityCalculate getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        HashMap<String, BigDecimal> scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); | 
					 | 
					 | 
					//        HashMap<String, BigDecimal> scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS);
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        log.info("communityGovernAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreCountOfSampleId)); | 
					 | 
					 | 
					        HashMap<String, CalculateResult> scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        List<FactIndexCommunityScoreDTO> result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), pid); | 
					 | 
					 | 
					        log.info("communityGovernAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        List<FactIndexCommunityScoreDTO> result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        deleteAndInsert(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), result); | 
					 | 
					 | 
					        deleteAndInsert(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(), result); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        return true; | 
					 | 
					 | 
					        return true; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -265,7 +268,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                            SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); | 
					 | 
					 | 
					                            SampleValue s = new SampleValue(c.getAgencyId(), c.getScore()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                            index1SampleValues.add(s); | 
					 | 
					 | 
					                            index1SampleValues.add(s); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        }); | 
					 | 
					 | 
					                        }); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                        IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); | 
					 | 
					 | 
					                        IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                        indexInputVOS.add(index1VO); | 
					 | 
					 | 
					                        indexInputVOS.add(index1VO); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    }); | 
					 | 
					 | 
					                    }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                } | 
					 | 
					 | 
					                } | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -295,7 +298,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                            SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); | 
					 | 
					 | 
					                            SampleValue s = new SampleValue((String) c.get(IndexCalConstant.AGENCY_ID), new BigDecimal(String.valueOf(c.get(fieldNameByIndexCode)))); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                            index1SampleValues.add(s); | 
					 | 
					 | 
					                            index1SampleValues.add(s); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        }); | 
					 | 
					 | 
					                        }); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                        IndexInputVO index1VO = new IndexInputVO(detail.getIndexId(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); | 
					 | 
					 | 
					                        IndexInputVO index1VO = new IndexInputVO(detail.getIndexCode(), detail.getAllParentIndexCode(), index1SampleValues, detail.getThreshold(), detail.getWeight(), sc1); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                        indexInputVOS.add(index1VO); | 
					 | 
					 | 
					                        indexInputVOS.add(index1VO); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    }); | 
					 | 
					 | 
					                    }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                } | 
					 | 
					 | 
					                } | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -303,9 +306,10 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        }); | 
					 | 
					 | 
					        }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); | 
					 | 
					 | 
					        BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        log.info("communityServiceAbilityCalculate getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); | 
					 | 
					 | 
					        log.info("communityServiceAbilityCalculate getScoreCountOfSampleId param:{}", JSON.toJSONString(indexInputVOS)); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        HashMap<String, BigDecimal> scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS); | 
					 | 
					 | 
					//        HashMap<String, BigDecimal> scoreCountOfSampleId = batchScoreCalculator.getScoreCountOfSampleId(indexInputVOS);
 | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        log.info("communityServiceAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreCountOfSampleId)); | 
					 | 
					 | 
					        HashMap<String, CalculateResult> scoreTotalOfSampleId = batchScoreCalculator.getScoreTotalOfSampleId(indexInputVOS); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					        List<FactIndexCommunityScoreDTO> result = getResult(scoreCountOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(), pid); | 
					 | 
					 | 
					        log.info("communityServiceAbilityCalculate getScoreCountOfSampleId result:{}", JSON.toJSONString(scoreTotalOfSampleId)); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        List<FactIndexCommunityScoreDTO> result = getResultB(scoreTotalOfSampleId, customerId, monthId, NumConstant.ZERO_STR, IndexCodeEnum.FU_WU_NENG_LI.getCode(), IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(), pid); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        deleteAndInsert(customerId, monthId, IndexCodeEnum.FU_WU_NENG_LI.getCode(), result); | 
					 | 
					 | 
					        deleteAndInsert(customerId, monthId, IndexCodeEnum.FU_WU_NENG_LI.getCode(), result); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        return true; | 
					 | 
					 | 
					        return true; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -338,6 +342,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            score.setYearId(DateUtils.getYearId(monthId)); | 
					 | 
					 | 
					            score.setYearId(DateUtils.getYearId(monthId)); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            score.setQuarterId(DateUtils.getQuarterId(monthId)); | 
					 | 
					 | 
					            score.setQuarterId(DateUtils.getQuarterId(monthId)); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            score.setIndexCode(IndexCalConstant.COMMUNITY_RELATE); | 
					 | 
					 | 
					            score.setIndexCode(IndexCalConstant.COMMUNITY_RELATE); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            score.setAllParentIndexCode(NumConstant.ZERO_STR); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            value.forEach(community -> { | 
					 | 
					 | 
					            value.forEach(community -> { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                score.setScore(score.getScore().add(community.getScore())); | 
					 | 
					 | 
					                score.setScore(score.getScore().add(community.getScore())); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                score.setParentAgencyId(community.getParentAgencyId()); | 
					 | 
					 | 
					                score.setParentAgencyId(community.getParentAgencyId()); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -402,7 +407,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    @Transactional(rollbackFor = Exception.class) | 
					 | 
					 | 
					    @Transactional(rollbackFor = Exception.class) | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    public void deleteAndInsert(String customerId, String monthId, String indexCode, List<FactIndexCommunityScoreDTO> subAllGridList) { | 
					 | 
					 | 
					    public void deleteAndInsert(String customerId, String monthId, String indexCode, List<FactIndexCommunityScoreDTO> subAllGridList) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        if (!CollectionUtils.isEmpty(subAllGridList)) { | 
					 | 
					 | 
					        if (!CollectionUtils.isEmpty(subAllGridList)) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            factIndexCommunityScoreDao.deleteOldRecord(customerId, monthId, indexCode); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            factIndexCommunityScoreDao.insertCommunityPartyRecord(subAllGridList); | 
					 | 
					 | 
					            factIndexCommunityScoreDao.insertCommunityPartyRecord(subAllGridList); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        } | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -439,6 +443,49 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        return result; | 
					 | 
					 | 
					        return result; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    public List<FactIndexCommunityScoreDTO> getResultB(HashMap<String, CalculateResult> scoreCountOfSampleId, String customerId, String monthId, String isTotal, String indexCode,String allParentIndexCode, Map<String, String> pid) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        List<FactIndexCommunityScoreDTO> result = new ArrayList<>(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        scoreCountOfSampleId.forEach((k, v) -> { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            FactIndexCommunityScoreDTO score = new FactIndexCommunityScoreDTO(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            score.setCustomerId(customerId); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            score.setAgencyId(k); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            score.setMonthId(monthId); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            score.setQuarterId(DateUtils.getQuarterId(monthId)); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            score.setYearId(DateUtils.getYearId(monthId)); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            score.setIsTotal(isTotal); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            score.setIndexCode(indexCode); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            score.setScore(v.getTotalScore()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            score.setAllParentIndexCode(allParentIndexCode); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            pid.forEach((agency, parentAgency) -> { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                if (k.equals(agency)) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    score.setParentAgencyId(parentAgency); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            if (!CollectionUtils.isEmpty(v.getDetails())) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                v.getDetails().forEach(fiveDetail -> { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    FactIndexCommunityScoreDTO s = new FactIndexCommunityScoreDTO(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    s.setCustomerId(customerId); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    s.setAgencyId(k); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    s.setMonthId(monthId); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    s.setQuarterId(DateUtils.getQuarterId(monthId)); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    s.setYearId(DateUtils.getYearId(monthId)); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    s.setIsTotal(isTotal); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    s.setIndexCode(fiveDetail.getIndexCode()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    s.setScore(fiveDetail.getScore()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    s.setAllParentIndexCode(fiveDetail.getAllParentIndexCode()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    pid.forEach((agency, parentAgency) -> { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                        if (k.equals(agency)) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                            s.setParentAgencyId(parentAgency); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    result.add(s); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            result.add(score); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        return result; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    /** | 
					 | 
					 | 
					    /** | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					     * @param agencyId | 
					 | 
					 | 
					     * @param agencyId | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					     * @param customerId | 
					 | 
					 | 
					     * @param customerId | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |