From 63219bfa3db42285b24c09a5d5805b204d26c942 Mon Sep 17 00:00:00 2001 From: lulz1 Date: Wed, 29 May 2024 16:31:36 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E8=A1=8C=E7=A8=8B=E8=A7=84=E5=88=92?= =?UTF-8?q?=E5=9C=B0=E7=82=B9=E5=A2=9E=E5=8A=A0=E6=89=93=E8=BD=A6=E7=9A=84?= =?UTF-8?q?=E5=9C=B0=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/chint/application/queryies/OrderQuery.java | 14 +++++++++++--- src/test/java/com/chint/RouteApplicationTests.java | 2 +- 2 files changed, 12 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 99e9ef14..0867599e 100644 --- a/src/main/java/com/chint/application/queryies/OrderQuery.java +++ b/src/main/java/com/chint/application/queryies/OrderQuery.java @@ -38,8 +38,7 @@ import java.util.stream.Collectors; import java.util.stream.Stream; import static com.chint.infrastructure.constant.FSSCConstant.*; -import static com.chint.infrastructure.constant.LegConstant.LEG_TYPE_HOTEL; -import static com.chint.infrastructure.constant.LegConstant.LEG_TYPE_OTHER; +import static com.chint.infrastructure.constant.LegConstant.*; import static com.chint.infrastructure.constant.LocationConstant.LOCATION_LEVEL_CITY; import static com.chint.infrastructure.constant.LocationConstant.LOCATION_LEVEL_COUNTY; import static com.chint.infrastructure.constant.OrderConstant.ORDER_EVENT_CANCEL_NAME; @@ -269,13 +268,22 @@ public class OrderQuery { res.setIfHaveCarLeg("0"); } - List locationRes = legItems + List locationRes = new ArrayList<>(legItems .stream() .flatMap(leg -> Stream.of(leg.getOriginLocation(), leg.getDestinationLocation())) .map(LocationRes::copyFrom) .distinct() .filter(Objects::nonNull) + .toList()); + List carLocationList = legItems + .stream() + .filter(leg -> leg.getLegType().equals(LEG_TYPE_TAXI)) + .flatMap(leg -> leg.getLegExtensionField().getLocationList().stream()) + .map(LocationRes::copyFrom) + .distinct() + .filter(Objects::nonNull) .toList(); + locationRes.addAll(carLocationList); res.setLocationResList(locationRes); res.setUserName(user.getName()); diff --git a/src/test/java/com/chint/RouteApplicationTests.java b/src/test/java/com/chint/RouteApplicationTests.java index 18600a63..25e0436e 100644 --- a/src/test/java/com/chint/RouteApplicationTests.java +++ b/src/test/java/com/chint/RouteApplicationTests.java @@ -299,7 +299,7 @@ class RouteApplicationTests { @Test void loginSign() { - String sfno = "231114011"; + String sfno = "220208013"; String syscode = "FSSC"; String billcode = "CLSQ240225000099"; String companycode = "正泰集团股份有限公司";