fix:修改获取用户行程规划单方法

This commit is contained in:
lulz1 2024-07-10 08:51:17 +08:00
parent e4defad983
commit 70361bc150
2 changed files with 15 additions and 15 deletions

View File

@ -554,7 +554,6 @@ public class OrderQuery {
}
}
if (legDomainService.checkLocation(legItems)) {
routeRepository.reloadRouteOrderInCache(routeOrder);
}

View File

@ -65,20 +65,21 @@ public class RouteCacheService {
public List<RouteOrder> getUserRoutes(String employeeNo) {
//获取当前用户所有的订单id
List<Long> routeIdsByEmployeeNo = routeCacheManage.getRouteIdsByEmployeeNo(employeeNo, null, null);
if (routeIdsByEmployeeNo != null) {
List<RouteOrder> 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<RouteOrder> 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<RouteOrder> routeOrders = jdbcRouteRepository.findByUserIdOrApproveOrderNo_Creator(employeeNo, employeeNo);
routeCacheManage.getRouteIdsByEmployeeNo(employeeNo, routeOrders, null);