From e7571f053881191578df1b6e9637ac16df2e302a Mon Sep 17 00:00:00 2001 From: zxc <1272811460@qq.com> Date: Thu, 2 Sep 2021 16:03:30 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=9B=9B=E8=88=8D=E4=BA=94=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../screen/impl/IndexServiceImpl.java | 16 ------------- .../screen/ScreenIndexDataMonthlyDao.xml | 24 +++++++++---------- .../screen/ScreenIndexDataYearlyDao.xml | 6 ++--- 3 files changed, 15 insertions(+), 31 deletions(-) diff --git a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java index 8ccc906405..95446fac0d 100644 --- a/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java +++ b/epmet-module/data-report/data-report-server/src/main/java/com/epmet/datareport/service/evaluationindex/screen/impl/IndexServiceImpl.java @@ -57,9 +57,6 @@ public class IndexServiceImpl implements IndexService { if (null == yearAverageIndexResultDTO){ return new YearAverageIndexResultDTO(); } - yearAverageIndexResultDTO.setPartyDevAbility(getRound(yearAverageIndexResultDTO.getPartyDevAbility())); - yearAverageIndexResultDTO.setGovernAbility(getRound(yearAverageIndexResultDTO.getGovernAbility())); - yearAverageIndexResultDTO.setServiceAbility(getRound(yearAverageIndexResultDTO.getServiceAbility())); yearAverageIndexResultDTO.setYearAverageIndex(getRound(yearAverageIndexResultDTO.getPartyDevAbility() + yearAverageIndexResultDTO.getGovernAbility() + yearAverageIndexResultDTO.getServiceAbility())); return yearAverageIndexResultDTO; } @@ -86,10 +83,6 @@ public class IndexServiceImpl implements IndexService { if (null == pieChartDTO) { return new MonthPieChartResultDTO(); } - // 处理小数四舍五入 - pieChartDTO.setPartyDevAbility(getRound(pieChartDTO.getPartyDevAbility())); - pieChartDTO.setGovernAbility(getRound(pieChartDTO.getGovernAbility())); - pieChartDTO.setServiceAbility(getRound(pieChartDTO.getServiceAbility())); return pieChartDTO; } @@ -154,9 +147,6 @@ public class IndexServiceImpl implements IndexService { } // 处理小数四舍五入 monthBarchartResults.forEach(barchart -> { - barchart.setPartyDevAbility(getRound(barchart.getPartyDevAbility())); - barchart.setGovernAbility(getRound(barchart.getGovernAbility())); - barchart.setServiceAbility(getRound(barchart.getServiceAbility())); barchart.setIndexTotal(getRound(barchart.getPartyDevAbility() + barchart.getGovernAbility() + barchart.getServiceAbility())); //四舍五入,保留小数点后两位 barchart.setServiceAblityWeight(barchart.getServiceAblityWeight().setScale(NumConstant.TWO,BigDecimal.ROUND_HALF_UP)); @@ -443,9 +433,6 @@ public class IndexServiceImpl implements IndexService { // 小数四舍五入 streetList.forEach(indexRank -> { indexRank.setOrgType("street"); - indexRank.setPartyDevAbility(getRound(indexRank.getPartyDevAbility())); - indexRank.setGovernAbility(getRound(indexRank.getGovernAbility())); - indexRank.setServiceAbility(getRound(indexRank.getServiceAbility())); indexRank.setTotalIndex(getRound(indexRank.getPartyDevAbility() + indexRank.getGovernAbility() + indexRank.getServiceAbility())); }); return streetList; @@ -455,9 +442,6 @@ public class IndexServiceImpl implements IndexService { // 小数四舍五入 gridList.forEach(indexRank -> { indexRank.setOrgType("grid"); - indexRank.setPartyDevAbility(getRound(indexRank.getPartyDevAbility())); - indexRank.setGovernAbility(getRound(indexRank.getGovernAbility())); - indexRank.setServiceAbility(getRound(indexRank.getServiceAbility())); indexRank.setTotalIndex(getRound(indexRank.getPartyDevAbility() + indexRank.getGovernAbility() + indexRank.getServiceAbility())); }); return gridList; diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml index 8d6109753d..03f4da3f4f 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataMonthlyDao.xml @@ -6,9 +6,9 @@ SELECT month_id AS monthId, - service_ablity * SERVICE_ABLITY_WEIGHT AS serviceAbility, - party_dev_ablity * PARTY_DEV_WEIGHT AS partyDevAbility, - govern_ablity * GOVERN_ABLITY_WEIGHT AS governAbility, + ROUND((ROUND(service_ablity,1) * SERVICE_ABLITY_WEIGHT),1) AS serviceAbility, + ROUND((ROUND(party_dev_ablity,1) * PARTY_DEV_WEIGHT),1) AS partyDevAbility, + ROUND((ROUND(govern_ablity,1) * GOVERN_ABLITY_WEIGHT),1) AS governAbility, ROUND(service_ablity,1) serviceOriginScore, ROUND(party_dev_ablity,1) partyOriginScore, ROUND(govern_ablity,1) governOriginScore, @@ -360,9 +360,9 @@ SELECT scg.GRID_NAME AS NAME, - sy.govern_ablity * sy.GOVERN_ABLITY_WEIGHT AS governAbility, - sy.party_dev_ablity * sy.PARTY_DEV_WEIGHT AS partyDevAbility, - sy.service_ablity * sy.SERVICE_ABLITY_WEIGHT AS serviceAbility, + ROUND((ROUND(sy.govern_ablity,1) * sy.GOVERN_ABLITY_WEIGHT),1) AS governAbility, + ROUND((ROUND(sy.party_dev_ablity,1) * sy.PARTY_DEV_WEIGHT),1) AS partyDevAbility, + ROUND((ROUND(sy.service_ablity,1) * sy.SERVICE_ABLITY_WEIGHT),1) AS serviceAbility, sy.ORG_ID as orgId, scg.area_code as areaCode FROM screen_customer_grid scg diff --git a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml index 78c494648b..c65c1bd3b0 100644 --- a/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml +++ b/epmet-module/data-report/data-report-server/src/main/resources/mapper/screen/ScreenIndexDataYearlyDao.xml @@ -6,9 +6,9 @@ SELECT fact.month_id AS "monthId", - ROUND(fact.score*fact.WEIGHT, 1) AS "indexTotal", + ROUND(ROUND(fact.score,1)*fact.WEIGHT, 1) AS "indexTotal", fact.index_code AS "indexCode" FROM fact_index_agency_score fact @@ -50,11 +50,11 @@ SELECT fact.month_id AS "monthId", - ROUND(fact.score*fact.WEIGHT, 1) AS "indexTotal", + ROUND(ROUND(fact.score,1)*fact.WEIGHT, 1) AS "indexTotal", fact.index_code AS "indexCode" FROM fact_index_community_score fact @@ -27,10 +27,10 @@ ROUND(ROUND(fact.score,1)*fact.WEIGHT, 1) AS "indexTotal", ROUND(fact.score,1) AS "indexTotalOriginScore", fact.WEIGHT AS "indexTotalSupWeight", - ROUND(self.self_score*fact.WEIGHT, 1) AS "agencyScore", + ROUND(ROUND(self.self_score,1)*fact.WEIGHT, 1) AS "agencyScore", ROUND(self.self_score, 1) AS selfOriginScore, self.SELF_WEIGHT AS agencyWeight, - ROUND(self.sub_score*fact.WEIGHT, 1) AS "subAgencyScore", + ROUND(ROUND(self.sub_score,1)*fact.WEIGHT, 1) AS "subAgencyScore", ROUND(self.sub_score, 1) AS subOriginScore, self.SUB_WEIGHT AS subAgencyWeight FROM @@ -50,11 +50,11 @@ SELECT fact.month_id AS "monthId", - ROUND(fact.score*fact.WEIGHT, 1) AS "indexTotal", + ROUND(ROUND(fact.score,1)*fact.WEIGHT, 1) AS "indexTotal", fact.index_code AS "indexCode" FROM fact_index_grid_score fact @@ -27,10 +27,10 @@ ROUND(ROUND(fact.score,1)*fact.WEIGHT, 1) AS "indexTotal", ROUND(fact.score,1) AS "indexTotalOriginScore", fact.WEIGHT AS "indexTotalSupWeight", - ROUND(self.self_score*fact.WEIGHT, 1) AS "agencyScore", + ROUND(ROUND(self.self_score,1)*fact.WEIGHT, 1) AS "agencyScore", ROUND(self.self_score, 1) AS selfOriginScore, self.SELF_WEIGHT AS agencyWeight, - ROUND(self.sub_score*fact.WEIGHT, 1) AS "subAgencyScore", + ROUND(ROUND(self.sub_score,1)*fact.WEIGHT, 1) AS "subAgencyScore", ROUND(self.sub_score, 1) AS subOriginScore, self.SUB_WEIGHT AS subAgencyWeight FROM @@ -51,11 +51,11 @@