|
@@ -41,9 +41,12 @@ public class SopScheduleServiceImpl extends ServiceImpl<SopScheduleMapper, TBSop
|
|
|
if (group.equals(SopAnalyseGroupEnum.POPULATION)) {
|
|
|
result.put("POPULATION", processData(list, group));
|
|
|
} else if (group.equals(SopAnalyseGroupEnum.REGION)) {
|
|
|
- list.stream().filter(map -> map.get("region_name") != null).collect(Collectors.groupingBy(map -> map.get("region_name"))).forEach((k, v) -> result.put(k.toString(), processData(v, group)));
|
|
|
+ list.stream().filter(map -> map.get("region_name") != null)
|
|
|
+ .collect(Collectors.groupingBy(map -> map.get("region_name")))
|
|
|
+ .forEach((k, v) -> result.put(k.toString(), processData(v, group)));
|
|
|
} else if (group.equals(SopAnalyseGroupEnum.SUPPLIER)) {
|
|
|
- list.stream().filter(map -> map.get("name") != null).collect(Collectors.groupingBy(map -> map.get("name"))).forEach((k, v) -> result.put(k.toString(), processData(v, group)));
|
|
|
+ list.stream().filter(map -> map.get("name") != null).collect(Collectors.groupingBy(map -> map.get("name")))
|
|
|
+ .forEach((k, v) -> result.put(k.toString(), processData(v, group)));
|
|
|
}
|
|
|
return result;
|
|
|
}
|
|
@@ -55,11 +58,20 @@ public class SopScheduleServiceImpl extends ServiceImpl<SopScheduleMapper, TBSop
|
|
|
} else if (group.equals(SopAnalyseGroupEnum.SUPPLIER)) {
|
|
|
map.put("supplier_id", list.get(0).get("supplier_id"));
|
|
|
}
|
|
|
- map.put("prepare", list.stream().filter(map1 -> map1.get("setup") == null || (Integer.parseInt(map1.get("setup").toString()) > 0 && Integer.parseInt(map1.get("setup").toString()) < 5)).count());
|
|
|
- map.put("scan", list.stream().filter(map1 -> map1.get("setup") != null && "5,6,7".indexOf(map1.get("setup").toString()) > 0).count());
|
|
|
- map.put("evaluation", list.stream().filter(map1 -> map1.get("setup") != null && "8,9".indexOf(map1.get("setup").toString()) > 0).count());
|
|
|
- map.put("summary", list.stream().filter(map1 -> map1.get("setup") != null && (Integer.parseInt(map1.get("setup").toString()) == 11 || Integer.parseInt(map1.get("setup").toString()) == 10)).count());
|
|
|
- map.put("finish", list.stream().filter(map1 -> map1.get("setup") != null && Integer.parseInt(map1.get("setup").toString()) == 0).count());
|
|
|
+ map.put("prepare", list.stream()
|
|
|
+ .filter(map1 -> map1.get("setup") == null || (Integer.parseInt(map1.get("setup").toString()) > 0
|
|
|
+ && Integer.parseInt(map1.get("setup").toString()) < 5)).count());
|
|
|
+ map.put("scan", list.stream()
|
|
|
+ .filter(map1 -> map1.get("setup") != null && "5,6,7".indexOf(map1.get("setup").toString()) > 0)
|
|
|
+ .count());
|
|
|
+ map.put("evaluation", list.stream()
|
|
|
+ .filter(map1 -> map1.get("setup") != null && "8,9".indexOf(map1.get("setup").toString()) > 0).count());
|
|
|
+ map.put("summary", list.stream()
|
|
|
+ .filter(map1 -> map1.get("setup") != null && (Integer.parseInt(map1.get("setup").toString()) == 11
|
|
|
+ || Integer.parseInt(map1.get("setup").toString()) == 10)).count());
|
|
|
+ map.put("finish", list.stream()
|
|
|
+ .filter(map1 -> map1.get("setup") != null && Integer.parseInt(map1.get("setup").toString()) == 0)
|
|
|
+ .count());
|
|
|
return map;
|
|
|
}
|
|
|
|
|
@@ -88,35 +100,42 @@ public class SopScheduleServiceImpl extends ServiceImpl<SopScheduleMapper, TBSop
|
|
|
List<TBSopPlanDateLogDto> list = entry.getValue();
|
|
|
TBSopPlanDateLog planDateLog = list.get(0);//计划
|
|
|
TBSopPlanDateLog planActaledDateLog = null;
|
|
|
- if (list.size() > 1) {//实际
|
|
|
+ if (list.size() >= 1) {//实际
|
|
|
planActaledDateLog = list.get(list.size() - 1);
|
|
|
}
|
|
|
if (Objects.nonNull(planActaledDateLog) && endTimeMap.containsKey(planActaledDateLog.getSopId())) {
|
|
|
planActaledDateLog.setEndTime(endTimeMap.get(planActaledDateLog.getSopId()));
|
|
|
}
|
|
|
if (Objects.nonNull(planDateLog)) {
|
|
|
- List<String> daysBetweenPlan = DateDisposeUtils.getDaysBetween(planDateLog.getBeginTime(), planDateLog.getEndTime(), SystemConstant.DEFAULT_DATE_YMD_PATTERN);
|
|
|
+ List<String> daysBetweenPlan = DateDisposeUtils.getDaysBetween(planDateLog.getBeginTime(),
|
|
|
+ planDateLog.getEndTime(), SystemConstant.DEFAULT_DATE_YMD_PATTERN);
|
|
|
Map<String, Integer> daysBetweenPlanMap = new LinkedHashMap<>();
|
|
|
for (int i = 0; i < daysBetweenPlan.size(); i++) {
|
|
|
daysBetweenPlanMap.put(daysBetweenPlan.get(i), i + 1);
|
|
|
}
|
|
|
for (Map.Entry<String, Integer> entryPlan : daysBetweenPlanMap.entrySet()) {
|
|
|
if (daysBetweenPlanCalculat.containsKey(entryPlan.getKey())) {
|
|
|
- daysBetweenPlanCalculat.put(entryPlan.getKey(), daysBetweenPlanCalculat.get(entryPlan.getKey()) + entryPlan.getValue());
|
|
|
+ daysBetweenPlanCalculat.put(entryPlan.getKey(),
|
|
|
+ daysBetweenPlanCalculat.get(entryPlan.getKey()) + entryPlan.getValue());
|
|
|
} else {
|
|
|
daysBetweenPlanCalculat.put(entryPlan.getKey(), entryPlan.getValue());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
if (Objects.nonNull(planActaledDateLog)) {
|
|
|
- List<String> daysBetweenActualed = DateDisposeUtils.getDaysBetween(planActaledDateLog.getBeginTime(), planActaledDateLog.getEndTime(), SystemConstant.DEFAULT_DATE_YMD_PATTERN);
|
|
|
+ Long endTime = planActaledDateLog.getEndTime() > System.currentTimeMillis() ?
|
|
|
+ System.currentTimeMillis() :
|
|
|
+ planActaledDateLog.getEndTime();
|
|
|
+ List<String> daysBetweenActualed = DateDisposeUtils.getDaysBetween(
|
|
|
+ planActaledDateLog.getBeginTime(), endTime, SystemConstant.DEFAULT_DATE_YMD_PATTERN);
|
|
|
Map<String, Integer> daysBetweenActualedMap = new LinkedHashMap<>();
|
|
|
for (int i = 0; i < daysBetweenActualed.size(); i++) {
|
|
|
daysBetweenActualedMap.put(daysBetweenActualed.get(i), i + 1);
|
|
|
}
|
|
|
for (Map.Entry<String, Integer> entryActualed : daysBetweenActualedMap.entrySet()) {
|
|
|
if (daysBetweenActaledCalculat.containsKey(entryActualed.getKey())) {
|
|
|
- daysBetweenActaledCalculat.put(entryActualed.getKey(), daysBetweenActaledCalculat.get(entryActualed.getKey()) + entryActualed.getValue());
|
|
|
+ daysBetweenActaledCalculat.put(entryActualed.getKey(),
|
|
|
+ daysBetweenActaledCalculat.get(entryActualed.getKey()) + entryActualed.getValue());
|
|
|
} else {
|
|
|
daysBetweenActaledCalculat.put(entryActualed.getKey(), entryActualed.getValue());
|
|
|
}
|