fix 修复查询办理人错误使用

This commit is contained in:
AprilWind 2025-05-12 18:11:32 +08:00
parent 553fca28a2
commit b9e5914bab
3 changed files with 13 additions and 7 deletions

View File

@ -28,6 +28,6 @@ public interface IFlwTaskAssigneeService {
* @param storageIds 多个存储标识符字符串逗号分隔
* @return 合并后的用户列表去重后返回非法格式的标识将被跳过
*/
List<UserDTO> fetchUsersByStorageIds(String storageIds);
List<UserDTO> fetchUsersByStorageIds(List<String> storageIds);
}

View File

@ -72,10 +72,13 @@ public class FlwCommonServiceImpl implements IFlwCommonService {
IFlwTaskAssigneeService taskAssigneeService = SpringUtils.getBean(IFlwTaskAssigneeService.class);
Map<String, List<User>> userListMap = StreamUtils.groupByKey(userList, User::getType);
for (Map.Entry<String, List<User>> entry : userListMap.entrySet()) {
List<User> entryValue = entry.getValue();
String processedBys = StreamUtils.join(entryValue, User::getProcessedBy);
List<String> processedBys = entry.getValue().stream()
.map(User::getProcessedBy)
.filter(StringUtils::isNotBlank)
.distinct()
.collect(Collectors.toList());
// 根据 processedBy 前缀判断处理人类型分别获取用户列表
List<UserDTO> users = taskAssigneeService.fetchUsersByStorageId(processedBys);
List<UserDTO> users = taskAssigneeService.fetchUsersByStorageIds(processedBys);
// 转换为 FlowUser 并添加到结果集合
if (CollUtil.isNotEmpty(users)) {
users.forEach(dto -> {

View File

@ -176,7 +176,7 @@ public class FlwTaskAssigneeServiceImpl implements IFlwTaskAssigneeService, Hand
public List<UserDTO> fetchUsersByStorageId(String storageId) {
Pair<TaskAssigneeEnum, Long> parsed = this.parseStorageId(storageId);
if (parsed == null) {
return Collections.emptyList();
return List.of();
}
return this.getUsersByType(parsed.getKey(), Collections.singletonList(parsed.getValue()));
}
@ -190,9 +190,12 @@ public class FlwTaskAssigneeServiceImpl implements IFlwTaskAssigneeService, Hand
* @return 合并后的用户列表去重后返回非法格式的标识将被跳过
*/
@Override
public List<UserDTO> fetchUsersByStorageIds(String storageIds) {
public List<UserDTO> fetchUsersByStorageIds(List<String> storageIds) {
if (CollUtil.isEmpty(storageIds)) {
return List.of();
}
Map<TaskAssigneeEnum, List<Long>> typeIdMap = new EnumMap<>(TaskAssigneeEnum.class);
for (String storageId : storageIds.split(StrUtil.COMMA)) {
for (String storageId : storageIds) {
Pair<TaskAssigneeEnum, Long> parsed = this.parseStorageId(storageId);
if (parsed != null) {
typeIdMap.computeIfAbsent(parsed.getKey(), k -> new ArrayList<>()).add(parsed.getValue());