Browse Source

优化

master
zxc 5 years ago
parent
commit
31aa4f2931
  1. 27
      epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java

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

@ -209,7 +209,9 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
subPartyAvgList.forEach(party -> { subPartyAvgList.forEach(party -> {
List<SampleValue> index1SampleValues = new ArrayList<>(); List<SampleValue> index1SampleValues = new ArrayList<>();
party.forEach(c -> { party.forEach(c -> {
pid.put(c.getParentId(),customerAgencyDao.selectPid(c.getParentId())); if (c.getParentId()!=NumConstant.ZERO_STR) {
pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId()));
}
SampleValue s = new SampleValue(c.getParentId(), c.getScore()); SampleValue s = new SampleValue(c.getParentId(), c.getScore());
index1SampleValues.add(s); index1SampleValues.add(s);
}); });
@ -275,6 +277,11 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
detailListByParentCode.forEach(detail -> { detailListByParentCode.forEach(detail -> {
if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) { 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); List<SubAgencyScoreAvgResultDTO> districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL);
for (int i = 0; i < districtGovernAvgList.size(); i++) {
if (districtGovernAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){
districtGovernAvgList.remove(districtGovernAvgList.get(i));
}
}
if (CollectionUtils.isEmpty(districtGovernAvgList)) { if (CollectionUtils.isEmpty(districtGovernAvgList)) {
log.error("查询所有街道治理能力平均值集合为空"); log.error("查询所有街道治理能力平均值集合为空");
} else{ } else{
@ -283,7 +290,9 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
governAvg.forEach(avg -> { governAvg.forEach(avg -> {
List<SampleValue> index1SampleValues = new ArrayList<>(); List<SampleValue> index1SampleValues = new ArrayList<>();
avg.forEach(c -> { avg.forEach(c -> {
pid.put(c.getParentId(),customerAgencyDao.selectPid(c.getParentId())); if (c.getParentId()!=NumConstant.ZERO_STR) {
pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId()));
}
SampleValue s = new SampleValue(c.getParentId(), c.getScore()); SampleValue s = new SampleValue(c.getParentId(), c.getScore());
index1SampleValues.add(s); index1SampleValues.add(s);
}); });
@ -294,6 +303,11 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
} }
} else if (IndexCodeEnum.SUO_YOU_ZHI_SHU_BMZLNLPJZ.getCode().equals(detail.getIndexCode())){ } 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()); List<SubAgencyScoreAvgResultDTO> deptScoreAvgList = deptScoreDao.selectGovernDeptScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode());
for (int i = 0; i < deptScoreAvgList.size(); i++) {
if (deptScoreAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){
deptScoreAvgList.remove(deptScoreAvgList.get(i));
}
}
if (CollectionUtils.isEmpty(deptScoreAvgList)) { if (CollectionUtils.isEmpty(deptScoreAvgList)) {
log.error("查询所有直属部门治理能力平均值集合为空"); log.error("查询所有直属部门治理能力平均值集合为空");
} else{ } else{
@ -343,6 +357,11 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
String indexCode = detail.getIndexCode(); String indexCode = detail.getIndexCode();
if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) { 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); List<SubAgencyScoreAvgResultDTO> subStreetAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL);
for (int i = 0; i < subStreetAvgList.size(); i++) {
if (subStreetAvgList.get(i).getAgencyId().equals(NumConstant.ZERO_STR)){
subStreetAvgList.remove(subStreetAvgList.get(i));
}
}
if (CollectionUtils.isEmpty(subStreetAvgList)) { if (CollectionUtils.isEmpty(subStreetAvgList)) {
log.error("查询区下属街道服务能力汇总平均值集合为空"); log.error("查询区下属街道服务能力汇总平均值集合为空");
} else{ } else{
@ -352,7 +371,9 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict
BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation())); BigDecimalScoreCalculator sc1 = new BigDecimalScoreCalculator(maxAndMinBigDecimal.getMin(), maxAndMinBigDecimal.getMax(), ScoreConstants.MIN_SCORE, ScoreConstants.MAX_SCORE, Correlation.getCorrelation(detail.getCorrelation()));
List<SampleValue> index1SampleValues = new ArrayList<>(); List<SampleValue> index1SampleValues = new ArrayList<>();
serviceAvg.forEach(c -> { serviceAvg.forEach(c -> {
pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId())); if (c.getParentId()!=NumConstant.ZERO_STR) {
pid.put(c.getParentId(), customerAgencyDao.selectPid(c.getParentId()));
}
SampleValue s = new SampleValue(c.getParentId(), c.getScore()); SampleValue s = new SampleValue(c.getParentId(), c.getScore());
index1SampleValues.add(s); index1SampleValues.add(s);
}); });

Loading…
Cancel
Save