|
@@ -43,17 +43,22 @@ public class SopScheduleServiceImpl extends ServiceImpl<SopScheduleMapper, TBSop
|
|
List<Map<String, Object>> list = this.baseMapper.progress(serviceId);
|
|
List<Map<String, Object>> list = this.baseMapper.progress(serviceId);
|
|
Map<String, Map<String, Object>> result = new HashMap<>();
|
|
Map<String, Map<String, Object>> result = new HashMap<>();
|
|
if (group.equals(SopAnalyseGroupEnum.POPULATION)) {
|
|
if (group.equals(SopAnalyseGroupEnum.POPULATION)) {
|
|
- result.put("POPULATION", processData(list));
|
|
|
|
|
|
+ result.put("POPULATION", processData(list,group));
|
|
} else if (group.equals(SopAnalyseGroupEnum.REGION)) {
|
|
} else if (group.equals(SopAnalyseGroupEnum.REGION)) {
|
|
- list.stream().collect(Collectors.groupingBy(map -> map.get("region_name"))).forEach((k, v) -> result.put(k.toString(), processData(v)));
|
|
|
|
|
|
+ list.stream().collect(Collectors.groupingBy(map -> map.get("region_name"))).forEach((k, v) -> result.put(k.toString(), processData(v,group)));
|
|
} else if (group.equals(SopAnalyseGroupEnum.SUPPLIER)) {
|
|
} else if (group.equals(SopAnalyseGroupEnum.SUPPLIER)) {
|
|
- list.stream().collect(Collectors.groupingBy(map -> map.get("name"))).forEach((k, v) -> result.put(k.toString(), processData(v)));
|
|
|
|
|
|
+ list.stream().collect(Collectors.groupingBy(map -> map.get("name"))).forEach((k, v) -> result.put(k.toString(), processData(v,group)));
|
|
}
|
|
}
|
|
return result;
|
|
return result;
|
|
}
|
|
}
|
|
|
|
|
|
- private Map<String, Object> processData(List<Map<String, Object>> list) {
|
|
|
|
|
|
+ private Map<String, Object> processData(List<Map<String, Object>> list,SopAnalyseGroupEnum group) {
|
|
Map<String, Object> map = new HashMap<>();
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
|
+ if (group.equals(SopAnalyseGroupEnum.REGION)) {
|
|
|
|
+ map.put("region_id", list.get(0).get("region_id"));
|
|
|
|
+ } 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("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("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("evaluation", list.stream().filter(map1 -> map1.get("setup") != null && "8,9".indexOf(map1.get("setup").toString()) > 0).count());
|