From a62de4dc4aaf1c5ddc3bb15e7dea4bcdef154e2a Mon Sep 17 00:00:00 2001 From: lulz1 Date: Thu, 20 Jun 2024 15:18:58 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9F=A5=E8=AF=A2=E4=B8=B4=E6=97=B6?= =?UTF-8?q?=E8=AE=A2=E5=8D=95=E5=87=BA=E9=94=99=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/chint/application/queryies/OrderQuery.java | 4 +++- .../chint/application/services/OrderApplicationService.java | 3 +++ .../com/chint/interfaces/rest/ctrip/tools/CTripUtils.java | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/chint/application/queryies/OrderQuery.java b/src/main/java/com/chint/application/queryies/OrderQuery.java index 42f2e615..818a0123 100644 --- a/src/main/java/com/chint/application/queryies/OrderQuery.java +++ b/src/main/java/com/chint/application/queryies/OrderQuery.java @@ -511,7 +511,9 @@ public class OrderQuery { List legItems = routeOrder.getLegItems(); if (legItems != null && !legItems.isEmpty()) { //这里使用领域事件进行检查leg的订单状态 ,用户每次想要查看行程都会进行一次检查 - legItems.forEach(leg -> legDomainService.legCheckOrder(leg)); + if (routeOrder.getApprovalStatusCode() != APPROVAL_EVENT_PREPARE) { + legItems.forEach(leg -> legDomainService.legCheckOrder(leg)); + } legDomainService.queryLocation(legItems); List list = legItems.stream().map(LegRes::copyFrom).toList(); routeOrderRes.setLegResList(list); diff --git a/src/main/java/com/chint/application/services/OrderApplicationService.java b/src/main/java/com/chint/application/services/OrderApplicationService.java index 97dd5ae9..09b154d0 100644 --- a/src/main/java/com/chint/application/services/OrderApplicationService.java +++ b/src/main/java/com/chint/application/services/OrderApplicationService.java @@ -176,6 +176,9 @@ public class OrderApplicationService { .newleg(leg) .changeType(1) .sendToQueue(); + + //如果行程变更成功,自动执行同步功能 + Command.of(RouteAutoSyncCommand.class).route(routeOrder).async().sendToQueue(); } private Leg handleLegChangeEvent(Leg leg, LegData legData) { diff --git a/src/main/java/com/chint/interfaces/rest/ctrip/tools/CTripUtils.java b/src/main/java/com/chint/interfaces/rest/ctrip/tools/CTripUtils.java index 4b81f124..a818f80d 100644 --- a/src/main/java/com/chint/interfaces/rest/ctrip/tools/CTripUtils.java +++ b/src/main/java/com/chint/interfaces/rest/ctrip/tools/CTripUtils.java @@ -166,7 +166,7 @@ public class CTripUtils { case "Submitted" -> OrderConstant.ORDER_EVENT_PREPARE; // "已提交"映射到准备状态 case "Confirmed" -> OrderConstant.ORDER_EVENT_ORDERED; // "已客户确认"映射到已下单 case "Cancelled" -> OrderConstant.ORDER_EVENT_REFUND; // "已取消"映射到取消 - case "Refunded" -> OrderConstant.ORDER_EVENT_REFUND; // "已取消"映射到取消 + case "Refunded" -> OrderConstant.ORDER_EVENT_REFUND; // "已退款"映射到取消 case "Wait" -> // "确认中"可能表示订单正在处理中,但没有直接映射,可能需要新的状态常量 OrderConstant.ORDER_EVENT_ORDERED;