Browse Source

指标优化

dev_shibei_match
zxc 5 years ago
parent
commit
2c4b5c7dd1
  1. 60
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java
  2. 5
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java
  3. 6
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java

60
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateCommunityServiceImpl.java

@ -69,6 +69,33 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
@Autowired
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
* @Description 社区名义发文数量计算党建能力
@ -91,7 +118,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
List<SubGridAvgResultDTO> subGridPartyAvgScore = factIndexGridScoreDao.selectSubGridAvgScore(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode());
if (CollectionUtils.isEmpty(subGridPartyAvgScore)) {
log.error(IndexCalConstant.GRID_PARTY_AVG_NULL);
return;
} else {
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList()));
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);
if (CollectionUtils.isEmpty(publishArticleCountList)) {
log.error(IndexCalConstant.COMMUNITY_PUBLISH_ARTICLE_LIST_NULL);
return;
}
String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode());
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());
if (CollectionUtils.isEmpty(subGridGovernAvg)){
log.error("社区下级治理能力平均分集合为空");
return;
}else{
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList()));
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);
if (CollectionUtils.isEmpty(communityGovernAbility)){
log.error(IndexCalConstant.COMMUNITY_GOVERN_ABILITY_NULL);
return;
}else{
String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode());
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());
if (CollectionUtils.isEmpty(subGridServiceAvg)) {
log.error("查询社区下级所有网格服务能力得分平均值集合为空");
//todo return;
} else {
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList()));
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);
if (CollectionUtils.isEmpty(communityActivityCountList)) {
log.error(IndexCalConstant.COMMUNITY_SERVICE_ABILITY_NULL);
return;
}else{
String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode());
if (StringUtils.isEmpty(fieldNameByIndexCode)) {
@ -336,33 +357,6 @@ public class IndexCalculateCommunityServiceImpl implements IndexCalculateCommuni
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
* @Description BigDecimal类型获取最大数和最小数

5
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java

@ -116,7 +116,6 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
List<SubAgencyScoreAvgResultDTO> subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL);
if (CollectionUtils.isEmpty(subGridPartyAvgScore)) {
log.error(IndexCalConstant.DISTRICT_PARTY_AVG_NULL);
return;
} else if (subGridPartyAvgScore.size() > NumConstant.ZERO) {
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList()));
List<List<SubAgencyScoreAvgResultDTO>> subPartyAvgList = ListUtils.partition(subGridPartyAvgScore, IndexCalConstant.PAGE_SIZE);
@ -137,7 +136,6 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
List<Map<String, Object>> publishArticleCountList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId,IndexCalConstant.DISTRICT_LEVEL);
if (CollectionUtils.isEmpty(publishArticleCountList)) {
log.error(IndexCalConstant.DISTRICT_PUBLISH_ARTICLE_LIST_NULL);
return;
}
String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode());
if (StringUtils.isEmpty(fieldNameByIndexCode)) {
@ -191,7 +189,6 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
List<SubAgencyScoreAvgResultDTO> districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL);
if (CollectionUtils.isEmpty(districtGovernAvgList)) {
log.error("查询所有街道治理能力平均值集合为空");
return;
} else{
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(districtGovernAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList()));
List<List<SubAgencyScoreAvgResultDTO>> governAvg = ListUtils.partition(districtGovernAvgList, IndexCalConstant.PAGE_SIZE);
@ -211,7 +208,6 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
List<SubAgencyScoreAvgResultDTO> deptScoreAvgList = deptScoreDao.selectGovernDeptScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode());
if (CollectionUtils.isEmpty(deptScoreAvgList)) {
log.error("查询所有直属部门治理能力平均值集合为空");
//return;
} else{
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(deptScoreAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList()));
List<List<SubAgencyScoreAvgResultDTO>> governAvg = ListUtils.partition(deptScoreAvgList, IndexCalConstant.PAGE_SIZE);
@ -261,7 +257,6 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
List<SubAgencyScoreAvgResultDTO> subStreetAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL);
if (CollectionUtils.isEmpty(subStreetAvgList)) {
log.error("查询区下属街道服务能力汇总平均值集合为空");
return;
} else{
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subStreetAvgList.stream().map(o -> o.getScore()).collect(Collectors.toList()));
List<List<SubAgencyScoreAvgResultDTO>> serviceAvgList = ListUtils.partition(subStreetAvgList, IndexCalConstant.PAGE_SIZE);

