diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java index 3c58609ada..f26101c3dd 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/toscreen/impl/PublicPartExtractServiceImpl.java @@ -112,14 +112,18 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService { return; } Map userCountMap = userCountList.stream().collect(Collectors.toMap(GridUserCountResultDTO::getOrgId, o -> o)); - issueTotal.forEach(issue -> { + for (FactIssueGridMonthlyEntity issue : issueTotal) { String gridId = issue.getGridId(); ScreenUserJoinEntity entity = insertMap.get(gridId); + if (entity == null) { + log.warn("gridId:{} is not exist in dimGrid,monthId:{},gridId:{}", formDTO.getCustomerId(), formDTO.getMonthId(), gridId); + continue; + } entity.setJoinTotal(issue.getIssueIncr()); GridUserCountResultDTO user = userCountMap.get(gridId); if (user == null) { log.warn("gridId:{} is not exist in issue,customerId:{},monthId:{},gridId:{}", JSON.toJSONString(issue), formDTO.getCustomerId(), formDTO.getMonthId(), gridId); - return; + continue; } //百人人均议题:统计周期内总的议题数/(注册用户数/100) log.debug("issue:{}", JSON.toJSONString(issue)); @@ -129,7 +133,7 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService { .divide(new BigDecimal(NumConstant.ONE_HUNDRED)), 4, BigDecimal.ROUND_HALF_UP); entity.setAvgIssue(avgIssueCount); } - }); + } //获取该月 表决的人数 @@ -153,6 +157,10 @@ public class PublicPartExtractServiceImpl implements PublicPartExtractService { for (Map.Entry> entry : voteMap.entrySet()) { String gridId = entry.getKey(); ScreenUserJoinEntity entity = insertMap.get(gridId); + if (entity == null) { + log.warn("gridId:{} is not exist in dimGrid,monthId:{},gridId:{}", formDTO.getCustomerId(), formDTO.getMonthId(), gridId); + continue; + } List issueList = entry.getValue(); BigDecimal bigDecimal = new BigDecimal(0); BigDecimal votedByIssueCount = new BigDecimal(issueList.get(0).getIssueCount());