diff --git a/src/main/java/com/chint/infrastructure/cache/RouteCacheService.java b/src/main/java/com/chint/infrastructure/cache/RouteCacheService.java index f0ff119a..457f28e9 100644 --- a/src/main/java/com/chint/infrastructure/cache/RouteCacheService.java +++ b/src/main/java/com/chint/infrastructure/cache/RouteCacheService.java @@ -41,7 +41,7 @@ public class RouteCacheService { .orElse(List.of()) .stream().filter(Objects::nonNull).toList(); if (!routeIdsByEmployeeNo.isEmpty()) { - return queryByIdIn(routeIdsByEmployeeNo); + return queryByIdIn(routeIdsByEmployeeNo).stream().filter(Objects::nonNull).toList(); } log.info("开始缓存用户行程规划单"); List routeOrders = jdbcRouteRepository.findByUserIdOrApproveOrderNo_Creator(employeeNo, employeeNo); @@ -54,7 +54,7 @@ public class RouteCacheService { invalidateUserRoutesCache(employeeNo); //获取当前用户所有的订单 , 缓存用户的routeIds列表 routeCacheManage.getRouteIdsByEmployeeNo(employeeNo, routeOrders, null); - return routeOrders; + return routeOrders.stream().filter(Objects::nonNull).toList(); } public RouteOrder reloadRouteOrderInCache(RouteOrder routeOrder) { @@ -190,7 +190,7 @@ public class RouteCacheService { List routeIds = routeCacheManage.getRouteIdsByEmployeeNo(userId, null, null); if (routeIds == null || routeIds.size() <= 2) { List routeOrders = preloadUserRoutes(userId); - routeIds = routeOrders.stream().filter(Objects::nonNull).map(RouteOrder::getRouteId).toList(); + routeIds = routeOrders.stream().map(RouteOrder::getRouteId).toList(); } if (!routeIds.contains(routeId)) { List newRouteIds = new ArrayList<>(routeIds);