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,