From 8faa729e5359b09a6b9fa847c7fb2f54e5b36b64 Mon Sep 17 00:00:00 2001 From: jianjun Date: Sun, 20 Sep 2020 23:29:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../extract/impl/CalGridIndexServiceImpl.java | 37 +++++++++---------- 1 file changed, 17 insertions(+), 20 deletions(-) diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalGridIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalGridIndexServiceImpl.java index 0b574b6009..9fea4c2476 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalGridIndexServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/impl/CalGridIndexServiceImpl.java @@ -6,7 +6,6 @@ import com.epmet.commons.tools.utils.DateUtils; import com.epmet.constant.ExtractConstant; import com.epmet.constant.ProjectEvaluateConstant; import com.epmet.dao.evaluationindex.indexcoll.FactIndexGovrnAblityGridMonthlyDao; -import com.epmet.dao.evaluationindex.indexcoll.FactIndexPartyAblityGridMonthlyDao; import com.epmet.dto.extract.form.GovernAbilityGridMonthlyFormDTO; import com.epmet.dto.extract.form.GridIssueCountResultDTO; import com.epmet.dto.extract.form.PartyAbilityGridMonthlyFormDTO; @@ -200,7 +199,7 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { autoSelf.set(false); } }); - if (autoSelf.get() == true){ + if (autoSelf.get()) { count.getAndSet(count.get() + NumConstant.ONE); } }); @@ -231,7 +230,7 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { Map> groupByProject = projectEvaluateInfoList.stream().collect(Collectors.groupingBy(ProjectEvaluateResultDTO::getProjectId)); groupByProject.forEach((projectId,projectList) -> { projectList.forEach(project -> { - switch (project.getActionCode()){ + switch (project.getActionCode()) { case ExtractConstant.EVALUATE_BAD: project.setScore(ProjectEvaluateConstant.BAD); break; @@ -241,9 +240,11 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { case ExtractConstant.EVALUATE_PERFECT: project.setScore(ProjectEvaluateConstant.PERFECT); break; + default: + log.warn("calGridIndexGovernAbility orther projectEvaluate,actionCode:{}", project.getActionCode()); } }); - Integer projectAllScore = projectList.stream().collect(Collectors.summingInt(ProjectEvaluateResultDTO::getScore)); + Integer projectAllScore = projectList.stream().mapToInt(ProjectEvaluateResultDTO::getScore).sum(); scoreMap.put(projectId,projectAllScore/projectList.size()); }); AtomicReference allScore = new AtomicReference<>(0); @@ -285,29 +286,25 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { }); } // 4. 网格吹哨部门准确率 - if (!CollectionUtils.isEmpty(notReturnProjectList)){ + if (!CollectionUtils.isEmpty(notReturnProjectList)) { notReturnProjectList.forEach(not -> { - if (r.getGridId().equals(not.getGridId())){ + if (r.getGridId().equals(not.getGridId())) { r.setTransferRightRatio(not.getTransferRightRatio()); } }); } // 5. 网格内解决的项目的满意度 - if (null != resultSatisfactionScore){ - resultSatisfactionScore.forEach((k,v) -> { - if (r.getGridId().equals(k)){ - r.setSatisfactionRatio(v); - } - }); - } + resultSatisfactionScore.forEach((k, v) -> { + if (r.getGridId().equals(k)) { + r.setSatisfactionRatio(v); + } + }); // 6. 网格自治项目数 - if (null != autoMap){ - autoMap.forEach((k,v) -> { - if (r.getGridId().equals(k)){ - r.setSelfSolveProjectCount(v); - } - }); - } + autoMap.forEach((k, v) -> { + if (r.getGridId().equals(k)) { + r.setSelfSolveProjectCount(v); + } + }); }); delAndInsertGovernAbility(result,customerId,monthId); return true;