fix: 查询临时订单出错的bug

This commit is contained in:
lulz1 2024-06-20 15:18:58 +08:00
parent 01ad704f98
commit a62de4dc4a
3 changed files with 7 additions and 2 deletions

View File

@ -511,7 +511,9 @@ public class OrderQuery {
List<Leg> 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<LegRes> list = legItems.stream().map(LegRes::copyFrom).toList();
routeOrderRes.setLegResList(list);

View File

@ -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) {

View File

@ -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;