| 
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -226,6 +226,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        indexDetailList.forEach(detail -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                List<SubAgencyScoreAvgResultDTO> subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                log.info("subGridPartyAvgScore:::"+subGridPartyAvgScore.toString()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    log.warn(IndexCalConstant.DISTRICT_PARTY_AVG_NULL); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } else if (subGridPartyAvgScore.size() > NumConstant.ZERO) { | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -248,6 +249,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } else { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                // 区名义发文数量
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                List<Map<String, Object>> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId,IndexCalConstant.DISTRICT_LEVEL); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                log.info("publishArticleCountList:::"+publishArticleCountList.toString()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (CollectionUtils.isEmpty(publishArticleCountList)) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    log.warn(IndexCalConstant.DISTRICT_PUBLISH_ARTICLE_LIST_NULL); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } else { | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -302,6 +304,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        detailListByParentCode.forEach(detail -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                List<SubAgencyScoreAvgResultDTO> districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                log.info("districtGovernAvgList:::"+districtGovernAvgList.toString()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                for (int i = 0; i < districtGovernAvgList.size(); i++) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    if (districtGovernAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        districtGovernAvgList.remove(districtGovernAvgList.get(i)); | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -328,6 +331,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } else if (IndexCodeEnum.SUO_YOU_ZHI_SHU_BMZLNLPJZ.getCode().equals(detail.getIndexCode())){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                List<SubAgencyScoreAvgResultDTO> deptScoreAvgList = deptScoreDao.selectGovernDeptScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                log.info("deptScoreAvgList:::"+deptScoreAvgList.toString()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                for (int i = 0; i < deptScoreAvgList.size(); i++) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    if (deptScoreAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        deptScoreAvgList.remove(deptScoreAvgList.get(i)); | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -382,6 +386,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            String indexCode = detail.getIndexCode(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                List<SubAgencyScoreAvgResultDTO> subStreetAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                log.info("subStreetAvgList:::"+subStreetAvgList.toString()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                for (int i = 0; i < subStreetAvgList.size(); i++) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    if (subStreetAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        subStreetAvgList.remove(subStreetAvgList.get(i)); | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -431,6 +436,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					    public Boolean districtRelate(String customerId, String monthId) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<IndexGroupDetailEntity> detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<AgencyScoreDTO> agencyScoreList = agencyScoreDao.selectAgencyScoreInfo(customerId, monthId, IndexCalConstant.DISTRICT_LEVEL); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        log.info("agencyScoreList:::"+agencyScoreList.toString()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        detailListByParentCode.forEach(detail -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            agencyScoreList.forEach(community -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (detail.getIndexCode().equals(community.getIndexCode())) { | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -606,10 +612,12 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<IndexInputVO> indexInputVOS = new ArrayList<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String, String> pid = new HashMap<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<ScreenProjectOrgDailyDTO> orgInfos = customerAgencyDao.selectAgencyByParentAreaCode(form.getCustomerAreaCode()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        log.info("orgInfos:::"+orgInfos.toString()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        //党建能力平均值
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        indexDetailList.forEach(detail -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                List<SubAgencyScoreAvgResultDTO> subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvgByOrgIds(monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),orgInfos.stream().map(o -> o.getOrgId()).collect(Collectors.toList())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                log.info("subGridPartyAvgScore:::"+subGridPartyAvgScore.toString()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    log.warn(IndexCalConstant.DISTRICT_PARTY_AVG_NULL); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } else if (subGridPartyAvgScore.size() > NumConstant.ZERO) { | 
				
			
			
		
	
	
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
				
				 | 
				
					@ -632,6 +640,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } else { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                // 区名义发文数量
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                List<Map<String, Object>> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMapExistSubNotSelf(monthId,form.getCustomerAreaCode()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                log.info("publishArticleCountList:::"+publishArticleCountList.toString()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (CollectionUtils.isEmpty(publishArticleCountList)) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    log.warn(IndexCalConstant.DISTRICT_PUBLISH_ARTICLE_LIST_NULL); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } else { | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -685,10 +694,12 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<IndexInputVO> indexInputVOS = new ArrayList<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String, String> pid = new HashMap<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<ScreenProjectOrgDailyDTO> orgInfos = customerAgencyDao.selectAgencyByParentAreaCode(form.getCustomerAreaCode()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        log.info("orgInfos:::"+orgInfos.toString()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        detailListByParentCode.forEach(detail -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					//                List<SubAgencyScoreAvgResultDTO> districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,form.getCustomerAreaCode(),NumConstant.SIX);
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                List<SubAgencyScoreAvgResultDTO> districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvgByOrgIds(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),orgInfos.stream().map(m -> m.getOrgId()).collect(Collectors.toList())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                log.info("districtGovernAvgList:::"+districtGovernAvgList.toString()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                log.info(districtGovernAvgList.toString()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                for (int i = 0; i < districtGovernAvgList.size(); i++) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    if (districtGovernAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -716,6 +727,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                } | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            } else if (IndexCodeEnum.SUO_YOU_ZHI_SHU_BMZLNLPJZ.getCode().equals(detail.getIndexCode())){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                List<SubAgencyScoreAvgResultDTO> deptScoreAvgList = deptScoreDao.selectGovernDeptScoreAvgExistsSubNotSelf(monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                log.info("deptScoreAvgList:::"+deptScoreAvgList.toString()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                for (int i = 0; i < deptScoreAvgList.size(); i++) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    if (deptScoreAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        deptScoreAvgList.remove(deptScoreAvgList.get(i)); | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -768,11 +780,13 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<IndexInputVO> indexInputVOS = new ArrayList<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        Map<String, String> pid = new HashMap<>(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<ScreenProjectOrgDailyDTO> orgInfos = customerAgencyDao.selectAgencyByParentAreaCode(form.getCustomerAreaCode()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        log.info("orgInfos"+orgInfos.toString()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        detailListByParentCode.forEach(detail -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            String indexCode = detail.getIndexCode(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					//                List<SubAgencyScoreAvgResultDTO> subStreetAvgList = agencyScoreDao.selectAgencyScoreAvgExistsSub(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL,form.getCustomerAreaCode(),NumConstant.SIX);
 | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                List<SubAgencyScoreAvgResultDTO> subStreetAvgList = agencyScoreDao.selectAgencyScoreAvgByOrgIds(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),orgInfos.stream().map(m -> m.getOrgId()).collect(Collectors.toList())); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                log.info("subStreetAvgList"+subStreetAvgList.toString()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                for (int i = 0; i < subStreetAvgList.size(); i++) { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                    if (subStreetAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){ | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                        subStreetAvgList.remove(subStreetAvgList.get(i)); | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
				
				 | 
				
					@ -823,6 +837,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        String monthId = form.getMonthId(); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<IndexGroupDetailEntity> detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        List<AgencyScoreDTO> agencyScoreList = agencyScoreDao.selectAgencyScoreInfoExistsSubSelf(form.getCustomerAreaCode(),monthId, IndexCalConstant.DISTRICT_LEVEL); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        log.info("agencyScoreList"+agencyScoreList.toString()); | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					        detailListByParentCode.forEach(detail -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					            agencyScoreList.forEach(community -> { | 
				
			
			
		
	
		
			
				
					 | 
					 | 
				
				 | 
				
					                if (detail.getIndexCode().equals(community.getIndexCode())) { | 
				
			
			
		
	
	
		
			
				
					| 
						
							
								
							
						
						
						
					 | 
				
				 | 
				
					
  |