|
|
|
@ -181,9 +181,10 @@ public class QualityReportServiceImpl implements IQualityReportService {
|
|
|
|
|
//周
|
|
|
|
|
else if (hashMap.get("month").equals("2")){
|
|
|
|
|
|
|
|
|
|
//将时间扩充到开始时间的周一和结束时间的周末
|
|
|
|
|
String beginTime = getFirstDayOfWeek(String.valueOf(hashMap.get("beginBeginTime")));
|
|
|
|
|
String endTime = getLastDayOfWeek(String.valueOf(hashMap.get("endBeginTime")));
|
|
|
|
|
|
|
|
|
|
Object year = String.valueOf(hashMap.get("year"));
|
|
|
|
|
String beginTime = year + "-01-01";
|
|
|
|
|
String endTime = year + "-12-31";
|
|
|
|
|
hashMap.put("year",endTime.substring(0,4));
|
|
|
|
|
hashMap.put("beginBeginTime",beginTime);
|
|
|
|
|
hashMap.put("endBeginTime",endTime);
|
|
|
|
@ -204,33 +205,19 @@ public class QualityReportServiceImpl implements IQualityReportService {
|
|
|
|
|
collect.get(i).setREPAIR_RATE(repairRateReports.get(i).getREPAIR_RATE()+ repairRateReports.get(i).getREPAIR_RATE());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
collect.get(i).setINSPECTOR_TIME("第"+collect.get(i).getCOLUMN_A()+"周");
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
return collect;
|
|
|
|
|
}
|
|
|
|
|
//月
|
|
|
|
|
//todo 逻辑 数据库会根据每天、不合格数量、所有数量、合格率分组 拿回来根据周/月进行循环累加,然后返回给前端
|
|
|
|
|
else if (hashMap.get("month").equals("3")){
|
|
|
|
|
List<RepairRateReport> repairRateReports = new ArrayList<>();
|
|
|
|
|
//将时间扩充到开始时间的月初和结束时间的月末
|
|
|
|
|
String beginTime = String.valueOf(hashMap.get("beginBeginTime")).substring(0, 7) + "01";
|
|
|
|
|
String endTime = String.valueOf(hashMap.get("endBeginTime")).substring(0, 7) + "31";
|
|
|
|
|
Object year = String.valueOf(hashMap.get("year"));
|
|
|
|
|
String beginTime = year + "-01-01";
|
|
|
|
|
String endTime = year + "-12-31";
|
|
|
|
|
hashMap.put("beginBeginTime",beginTime);
|
|
|
|
|
hashMap.put("endBeginTime",endTime);
|
|
|
|
|
if (beginTime.substring(0,4).equals(endTime.substring(0,4))){
|
|
|
|
|
hashMap.put("year",endTime.substring(0,4));
|
|
|
|
|
repairRateReports = reportMapper.repairRateReportListMONTH(hashMap);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
hashMap.put("year",beginTime.substring(0,4));
|
|
|
|
|
List<RepairRateReport> repairRateReports1 = reportMapper.repairRateReportListMONTH(hashMap);
|
|
|
|
|
hashMap.put("year",endTime.substring(0,4));
|
|
|
|
|
List<RepairRateReport> repairRateReports2 = reportMapper.repairRateReportListMONTH(hashMap);
|
|
|
|
|
repairRateReports.addAll(repairRateReports1);
|
|
|
|
|
repairRateReports.addAll(repairRateReports2);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<RepairRateReport> repairRateReports = reportMapper.repairRateReportListMONTH(hashMap);
|
|
|
|
|
List<RepairRateReport> collect = repairRateReports.stream().collect(Collectors.collectingAndThen(
|
|
|
|
|
Collectors.toCollection(()->new TreeSet<>(Comparator.comparing(RepairRateReport::getCOLUMN_A))),ArrayList::new
|
|
|
|
|
));
|
|
|
|
@ -247,7 +234,7 @@ public class QualityReportServiceImpl implements IQualityReportService {
|
|
|
|
|
collect.get(i).setREPAIR_RATE(repairRateReports.get(i).getREPAIR_RATE()+ repairRateReports.get(i).getREPAIR_RATE());
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
collect.get(i).setINSPECTOR_TIME(collect.get(i).getINSPECTOR_TIME().substring(0,7));
|
|
|
|
|
}
|
|
|
|
|
return collect;
|
|
|
|
|
}
|
|
|
|
|