Commit 560f01aa by HlQ

[fix] 根据人员统计工单,修改工单完成人的判断逻辑

1 parent 76aea466
...@@ -444,6 +444,11 @@ public class TaskServiceImpl extends MPJBaseServiceImpl<TaskMapper, Task> implem ...@@ -444,6 +444,11 @@ public class TaskServiceImpl extends MPJBaseServiceImpl<TaskMapper, Task> implem
List<FaultLog> logList = faultLogService.lambdaQuery().isNotNull(FaultLog::getManHour).list(); List<FaultLog> logList = faultLogService.lambdaQuery().isNotNull(FaultLog::getManHour).list();
Map<Long, Double> taskId2HourMap = logList.stream().collect(Collectors.groupingBy(FaultLog::getTaskId, Collectors.summingDouble(FaultLog::getManHour))); Map<Long, Double> taskId2HourMap = logList.stream().collect(Collectors.groupingBy(FaultLog::getTaskId, Collectors.summingDouble(FaultLog::getManHour)));
// 根据工单日志,判断工单完成人
var faultLogList = faultLogService.lambdaQuery().eq(FaultLog::getContent, "工单处理完成").list();
var user2TaskIdMap = faultLogList.stream().collect(Collectors.groupingBy(FaultLog::getOperator,
Collectors.mapping(FaultLog::getTaskId, Collectors.toList())));
// 人 => 工单 // 人 => 工单
Map<Long, List<Task>> p2TaskMap = taskList.stream().collect(Collectors.groupingBy(Task::getActiveUser)); Map<Long, List<Task>> p2TaskMap = taskList.stream().collect(Collectors.groupingBy(Task::getActiveUser));
var resList = new ArrayList<Map<String, Object>>(); var resList = new ArrayList<Map<String, Object>>();
...@@ -452,7 +457,7 @@ public class TaskServiceImpl extends MPJBaseServiceImpl<TaskMapper, Task> implem ...@@ -452,7 +457,7 @@ public class TaskServiceImpl extends MPJBaseServiceImpl<TaskMapper, Task> implem
var inList = list.stream().filter(v -> v.getStatus().equals(2)).toList(); var inList = list.stream().filter(v -> v.getStatus().equals(2)).toList();
var expList = inList.stream().filter(v -> v.getExpDate().after(new Date())).toList(); var expList = inList.stream().filter(v -> v.getExpDate().after(new Date())).toList();
var finishList = list.stream().filter(v -> v.getStatus().equals(3)).toList(); var finishList = taskList.stream().filter(t -> user2TaskIdMap.getOrDefault(p, List.of()).contains(t.getId())).toList();
var storeIdSet = list.stream().map(Task::getStoreId).collect(Collectors.toSet()); var storeIdSet = list.stream().map(Task::getStoreId).collect(Collectors.toSet());
var storeNameList = storeList.stream().filter(v -> storeIdSet.contains(v.getId())).distinct().map(Store::getName).collect(Collectors.joining(",")); var storeNameList = storeList.stream().filter(v -> storeIdSet.contains(v.getId())).distinct().map(Store::getName).collect(Collectors.joining(","));
Map<String, Object> cntMap = Map.of("person", id2UsernameMap.get(p), Map<String, Object> cntMap = Map.of("person", id2UsernameMap.get(p),
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!