From 350333606c26553939c045f8dce53b0123a8868a Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Mon, 7 Sep 2020 09:34:19 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=A8=E5=8C=BA=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dao/evaluationindex/indexcal/AgencyScoreDao.java | 2 +- .../indexcal/impl/IndexCalculateDistrictServiceImpl.java | 8 ++++---- .../mapper/evaluationindex/indexcal/AgencyScoreDao.xml | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java index 72c11ee8ac..5cbcfb20e2 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/dao/evaluationindex/indexcal/AgencyScoreDao.java @@ -70,7 +70,7 @@ public interface AgencyScoreDao extends BaseDao { * @author zxc * @date 2020/8/31 1:51 下午 */ - List selectAgencyScoreAvg(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode); + List selectAgencyScoreAvg(@Param("customerId")String customerId, @Param("monthId")String monthId, @Param("indexCode")String indexCode,@Param("dataType")String dataType); /** 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 4fd50137bd..62a698c953 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 @@ -104,7 +104,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict //党建能力平均值 indexDetailList.forEach(detail -> { if (IndexCodeEnum.QU_XIA_JI_JIE_DDJNLHZPJZ.getCode().equals(detail.getIndexCode())) { - List subGridPartyAvgScore = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.DANG_JIAN_NENG_LI.getCode()); + List 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; @@ -184,7 +184,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict Map pid = new HashMap<>(); 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()); + List districtGovernAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId, IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); if (districtGovernAvgList.size() == NumConstant.ONE) { pid.put(districtGovernAvgList.get(NumConstant.ZERO).getAgencyId(),districtGovernAvgList.get(NumConstant.ZERO).getParentId()); sizeOne(districtGovernAvgList.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.ZHI_LI_NENG_LI.getCode(),pid); @@ -254,7 +254,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict detailListByParentCode.forEach(detail -> { 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()); + List subStreetAvgList = agencyScoreDao.selectAgencyScoreAvg(customerId, monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),IndexCalConstant.STREET_LEVEL); if (subStreetAvgList.size() == NumConstant.ONE) { pid.put(subStreetAvgList.get(NumConstant.ZERO).getAgencyId(),subStreetAvgList.get(NumConstant.ZERO).getParentId()); sizeOne(subStreetAvgList.get(NumConstant.ZERO).getAgencyId(),customerId,monthId,IndexCodeEnum.FU_WU_NENG_LI.getCode(),pid); @@ -312,6 +312,7 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict score.setMonthId(monthId); score.setYearId(DateUtils.getYearId(monthId)); score.setQuarterId(DateUtils.getQuarterId(monthId)); + score.setDataType(IndexCalConstant.DISTRICT_LEVEL); score.setIndexCode(IndexCodeEnum.QUAN_QU_XIANG_GUAN.getCode()); value.forEach(community -> { score.setScore(score.getScore().add(community.getScore())); @@ -351,7 +352,6 @@ public class IndexCalculateDistrictServiceImpl implements IndexCalculateDistrict public void deleteAndInsert(String customerId, String monthId, String indexCode, List subAllDistrict) { if (!CollectionUtils.isEmpty(subAllDistrict)) { agencyScoreDao.deleteOldRecord(customerId, monthId, indexCode,IndexCalConstant.DISTRICT_LEVEL); - System.err.println(subAllDistrict.size()); agencyScoreDao.insertStreetRecord(subAllDistrict); } } diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml index cdc7ea366a..211e573c3c 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml +++ b/epmet-module/data-statistical/data-statistical-server/src/main/resources/mapper/evaluationindex/indexcal/AgencyScoreDao.xml @@ -100,6 +100,7 @@ AND fics.customer_id = #{customerId} AND fics.month_id = #{monthId} AND fics.index_code = #{indexCode} + AND fics.DATA_TYPE = #{dataType} GROUP BY fics.agency_id