fix:修复通过临时规划单和系统编号查询结果一直是临时单号的问题
This commit is contained in:
parent
370117b2ac
commit
8a5eb3c098
|
@ -64,8 +64,9 @@ public class OrderOutController {
|
|||
String billcode = queryData.getBillcode();
|
||||
String sysCode = queryData.getSysCode();
|
||||
RouteOrder routeOrder = routeRepository.findTempRouteOrderBySysCodeAndBillCode(sysCode, billcode);
|
||||
if (routeOrder == null) {
|
||||
routeOrder = orderQuery.queryByBillCodeAndSysCode(billcode, sysCode);
|
||||
RouteOrder routeOrderFromDB = orderQuery.queryByBillCodeAndSysCode(billcode, sysCode);
|
||||
if (routeOrderFromDB != null) {
|
||||
routeOrder = routeOrderFromDB;
|
||||
}
|
||||
return Result.Success(SUCCESS, orderQuery.queryRouteRes(routeOrder.reloadStatus()));
|
||||
}
|
||||
|
|
|
@ -58,8 +58,7 @@ public class RouteCacheService {
|
|||
}
|
||||
|
||||
public RouteOrder reloadRouteOrderInCache(RouteOrder routeOrder) {
|
||||
routeCacheManage.invalidateRouteCache(routeOrder.getRouteId());
|
||||
routeCacheManage.cacheRouteOrder(routeOrder);
|
||||
updateRouteCache(routeOrder);
|
||||
return routeOrder;
|
||||
}
|
||||
|
||||
|
@ -110,36 +109,45 @@ public class RouteCacheService {
|
|||
}
|
||||
|
||||
public RouteOrder getRouteByFakeOrderNoAndSysCode(String fakeOrderNo, String sysCode) {
|
||||
Long routeId = routeCacheManage.cacheFakeOrderNoAndSysCodeMapRouteId(fakeOrderNo, sysCode, null);
|
||||
if (routeId == null) {
|
||||
routeCacheManage.invalidateFakeOrderNoAndSysCodeMapRouteId(fakeOrderNo, sysCode);
|
||||
}
|
||||
RouteOrder routeOrder = jdbcRouteRepository.findByApproveOrderNo_FakeOrderNoAndApproveOrderNo_SysCode(fakeOrderNo, sysCode);
|
||||
if (routeOrder == null) {
|
||||
routeCacheManage.invalidateFakeOrderNoAndSysCodeMapRouteId(fakeOrderNo, sysCode);
|
||||
return null;
|
||||
} else {
|
||||
routeOrder.reloadStatus();
|
||||
routeCacheManage.cacheFakeOrderNoAndSysCodeMapRouteId(fakeOrderNo, sysCode, routeOrder);
|
||||
return getFromCacheOrSaveToCache(routeOrder.getRouteId());
|
||||
}
|
||||
return getRouteByOrderNoAndSysCode(fakeOrderNo, sysCode, true);
|
||||
}
|
||||
|
||||
public RouteOrder getRouteByActualOrderNoAndSysCode(String actualOrderNo, String sysCode) {
|
||||
Long routeId = routeCacheManage.cacheActualOrderNoAndSysCodeMapRouteId(actualOrderNo, sysCode, null);
|
||||
if (routeId == null) {
|
||||
routeCacheManage.invalidateActualOrderNoAndSysCodeMapRouteId(actualOrderNo, sysCode);
|
||||
return getRouteByOrderNoAndSysCode(actualOrderNo, sysCode, false);
|
||||
}
|
||||
RouteOrder routeOrder = jdbcRouteRepository.findByApproveOrderNo_ActualOrderNoAndApproveOrderNo_SysCode(actualOrderNo, sysCode);
|
||||
|
||||
private RouteOrder getRouteByOrderNoAndSysCode(String orderNo, String sysCode, boolean isFake) {
|
||||
Long routeId = isFake ?
|
||||
routeCacheManage.cacheFakeOrderNoAndSysCodeMapRouteId(orderNo, sysCode, null) :
|
||||
routeCacheManage.cacheActualOrderNoAndSysCodeMapRouteId(orderNo, sysCode, null);
|
||||
if (routeId == null) {
|
||||
if (isFake) {
|
||||
routeCacheManage.invalidateFakeOrderNoAndSysCodeMapRouteId(orderNo, sysCode);
|
||||
} else {
|
||||
routeCacheManage.invalidateActualOrderNoAndSysCodeMapRouteId(orderNo, sysCode);
|
||||
}
|
||||
}
|
||||
RouteOrder routeOrder = isFake ?
|
||||
jdbcRouteRepository.findByApproveOrderNo_FakeOrderNoAndApproveOrderNo_SysCode(orderNo, sysCode) :
|
||||
jdbcRouteRepository.findByApproveOrderNo_ActualOrderNoAndApproveOrderNo_SysCode(orderNo, sysCode);
|
||||
if (routeOrder == null) {
|
||||
routeCacheManage.invalidateActualOrderNoAndSysCodeMapRouteId(actualOrderNo, sysCode);
|
||||
return null;
|
||||
if (isFake) {
|
||||
routeCacheManage.invalidateFakeOrderNoAndSysCodeMapRouteId(orderNo, sysCode);
|
||||
} else {
|
||||
routeCacheManage.invalidateActualOrderNoAndSysCodeMapRouteId(orderNo, sysCode);
|
||||
}
|
||||
} else {
|
||||
routeOrder.reloadStatus();
|
||||
routeCacheManage.cacheActualOrderNoAndSysCodeMapRouteId(actualOrderNo, sysCode, routeOrder);
|
||||
return getFromCacheOrSaveToCache(routeOrder.getRouteId());
|
||||
if (isFake) {
|
||||
routeCacheManage.cacheFakeOrderNoAndSysCodeMapRouteId(orderNo, sysCode, routeOrder);
|
||||
} else {
|
||||
routeCacheManage.cacheActualOrderNoAndSysCodeMapRouteId(orderNo, sysCode, routeOrder);
|
||||
}
|
||||
updateRouteCache(routeOrder);
|
||||
}
|
||||
return routeOrder;
|
||||
}
|
||||
|
||||
|
||||
public RouteOrder getRouteByRouteOrderNo(String routeOrderNo) {
|
||||
Long routeId = routeCacheManage.cacheRouteOrderNoMapRouteId(routeOrderNo, null);
|
||||
|
|
|
@ -335,6 +335,8 @@ class RouteApplicationTests {
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Test
|
||||
void testPushBatch() throws UnsupportedEncodingException {
|
||||
List<String> billcodeList = List.of("CLS24062500065",
|
||||
|
|
Loading…
Reference in New Issue