diff --git a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java index bcef31dc14..75c8c1cac9 100644 --- a/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java +++ b/epmet-commons/epmet-commons-tools/src/main/java/com/epmet/commons/tools/constant/NumConstant.java @@ -38,6 +38,7 @@ public interface NumConstant { int FIFTY_ONE = 51; int SIXTY = 60; int ONE_HUNDRED = 100; + BigDecimal ONE_HUNDRED_DECIMAL = new BigDecimal(100); int ONE_THOUSAND = 1000; int MAX = 99999999; int EIGHTY_EIGHT = 88; diff --git a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java index dd4befe207..1d189bacef 100644 --- a/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java +++ b/epmet-module/data-statistical/data-statistical-server/src/main/java/com/epmet/service/evaluationindex/extract/dataToIndex/impl/CalGridIndexServiceImpl.java @@ -282,7 +282,7 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { notReturnProjectList.forEach(not -> { gridIssueShiftProjectRatio.forEach(total -> { if (not.getGridId().equals(total.getGridId())){ - not.setTransferRightRatio(getRound(new BigDecimal(not.getNotReturnProject()/total.getProjectTotal()))); + not.setTransferRightRatio(getRound(new BigDecimal(not.getNotReturnProject()/total.getProjectTotal()).multiply(NumConstant.ONE_HUNDRED_DECIMAL))); } }); }); @@ -319,7 +319,7 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { scoreMap.forEach((k,v) -> { allScore.set(++v); }); - resultSatisfactionScore.put(gridId,getRound(new BigDecimal(allScore.get()/scoreMap.size()))); + resultSatisfactionScore.put(gridId,getRound(new BigDecimal(allScore.get()/scoreMap.size()).multiply(NumConstant.ONE_HUNDRED_DECIMAL))); }); } String quarterId = DateUtils.getQuarterId(monthId); @@ -491,7 +491,7 @@ public class CalGridIndexServiceImpl implements CalGridIndexService { gridProjectTotalList.forEach(project -> { gridIssueTotalList.forEach(issue -> { if (project.getGridId().equals(issue.getGridId())) { - project.setIssueToProjectRatio(getRound(new BigDecimal(project.getProjectTotal() / issue.getIssueTotal()))); + project.setIssueToProjectRatio(getRound(new BigDecimal(project.getProjectTotal() / issue.getIssueTotal()).multiply(NumConstant.ONE_HUNDRED_DECIMAL))); } }); });