mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2026-07-26 06:26:08 +00:00
fix 修复 虚拟线程导致的问题
This commit is contained in:
+3
-14
@@ -10,7 +10,6 @@ import lombok.extern.slf4j.Slf4j;
|
||||
import org.dromara.common.core.utils.DateUtils;
|
||||
import org.dromara.common.core.utils.StreamUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.core.utils.ThreadUtils;
|
||||
import org.dromara.system.api.*;
|
||||
import org.dromara.system.api.domain.DeptDTO;
|
||||
import org.dromara.system.api.domain.TaskAssigneeDTO;
|
||||
@@ -29,7 +28,6 @@ import org.dromara.workflow.service.IFlwTaskAssigneeService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -221,25 +219,16 @@ public class FlwTaskAssigneeServiceImpl implements IFlwTaskAssigneeService, Hand
|
||||
}
|
||||
|
||||
private List<UserDTO> getUsersByTypes(Map<TaskAssigneeEnum, List<String>> typeIdMap) {
|
||||
List<Supplier<List<UserDTO>>> suppliers = typeIdMap.entrySet().stream()
|
||||
.map(entry -> (Supplier<List<UserDTO>>) () -> this.getUsersByType(entry.getKey(), entry.getValue()))
|
||||
.toList();
|
||||
return ThreadUtils.virtualSubmitAll(suppliers).stream()
|
||||
return typeIdMap.entrySet().stream()
|
||||
.map(entry -> this.getUsersByType(entry.getKey(), entry.getValue()))
|
||||
.filter(CollUtil::isNotEmpty)
|
||||
.flatMap(Collection::stream)
|
||||
.toList();
|
||||
}
|
||||
|
||||
private Map<TaskAssigneeEnum, Map<String, String>> getNamesByTypes(Map<TaskAssigneeEnum, List<String>> typeIdMap) {
|
||||
List<TaskAssigneeEnum> types = new ArrayList<>(typeIdMap.keySet());
|
||||
List<Supplier<Map<String, String>>> suppliers = types.stream()
|
||||
.map(type -> (Supplier<Map<String, String>>) () -> this.getNamesByType(type, typeIdMap.get(type)))
|
||||
.toList();
|
||||
List<Map<String, String>> names = ThreadUtils.virtualSubmitAll(suppliers);
|
||||
Map<TaskAssigneeEnum, Map<String, String>> nameMap = new EnumMap<>(TaskAssigneeEnum.class);
|
||||
for (int i = 0; i < types.size(); i++) {
|
||||
nameMap.put(types.get(i), names.get(i));
|
||||
}
|
||||
typeIdMap.forEach((type, ids) -> nameMap.put(type, this.getNamesByType(type, ids)));
|
||||
return nameMap;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user