|
@ -69,6 +69,33 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni |
|
|
@Autowired |
|
|
@Autowired |
|
|
private CommunitySubScoreDao communitySubScoreDao; |
|
|
private CommunitySubScoreDao communitySubScoreDao; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @param customerId |
|
|
|
|
|
* @param monthId |
|
|
|
|
|
* @Description 计算社区相关总分 |
|
|
|
|
|
* @author zxc |
|
|
|
|
|
* @date 2020/9/1 4:12 下午 |
|
|
|
|
|
*/ |
|
|
|
|
|
public Boolean calCommunityAll(String customerId, String monthId) { |
|
|
|
|
|
Boolean aBoolean = communityPartyCalculate(customerId, monthId);//党建能力
|
|
|
|
|
|
if (!aBoolean.equals(true)) { |
|
|
|
|
|
throw new RenException("calculate community-party-ability failure ......"); |
|
|
|
|
|
} |
|
|
|
|
|
Boolean bBoolean = communityGovernAbilityCalculate(customerId, monthId);// 治理能力
|
|
|
|
|
|
if (!bBoolean.equals(true)) { |
|
|
|
|
|
throw new RenException("calculate community-govern-ability failure ......"); |
|
|
|
|
|
} |
|
|
|
|
|
Boolean cBoolean = communityServiceAbilityCalculate(customerId, monthId);// 服务能力
|
|
|
|
|
|
if (!cBoolean.equals(true)) { |
|
|
|
|
|
throw new RenException("calculate community-service-ability failure ......"); |
|
|
|
|
|
} |
|
|
|
|
|
Boolean dBoolean = communityRelate(customerId, monthId); |
|
|
|
|
|
if (!dBoolean.equals(true)) { |
|
|
|
|
|
throw new RenException("calculate community-all insert failure ......"); |
|
|
|
|
|
} |
|
|
|
|
|
return true; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @param customerId |
|
|
* @param customerId |
|
|
* @Description 社区名义发文数量计算【党建能力】 |
|
|
* @Description 社区名义发文数量计算【党建能力】 |
|
@ -91,7 +118,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni |
|
|
List<SubGridAvgResultDTO> subGridPartyAvgScore = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); |
|
|
List<SubGridAvgResultDTO> subGridPartyAvgScore = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); |
|
|
if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { |
|
|
if (CollectionUtils.isEmpty(subGridPartyAvgScore)) { |
|
|
log.error(IndexCalConstant.GRID_PARTY_AVG_NULL); |
|
|
log.error(IndexCalConstant.GRID_PARTY_AVG_NULL); |
|
|
return; |
|
|
|
|
|
} else { |
|
|
} else { |
|
|
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); |
|
|
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList())); |
|
|
List<List<SubGridAvgResultDTO>> subPartyAvgList = ListUtils.partition(subGridPartyAvgScore, IndexCalConstant.PAGE_SIZE); |
|
|
List<List<SubGridAvgResultDTO>> subPartyAvgList = ListUtils.partition(subGridPartyAvgScore, IndexCalConstant.PAGE_SIZE); |
|
@ -112,7 +138,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni |
|
|
List<Map<String, Object>> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId,IndexCalConstant.COMMUNITY_LEVEL); |
|
|
List<Map<String, Object>> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId,IndexCalConstant.COMMUNITY_LEVEL); |
|
|
if (CollectionUtils.isEmpty(publishArticleCountList)) { |
|
|
if (CollectionUtils.isEmpty(publishArticleCountList)) { |
|
|
log.error(IndexCalConstant.COMMUNITY_PUBLISH_ARTICLE_LIST_NULL); |
|
|
log.error(IndexCalConstant.COMMUNITY_PUBLISH_ARTICLE_LIST_NULL); |
|
|
return; |
|
|
|
|
|
} |
|
|
} |
|
|
String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); |
|
|
String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); |
|
|
if (StringUtils.isEmpty(fieldNameByIndexCode)) { |
|
|
if (StringUtils.isEmpty(fieldNameByIndexCode)) { |
|
@ -166,7 +191,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni |
|
|
List<SubGridAvgResultDTO> subGridGovernAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); |
|
|
List<SubGridAvgResultDTO> subGridGovernAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode()); |
|
|
if (CollectionUtils.isEmpty(subGridGovernAvg)){ |
|
|
if (CollectionUtils.isEmpty(subGridGovernAvg)){ |
|
|
log.error("社区下级治理能力平均分集合为空"); |
|
|
log.error("社区下级治理能力平均分集合为空"); |
|
|
return; |
|
|
|
|
|
}else{ |
|
|
}else{ |
|
|
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); |
|
|
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); |
|
|
List<List<SubGridAvgResultDTO>> governAvg = ListUtils.partition(subGridGovernAvg, IndexCalConstant.PAGE_SIZE); |
|
|
List<List<SubGridAvgResultDTO>> governAvg = ListUtils.partition(subGridGovernAvg, IndexCalConstant.PAGE_SIZE); |
|
@ -187,7 +211,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni |
|
|
List<Map<String, Object>> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbility(customerId, monthId,IndexCalConstant.COMMUNITY_LEVEL); |
|
|
List<Map<String, Object>> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbility(customerId, monthId,IndexCalConstant.COMMUNITY_LEVEL); |
|
|
if (CollectionUtils.isEmpty(communityGovernAbility)){ |
|
|
if (CollectionUtils.isEmpty(communityGovernAbility)){ |
|
|
log.error(IndexCalConstant.COMMUNITY_GOVERN_ABILITY_NULL); |
|
|
log.error(IndexCalConstant.COMMUNITY_GOVERN_ABILITY_NULL); |
|
|
return; |
|
|
|
|
|
}else{ |
|
|
}else{ |
|
|
String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); |
|
|
String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); |
|
|
if (StringUtils.isEmpty(fieldNameByIndexCode)) { |
|
|
if (StringUtils.isEmpty(fieldNameByIndexCode)) { |
|
@ -241,7 +264,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni |
|
|
List<SubGridAvgResultDTO> subGridServiceAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); |
|
|
List<SubGridAvgResultDTO> subGridServiceAvg = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode()); |
|
|
if (CollectionUtils.isEmpty(subGridServiceAvg)) { |
|
|
if (CollectionUtils.isEmpty(subGridServiceAvg)) { |
|
|
log.error("查询社区下级所有网格服务能力得分平均值集合为空"); |
|
|
log.error("查询社区下级所有网格服务能力得分平均值集合为空"); |
|
|
//todo return;
|
|
|
|
|
|
} else { |
|
|
} else { |
|
|
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); |
|
|
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList())); |
|
|
List<List<SubGridAvgResultDTO>> serviceAvgList = ListUtils.partition(subGridServiceAvg, IndexCalConstant.PAGE_SIZE); |
|
|
List<List<SubGridAvgResultDTO>> serviceAvgList = ListUtils.partition(subGridServiceAvg, IndexCalConstant.PAGE_SIZE); |
|
@ -261,7 +283,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni |
|
|
List<Map<String, Object>> communityActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMap(customerId, monthId,IndexCalConstant.COMMUNITY_LEVEL); |
|
|
List<Map<String, Object>> communityActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMap(customerId, monthId,IndexCalConstant.COMMUNITY_LEVEL); |
|
|
if (CollectionUtils.isEmpty(communityActivityCountList)) { |
|
|
if (CollectionUtils.isEmpty(communityActivityCountList)) { |
|
|
log.error(IndexCalConstant.COMMUNITY_SERVICE_ABILITY_NULL); |
|
|
log.error(IndexCalConstant.COMMUNITY_SERVICE_ABILITY_NULL); |
|
|
return; |
|
|
|
|
|
}else{ |
|
|
}else{ |
|
|
String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); |
|
|
String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode()); |
|
|
if (StringUtils.isEmpty(fieldNameByIndexCode)) { |
|
|
if (StringUtils.isEmpty(fieldNameByIndexCode)) { |
|
@ -336,33 +357,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni |
|
|
return true; |
|
|
return true; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
* @param customerId |
|
|
|
|
|
* @param monthId |
|
|
|
|
|
* @Description 计算社区相关总分 |
|
|
|
|
|
* @author zxc |
|
|
|
|
|
* @date 2020/9/1 4:12 下午 |
|
|
|
|
|
*/ |
|
|
|
|
|
public Boolean calCommunityAll(String customerId, String monthId) { |
|
|
|
|
|
Boolean aBoolean = communityPartyCalculate(customerId, monthId);//党建能力
|
|
|
|
|
|
if (!aBoolean.equals(true)) { |
|
|
|
|
|
throw new RenException("calculate community-party-ability failure ......"); |
|
|
|
|
|
} |
|
|
|
|
|
Boolean bBoolean = communityGovernAbilityCalculate(customerId, monthId);// 治理能力
|
|
|
|
|
|
if (!bBoolean.equals(true)) { |
|
|
|
|
|
throw new RenException("calculate community-govern-ability failure ......"); |
|
|
|
|
|
} |
|
|
|
|
|
Boolean cBoolean = communityServiceAbilityCalculate(customerId, monthId);// 服务能力
|
|
|
|
|
|
if (!cBoolean.equals(true)) { |
|
|
|
|
|
throw new RenException("calculate community-service-ability failure ......"); |
|
|
|
|
|
} |
|
|
|
|
|
Boolean dBoolean = communityRelate(customerId, monthId); |
|
|
|
|
|
if (!dBoolean.equals(true)) { |
|
|
|
|
|
throw new RenException("calculate community-all insert failure ......"); |
|
|
|
|
|
} |
|
|
|
|
|
return true; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @param list |
|
|
* @param list |
|
|
* @Description BigDecimal类型获取最大数和最小数 |
|
|
* @Description BigDecimal类型获取最大数和最小数 |
|
|