From 2005e023a8bb8aec5e5217f31d6645efd77b676c Mon Sep 17 00:00:00 2001 From: lulz1 Date: Tue, 9 Apr 2024 12:59:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BD=93=E4=B8=8D=E4=BC=A0?= =?UTF-8?q?=E8=A1=8C=E7=A8=8B=E8=8A=82=E7=82=B9=E5=8F=82=E6=95=B0=E7=9A=84?= =?UTF-8?q?=E6=97=B6=E5=80=99=EF=BC=8C=E9=BB=98=E8=AE=A4=E4=B8=BA=E5=85=A8?= =?UTF-8?q?=E9=83=A8=E8=A1=8C=E7=A8=8B=E8=8A=82=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../application/in/OrderPublicController.java | 1 + .../service/RouteRequestDomainService.java | 19 +++++++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/main/java/com/chint/application/in/OrderPublicController.java b/src/main/java/com/chint/application/in/OrderPublicController.java index 160780a0..5fa4436f 100644 --- a/src/main/java/com/chint/application/in/OrderPublicController.java +++ b/src/main/java/com/chint/application/in/OrderPublicController.java @@ -81,4 +81,5 @@ public class OrderPublicController { return Result.Success(SUCCESS); } + } diff --git a/src/main/java/com/chint/domain/service/RouteRequestDomainService.java b/src/main/java/com/chint/domain/service/RouteRequestDomainService.java index e26438b0..0635eb57 100644 --- a/src/main/java/com/chint/domain/service/RouteRequestDomainService.java +++ b/src/main/java/com/chint/domain/service/RouteRequestDomainService.java @@ -144,10 +144,17 @@ public class RouteRequestDomainService { //获取目前已经同步到供应商的差旅申请单 private RouteRequest loadLegInfo(RouteRequest routeRequest, RouteOrder routeOrder, List legIds) { List legItems = routeOrder.getLegItems(); - List list = legItems.stream() - .filter(leg -> legIds.contains(leg.getLegId())) - .map(RouteRequestLeg::ofLeg) - .toList(); + List list; + if (legIds != null && !legIds.isEmpty()) { + list = legItems.stream() + .filter(leg -> legIds.contains(leg.getLegId())) + .map(RouteRequestLeg::ofLeg) + .toList(); + } else { + list = legItems.stream() + .map(RouteRequestLeg::ofLeg) + .toList(); + } routeRequest.setRouteRequestLegList(list); return routeRequest; } @@ -168,8 +175,8 @@ public class RouteRequestDomainService { public RouteOrder getRouteOrder(String journeyNo) { //先通过 RouteRequest routeRequest = routeRequestRepository.findByRouteRequestNo(journeyNo); - if(routeRequest == null){ - return routeRepository.findByOrderNo(journeyNo); + if (routeRequest == null) { + return routeRepository.findByOrderNo(journeyNo); } return routeRepository.queryById(routeRequest.getRouteId()); }