修复数据突然查询不到的bug

This commit is contained in:
lulz1 2024-03-13 16:54:43 +08:00
parent 47f497e25d
commit a8cc617703
1 changed files with 5 additions and 3 deletions

View File

@ -1,10 +1,8 @@
package com.chint.infrastructure.cache;
import com.chint.application.commands.OrderApprovalStartCommand;
import com.chint.domain.aggregates.order.ApproveOrderNo;
import com.chint.domain.aggregates.order.RouteOrder;
import com.chint.domain.aggregates.user.User;
import com.chint.infrastructure.echo_framework.annotation.ListenTo;
import com.chint.infrastructure.repository.jdbc.JdbcRouteRepository;
import com.chint.infrastructure.util.BaseContext;
import org.springframework.beans.factory.annotation.Autowired;
@ -42,7 +40,11 @@ public class RouteCacheService {
List<Long> routeIdsByEmployeeNo = routeCacheManage.getRouteIdsByEmployeeNo(employeeNo, null, null);
if (routeIdsByEmployeeNo != null) {
List<RouteOrder> routeListByIds = routeCacheManage
.getRouteListByIds(routeIdsByEmployeeNo).stream().filter(Objects::nonNull).toList();
.getRouteListByIds(routeIdsByEmployeeNo)
.stream()
.filter(Objects::nonNull)
.filter(it -> it.getApproveOrderNo() != null && it.getApproveOrderNo().getActualOrderNo() != null)
.toList();
//如果这里数量对不上名单那么对该用户的信息重新进行缓存
if (routeListByIds.size() != routeIdsByEmployeeNo.size()) {
return preloadUserRoutes(employeeNo);