6
epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateStreetServiceImpl.java

@ -119,7 +119,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
List<SubCommunityAvgResultDTO> subCommPartyAvgScore = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode());
if (CollectionUtils.isEmpty(subCommPartyAvgScore)) {
log.error(IndexCalConstant.COMMUNITY_PARTY_AVG_NULL);
//todo return;
} else if (subCommPartyAvgScore.size() > NumConstant.ZERO) {
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subCommPartyAvgScore.stream().map(o -> o.getScore()).collect(Collectors.toList()));
Integer indexEnd = NumConstant.TEN;
@ -141,7 +140,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
List<Map<String, Object>> mapList = factIndexPartyAblityOrgMonthlyDao.selectPublishArticleCountMap(customerId, monthId, IndexCalConstant.STREET_LEVEL);
if (CollectionUtils.isEmpty(mapList)) {
log.error(IndexCalConstant.STREET_PUBLISH_ARTICLE_LIST_NULL);
return;
}
String fieldName = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode());
if (StringUtils.isEmpty(fieldName)) {
@ -194,7 +192,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
List<SubCommunityAvgResultDTO> subGridGovernAvg = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode());
if (CollectionUtils.isEmpty(subGridGovernAvg)){
log.error("查询街道下属所有社区治理能力汇总为空");
//todo return;
}else if (subGridGovernAvg.size() > NumConstant.ZERO) {
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subGridGovernAvg.stream().map(o -> o.getScore()).collect(Collectors.toList()));
List<List<SubCommunityAvgResultDTO>> governAvg = ListUtils.partition(subGridGovernAvg, IndexCalConstant.PAGE_SIZE);
@ -215,7 +212,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
List<Map<String, Object>> communityGovernAbility = factIndexGovrnAblityOrgMonthlyDao.selectCommunityGovernAbility(customerId, monthId,IndexCalConstant.STREET_LEVEL);
if (CollectionUtils.isEmpty(communityGovernAbility)){
log.error(IndexCalConstant.STREET_GOVERN_ABILITY_NULL);
return;
}else{
String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode());
if (StringUtils.isEmpty(fieldNameByIndexCode)) {
@ -269,7 +265,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
List<SubCommunityAvgResultDTO> subCommServiceAvg = communityScoreDao.selectSubCommAvgScore(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode());
if (CollectionUtils.isEmpty(subCommServiceAvg)) {
log.error("查询街道下属社区服务能力得分平均值为空");
//todo return;
} else if (subCommServiceAvg.size() > NumConstant.ZERO) {
MaxAndMinBigDecimalResultDTO maxAndMinBigDecimal = this.getMaxAndMinBigDecimal(subCommServiceAvg.stream().map(o -> o.getScore()).collect(Collectors.toList()));
List<List<SubCommunityAvgResultDTO>> serviceAvgList = ListUtils.partition(subCommServiceAvg, IndexCalConstant.PAGE_SIZE);
@ -289,7 +284,6 @@ public class IndexCalculateStreetServiceImpl implements IndexCalculateStreetServ
List<Map<String, Object>> communityActivityCountList = factIndexServiceAblityOrgMonthlyDao.selectActivityCountMap(customerId, monthId,IndexCalConstant.STREET_LEVEL);
if (CollectionUtils.isEmpty(communityActivityCountList)) {
log.error(IndexCalConstant.STREET_SERVICE_ABILITY_NULL);
return;
}else{
String fieldNameByIndexCode = indexCodeFieldReService.getFieldNameByIndexCode(detail.getIndexCode());
if (StringUtils.isEmpty(fieldNameByIndexCode)) {

Loading…
Cancel
Save