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