From d1408e39d951f3c4022f953599c3c15c91ebd8fa Mon Sep 17 00:00:00 2001 From: lulz1 Date: Tue, 6 Feb 2024 16:47:00 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=8C=E6=AD=A5=E6=8E=A5=E5=8F=A3=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E6=8A=9B=E5=87=BA=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/chint/domain/service/leg_event/LegEventHandler.java | 4 +++- .../domain/service/order_sync/CTripOrderSyncAdapter.java | 3 ++- .../chint/domain/service/order_sync/LYOrderSyncAdapter.java | 2 +- .../chint/domain/service/order_sync/SupplierOrderSync.java | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/chint/domain/service/leg_event/LegEventHandler.java b/src/main/java/com/chint/domain/service/leg_event/LegEventHandler.java index b7225851..8875eddb 100644 --- a/src/main/java/com/chint/domain/service/leg_event/LegEventHandler.java +++ b/src/main/java/com/chint/domain/service/leg_event/LegEventHandler.java @@ -79,7 +79,9 @@ public class LegEventHandler implements LegEventService{ )); //保存routeOrder的状态 routeRepository.save(routeOrder); - syncAdapter.of(supplierName).syncSupplierOrder(routeOrder.reloadStatus()); + if (!syncAdapter.of(supplierName).syncSupplierOrder(routeOrder.reloadStatus())) { + throw new CommandException("订单提交失败"); + } } else { throw new CommandException("订单未提交审批"); } diff --git a/src/main/java/com/chint/domain/service/order_sync/CTripOrderSyncAdapter.java b/src/main/java/com/chint/domain/service/order_sync/CTripOrderSyncAdapter.java index 497cda7c..429252a3 100644 --- a/src/main/java/com/chint/domain/service/order_sync/CTripOrderSyncAdapter.java +++ b/src/main/java/com/chint/domain/service/order_sync/CTripOrderSyncAdapter.java @@ -37,7 +37,7 @@ public class CTripOrderSyncAdapter implements SupplierOrderSync { private OrderDomainService orderDomainService; @Override - public void syncSupplierOrder(RouteOrder order) { + public boolean syncSupplierOrder(RouteOrder order) { System.out.println("开始同步协程订单"); User currentUser = BaseContext.getCurrentUser(); ApproveOrderNo approveOrderNo = order.getApproveOrderNo(); @@ -63,5 +63,6 @@ public class CTripOrderSyncAdapter implements SupplierOrderSync { ApprovalRequest approvalRequestParam = ApprovalRequest.buildApproval(String.valueOf(currentUser.getEmployeeNo()), approveOrderNo.getActualOrderNo(), rankInfo) .withHotel(hotelList); approvalRequest.approval(approvalRequestParam); + return false; } } diff --git a/src/main/java/com/chint/domain/service/order_sync/LYOrderSyncAdapter.java b/src/main/java/com/chint/domain/service/order_sync/LYOrderSyncAdapter.java index 85e2f107..df3592a9 100644 --- a/src/main/java/com/chint/domain/service/order_sync/LYOrderSyncAdapter.java +++ b/src/main/java/com/chint/domain/service/order_sync/LYOrderSyncAdapter.java @@ -27,7 +27,7 @@ public class LYOrderSyncAdapter implements SupplierOrderSync { private LocationRepository locationRepository; @Override - public void syncSupplierOrder(RouteOrder order) { + public boolean syncSupplierOrder(RouteOrder order) { String supplierOrderSyncUrl = Constant.L_Y_BASE_URL + Constant.L_Y_ORDER_PATH;//请求地址 //1.设置订单参数 SupplierOrderParam param = new SupplierOrderParam();//参数 diff --git a/src/main/java/com/chint/domain/service/order_sync/SupplierOrderSync.java b/src/main/java/com/chint/domain/service/order_sync/SupplierOrderSync.java index 25bee80c..b7370015 100644 --- a/src/main/java/com/chint/domain/service/order_sync/SupplierOrderSync.java +++ b/src/main/java/com/chint/domain/service/order_sync/SupplierOrderSync.java @@ -5,5 +5,5 @@ import com.chint.domain.aggregates.order.RouteOrder; import com.chint.domain.factoriy.order.RouteOrderFactory; public interface SupplierOrderSync { - void syncSupplierOrder(RouteOrder order); + boolean syncSupplierOrder(RouteOrder order); }