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<>();
User currentUser = userHttpRequest.loadUserInfo(

View File

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