|
|
|
@ -416,10 +416,10 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService {
|
|
|
|
|
wrapper.eq(OperPhenomenonEntity::getDiscriminateStatus, TreatMethodConstant.AUTO_SCREENED); |
|
|
|
|
wrapper.in(OperPhenomenonEntity::getCreateDept, deptIds); |
|
|
|
|
List<OperPhenomenonEntity> monPhenomenonList = operPhenomenonService.list(wrapper); |
|
|
|
|
monPhenomenonList = monPhenomenonList.stream().filter(s -> s.getDefectGrading() != null).collect(Collectors.toList()); |
|
|
|
|
monPhenomenonList = monPhenomenonList.stream().filter(s -> s.getDefectLevel() != null).collect(Collectors.toList()); |
|
|
|
|
List<OperPhenomenonEntity> monConclusionList = monPhenomenonList.stream().filter(s -> "1".equals(s.getConclusionStatus())).collect(Collectors.toList()); |
|
|
|
|
// 只填写二类及以上缺陷
|
|
|
|
|
List<OperPhenomenonEntity> monConclusionListByDefectGrading = monConclusionList.stream().filter(s -> !"1".equals(s.getDefectGrading())).sorted(Comparator.comparing(OperPhenomenonEntity::getCreateDept).reversed().thenComparing(OperPhenomenonEntity::getDefectGrading)).collect(Collectors.toList()); |
|
|
|
|
List<OperPhenomenonEntity> monConclusionListByDefectGrading = monConclusionList.stream().filter(s -> !"1".equals(s.getDefectLevel())).sorted(Comparator.comparing(OperPhenomenonEntity::getCreateDept).reversed().thenComparing(OperPhenomenonEntity::getDefectLevel)).collect(Collectors.toList()); |
|
|
|
|
// 各电站缺陷处理统计表
|
|
|
|
|
ArrayList<HashMap<String, String>> checkList = new ArrayList<>(); |
|
|
|
|
for (OperPhenomenonEntity operPhenomenonEntity : monConclusionListByDefectGrading) { |
|
|
|
@ -432,13 +432,13 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService {
|
|
|
|
|
HashMap<String, String> temp = new HashMap<>(); |
|
|
|
|
temp.put("name", createDeptName.getData()); |
|
|
|
|
String checkLevel=""; |
|
|
|
|
if("1".equals(operPhenomenonEntity.getDefectGrading())) { |
|
|
|
|
if("1".equals(operPhenomenonEntity.getDefectLevel())) { |
|
|
|
|
checkLevel="Ⅰ级缺陷"; |
|
|
|
|
} |
|
|
|
|
if("2".equals(operPhenomenonEntity.getDefectGrading()) ){ |
|
|
|
|
if("2".equals(operPhenomenonEntity.getDefectLevel()) ){ |
|
|
|
|
checkLevel="Ⅱ级缺陷"; |
|
|
|
|
} |
|
|
|
|
if("3".equals(operPhenomenonEntity.getDefectGrading()) ){ |
|
|
|
|
if("3".equals(operPhenomenonEntity.getDefectLevel()) ){ |
|
|
|
|
checkLevel="Ⅲ级缺陷"; |
|
|
|
|
} |
|
|
|
|
temp.put("level", checkLevel); |
|
|
|
@ -460,7 +460,7 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService {
|
|
|
|
|
wrapperYear.eq(OperPhenomenonEntity::getDiscriminateStatus, TreatMethodConstant.AUTO_SCREENED); |
|
|
|
|
wrapperYear.in(OperPhenomenonEntity::getCreateDept, deptIds); |
|
|
|
|
List<OperPhenomenonEntity> yearPhenomenonEntities = operPhenomenonService.list(wrapperYear); |
|
|
|
|
yearPhenomenonEntities = yearPhenomenonEntities.stream().filter(s -> StringUtil.isNotBlank(s.getDefectGrading())).filter(s -> ObjectUtil.isNotEmpty(s.getCreateDept())).collect(Collectors.toList()); |
|
|
|
|
yearPhenomenonEntities = yearPhenomenonEntities.stream().filter(s -> StringUtil.isNotBlank(s.getDefectLevel())).filter(s -> ObjectUtil.isNotEmpty(s.getCreateDept())).collect(Collectors.toList()); |
|
|
|
|
List<OperPhenomenonEntity> yearConclusionList = yearPhenomenonEntities.stream().filter(s -> "1".equals(s.getConclusionStatus())).collect(Collectors.toList()); |
|
|
|
|
|
|
|
|
|
ArrayList<HashMap<String, String>> checkStatistics = new ArrayList<>(); |
|
|
|
@ -480,7 +480,7 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService {
|
|
|
|
|
} else { |
|
|
|
|
Map<Long, Map<String, List<OperPhenomenonEntity>>> phenomenonMap = yearPhenomenonEntities.stream().collect( |
|
|
|
|
Collectors.groupingBy(OperPhenomenonEntity::getCreateDept, |
|
|
|
|
Collectors.groupingBy(OperPhenomenonEntity::getDefectGrading))); |
|
|
|
|
Collectors.groupingBy(OperPhenomenonEntity::getDefectLevel))); |
|
|
|
|
for (Map.Entry<Long, Map<String, List<OperPhenomenonEntity>>> deptMapEntry : phenomenonMap.entrySet()) { |
|
|
|
|
R<String> deptName1 = sysClient.getDeptName(deptMapEntry.getKey()); |
|
|
|
|
for (Map.Entry<String, List<OperPhenomenonEntity>> levelList : deptMapEntry.getValue().entrySet()) { |
|
|
|
@ -488,26 +488,26 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService {
|
|
|
|
|
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, RoundingMode.UP).doubleValue(); |
|
|
|
|
shortagesRate = BigDecimal.valueOf(shortagesYear).divide(BigDecimal.valueOf(findShortagesYear), 2, RoundingMode.UP).setScale(2).doubleValue(); |
|
|
|
|
} |
|
|
|
|
int findShortagesMon = (int) Optional.ofNullable(monPhenomenonList).orElse(new ArrayList<>()).stream().filter(s -> s.getDefectGrading().equals(levelList.getKey())).count(); |
|
|
|
|
int shortagesMon = (int) Optional.ofNullable(monConclusionList).orElse(new ArrayList<>()).stream().filter(s -> s.getDefectGrading().equals(levelList.getKey())).count(); |
|
|
|
|
int findShortagesMon = (int) Optional.ofNullable(monPhenomenonList).orElse(new ArrayList<>()).stream().filter(s -> s.getDefectLevel().equals(levelList.getKey())).count(); |
|
|
|
|
int shortagesMon = (int) Optional.ofNullable(monConclusionList).orElse(new ArrayList<>()).stream().filter(s -> s.getDefectLevel().equals(levelList.getKey())).count(); |
|
|
|
|
CheckChartVo checkChartVo = new CheckChartVo(deptName1.getData(), levelList.getKey(), findShortagesMon, shortagesMon, findShortagesYear, shortagesYear, shortagesRate); |
|
|
|
|
checkChartRes.add(checkChartVo); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
// 总计
|
|
|
|
|
Map<String, List<OperPhenomenonEntity>> levelPhenomenonList = yearPhenomenonEntities.stream().collect(Collectors.groupingBy(OperPhenomenonEntity::getDefectGrading)); |
|
|
|
|
Map<String, List<OperPhenomenonEntity>> levelPhenomenonList = yearPhenomenonEntities.stream().collect(Collectors.groupingBy(OperPhenomenonEntity::getDefectLevel)); |
|
|
|
|
for (Map.Entry<String, List<OperPhenomenonEntity>> 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(); |
|
|
|
|
.filter(s -> s.getDefectLevel().equals(levelPhenomenon.getKey())).count(); |
|
|
|
|
double shortagesRate = 0d; |
|
|
|
|
if (findShortagesYear != 0 && shortagesYear != 0) { |
|
|
|
|
shortagesRate = BigDecimal.valueOf(shortagesYear).divide(BigDecimal.valueOf(findShortagesYear), 2, RoundingMode.UP).doubleValue(); |
|
|
|
|
} |
|
|
|
|
int findShortagesMon = (int) Optional.ofNullable(monPhenomenonList).orElse(new ArrayList<>()).stream().filter(s -> s.getDefectGrading().equals(levelPhenomenon.getKey())).count(); |
|
|
|
|
int shortagesMon = (int) Optional.ofNullable(monConclusionList).orElse(new ArrayList<>()).stream().filter(s -> s.getDefectGrading().equals(levelPhenomenon.getKey())).count(); |
|
|
|
|
int findShortagesMon = (int) Optional.ofNullable(monPhenomenonList).orElse(new ArrayList<>()).stream().filter(s -> s.getDefectLevel().equals(levelPhenomenon.getKey())).count(); |
|
|
|
|
int shortagesMon = (int) Optional.ofNullable(monConclusionList).orElse(new ArrayList<>()).stream().filter(s -> s.getDefectLevel().equals(levelPhenomenon.getKey())).count(); |
|
|
|
|
CheckChartVo checkChartVo = new CheckChartVo("总计", levelPhenomenon.getKey(), findShortagesMon, shortagesMon, findShortagesYear, shortagesYear, shortagesRate); |
|
|
|
|
checkChartRes.add(checkChartVo); |
|
|
|
|
} |
|
|
|
@ -528,8 +528,8 @@ public class AreaMonthReportServiceImpl implements IAreaMonthReportService {
|
|
|
|
|
temp.put("checkLevel", checkLevel); |
|
|
|
|
temp.put("findShortagesMon", checkChartRe.getFindShortagesMon().toString()); |
|
|
|
|
temp.put("shortagesMon", checkChartRe.getShortagesMon().toString()); |
|
|
|
|
temp.put("findShortagesYear", checkChartRe.getShortagesYear().toString()); |
|
|
|
|
temp.put("shortagesYear", checkChartRe.getFindShortagesYear().toString()); |
|
|
|
|
temp.put("findShortagesYear", checkChartRe.getFindShortagesYear().toString()); |
|
|
|
|
temp.put("shortagesYear", checkChartRe.getShortagesYear().toString()); |
|
|
|
|
temp.put("shortagesRate", checkChartRe.getShortagesRate()* 100 + "%"); |
|
|
|
|
checkStatistics.add(temp); |
|
|
|
|
map.put("checkStatistics", checkStatistics); |
|
|
|
|