From def59eaf05e6ae0d9907c003c6d2e2fb859a7076 Mon Sep 17 00:00:00 2001 From: lulz1 Date: Fri, 12 Jul 2024 14:43:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E7=BB=86=E8=8A=82?= =?UTF-8?q?=E5=AE=A1=E6=89=B9=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../chint/application/services/OrderApplicationService.java | 6 +++--- .../chint/domain/service/RouteApprovalDomainService.java | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/chint/application/services/OrderApplicationService.java b/src/main/java/com/chint/application/services/OrderApplicationService.java index 81644ad8..b41ff68b 100644 --- a/src/main/java/com/chint/application/services/OrderApplicationService.java +++ b/src/main/java/com/chint/application/services/OrderApplicationService.java @@ -140,7 +140,7 @@ public class OrderApplicationService { // 发送 BPM 保存结果 ApproveOrderNo approveOrderNo = routeOrder.getApproveOrderNo(); - if (!routeOrder.getOrderStatus().equals(ORDER_STATUS_PREPARE)) { + if (routeOrder.getApproveOrderNo().getActualOrderNo() != null) { //这里加入一个待审批事件, 变更加入旧行程数据, 用于回滚还原 if (checkIfNeedApprove(routeOrder)) { leg.addEvent(LegApprovalEvent.prepare(oldLeg)); @@ -158,7 +158,7 @@ public class OrderApplicationService { private boolean checkIfNeedApprove(RouteOrder routeOrder) { Set routePermissionSet = routeOrder.getRoutePermissionSet(); - if (routePermissionSet == null) { + if (routePermissionSet == null || routePermissionSet.isEmpty()) { routeApprovalDomainService.checkApprovalPermissions(routeOrder); } if (routePermissionSet == null || routePermissionSet.isEmpty() || routePermissionSet.contains(LEG_NO_APPROVAL)) { @@ -190,7 +190,7 @@ public class OrderApplicationService { leg.setRouteId(routeOrder.getRouteId()); ApproveOrderNo approveOrderNo = routeOrder.getApproveOrderNo(); - if (!routeOrder.getOrderStatus().equals(ORDER_STATUS_PREPARE) && addLegData.getIfApprove() == 1) { + if (routeOrder.getApproveOrderNo().getActualOrderNo() != null && addLegData.getIfApprove() == 1) { //这里加入一个待审批事件 if (checkIfNeedApprove(routeOrder)) { leg.addEvent(LegApprovalEvent.prepare()); diff --git a/src/main/java/com/chint/domain/service/RouteApprovalDomainService.java b/src/main/java/com/chint/domain/service/RouteApprovalDomainService.java index 5f0982ea..8e4e6206 100644 --- a/src/main/java/com/chint/domain/service/RouteApprovalDomainService.java +++ b/src/main/java/com/chint/domain/service/RouteApprovalDomainService.java @@ -154,7 +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("&"))) + .flatMap(it -> Arrays.stream(it.split("&"))) .distinct() .map(permission -> Enum.valueOf(RoutePermission.class, permission)) .collect(Collectors.toSet())));