diff --git a/src/main/java/com/chint/domain/service/RouteRequestDomainService.java b/src/main/java/com/chint/domain/service/RouteRequestDomainService.java index 39b59076..218d27be 100644 --- a/src/main/java/com/chint/domain/service/RouteRequestDomainService.java +++ b/src/main/java/com/chint/domain/service/RouteRequestDomainService.java @@ -125,15 +125,18 @@ public class RouteRequestDomainService { Map> collect = legs .stream() - .collect(Collectors.partitioningBy(leg -> leg.reloadStatus().getLegStatus().equals(LEG_STATUS_ORDERED) - && leg.getLegType().equals(LEG_TYPE_AIRPLANE))); + .collect(Collectors.partitioningBy(leg -> { + Integer legStatus = leg.reloadStatus().getLegStatus(); + return (legStatus.equals(LEG_STATUS_ORDERED) || legStatus.equals(LEG_STATUS_PAYED) || legStatus.equals(LEG_STATUS_FINISH)) + && leg.getLegType().equals(LEG_TYPE_AIRPLANE); + })); List orderedLegs = collect.get(true); if (!orderedLegs.isEmpty()) { it.reloadGenerateRequestLegs(orderedLegs); syncAdapter.of(it.getSupplier()).syncRouteRequest(it); it.addEvent(RouteRequestEvent.sync(it.getSupplier())); List notOrderLegs = collect.get(false); - notOrderLegs.forEach(leg->leg.addEvent(legEventFactory.creatLegEvent(LEG_EVENT_APPROVAL))); + notOrderLegs.forEach(leg -> leg.addEvent(legEventFactory.creatLegEvent(LEG_EVENT_APPROVAL))); } else { it.addEvent(RouteRequestEvent.cancel(it.getSupplier())); getLegInfoFromRouteOrder(it, routeOrder);