From 1a0e4c65c179263276f1abefbff0c680a2d4c728 Mon Sep 17 00:00:00 2001 From: lulz1 Date: Mon, 24 Jun 2024 09:19:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=8F=90=E4=BA=A4?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E4=BC=9A=E5=88=9B=E5=BB=BA=E4=B8=B4=E6=97=B6?= =?UTF-8?q?=E5=8D=95=E5=8F=B7=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/chint/application/queryies/OrderQuery.java | 2 +- .../domain/service/leg_event/LegEventHandler.java | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/main/java/com/chint/application/queryies/OrderQuery.java b/src/main/java/com/chint/application/queryies/OrderQuery.java index 133e6784..20a6b705 100644 --- a/src/main/java/com/chint/application/queryies/OrderQuery.java +++ b/src/main/java/com/chint/application/queryies/OrderQuery.java @@ -338,7 +338,7 @@ public class OrderQuery { } // 这里查询出来的订单,需要保存它的状态 - routeRepository.save(routeOrder); + routeRepository.saveTempRouteOrder(routeOrder,24L); List locationList = new ArrayList<>(); User currentUser = userHttpRequest.loadUserInfo( 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 97bdbd1a..d31eebb6 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 @@ -121,14 +121,14 @@ public class LegEventHandler implements LegEventService { String sysCode = data.getSysCode(); //先查看是否已保存到数据库,再从redis获取,如果没有的话再从数据库获取 RouteOrder routeOrder = routeRepository. - findByActualOrderNoAndSysCode(data.getActualOrderNo(), sysCode); - if (routeOrder == null) { - routeOrder = routeRepository.findTempRouteOrderBySysCodeAndBillCode(sysCode, fakeOrderNo); - } + findByFakeOrderNoAndSysCode(data.getActualOrderNo(), sysCode); if (routeOrder == null) { routeOrder = routeRepository .findByFakeOrderNoAndSysCode(fakeOrderNo, sysCode); } + if (routeOrder == null) { + routeOrder = routeRepository.findTempRouteOrderBySysCodeAndBillCode(sysCode, fakeOrderNo); + } routeOrder.reloadStatus(); if (routeOrder.getLegItems().isEmpty()) { throw new OrderException(CommonMessageConstant.LEG_ERROR); @@ -160,8 +160,7 @@ public class LegEventHandler implements LegEventService { command.order(save); //异步执行自动同步功能 - Command.of(RouteAutoSyncCommand.class).route(routeRepository - .findByFakeOrderNoAndSysCode(fakeOrderNo, sysCode)).async().sendToQueue(); + Command.of(RouteAutoSyncCommand.class).route(save).async().sendToQueue(); } @Transactional