Browse Source

缺陷月报bug代码提交

zhongwei
ty 11 months ago
parent
commit
9aee3e909f
  1. 5
      hzims-service/operational/src/main/java/com/hnac/hzims/operational/main/service/impl/AreaMonthReportServiceImpl.java

5
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<String> deptName1 = sysClient.getDeptName(deptMapEntry.getKey()); R<String> deptName1 = sysClient.getDeptName(deptMapEntry.getKey());
for (Map.Entry<String, List<OperPhenomenonEntity>> levelList : deptMapEntry.getValue().entrySet()) { for (Map.Entry<String, List<OperPhenomenonEntity>> levelList : deptMapEntry.getValue().entrySet()) {
int findShortagesYear = levelList.getValue().size(); 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; double shortagesRate = 0d;
if (findShortagesYear != 0 && shortagesYear != 0) { if (findShortagesYear != 0 && shortagesYear != 0) {
shortagesRate = BigDecimal.valueOf(shortagesYear).divide(BigDecimal.valueOf(findShortagesYear), 2, BigDecimal.ROUND_UP).doubleValue(); shortagesRate = BigDecimal.valueOf(shortagesYear).divide(BigDecimal.valueOf(findShortagesYear), 2, BigDecimal.ROUND_UP).doubleValue();
@ -498,7 +498,8 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService {
Map<String, List<OperPhenomenonEntity>> levelPhenomenonList = yearPhenomenonEntities.stream().collect(Collectors.groupingBy(OperPhenomenonEntity::getDefectGrading)); Map<String, List<OperPhenomenonEntity>> levelPhenomenonList = yearPhenomenonEntities.stream().collect(Collectors.groupingBy(OperPhenomenonEntity::getDefectGrading));
for (Map.Entry<String, List<OperPhenomenonEntity>> levelPhenomenon : levelPhenomenonList.entrySet()) { for (Map.Entry<String, List<OperPhenomenonEntity>> levelPhenomenon : levelPhenomenonList.entrySet()) {
int findShortagesYear = levelPhenomenon.getValue().size(); 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; double shortagesRate = 0d;
if (findShortagesYear != 0 && shortagesYear != 0) { if (findShortagesYear != 0 && shortagesYear != 0) {
shortagesRate = BigDecimal.valueOf(shortagesYear).divide(BigDecimal.valueOf(findShortagesYear), 2, BigDecimal.ROUND_UP).doubleValue(); shortagesRate = BigDecimal.valueOf(shortagesYear).divide(BigDecimal.valueOf(findShortagesYear), 2, BigDecimal.ROUND_UP).doubleValue();

Loading…
Cancel
Save