mirror of
https://gitee.com/dromara/RuoYi-Cloud-Plus.git
synced 2025-10-15 22:50:28 +00:00
fix 修复 重构导致的问题
This commit is contained in:
@@ -11,15 +11,6 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public interface IFlwTaskAssigneeService {
|
public interface IFlwTaskAssigneeService {
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据存储标识符(storageId)解析分配类型和ID,并获取对应的用户列表
|
|
||||||
* 支持单个标识(例如 "user:123" 或 "456"),格式非法将返回空列表
|
|
||||||
*
|
|
||||||
* @param storageId 包含分配类型和ID的字符串
|
|
||||||
* @return 匹配的用户列表,格式非法返回空列表
|
|
||||||
*/
|
|
||||||
List<RemoteUserVo> fetchUsersByStorageId(String storageId);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 批量解析多个存储标识符(storageIds),按类型分类并合并查询用户列表
|
* 批量解析多个存储标识符(storageIds),按类型分类并合并查询用户列表
|
||||||
* 输入格式支持多个以逗号分隔的标识(如 "user:123,role:456,789")
|
* 输入格式支持多个以逗号分隔的标识(如 "user:123,role:456,789")
|
||||||
|
@@ -81,7 +81,7 @@ public class FlwCommonServiceImpl implements IFlwCommonService {
|
|||||||
List<User> entryValue = entry.getValue();
|
List<User> entryValue = entry.getValue();
|
||||||
String processedBys = StreamUtils.join(entryValue, User::getProcessedBy);
|
String processedBys = StreamUtils.join(entryValue, User::getProcessedBy);
|
||||||
// 根据 processedBy 前缀判断处理人类型,分别获取用户列表
|
// 根据 processedBy 前缀判断处理人类型,分别获取用户列表
|
||||||
List<RemoteUserVo> users = taskAssigneeService.fetchUsersByStorageId(processedBys);
|
List<RemoteUserVo> users = taskAssigneeService.fetchUsersByStorageIds(processedBys);
|
||||||
// 转换为 FlowUser 并添加到结果集合
|
// 转换为 FlowUser 并添加到结果集合
|
||||||
if (CollUtil.isNotEmpty(users)) {
|
if (CollUtil.isNotEmpty(users)) {
|
||||||
users.forEach(dto -> {
|
users.forEach(dto -> {
|
||||||
|
@@ -8,7 +8,6 @@ import lombok.RequiredArgsConstructor;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.apache.dubbo.config.annotation.DubboReference;
|
import org.apache.dubbo.config.annotation.DubboReference;
|
||||||
import org.dromara.common.core.enums.FormatsType;
|
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.DateUtils;
|
||||||
import org.dromara.common.core.utils.StringUtils;
|
import org.dromara.common.core.utils.StringUtils;
|
||||||
import org.dromara.system.api.RemoteDeptService;
|
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()));
|
.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),按类型分类并合并查询用户列表
|
* 批量解析多个存储标识符(storageIds),按类型分类并合并查询用户列表
|
||||||
* 输入格式支持多个以逗号分隔的标识(如 "user:123,role:456,789")
|
* 输入格式支持多个以逗号分隔的标识(如 "user:123,role:456,789")
|
||||||
@@ -197,8 +180,11 @@ public class FlwTaskAssigneeServiceImpl implements IFlwTaskAssigneeService, Hand
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<RemoteUserVo> fetchUsersByStorageIds(String storageIds) {
|
public List<RemoteUserVo> fetchUsersByStorageIds(String storageIds) {
|
||||||
|
if (StringUtils.isEmpty(storageIds)) {
|
||||||
|
return List.of();
|
||||||
|
}
|
||||||
Map<TaskAssigneeEnum, List<Long>> typeIdMap = new EnumMap<>(TaskAssigneeEnum.class);
|
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);
|
Pair<TaskAssigneeEnum, Long> parsed = this.parseStorageId(storageId);
|
||||||
if (parsed != null) {
|
if (parsed != null) {
|
||||||
typeIdMap.computeIfAbsent(parsed.getKey(), k -> new ArrayList<>()).add(parsed.getValue());
|
typeIdMap.computeIfAbsent(parsed.getKey(), k -> new ArrayList<>()).add(parsed.getValue());
|
||||||
|
@@ -603,7 +603,7 @@ public class FlwTaskServiceImpl implements IFlwTaskService {
|
|||||||
for (FlowNode flowNode : nextFlowNodes) {
|
for (FlowNode flowNode : nextFlowNodes) {
|
||||||
buildNextTaskList.stream().filter(t -> t.getNodeCode().equals(flowNode.getNodeCode())).findFirst().ifPresent(t -> {
|
buildNextTaskList.stream().filter(t -> t.getNodeCode().equals(flowNode.getNodeCode())).findFirst().ifPresent(t -> {
|
||||||
if (CollUtil.isNotEmpty(t.getPermissionList())) {
|
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)) {
|
if (CollUtil.isNotEmpty(users)) {
|
||||||
flowNode.setPermissionFlag(StreamUtils.join(users, e -> String.valueOf(e.getUserId())));
|
flowNode.setPermissionFlag(StreamUtils.join(users, e -> String.valueOf(e.getUserId())));
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user