| 
						
						
							
								
							
						
						
					 | 
					@ -8,10 +8,7 @@ import com.epmet.commons.tools.constant.StrConstant; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.exception.RenException; | 
					 | 
					 | 
					import com.epmet.commons.tools.exception.RenException; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.utils.ConvertUtils; | 
					 | 
					 | 
					import com.epmet.commons.tools.utils.ConvertUtils; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.commons.tools.utils.DateUtils; | 
					 | 
					 | 
					import com.epmet.commons.tools.utils.DateUtils; | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					import com.epmet.constant.DataSourceConstant; | 
					 | 
					 | 
					import com.epmet.constant.*; | 
				
			
			
				
				
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.constant.IndexCalConstant; | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.constant.OrgTypeConstant; | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.constant.ProjectConstant; | 
					 | 
					 | 
					 | 
				
			
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao; | 
					 | 
					 | 
					import com.epmet.dao.evaluationindex.indexcal.AgencyScoreDao; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.dao.evaluationindex.indexcal.AgencySelfSubScoreDao; | 
					 | 
					 | 
					import com.epmet.dao.evaluationindex.indexcal.AgencySelfSubScoreDao; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.dao.evaluationindex.indexcal.AgencySubScoreDao; | 
					 | 
					 | 
					import com.epmet.dao.evaluationindex.indexcal.AgencySubScoreDao; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -25,6 +22,7 @@ import com.epmet.dto.indexcal.AgencyCalResultDTO; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.dto.indexcal.AgencyScoreDTO; | 
					 | 
					 | 
					import com.epmet.dto.indexcal.AgencyScoreDTO; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.dto.indexcal.CalculateCommonFormDTO; | 
					 | 
					 | 
					import com.epmet.dto.indexcal.CalculateCommonFormDTO; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.dto.indexcal.SubCommunityAvgResultDTO; | 
					 | 
					 | 
					import com.epmet.dto.indexcal.SubCommunityAvgResultDTO; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					import com.epmet.dto.screen.ScreenProjectOrgDailyDTO; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.dto.screen.result.MaxAndMinBigDecimalResultDTO; | 
					 | 
					 | 
					import com.epmet.dto.screen.result.MaxAndMinBigDecimalResultDTO; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.entity.evaluationindex.indexcal.AgencySelfSubScoreEntity; | 
					 | 
					 | 
					import com.epmet.entity.evaluationindex.indexcal.AgencySelfSubScoreEntity; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import com.epmet.entity.evaluationindex.indexcal.AgencySubScoreEntity; | 
					 | 
					 | 
					import com.epmet.entity.evaluationindex.indexcal.AgencySubScoreEntity; | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -50,6 +48,7 @@ import org.springframework.util.CollectionUtils; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import java.math.BigDecimal; | 
					 | 
					 | 
					import java.math.BigDecimal; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import java.util.*; | 
					 | 
					 | 
					import java.util.*; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					import java.util.concurrent.atomic.AtomicReference; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					import java.util.stream.Collectors; | 
					 | 
					 | 
					import java.util.stream.Collectors; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					/** | 
					 | 
					 | 
					/** | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -616,7 +615,8 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        //下属所有社区的党建能力平均值
 | 
					 | 
					 | 
					        //下属所有社区的党建能力平均值
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        detailListByParentCode.forEach(detail -> { | 
					 | 
					 | 
					        detailListByParentCode.forEach(detail -> { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { | 
					 | 
					 | 
					            if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                List<SubCommunityAvgResultDTO> subCommPartyAvgScore = communityScoreDao.selectSubCommAvgScoreExistSubNotSelf(monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),form.getCustomerAreaCode()); | 
					 | 
					 | 
					                List<SubCommunityAvgResultDTO> dispose = communityScoreDao.selectSubCommAvgScoreExistSubNotSelf(monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),form.getCustomerAreaCode()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                List<SubCommunityAvgResultDTO> subCommPartyAvgScore = disposeSubAvg(dispose, form); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                if (CollectionUtils.isEmpty(subCommPartyAvgScore)) { | 
					 | 
					 | 
					                if (CollectionUtils.isEmpty(subCommPartyAvgScore)) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    log.warn(IndexCalConstant.COMMUNITY_PARTY_AVG_NULL); | 
					 | 
					 | 
					                    log.warn(IndexCalConstant.COMMUNITY_PARTY_AVG_NULL); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                } else if (subCommPartyAvgScore.size() > NumConstant.ZERO) { | 
					 | 
					 | 
					                } else if (subCommPartyAvgScore.size() > NumConstant.ZERO) { | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -692,7 +692,8 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        Map<String, String> pid = new HashMap<>(); | 
					 | 
					 | 
					        Map<String, String> pid = new HashMap<>(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        detailListByParentCode.forEach(detail -> { | 
					 | 
					 | 
					        detailListByParentCode.forEach(detail -> { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQZLNLHZ.getCode().equals(detail.getIndexCode())) { | 
					 | 
					 | 
					            if (IndexCodeEnum.JIE_DAO_XIA_SHU_SYSQZLNLHZ.getCode().equals(detail.getIndexCode())) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                List<SubCommunityAvgResultDTO> subGridGovernAvg = communityScoreDao.selectSubCommAvgScoreExistSubNotSelf(monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode()); | 
					 | 
					 | 
					                List<SubCommunityAvgResultDTO> dispose = communityScoreDao.selectSubCommAvgScoreExistSubNotSelf(monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),form.getCustomerAreaCode()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                List<SubCommunityAvgResultDTO> subGridGovernAvg = disposeSubAvg(dispose,form); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                if (CollectionUtils.isEmpty(subGridGovernAvg)){ | 
					 | 
					 | 
					                if (CollectionUtils.isEmpty(subGridGovernAvg)){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    log.warn("查询街道下属所有社区治理能力汇总为空"); | 
					 | 
					 | 
					                    log.warn("查询街道下属所有社区治理能力汇总为空"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                }else if (subGridGovernAvg.size() > NumConstant.ZERO) { | 
					 | 
					 | 
					                }else if (subGridGovernAvg.size() > NumConstant.ZERO) { | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -713,7 +714,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                } | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            } else { | 
					 | 
					 | 
					            } else { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                // 治理能力的六个五级指标
 | 
					 | 
					 | 
					                // 治理能力的六个五级指标
 | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                List<Map<String, Object>> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityExistsSubNotSelf(monthId,form.getCustomerAreaCode()); | 
					 | 
					 | 
					                List<Map<String, Object>> communityGovernAbility = disposeFiveLevel(form); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                if (CollectionUtils.isEmpty(communityGovernAbility)){ | 
					 | 
					 | 
					                if (CollectionUtils.isEmpty(communityGovernAbility)){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    log.warn(IndexCalConstant.STREET_GOVERN_ABILITY_NULL); | 
					 | 
					 | 
					                    log.warn(IndexCalConstant.STREET_GOVERN_ABILITY_NULL); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                }else{ | 
					 | 
					 | 
					                }else{ | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -767,7 +768,8 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        detailListByParentCode.forEach(detail -> { | 
					 | 
					 | 
					        detailListByParentCode.forEach(detail -> { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            String indexCode = detail.getIndexCode(); | 
					 | 
					 | 
					            String indexCode = detail.getIndexCode(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            if (IndexCodeEnum.JIE_DAO_XIA_SHU_SQFWNLDFPYZ.getCode().equals(indexCode)) { | 
					 | 
					 | 
					            if (IndexCodeEnum.JIE_DAO_XIA_SHU_SQFWNLDFPYZ.getCode().equals(indexCode)) { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                List<SubCommunityAvgResultDTO> subCommServiceAvg = communityScoreDao.selectSubCommAvgScoreExistSubNotSelf(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),form.getCustomerAreaCode()); | 
					 | 
					 | 
					                List<SubCommunityAvgResultDTO> dispose = communityScoreDao.selectSubCommAvgScoreExistSubNotSelf(monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),form.getCustomerAreaCode()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                List<SubCommunityAvgResultDTO> subCommServiceAvg = disposeSubAvg(dispose,form); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                if (CollectionUtils.isEmpty(subCommServiceAvg)) { | 
					 | 
					 | 
					                if (CollectionUtils.isEmpty(subCommServiceAvg)) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    log.warn("查询街道下属社区服务能力得分平均值为空"); | 
					 | 
					 | 
					                    log.warn("查询街道下属社区服务能力得分平均值为空"); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                } else if (subCommServiceAvg.size() > NumConstant.ZERO) { | 
					 | 
					 | 
					                } else if (subCommServiceAvg.size() > NumConstant.ZERO) { | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
							
								
							
						
					 | 
					@ -787,7 +789,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    }); | 
					 | 
					 | 
					                    }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                } | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            } else { | 
					 | 
					 | 
					            } else { | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					                List<Map<String, Object>> communityActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMapExistsSubNotSelf(monthId,form.getCustomerAreaCode()); | 
					 | 
					 | 
					                List<Map<String, Object>> communityActivityCountList = disposeActivityCount(form); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					                if (CollectionUtils.isEmpty(communityActivityCountList)) { | 
					 | 
					 | 
					                if (CollectionUtils.isEmpty(communityActivityCountList)) { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                    log.warn(IndexCalConstant.STREET_SERVICE_ABILITY_NULL); | 
					 | 
					 | 
					                    log.warn(IndexCalConstant.STREET_SERVICE_ABILITY_NULL); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                }else{ | 
					 | 
					 | 
					                }else{ | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -832,7 +834,7 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        String customerId = form.getCustomerId(); | 
					 | 
					 | 
					        String customerId = form.getCustomerId(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        String monthId = form.getMonthId(); | 
					 | 
					 | 
					        String monthId = form.getMonthId(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        List<IndexGroupDetailEntity> detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode()); | 
					 | 
					 | 
					        List<IndexGroupDetailEntity> detailListByParentCode = indexGroupDetailService.getDetailListByParentCode(customerId, IndexCodeEnum.SHE_QU_XIANG_GUAN.getCode()); | 
				
			
			
		
	
		
		
			
				
					
					 | 
					 | 
					        List<AgencyScoreDTO> agencyScoreList = agencyScoreDao.selectAgencyScoreInfoExistsSub(form.getCustomerAreaCode(), NumConstant.NINE, monthId, IndexCalConstant.STREET_LEVEL); | 
					 | 
					 | 
					        List<AgencyScoreDTO> agencyScoreList = agencyScoreDao.selectAgencyScoreInfoExistsSub(form.getCustomerAreaCode(), monthId, IndexCalConstant.STREET_LEVEL,form.getCustomerId()); | 
				
			
			
				
				
			
		
	
		
		
	
		
		
			
				
					 | 
					 | 
					        detailListByParentCode.forEach(detail -> { | 
					 | 
					 | 
					        detailListByParentCode.forEach(detail -> { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					            agencyScoreList.forEach(community -> { | 
					 | 
					 | 
					            agencyScoreList.forEach(community -> { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					                if (detail.getIndexCode().equals(community.getIndexCode())) { | 
					 | 
					 | 
					                if (detail.getIndexCode().equals(community.getIndexCode())) { | 
				
			
			
		
	
	
		
		
			
				
					| 
						
							
								
							
						
						
							
								
							
						
						
					 | 
					@ -866,4 +868,76 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					        return true; | 
					 | 
					 | 
					        return true; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					    } | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					
 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    public List<SubCommunityAvgResultDTO> disposeSubAvg(List<SubCommunityAvgResultDTO> avgScore, CalculateCommonFormDTO formDTO){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        List<ScreenProjectOrgDailyDTO> orgIds = customerAgencyDao.selectAgencyByParentAreaCode(formDTO.getCustomerAreaCode()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        List<SubCommunityAvgResultDTO> subAvgScores = new ArrayList<>(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        orgIds.forEach(org -> { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            SubCommunityAvgResultDTO s = new SubCommunityAvgResultDTO(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            s.setAgencyId(org.getOrgId()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            subAvgScores.add(s); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        subAvgScores.forEach(subScore -> { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            if (!CollectionUtils.isEmpty(avgScore)){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                avgScore.forEach(avg -> { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    if (subScore.getAgencyId().equals(avg.getParentId())){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                        subScore.setScore(avg.getScore()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                        avg.setScoreStatus(true); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        Map<Boolean, List<SubCommunityAvgResultDTO>> groupByStatus = avgScore.stream().collect(Collectors.groupingBy(SubCommunityAvgResultDTO::getScoreStatus)); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        List<SubCommunityAvgResultDTO> subAvgResultDTOS = groupByStatus.get(false); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        if (!CollectionUtils.isEmpty(subAvgResultDTOS)){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            AtomicReference<BigDecimal> finalScore = new AtomicReference<>(new BigDecimal(NumConstant.ZERO)); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            subAvgResultDTOS.forEach(sub -> { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                finalScore.set(finalScore.get().add(sub.getScore())); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            BigDecimal divide = finalScore.get().divide(new BigDecimal(subAvgResultDTOS.size())); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            subAvgScores.forEach(s -> { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                if (s.getAgencyId().equals("1234085031077498881")){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                    s.setScore(divide); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        return subAvgScores; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    public List<Map<String, Object>> disposeFiveLevel(CalculateCommonFormDTO formDTO){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        List<Map<String, Object>> result = new ArrayList<>(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        List<Map<String, Object>> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityExistsSubNotSelf(formDTO.getMonthId(),formDTO.getCustomerAreaCode(), ScreenConstant.STREET); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        List<Map<String, Object>> kongCunGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbilityIsKongCun(formDTO.getMonthId(),formDTO.getCustomerAreaCode()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        if (!CollectionUtils.isEmpty(kongCunGovernAbility)){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            kongCunGovernAbility.forEach(k -> { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                k.put("AGENCY_ID",k.get("PARENT_ID")); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                k.put("PARENT_ID",NumConstant.ZERO_STR); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        if (!CollectionUtils.isEmpty(communityGovernAbility)){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            result.addAll(communityGovernAbility); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        if (!CollectionUtils.isEmpty(kongCunGovernAbility)){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            result.addAll(kongCunGovernAbility); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        return result; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					
 | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    public List<Map<String, Object>> disposeActivityCount(CalculateCommonFormDTO formDTO){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        List<Map<String, Object>> result = new ArrayList<>(); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        List<Map<String, Object>> ActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMapExistsSub(formDTO.getMonthId(),formDTO.getCustomerAreaCode()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        List<Map<String, Object>> kongCunActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMapIsKongCun(formDTO.getMonthId(),formDTO.getCustomerAreaCode()); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        if (!CollectionUtils.isEmpty(kongCunActivityCountList)){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            kongCunActivityCountList.forEach(k -> { | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                k.put("AGENCY_ID",k.get("PARENT_ID")); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					                k.put("PARENT_ID",NumConstant.ZERO_STR); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            }); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        if (!CollectionUtils.isEmpty(ActivityCountList)){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            result.addAll(ActivityCountList); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        if (!CollectionUtils.isEmpty(kongCunActivityCountList)){ | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					            result.addAll(kongCunActivityCountList); | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					        return result; | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					 | 
					 | 
					 | 
					    } | 
				
			
			
		
	
		
		
			
				
					 | 
					 | 
					} | 
					 | 
					 | 
					} | 
				
			
			
		
	
	
		
		
			
				
					| 
						
						
						
					 | 
					
  |