fix: 修复提交时,会创建临时单号的bug

This commit is contained in:
lulz1 2024-06-24 09:19:36 +08:00
parent b95b5c29cb
commit 1a0e4c65c1
2 changed files with 6 additions and 7 deletions

View File

@ -338,7 +338,7 @@ public class OrderQuery {
} }
// 这里查询出来的订单需要保存它的状态 // 这里查询出来的订单需要保存它的状态
routeRepository.save(routeOrder); routeRepository.saveTempRouteOrder(routeOrder,24L);
List<Location> locationList = new ArrayList<>(); List<Location> locationList = new ArrayList<>();
User currentUser = userHttpRequest.loadUserInfo( User currentUser = userHttpRequest.loadUserInfo(

View File

@ -121,14 +121,14 @@ public class LegEventHandler implements LegEventService {
String sysCode = data.getSysCode(); String sysCode = data.getSysCode();
//先查看是否已保存到数据库再从redis获取如果没有的话再从数据库获取 //先查看是否已保存到数据库再从redis获取如果没有的话再从数据库获取
RouteOrder routeOrder = routeRepository. RouteOrder routeOrder = routeRepository.
findByActualOrderNoAndSysCode(data.getActualOrderNo(), sysCode); findByFakeOrderNoAndSysCode(data.getActualOrderNo(), sysCode);
if (routeOrder == null) {
routeOrder = routeRepository.findTempRouteOrderBySysCodeAndBillCode(sysCode, fakeOrderNo);
}
if (routeOrder == null) { if (routeOrder == null) {
routeOrder = routeRepository routeOrder = routeRepository
.findByFakeOrderNoAndSysCode(fakeOrderNo, sysCode); .findByFakeOrderNoAndSysCode(fakeOrderNo, sysCode);
} }
if (routeOrder == null) {
routeOrder = routeRepository.findTempRouteOrderBySysCodeAndBillCode(sysCode, fakeOrderNo);
}
routeOrder.reloadStatus(); routeOrder.reloadStatus();
if (routeOrder.getLegItems().isEmpty()) { if (routeOrder.getLegItems().isEmpty()) {
throw new OrderException(CommonMessageConstant.LEG_ERROR); throw new OrderException(CommonMessageConstant.LEG_ERROR);
@ -160,8 +160,7 @@ public class LegEventHandler implements LegEventService {
command.order(save); command.order(save);
//异步执行自动同步功能 //异步执行自动同步功能
Command.of(RouteAutoSyncCommand.class).route(routeRepository Command.of(RouteAutoSyncCommand.class).route(save).async().sendToQueue();
.findByFakeOrderNoAndSysCode(fakeOrderNo, sysCode)).async().sendToQueue();
} }
@Transactional @Transactional