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