From ed0b9beffc30fa3787e0d33192d30f5ee7956d78 Mon Sep 17 00:00:00 2001 From: lulz1 Date: Thu, 20 Jun 2024 09:24:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=9F=A5=E7=9C=8B=E8=AF=A6=E6=83=85?= =?UTF-8?q?=E9=83=A8=E5=88=86=E8=A1=8C=E7=A8=8B=E8=A7=84=E5=88=92=E7=BC=BA?= =?UTF-8?q?=E5=B0=91=E5=A7=93=E5=90=8D=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/chint/application/queryies/OrderQuery.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/chint/application/queryies/OrderQuery.java b/src/main/java/com/chint/application/queryies/OrderQuery.java index fa38ba24..42f2e615 100644 --- a/src/main/java/com/chint/application/queryies/OrderQuery.java +++ b/src/main/java/com/chint/application/queryies/OrderQuery.java @@ -515,16 +515,19 @@ public class OrderQuery { legDomainService.queryLocation(legItems); List list = legItems.stream().map(LegRes::copyFrom).toList(); routeOrderRes.setLegResList(list); - List orderDetailResList = routeOrder - .getOrderDetails() + } + List orderDetails = routeOrder + .getOrderDetails(); + if (orderDetails != null && !orderDetails.isEmpty()) { + List orderDetailResList = orderDetails .stream() .filter(it -> !it.getOrderStatus().equals(ORDER_EVENT_CANCEL_NAME) && !it.getOrderStatus().equals(ORDER_EVENT_PREPARE_NAME)) .map(OrderDetailMapper::copyFromExtension) .toList(); - User user = userRepository.findByUserEmployeeNo(routeOrder.getUserId()); - routeOrderRes.setUserName(user.getName()); routeOrderRes.setOrderDetailRes(orderDetailResList); } + User user = userRepository.findByUserEmployeeNo(routeOrder.getUserId()); + routeOrderRes.setUserName(user.getName()); return routeOrderRes; }