修复数据突然查询不到的bug

This commit is contained in:
lulz1 2024-03-13 17:07:17 +08:00
parent a367f19002
commit e7884bd855
1 changed files with 2 additions and 5 deletions

View File

@ -149,11 +149,8 @@ public class RouteCacheService {
// Fetch, invalidate, and update the cache in an optimized manner if possible
List<Long> routeIds = routeCacheManage.getRouteIdsByEmployeeNo(userId, null, null);
if (routeIds == null || routeIds.size() <= 2) {
preloadUserRoutes(userId);
routeIds = routeCacheManage.getRouteIdsByEmployeeNo(userId, null, null);
if (routeIds == null) {
routeIds = new ArrayList<>();
}
List<RouteOrder> routeOrders = preloadUserRoutes(userId);
routeIds = routeOrders.stream().map(RouteOrder::getRouteId).toList();
}
if (!routeIds.contains(routeId)) {
List<Long> newRouteIds = new ArrayList<>(routeIds);