diff --git a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AreaMonthReportServiceImpl.java b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AreaMonthReportServiceImpl.java index 88ba200..58587d6 100644 --- a/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AreaMonthReportServiceImpl.java +++ b/hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AreaMonthReportServiceImpl.java @@ -483,7 +483,7 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService { R deptName1 = sysClient.getDeptName(deptMapEntry.getKey()); for (Map.Entry> levelList : deptMapEntry.getValue().entrySet()) { int findShortagesYear = levelList.getValue().size(); - int shortagesYear = (int) yearConclusionList.stream().filter(s -> s.getDefectGrading().equals(levelList.getKey())).count(); + int shortagesYear = (int) levelList.getValue().stream().filter(s -> "1".equals(s.getConclusionStatus())).count(); double shortagesRate = 0d; if (findShortagesYear != 0 && shortagesYear != 0) { shortagesRate = BigDecimal.valueOf(shortagesYear).divide(BigDecimal.valueOf(findShortagesYear), 2, BigDecimal.ROUND_UP).doubleValue(); @@ -498,7 +498,8 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService { Map> levelPhenomenonList = yearPhenomenonEntities.stream().collect(Collectors.groupingBy(OperPhenomenonEntity::getDefectGrading)); for (Map.Entry> levelPhenomenon : levelPhenomenonList.entrySet()) { int findShortagesYear = levelPhenomenon.getValue().size(); - int shortagesYear = (int) Optional.ofNullable(yearConclusionList).orElse(new ArrayList<>()).stream().filter(s -> s.getDefectGrading().equals(levelPhenomenon.getKey())).count(); + int shortagesYear = (int) Optional.ofNullable(yearConclusionList).orElse(new ArrayList<>()).stream() + .filter(s -> s.getDefectGrading().equals(levelPhenomenon.getKey())).count(); double shortagesRate = 0d; if (findShortagesYear != 0 && shortagesYear != 0) { shortagesRate = BigDecimal.valueOf(shortagesYear).divide(BigDecimal.valueOf(findShortagesYear), 2, BigDecimal.ROUND_UP).doubleValue();