修改同程飞机订单明细的生成逻辑

This commit is contained in:
lulz1 2024-03-19 13:41:06 +08:00
parent 4c297cd2a0
commit b06c01f8c4
1 changed files with 7 additions and 4 deletions

View File

@ -76,15 +76,18 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
BaseOrderExtension baseOrderExtension = orderDetailFactory.buildWithRouteOrder(routeOrder);
FlightOrderDetail flightOrderDetail;
Optional<FlightOrderDetail> first = routeOrder
Optional<OrderDetail> first = routeOrder
.getOrderDetails()
.stream()
.filter(it -> it.getOrderNo().equals(orderDetails.getOrderSerialNo()))
.map(OrderDetail::getFlightOrderDetail)
.findFirst();
flightOrderDetail = first.orElseGet(() -> BeanUtil.copyProperties(baseOrderExtension, FlightOrderDetail.class));
if (first.isPresent()) {
OrderDetail orderDetail1 = first.get();
flightOrderDetail = Optional.ofNullable(orderDetail1.getFlightOrderDetail()).orElseGet(() -> BeanUtil.copyProperties(baseOrderExtension, FlightOrderDetail.class));
} else {
flightOrderDetail = BeanUtil.copyProperties(baseOrderExtension, FlightOrderDetail.class);
}
//飞机票状态属性保存
OrderEvent lastEvent = orderDetail.getLastEvent();