增加已同步行程筛选功能

This commit is contained in:
lulz1 2024-04-09 10:41:30 +08:00
parent e98af60faa
commit 16fd3c32c1
1 changed files with 11 additions and 0 deletions

View File

@ -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<Long> 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;
}
}