fix:修复添加行程出现的缓存问题

This commit is contained in:
lulz1 2024-07-09 15:35:39 +08:00
parent b7e1734ec7
commit 75152cea8a
4 changed files with 6 additions and 5 deletions

View File

@ -103,7 +103,8 @@ public class RouteCacheService {
deleteRouteIdCacheForUser(currentUser.getEmployeeNo(), routeId); deleteRouteIdCacheForUser(currentUser.getEmployeeNo(), routeId);
return null; return null;
} }
return routeCacheManage.cacheRouteOrder(routeOrder.reloadStatus()); updateRouteCache(routeOrder);
return routeOrder;
} }
return routeOrder; return routeOrder;
} }
@ -189,7 +190,7 @@ public class RouteCacheService {
List<Long> routeIds = routeCacheManage.getRouteIdsByEmployeeNo(userId, null, null); List<Long> routeIds = routeCacheManage.getRouteIdsByEmployeeNo(userId, null, null);
if (routeIds == null || routeIds.size() <= 2) { if (routeIds == null || routeIds.size() <= 2) {
List<RouteOrder> routeOrders = preloadUserRoutes(userId); List<RouteOrder> routeOrders = preloadUserRoutes(userId);
routeIds = routeOrders.stream().map(RouteOrder::getRouteId).toList(); routeIds = routeOrders.stream().filter(Objects::nonNull).map(RouteOrder::getRouteId).toList();
} }
if (!routeIds.contains(routeId)) { if (!routeIds.contains(routeId)) {
List<Long> newRouteIds = new ArrayList<>(routeIds); List<Long> newRouteIds = new ArrayList<>(routeIds);

View File

@ -250,7 +250,7 @@ public class CTripTest {
@Test @Test
void search() { void search() {
BaseContext.setCurrentUser(user); BaseContext.setCurrentUser(user);
SearchOrderResponse response = orderSearchRequest.searchOrderResponseByOrderId("33513622716"); SearchOrderResponse response = orderSearchRequest.searchOrderResponseByOrderId("32158848688");
System.out.println(response); System.out.println(response);
} }

View File

@ -812,7 +812,7 @@ public class LYTest {
@Test @Test
void searchFlight() { void searchFlight() {
FlightOrderResponse flightOrderDetail = lySearchRequest.getFlightOrderDetail("DF24041870728743261"); FlightOrderResponse flightOrderDetail = lySearchRequest.getFlightOrderDetail("DF24061877666447239");
Gson gson = new Gson(); Gson gson = new Gson();
String json = gson.toJson(flightOrderDetail); String json = gson.toJson(flightOrderDetail);
System.out.println(json); System.out.println(json);

View File

@ -313,7 +313,7 @@ class RouteApplicationTests {
@Test @Test
void loginSign() { void loginSign() {
String sfno = "230615020"; String sfno = "211213002";
String syscode = "FSSC"; String syscode = "FSSC";
String billcode = "CLSQ240225000099"; String billcode = "CLSQ240225000099";
String companycode = "正泰集团股份有限公司"; String companycode = "正泰集团股份有限公司";