同步接口修改抛出异常
This commit is contained in:
parent
4fe1eb411b
commit
d1408e39d9
|
@ -79,7 +79,9 @@ public class LegEventHandler implements LegEventService{
|
||||||
));
|
));
|
||||||
//保存routeOrder的状态
|
//保存routeOrder的状态
|
||||||
routeRepository.save(routeOrder);
|
routeRepository.save(routeOrder);
|
||||||
syncAdapter.of(supplierName).syncSupplierOrder(routeOrder.reloadStatus());
|
if (!syncAdapter.of(supplierName).syncSupplierOrder(routeOrder.reloadStatus())) {
|
||||||
|
throw new CommandException("订单提交失败");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
throw new CommandException("订单未提交审批");
|
throw new CommandException("订单未提交审批");
|
||||||
}
|
}
|
||||||
|
|
|
@ -37,7 +37,7 @@ public class CTripOrderSyncAdapter implements SupplierOrderSync {
|
||||||
private OrderDomainService orderDomainService;
|
private OrderDomainService orderDomainService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void syncSupplierOrder(RouteOrder order) {
|
public boolean syncSupplierOrder(RouteOrder order) {
|
||||||
System.out.println("开始同步协程订单");
|
System.out.println("开始同步协程订单");
|
||||||
User currentUser = BaseContext.getCurrentUser();
|
User currentUser = BaseContext.getCurrentUser();
|
||||||
ApproveOrderNo approveOrderNo = order.getApproveOrderNo();
|
ApproveOrderNo approveOrderNo = order.getApproveOrderNo();
|
||||||
|
@ -63,5 +63,6 @@ public class CTripOrderSyncAdapter implements SupplierOrderSync {
|
||||||
ApprovalRequest approvalRequestParam = ApprovalRequest.buildApproval(String.valueOf(currentUser.getEmployeeNo()), approveOrderNo.getActualOrderNo(), rankInfo)
|
ApprovalRequest approvalRequestParam = ApprovalRequest.buildApproval(String.valueOf(currentUser.getEmployeeNo()), approveOrderNo.getActualOrderNo(), rankInfo)
|
||||||
.withHotel(hotelList);
|
.withHotel(hotelList);
|
||||||
approvalRequest.approval(approvalRequestParam);
|
approvalRequest.approval(approvalRequestParam);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ public class LYOrderSyncAdapter implements SupplierOrderSync {
|
||||||
private LocationRepository locationRepository;
|
private LocationRepository locationRepository;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void syncSupplierOrder(RouteOrder order) {
|
public boolean syncSupplierOrder(RouteOrder order) {
|
||||||
String supplierOrderSyncUrl = Constant.L_Y_BASE_URL + Constant.L_Y_ORDER_PATH;//请求地址
|
String supplierOrderSyncUrl = Constant.L_Y_BASE_URL + Constant.L_Y_ORDER_PATH;//请求地址
|
||||||
//1.设置订单参数
|
//1.设置订单参数
|
||||||
SupplierOrderParam param = new SupplierOrderParam();//参数
|
SupplierOrderParam param = new SupplierOrderParam();//参数
|
||||||
|
|
|
@ -5,5 +5,5 @@ import com.chint.domain.aggregates.order.RouteOrder;
|
||||||
import com.chint.domain.factoriy.order.RouteOrderFactory;
|
import com.chint.domain.factoriy.order.RouteOrderFactory;
|
||||||
|
|
||||||
public interface SupplierOrderSync {
|
public interface SupplierOrderSync {
|
||||||
void syncSupplierOrder(RouteOrder order);
|
boolean syncSupplierOrder(RouteOrder order);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue