修改同程飞机订单明细的生成逻辑
This commit is contained in:
parent
4c297cd2a0
commit
b06c01f8c4
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue