From 70361bc1503d1482867a56fe59cf6d9c64edb99a Mon Sep 17 00:00:00 2001 From: lulz1 Date: Wed, 10 Jul 2024 08:51:17 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E4=BF=AE=E6=94=B9=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E8=A1=8C=E7=A8=8B=E8=A7=84=E5=88=92=E5=8D=95?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/queryies/OrderQuery.java | 1 - .../cache/RouteCacheService.java | 29 ++++++++++--------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/chint/application/queryies/OrderQuery.java b/src/main/java/com/chint/application/queryies/OrderQuery.java index d1822949..8b34c68b 100644 --- a/src/main/java/com/chint/application/queryies/OrderQuery.java +++ b/src/main/java/com/chint/application/queryies/OrderQuery.java @@ -554,7 +554,6 @@ public class OrderQuery { } } - if (legDomainService.checkLocation(legItems)) { routeRepository.reloadRouteOrderInCache(routeOrder); } diff --git a/src/main/java/com/chint/infrastructure/cache/RouteCacheService.java b/src/main/java/com/chint/infrastructure/cache/RouteCacheService.java index 8b4a4068..10016e16 100644 --- a/src/main/java/com/chint/infrastructure/cache/RouteCacheService.java +++ b/src/main/java/com/chint/infrastructure/cache/RouteCacheService.java @@ -65,20 +65,21 @@ public class RouteCacheService { public List getUserRoutes(String employeeNo) { //获取当前用户所有的订单id List routeIdsByEmployeeNo = routeCacheManage.getRouteIdsByEmployeeNo(employeeNo, null, null); - if (routeIdsByEmployeeNo != null) { - List routeListByIds = routeCacheManage - .getRouteListByIds(routeIdsByEmployeeNo) - .stream() - .filter(Objects::nonNull) - .toList(); - //如果这里数量对不上名单,那么对该用户的信息重新进行缓存 - if (routeListByIds.size() != routeIdsByEmployeeNo.size()) { - return preloadUserRoutes(employeeNo); - } - if (routeListByIds.size() <= 1) { - return preloadUserRoutes(employeeNo); - } - return routeListByIds; + if (routeIdsByEmployeeNo != null && !routeIdsByEmployeeNo.isEmpty()) { + return queryByIdIn(routeIdsByEmployeeNo).stream().filter(Objects::nonNull).toList(); +// List routeListByIds = routeCacheManage +// .getRouteListByIds(routeIdsByEmployeeNo) +// .stream() +// .filter(Objects::nonNull) +// .toList(); +// //如果这里数量对不上名单,那么对该用户的信息重新进行缓存 +// if (routeListByIds.size() != routeIdsByEmployeeNo.size()) { +// return preloadUserRoutes(employeeNo); +// } +// if (routeListByIds.size() <= 1) { +// return preloadUserRoutes(employeeNo); +// } +// return routeListByIds; } else { List routeOrders = jdbcRouteRepository.findByUserIdOrApproveOrderNo_Creator(employeeNo, employeeNo); routeCacheManage.getRouteIdsByEmployeeNo(employeeNo, routeOrders, null);