From 31aa4f29318ac9e4bcfea69365517af2231e7970 Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 28 Sep 2020 20:38:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IndexCalculateDistrictServiceImpl.java | 27 ++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java index 4f522f80e7..8d7cbdaf26 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/indexcal/impl/IndexCalculateDistrictServiceImpl.java +++ b/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 -> { List index1SampleValues = new ArrayList<>(); 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()); index1SampleValues.add(s); }); @@ -275,6 +277,11 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict detailListByParentCode.forEach(detail -> { if (IndexCodeEnum.SUO_YOU_JIE_DAO_ZLNLPJZ.getCode().equals(detail.getIndexCode())) { List 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)) { log.error("查询所有街道治理能力平均值集合为空"); } else{ @@ -283,7 +290,9 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict governAvg.forEach(avg -> { List index1SampleValues = new ArrayList<>(); 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()); index1SampleValues.add(s); }); @@ -294,6 +303,11 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict } } else if (IndexCodeEnum.SUO_YOU_ZHI_SHU_BMZLNLPJZ.getCode().equals(detail.getIndexCode())){ List 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)) { log.error("查询所有直属部门治理能力平均值集合为空"); } else{ @@ -343,6 +357,11 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict String indexCode = detail.getIndexCode(); if (IndexCodeEnum.QU_XIA_SHU_JIE_DFWNLHZPJZ.getCode().equals(indexCode)) { List 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)) { log.error("查询区下属街道服务能力汇总平均值集合为空"); } 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())); List index1SampleValues = new ArrayList<>(); 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()); index1SampleValues.add(s); });