From 16fd3c32c17f77383597a9fb27667d98061eb3e9 Mon Sep 17 00:00:00 2001 From: lulz1 Date: Tue, 9 Apr 2024 10:41:30 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=B7=B2=E5=90=8C=E6=AD=A5?= =?UTF-8?q?=E8=A1=8C=E7=A8=8B=E7=AD=9B=E9=80=89=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/chint/domain/service/LegDomainService.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/com/chint/domain/service/LegDomainService.java b/src/main/java/com/chint/domain/service/LegDomainService.java index 61c44b5e..146d77a0 100644 --- a/src/main/java/com/chint/domain/service/LegDomainService.java +++ b/src/main/java/com/chint/domain/service/LegDomainService.java @@ -17,6 +17,7 @@ import static com.chint.infrastructure.constant.LegConstant.*; import static com.chint.infrastructure.constant.OrderConstant.*; import static com.chint.infrastructure.constant.RouteConstant.APPROVAL_EVENT_PREPARE; import static com.chint.infrastructure.constant.RouteConstant.ORDER_STATUS_PREPARE; +import static com.chint.infrastructure.constant.RouteRequestConstant.ROUTE_REQUEST_STATUS_SYNC; @Service public class LegDomainService { @@ -158,6 +159,16 @@ public class LegDomainService { if (supplierName.equals("CTrip")) { legItems = legItems.stream().filter(it -> !it.getLegType().equals(LEG_TYPE_TRAIN)).toList(); } + + List alreadySyncLegIds = routeOrder.getRouteRequestList() + .stream() + .filter(it -> it.reloadStatus().getStatus().equals(ROUTE_REQUEST_STATUS_SYNC)) + .flatMap(it -> it.getRouteRequestLegList().stream().map(RouteRequestLeg::getLegId)) + .toList(); + + legItems = legItems.stream() + .filter(it -> !alreadySyncLegIds.contains(it.getLegId())) + .toList(); return legItems; } }