From 2ba217d23d7dc4bec4fcb37706512456998f60f6 Mon Sep 17 00:00:00 2001 From: lulz1 Date: Tue, 2 Jul 2024 14:48:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E5=AE=A1=E6=89=B9=E5=8A=9F=E8=83=BD?= =?UTF-8?q?=E9=87=8D=E6=9E=84-=E5=AE=89=E8=83=BD=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E8=A1=8C=E7=A8=8B=E5=92=8C=E5=8F=98=E6=9B=B4=E8=A1=8C=E7=A8=8B?= =?UTF-8?q?-=E7=BB=86=E8=8A=82=E9=97=AE=E9=A2=98=E4=BF=AE=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../approval/platform/ApprovalPlatformAN.java | 2 +- .../service/RouteApprovalDomainService.java | 24 +++++++++++-------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/main/java/com/chint/domain/aggregates/approval/platform/ApprovalPlatformAN.java b/src/main/java/com/chint/domain/aggregates/approval/platform/ApprovalPlatformAN.java index 3ceac25f..264f72d3 100644 --- a/src/main/java/com/chint/domain/aggregates/approval/platform/ApprovalPlatformAN.java +++ b/src/main/java/com/chint/domain/aggregates/approval/platform/ApprovalPlatformAN.java @@ -108,7 +108,7 @@ public class ApprovalPlatformAN implements ApprovalPlatform { approvalScheduleParam.setSourceSystem(systemNum()); RouteOrder routeOrder = approvalData.getRouteOrder(); ApproveOrderNo approveOrderNo = routeOrder.getApproveOrderNo(); - approvalScheduleParam.setSourceSystemNum(legChangeTag() + routeOrder.getRouteOrderNo()); + approvalScheduleParam.setSourceSystemNum(approvalData.getApprovalRecordNo()); approvalScheduleParam.setApplicant(routeOrder.getUserId()); approvalScheduleParam.setApplicantDate(DateTimeUtil.timeToStr(LocalDateTime.now())); approvalScheduleParam.setApplyNo(approveOrderNo.getActualOrderNo()); diff --git a/src/main/java/com/chint/domain/service/RouteApprovalDomainService.java b/src/main/java/com/chint/domain/service/RouteApprovalDomainService.java index 682d568d..8f37b4ea 100644 --- a/src/main/java/com/chint/domain/service/RouteApprovalDomainService.java +++ b/src/main/java/com/chint/domain/service/RouteApprovalDomainService.java @@ -135,16 +135,20 @@ public class RouteApprovalDomainService { String approvalType = systemOrganizationRepository.findByOrgCodeContainingOrOrgNameContaining(approveOrderNo.getAccountCompany(), approveOrderNo.getAccountCompany()).map(SystemOrganization::getApprovalType).orElseGet( () -> systemCodeRepository.findBySysCode(approveOrderNo.getSysCode()).getApprovalType()); - routeOrder.setRoutePermissionSet( - permissionConfigRepository.findByPermissionName(approvalType) - .map(permissionConfig -> { - List permissions = permissionConfig.permissions(); - return permissions.stream() - .distinct() - .map(permission -> Enum.valueOf(RoutePermission.class, permission)) - .collect(Collectors.toSet()); - }).orElseGet(Set::of) - ); + if(approvalType != null){ + routeOrder.setRoutePermissionSet( + permissionConfigRepository.findByPermissionName(approvalType) + .map(permissionConfig -> { + List permissions = permissionConfig.permissions(); + return permissions.stream() + .distinct() + .map(permission -> Enum.valueOf(RoutePermission.class, permission)) + .collect(Collectors.toSet()); + }).orElseGet(Set::of) + ); + } else { + routeOrder.setRoutePermissionSet(Collections.emptySet()); + } return routeOrder; }