diff --git a/src/main/java/com/chint/domain/service/RouteApprovalDomainService.java b/src/main/java/com/chint/domain/service/RouteApprovalDomainService.java index 855a372b..5f0982ea 100644 --- a/src/main/java/com/chint/domain/service/RouteApprovalDomainService.java +++ b/src/main/java/com/chint/domain/service/RouteApprovalDomainService.java @@ -154,6 +154,7 @@ public class RouteApprovalDomainService { // 将权限映射为枚举 Map> approvalTypeToPermissionSet = approvalTypeToPermissions.entrySet().stream() .collect(Collectors.toMap(Map.Entry::getKey, entry -> entry.getValue().stream() + .flatMap(it-> Arrays.stream(it.split("&"))) .distinct() .map(permission -> Enum.valueOf(RoutePermission.class, permission)) .collect(Collectors.toSet()))); @@ -163,12 +164,15 @@ public class RouteApprovalDomainService { ApproveOrderNo approveOrderNo = routeOrder.getApproveOrderNo(); String approvalType = accountCompanyToApprovalType.getOrDefault(approveOrderNo.getAccountCompany(), sysCodeToApprovalType.get(approveOrderNo.getSysCode())); - Set routePermissionSet = approvalTypeToPermissionSet - .getOrDefault(approvalType, Collections.emptySet()); - routeOrder.setRoutePermissionSet(routePermissionSet); - if (approvalType != null && !approvalType.isEmpty()) { List list = Arrays.stream(approvalType.split("&")).distinct().toList(); + Set routePermissions = list + .stream() + .flatMap(it -> Optional.ofNullable(approvalTypeToPermissionSet.get(it)) + .orElse(Collections.emptySet()) + .stream()) + .collect(Collectors.toSet()); + routeOrder.setRoutePermissionSet(routePermissions); routeOrder.setPermissionConfigSet(byPermissionNameIn .stream() .filter(it -> list.contains(it.getPermissionName()))