Ver código fonte

客户修改

Guo1B0 10 meses atrás
pai
commit
a7be343b2b

+ 16 - 0
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/CustomServiceImpl.java

@@ -272,6 +272,22 @@ public class CustomServiceImpl extends ServiceImpl<CustomMapper, Custom> impleme
         //操作记录
         List<ActionLog> actionLogs = actionLogMapper.selectByInfoListCustom(custom.getId());
         List<Task> tasks = taskMapper.selectList(new QueryWrapper<Task>().in("custom_id", custom1.getId()));
+        if (tasks.size()>0){
+            List<String> ids = tasks.stream()
+                    .flatMap(task -> Arrays.stream(task.getExecutorId().split(",")))
+                    .distinct()
+                    .collect(Collectors.toList());
+            List<User> users = userMapper.selectList(new QueryWrapper<User>().in("id", ids));
+            Map<String, String> map = users.stream().collect(Collectors.toMap(User::getId, User::getName));
+            for (Task task : tasks) {
+                List<String> executorNames = Arrays.stream(task.getExecutorId().split(","))
+                        .map(map::get)
+                        .collect(Collectors.toList());
+                task.setExecutorNames(executorNames);
+            }
+        }
+
+
         custom1.setTasks(tasks);
         custom1.setActionLogs(actionLogs);
         //联系人