| 
						
						
							
								
							
						
						
					 | 
					@ -72,27 +72,31 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    @Override | 
					 | 
					 | 
					    @Override | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    public void communityPublishArticleCountCalculate(String customerId, String monthId) { | 
					 | 
					 | 
					    public void communityPublishArticleCountCalculate(String customerId, String monthId) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        customerId = "b09527201c4409e19d1dbc5e3c3429a1"; | 
					 | 
					 | 
					        customerId = "b09527201c4409e19d1dbc5e3c3429a1"; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        // 党建能力
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        // 根据all_parent_index_code  获取指标明细
 | 
					 | 
					 | 
					        // 根据all_parent_index_code  获取指标明细
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        List<IndexGroupDetailEntity> detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(),IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); | 
					 | 
					 | 
					        List<IndexGroupDetailEntity> detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode(),IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        List<FactIndexCommunityPartyFiveScoreDTO> subAllGridList = new ArrayList<>(); | 
					 | 
					 | 
					        List<FactIndexCommunityPartyFiveScoreDTO> subAllGridList = new ArrayList<>(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        List<FactIndexCommunityPartyFiveScoreDTO> communityPublishArticle = new ArrayList<>(); | 
					 | 
					 | 
					        List<FactIndexCommunityPartyFiveScoreDTO> communityPublishArticle = new ArrayList<>(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        // todo 下属所有网格的党建能力平均值
 | 
					 | 
					 | 
					        //下属所有网格的党建能力平均值
 | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        String finalCustomerId = customerId; | 
					 | 
					 | 
					        String finalCustomerId = customerId; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        detailListByParentCode.forEach(indexGroup -> { | 
					 | 
					 | 
					        detailListByParentCode.forEach(indexGroup -> { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            if (indexGroup.getIndexCode().equals("xiazhusuoyouwgddjnlpjz")){ | 
					 | 
					 | 
					            if (indexGroup.getIndexCode().equals("xiazhusuoyouwgddjnlpjz")){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                List<SubGridPartyAvgResultDTO> subGridPartyAvgScore = factIndexGridScoreDao.selectSubGridPartyAvgScore(finalCustomerId, monthId); | 
					 | 
					 | 
					                List<SubGridPartyAvgResultDTO> subGridPartyAvgScore = factIndexGridScoreDao.selectSubGridPartyAvgScore(finalCustomerId, monthId); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                subGridPartyAvgScore.forEach(subGridParty -> { | 
					 | 
					 | 
					                if (subGridPartyAvgScore.size() != NumConstant.ZERO){ | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    BigDecimal multiply = subGridParty.getScore().multiply(indexGroup.getWeight()); | 
					 | 
					 | 
					                    subGridPartyAvgScore.forEach(subGridParty -> { | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    subGridParty.setScore(multiply); | 
					 | 
					 | 
					                        BigDecimal multiply = subGridParty.getScore().multiply(indexGroup.getWeight()); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    FactIndexCommunityPartyFiveScoreDTO dto = new FactIndexCommunityPartyFiveScoreDTO(); | 
					 | 
					 | 
					                        subGridParty.setScore(multiply); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    BeanUtils.copyProperties(subGridParty,dto); | 
					 | 
					 | 
					                        FactIndexCommunityPartyFiveScoreDTO dto = new FactIndexCommunityPartyFiveScoreDTO(); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    dto.setType("sub_all_grid_party_avg"); | 
					 | 
					 | 
					                        BeanUtils.copyProperties(subGridParty,dto); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    dto.setIndexId(indexGroup.getIndexId()); | 
					 | 
					 | 
					                        dto.setIndexId(indexGroup.getIndexId()); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    subAllGridList.add(dto); | 
					 | 
					 | 
					                        dto.setTotalScore(dto.getPartyAbilityScore()); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                }); | 
					 | 
					 | 
					                        subAllGridList.add(dto); | 
				
			
			
				
				
			
		
	
		
		
			
				
					
					 | 
					 | 
					                factIndexCommunityPartyFiveScoreDao.insertCommunityPartyRecord(subAllGridList); | 
					 | 
					 | 
					                    }); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    factIndexCommunityPartyFiveScoreDao.insertCommunityPartyRecord(subAllGridList); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            } | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        }); | 
					 | 
					 | 
					        }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -103,8 +107,7 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    //TODO 计算之后的分数
 | 
					 | 
					 | 
					                    //TODO 计算之后的分数
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    FactIndexCommunityPartyFiveScoreDTO dto = new FactIndexCommunityPartyFiveScoreDTO(); | 
					 | 
					 | 
					                    FactIndexCommunityPartyFiveScoreDTO dto = new FactIndexCommunityPartyFiveScoreDTO(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    BeanUtils.copyProperties(detailListByParentCode.get(NumConstant.ZERO), dto); | 
					 | 
					 | 
					                    BeanUtils.copyProperties(detailListByParentCode.get(NumConstant.ZERO), dto); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                    dto.setScore(BigDecimal.valueOf(50.00)); | 
					 | 
					 | 
					                    dto.setPartyAbilityScore(BigDecimal.valueOf(50.00)); | 
				
			
			
				
				
			
		
	
		
		
			
				
					 | 
					 | 
					                    dto.setType("publish_article_count"); | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                    dto.setIndexId(detailListByParentCode.get(NumConstant.ZERO).getIndexId()); | 
					 | 
					 | 
					                    dto.setIndexId(detailListByParentCode.get(NumConstant.ZERO).getIndexId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    communityPublishArticle.add(dto); | 
					 | 
					 | 
					                    communityPublishArticle.add(dto); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    factIndexCommunityPartyFiveScoreDao.insertCommunityPartyRecord(communityPublishArticle); | 
					 | 
					 | 
					                    factIndexCommunityPartyFiveScoreDao.insertCommunityPartyRecord(communityPublishArticle); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -120,14 +123,26 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        collect.forEach(c -> { | 
					 | 
					 | 
					                        collect.forEach(c -> { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                            SampleValue s = new SampleValue(c.getAgencyId(), c.getPublishArticleCount()); | 
					 | 
					 | 
					                            SampleValue s = new SampleValue(c.getAgencyId(), c.getPublishArticleCount()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                            ll.add(s); | 
					 | 
					 | 
					                            ll.add(s); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                            FactIndexCommunityPartyFiveScoreDTO publishArticle = new FactIndexCommunityPartyFiveScoreDTO(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                            BeanUtils.copyProperties(c,publishArticle); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                            communityPublishArticle.add(publishArticle); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        }); | 
					 | 
					 | 
					                        }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        IndexInputVO<Integer> index1VO = new IndexInputVO<>(indexGroup.getIndexId(), ll, indexGroup.getWeight(), sc1); | 
					 | 
					 | 
					                        IndexInputVO<Integer> index1VO = new IndexInputVO<>(indexGroup.getIndexId(), ll, indexGroup.getWeight(), sc1); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        List<IndexInputVO> indexInputVOS = Arrays.asList(index1VO); | 
					 | 
					 | 
					                        List<IndexInputVO> indexInputVOS = Arrays.asList(index1VO); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); | 
					 | 
					 | 
					                        BatchScoreCalculator batchScoreCalculator = new BatchScoreCalculator(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        List<IndexOutputVO> result = batchScoreCalculator.exec(indexInputVOS); | 
					 | 
					 | 
					                        List<IndexOutputVO> result = batchScoreCalculator.exec(indexInputVOS); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                         | 
					 | 
					 | 
					                        result.get(NumConstant.ZERO).getIndexScoreVOs().forEach(agency -> { | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                            communityPublishArticle.forEach(publish -> { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                                if (publish.getAgencyId().equals(agency.getSampleId())){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                                    publish.setIndexId(indexGroup.getIndexId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                                    publish.setPartyAbilityScore(agency.getSampleScore()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                                    publish.setTotalScore(agency.getSampleScore()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                                } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                            }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                        }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                        indexStart++; | 
					 | 
					 | 
					                        indexStart++; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    } while (collect.size() == 10); | 
					 | 
					 | 
					                    } while (collect.size() == 10); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    factIndexCommunityPartyFiveScoreDao.insertCommunityPartyRecord(communityPublishArticle); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                } | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            } | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        }); | 
					 | 
					 | 
					        }); | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
					
  |