From 391ec93f27dfe44d8333086000174deddaee042c Mon Sep 17 00:00:00 2001 From: lulz1 Date: Mon, 8 Jul 2024 16:34:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BC=98=E5=8C=96=E8=A1=8C=E7=A8=8B?= =?UTF-8?q?=E8=A7=84=E5=88=92=E5=88=86=E9=A1=B5=E6=9F=A5=E8=AF=A2=E7=9A=84?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/chint/infrastructure/cache/RouteCacheService.java | 5 +++++ .../echo_framework/repository/AbstractGenericRepository.java | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/chint/infrastructure/cache/RouteCacheService.java b/src/main/java/com/chint/infrastructure/cache/RouteCacheService.java index 17cf822e..1b1899a4 100644 --- a/src/main/java/com/chint/infrastructure/cache/RouteCacheService.java +++ b/src/main/java/com/chint/infrastructure/cache/RouteCacheService.java @@ -36,6 +36,11 @@ public class RouteCacheService { public List preloadUserRoutes(String employeeNo) { + List routeIdsByEmployeeNo = routeCacheManage + .getRouteIdsByEmployeeNo(employeeNo, null, null).stream().filter(Objects::nonNull).toList(); + if (!routeIdsByEmployeeNo.isEmpty()) { + return routeCacheManage.getRouteListByIds(routeIdsByEmployeeNo); + } log.info("开始缓存用户行程规划单"); List routeOrders = jdbcRouteRepository.findByUserIdOrApproveOrderNo_Creator(employeeNo, employeeNo); for (RouteOrder routeOrder : routeOrders) { diff --git a/src/main/java/com/chint/infrastructure/echo_framework/repository/AbstractGenericRepository.java b/src/main/java/com/chint/infrastructure/echo_framework/repository/AbstractGenericRepository.java index 6f67a834..0f2a489a 100644 --- a/src/main/java/com/chint/infrastructure/echo_framework/repository/AbstractGenericRepository.java +++ b/src/main/java/com/chint/infrastructure/echo_framework/repository/AbstractGenericRepository.java @@ -114,7 +114,7 @@ public abstract class AbstractGenericRepository { } // Step 4: Return the complete list - return inCacheList; + return inCacheList.stream().filter(Objects::nonNull).collect(Collectors.toList()); } public List findByFieldsIn(String fieldPrefix,