fix 修复 重构导致的问题

This commit is contained in:
疯狂的狮子Li
2025-05-12 18:27:14 +08:00
parent ec7aa9035a
commit e83e0548d0
4 changed files with 6 additions and 29 deletions

View File

@@ -11,15 +11,6 @@ import java.util.List;
*/
public interface IFlwTaskAssigneeService {
/**
* 根据存储标识符storageId解析分配类型和ID并获取对应的用户列表
* 支持单个标识(例如 "user:123" 或 "456"),格式非法将返回空列表
*
* @param storageId 包含分配类型和ID的字符串
* @return 匹配的用户列表,格式非法返回空列表
*/
List<RemoteUserVo> fetchUsersByStorageId(String storageId);
/**
* 批量解析多个存储标识符storageIds按类型分类并合并查询用户列表
* 输入格式支持多个以逗号分隔的标识(如 "user:123,role:456,789"

View File

@@ -81,7 +81,7 @@ public class FlwCommonServiceImpl implements IFlwCommonService {
List<User> entryValue = entry.getValue();
String processedBys = StreamUtils.join(entryValue, User::getProcessedBy);
// 根据 processedBy 前缀判断处理人类型,分别获取用户列表
List<RemoteUserVo> users = taskAssigneeService.fetchUsersByStorageId(processedBys);
List<RemoteUserVo> users = taskAssigneeService.fetchUsersByStorageIds(processedBys);
// 转换为 FlowUser 并添加到结果集合
if (CollUtil.isNotEmpty(users)) {
users.forEach(dto -> {

View File

@@ -8,7 +8,6 @@ import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
import org.dromara.common.core.enums.FormatsType;
import org.dromara.common.core.exception.ServiceException;
import org.dromara.common.core.utils.DateUtils;
import org.dromara.common.core.utils.StringUtils;
import org.dromara.system.api.RemoteDeptService;
@@ -171,22 +170,6 @@ public class FlwTaskAssigneeServiceImpl implements IFlwTaskAssigneeService, Hand
.setCreateTime(assignee -> DateUtils.parseDateToStr(FormatsType.YYYY_MM_DD_HH_MM_SS, assignee.getCreateTime()));
}
/**
* 根据存储标识符storageId解析分配类型和ID并获取对应的用户列表
* 支持单个标识(例如 "user:123" 或 "456"),格式非法将返回空列表
*
* @param storageId 包含分配类型和ID的字符串
* @return 匹配的用户列表,格式非法返回空列表
*/
@Override
public List<RemoteUserVo> fetchUsersByStorageId(String storageId) {
Pair<TaskAssigneeEnum, Long> parsed = this.parseStorageId(storageId);
if (parsed == null) {
return Collections.emptyList();
}
return this.getUsersByType(parsed.getKey(), Collections.singletonList(parsed.getValue()));
}
/**
* 批量解析多个存储标识符storageIds按类型分类并合并查询用户列表
* 输入格式支持多个以逗号分隔的标识(如 "user:123,role:456,789"
@@ -197,8 +180,11 @@ public class FlwTaskAssigneeServiceImpl implements IFlwTaskAssigneeService, Hand
*/
@Override
public List<RemoteUserVo> fetchUsersByStorageIds(String storageIds) {
if (StringUtils.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.split(StringUtils.SEPARATOR)) {
Pair<TaskAssigneeEnum, Long> parsed = this.parseStorageId(storageId);
if (parsed != null) {
typeIdMap.computeIfAbsent(parsed.getKey(), k -> new ArrayList<>()).add(parsed.getValue());

View File

@@ -603,7 +603,7 @@ public class FlwTaskServiceImpl implements IFlwTaskService {
for (FlowNode flowNode : nextFlowNodes) {
buildNextTaskList.stream().filter(t -> t.getNodeCode().equals(flowNode.getNodeCode())).findFirst().ifPresent(t -> {
if (CollUtil.isNotEmpty(t.getPermissionList())) {
List<RemoteUserVo> users = flwTaskAssigneeService.fetchUsersByStorageId(String.join(StringUtils.SEPARATOR, t.getPermissionList()));
List<RemoteUserVo> users = flwTaskAssigneeService.fetchUsersByStorageIds(String.join(StringUtils.SEPARATOR, t.getPermissionList()));
if (CollUtil.isNotEmpty(users)) {
flowNode.setPermissionFlag(StreamUtils.join(users, e -> String.valueOf(e.getUserId())));
}