diff --git a/src/main/java/com/chint/application/out/OrderOutController.java b/src/main/java/com/chint/application/out/OrderOutController.java index 746e199d..a7559d63 100644 --- a/src/main/java/com/chint/application/out/OrderOutController.java +++ b/src/main/java/com/chint/application/out/OrderOutController.java @@ -94,4 +94,5 @@ public class OrderOutController { public Result> queryNotSubmit(@RequestBody OrderQueryData queryData) { return Result.Success(SUCCESS, orderQuery.queryNotSubmit(queryData)); } + } diff --git a/src/main/java/com/chint/application/queryies/OrderQuery.java b/src/main/java/com/chint/application/queryies/OrderQuery.java index 1a128e95..a2ac90e6 100644 --- a/src/main/java/com/chint/application/queryies/OrderQuery.java +++ b/src/main/java/com/chint/application/queryies/OrderQuery.java @@ -142,7 +142,8 @@ public class OrderQuery { private static RouteOrderPageRes getRouteOrderPageRes(RouteOrder routeOrder) { User currentUser = BaseContext.getCurrentUser(); RouteOrderPageRes res = BeanUtil.copyProperties(routeOrder.reloadStatus(), RouteOrderPageRes.class); - List locationRes = routeOrder.getLegItems() + List legItems = routeOrder.getLegItems(); + List locationRes = legItems .stream() .flatMap(leg -> Stream.of(leg.getOriginLocation(), leg.getDestinationLocation())) .map(LocationRes::copyFrom) @@ -324,8 +325,9 @@ public class OrderQuery { } public List queryNotSubmit(OrderQueryData queryData) { - List byActualOrderNoNotNull = routeRepository.findByActualOrderNoNotNull(queryData); - return byActualOrderNoNotNull.stream().filter(order -> order.reloadStatus().getOrderStatus().equals(ORDER_STATUS_APPROVAL)) + List routeOrders = routeRepository.findByActualOrderNoNotNull(queryData); + routeOrders.forEach(route -> orderDomainService.queryLocation(route.getLegItems())); + return routeOrders.stream().filter(order -> order.reloadStatus().getOrderStatus().equals(ORDER_STATUS_APPROVAL)) .map(OrderQuery::getRouteOrderPageRes) .toList(); } diff --git a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcLocationRepository.java b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcLocationRepository.java index 849bb9ab..4695cc40 100644 --- a/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcLocationRepository.java +++ b/src/main/java/com/chint/infrastructure/repository/jdbc/JdbcLocationRepository.java @@ -6,6 +6,7 @@ import org.springframework.data.domain.Pageable; import org.springframework.data.repository.CrudRepository; import org.springframework.stereotype.Repository; +import java.util.Collection; import java.util.List; @Repository @@ -23,4 +24,5 @@ public interface JdbcLocationRepository extends CrudRepository { List findByLocationNameContaining(String locationName); Location findByLocationName(String locationName); + }