From 8c81472f716c4dc0825d100a2696ac2a304f0ec7 Mon Sep 17 00:00:00 2001 From: lulz1 Date: Tue, 9 Jul 2024 15:37:43 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E5=A4=8D=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E8=A1=8C=E7=A8=8B=E5=87=BA=E7=8E=B0=E7=9A=84=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/chint/infrastructure/cache/RouteCacheService.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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);