fix 修复 重构导致的问题

master
疯狂的狮子Li 7 months ago
parent a4ad56f0eb
commit facd3e351f

@ -15,19 +15,9 @@ public interface IFlwTaskAssigneeService {
* storageIdID
* "user:123" "456"
*
* @param storageId ID
* @param storageIds ID
* @return
*/
List<UserDTO> fetchUsersByStorageId(String storageId);
/**
* storageIds
* "user:123,role:456,789"
*
*
* @param storageIds
* @return
*/
List<UserDTO> fetchUsersByStorageIds(List<String> storageIds);
List<UserDTO> fetchUsersByStorageIds(String storageIds);
}

@ -72,11 +72,8 @@ 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<String> processedBys = entry.getValue().stream()
.map(User::getProcessedBy)
.filter(StringUtils::isNotBlank)
.distinct()
.collect(Collectors.toList());
List<User> entryValue = entry.getValue();
String processedBys = StreamUtils.join(entryValue, User::getProcessedBy);
// 根据 processedBy 前缀判断处理人类型,分别获取用户列表
List<UserDTO> users = taskAssigneeService.fetchUsersByStorageIds(processedBys);
// 转换为 FlowUser 并添加到结果集合

@ -169,33 +169,16 @@ public class FlwTaskAssigneeServiceImpl implements IFlwTaskAssigneeService, Hand
* storageIdID
* "user:123" "456"
*
* @param storageId ID
* @param storageIds ID
* @return
*/
@Override
public List<UserDTO> fetchUsersByStorageId(String storageId) {
Pair<TaskAssigneeEnum, Long> parsed = this.parseStorageId(storageId);
if (parsed == null) {
return List.of();
}
return this.getUsersByType(parsed.getKey(), Collections.singletonList(parsed.getValue()));
}
/**
* storageIds
* "user:123,role:456,789"
*
*
* @param storageIds
* @return
*/
@Override
public List<UserDTO> fetchUsersByStorageIds(List<String> storageIds) {
if (CollUtil.isEmpty(storageIds)) {
public List<UserDTO> fetchUsersByStorageIds(String storageIds) {
if (StringUtils.isEmpty(storageIds)) {
return List.of();
}
Map<TaskAssigneeEnum, List<Long>> typeIdMap = new EnumMap<>(TaskAssigneeEnum.class);
for (String storageId : storageIds) {
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());

@ -600,7 +600,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<UserDTO> users = flwTaskAssigneeService.fetchUsersByStorageIds(t.getPermissionList());
List<UserDTO> users = flwTaskAssigneeService.fetchUsersByStorageIds(String.join(StringUtils.SEPARATOR, t.getPermissionList()));
if (CollUtil.isNotEmpty(users)) {
flowNode.setPermissionFlag(StreamUtils.join(users, e -> String.valueOf(e.getUserId())));
}

Loading…
Cancel
Save