From 9e3a4228ca67b51bf44fbb4bd3391b34f7fd49e1 Mon Sep 17 00:00:00 2001 From: wangchao Date: Sun, 27 Sep 2020 15:00:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=9E=E7=BB=93=E6=95=88=E7=8E=87=E4=B8=BA?= =?UTF-8?q?=E7=A9=BA=E6=97=B6=E6=94=BE=E5=85=A5=E9=BB=98=E8=AE=A4=E5=80=BC?= =?UTF-8?q?0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dataToIndex/impl/IndexCollCommunityServiceImpl.java | 4 +++- .../dataToIndex/impl/IndexCollStreetServiceImpl.java | 7 +++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollCommunityServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollCommunityServiceImpl.java index 6cd619a2fd..2ed9e35483 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollCommunityServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollCommunityServiceImpl.java @@ -26,6 +26,7 @@ import java.math.RoundingMode; import java.util.Date; import java.util.List; import java.util.Map; +import java.util.Optional; import java.util.stream.Collectors; /** @@ -143,7 +144,8 @@ public class IndexCollCommunityServiceImpl implements IndexCollCommunityService entity.setClosedProjectRatio(BigDecimal.ZERO); } //办结效率 - entity.setHandleProjectRatio(efficiencyMap.get(entity.getAgencyId())); + entity.setHandleProjectRatio(Optional.ofNullable(efficiencyMap.get(entity.getAgencyId())).orElse(BigDecimal.ZERO)); + }); factIndexGovrnAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.COMMUNITY); diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollStreetServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollStreetServiceImpl.java index 896d2d47bd..256ac5b76f 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollStreetServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/IndexCollStreetServiceImpl.java @@ -26,6 +26,7 @@ import java.math.RoundingMode; import java.util.Date; import java.util.List; import java.util.Map; +import java.util.Optional; import java.util.stream.Collectors; /** @@ -125,14 +126,16 @@ public class IndexCollStreetServiceImpl implements IndexCollStreetService { BigDecimal element = new BigDecimal(entity.getClosedProjectCount()); //分母,即机关参与过的项目数(去重) Integer denominator = agencyParticipatedCount.get(entity.getAgencyId()); - if (agencyParticipatedCount.get(entity.getAgencyId()) != NumConstant.ZERO) { + if (null != denominator && denominator != NumConstant.ZERO) { //办结率 entity.setClosedProjectRatio( element.divide(new BigDecimal(denominator), NumConstant.SIX, RoundingMode.HALF_UP) ); + }else{ + entity.setClosedProjectRatio(BigDecimal.ZERO); } //办结效率 - entity.setHandleProjectRatio(efficiencyMap.get(entity.getAgencyId())); + entity.setHandleProjectRatio(Optional.ofNullable(efficiencyMap.get(entity.getAgencyId())).orElse(BigDecimal.ZERO)); }); factIndexGovrnAblityOrgMonthlyService.deleteByCustomer(customerId, dimId.getMonthId(), OrgTypeConstant.STREET);