Commit 7b7731ff by HlQ

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

1 parent 560f01aa
......@@ -441,13 +441,16 @@ public class TaskServiceImpl extends MPJBaseServiceImpl<TaskMapper, Task> implem
.list();
List<Store> storeList = storeService.list();
Map<Long, String> id2UsernameMap = userService.list().stream().collect(Collectors.toMap(User::getId, User::getUsername));
List<FaultLog> logList = faultLogService.lambdaQuery().isNotNull(FaultLog::getManHour).list();
Map<Long, Double> taskId2HourMap = logList.stream().collect(Collectors.groupingBy(FaultLog::getTaskId, Collectors.summingDouble(FaultLog::getManHour)));
List<FaultLog> logList = faultLogService.lambdaQuery().list();
Map<Long, Double> taskId2HourMap = logList.stream()
.filter(l -> ObjUtil.isNotNull(l.getManHour()))
.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())));
var user2TaskIdMap = logList.stream()
.filter(l -> StrUtil.equals(l.getContent(), "工单处理完成"))
.collect(Collectors.groupingBy(FaultLog::getOperator, Collectors.mapping(FaultLog::getTaskId,
Collectors.toList())));
// 人 => 工单
Map<Long, List<Task>> p2TaskMap = taskList.stream().collect(Collectors.groupingBy(Task::getActiveUser));
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!