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())));