fix:修复携程结算数据拉去出现的bug

This commit is contained in:
lulz1 2024-04-19 19:46:28 +08:00
parent 11a405ca25
commit c78a100367
8 changed files with 84 additions and 38 deletions

View File

@ -8,6 +8,7 @@ import com.chint.application.services.OrderApplicationService;
import com.chint.domain.aggregates.order.RouteOrder;
import com.chint.domain.service.OrderDetailDomainService;
import com.chint.domain.service.OrderDomainService;
import com.chint.domain.service.RouteRequestDomainService;
import com.chint.domain.value_object.OrderSaveData;
import com.chint.domain.value_object.SyncLegData;
import com.chint.domain.value_object.UpdateLegData;
@ -38,6 +39,8 @@ public class OrderController {
@Autowired
private OrderDomainService orderDomainService;
@Autowired
private RouteRequestDomainService routeRequestDomainService;
@Transactional
@ApiOperation("保存行程规划单")
@ -73,7 +76,7 @@ public class OrderController {
syncLegDataItem.setRouteId(routeId);
syncLegDataItem.setSupplierName(syncLegData.getSupplierName());
return syncLegDataItem;
}).toList().forEach(data -> orderApplicationService.sync(data));
}).toList().forEach(data -> routeRequestDomainService.syncRouteRequestToSupplier(data));
return Result.Success(SUCCESS);
}

View File

@ -140,6 +140,7 @@ public class OrderDetailQuery {
public File exportOrderDetailToFile(AuthenticationSignDto authenticationDto) {
List<OrderDetail> orderDetailList = queryOrderDetail(authenticationDto).stream().filter(Objects::nonNull).toList();
Integer productType = authenticationDto.getProductType();
return OrderDetailWriter.exportReport(
switch (productType) {

View File

@ -545,7 +545,9 @@ public class OrderQuery {
Stream<RouteOrder> stream = routeOrders.stream();
if (queryData.getSupplierName() != null) {
stream = stream
.filter(it -> it.getSupplierName() == null || it.getSupplierName().equals(queryData.getSupplierName()));
.filter(it-> it.getRouteRequestList()
.stream()
.anyMatch(routeRequest -> !routeRequest.getSupplier().equals(queryData.getSupplierName())));
}
return stream
.filter(order -> order.reloadStatus().getOrderStatus().equals(ORDER_STATUS_APPROVAL))

View File

@ -24,7 +24,6 @@ import java.util.List;
import java.util.Optional;
import static com.chint.infrastructure.constant.BelongSystemConstant.*;
import static com.chint.infrastructure.constant.LegConstant.LEG_TYPE_HOTEL;
import static com.chint.infrastructure.constant.UtilConstant.KEEP_TWO_DECIMAL_ZERO;
@Component
@ -179,16 +178,29 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
String orderNo = getOrderNoForCTrip(cTripCarRecord.getRouteOrderNo());
orderDetail.ifPresentOrElse(it -> {
CarOrderDetail carOrderDetail = it.getCarOrderDetail();
orderCarRecord.loadComplianceInfo(it)
.loadRelatedOrderInfo(it.getOrderId(),
cTripCarRecord.getRecordId(),
byOrderNo.isPresent() ? byOrderNo.get().getApproveOrderNo().getActualOrderNo() : orderNo, //兼容测试环境和正式环境的数据
carOrderDetail.getReceiptsNum(),
carOrderDetail.getParentOrderNo(),
carOrderDetail.getOriginalOrderNo())
.loadBasicOrderInfo(carOrderDetail.getOrderNo(),
translateCarCTripStatusToRecordStatus(cTripCarRecordBase.getDelType()),
cTripCarRecord.getOrderDate());
if (carOrderDetail != null) {
orderCarRecord.loadComplianceInfo(it)
.loadRelatedOrderInfo(it.getOrderId(),
cTripCarRecord.getRecordId(),
byOrderNo.isPresent() ? byOrderNo.get().getApproveOrderNo().getActualOrderNo() : orderNo, //兼容测试环境和正式环境的数据
carOrderDetail.getReceiptsNum(),
carOrderDetail.getParentOrderNo(),
carOrderDetail.getOriginalOrderNo())
.loadBasicOrderInfo(carOrderDetail.getOrderNo(),
translateCarCTripStatusToRecordStatus(cTripCarRecordBase.getDelType()),
cTripCarRecord.getOrderDate());
} else {
orderCarRecord.loadComplianceInfoNot()
.loadRelatedOrderInfo(cTripCarRecordBase.getOrderId(),
cTripCarRecord.getRecordId(),
orderNo,
cTripCarRecord.getRouteOrderNo(),
String.valueOf(cTripCarRecordBase.getOrderId()),
String.valueOf(cTripCarRecordBase.getOrderId()))
.loadBasicOrderInfo(String.valueOf(cTripCarRecordBase.getOrderId()),
translateCarCTripStatusToRecordStatus(cTripCarRecordBase.getDelType()),
cTripCarRecord.getOrderDate());
}
}, () -> orderCarRecord.loadComplianceInfoNot()
.loadRelatedOrderInfo(cTripCarRecordBase.getOrderId(),
cTripCarRecord.getRecordId(),
@ -398,16 +410,29 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
String orderNo = getOrderNoForCTrip(cTripFlightRecord.getRouteOrderNo());
orderDetail.ifPresentOrElse(it -> {
FlightOrderDetail flightOrderDetail = it.getFlightOrderDetail();
orderFlightRecord.loadComplianceInfo(it)
.loadBasicOrderInfo(String.valueOf(cTripFlightRecordBase.getOrderId()),
translateFlightCTripStatusToRecordStatus(cTripFlightRecordBase.getOrderDetailType()),
cTripFlightRecordBase.getCreateTime())
.loadRelatedOrderInfo(cTripFlightRecordBase.getOrderId(),
String.valueOf(cTripFlightRecordBase.getRecordId()),
byOrderNo.isPresent() ? byOrderNo.get().getApproveOrderNo().getActualOrderNo() : orderNo, //兼容测试环境和正式环境的数据
flightOrderDetail.getReceiptsNum(),
flightOrderDetail.getParentOrderNo(),
it.getOrderNo());
if (flightOrderDetail != null) {
orderFlightRecord.loadComplianceInfo(it)
.loadBasicOrderInfo(String.valueOf(cTripFlightRecordBase.getOrderId()),
translateFlightCTripStatusToRecordStatus(cTripFlightRecordBase.getOrderDetailType()),
cTripFlightRecordBase.getCreateTime())
.loadRelatedOrderInfo(cTripFlightRecordBase.getOrderId(),
String.valueOf(cTripFlightRecordBase.getRecordId()),
byOrderNo.isPresent() ? byOrderNo.get().getApproveOrderNo().getActualOrderNo() : orderNo, //兼容测试环境和正式环境的数据
flightOrderDetail.getReceiptsNum(),
flightOrderDetail.getParentOrderNo(),
it.getOrderNo());
} else {
orderFlightRecord.loadComplianceInfoNot()
.loadRelatedOrderInfo(cTripFlightRecordBase.getOrderId(), //兼容测试环境没有申请单的情况
String.valueOf(cTripFlightRecordBase.getRecordId()),
orderNo,
cTripFlightBaseInfo.getJourneyID(),
String.valueOf(cTripFlightRecordBase.getOrderId()),
String.valueOf(cTripFlightRecordBase.getOrderId()))
.loadBasicOrderInfo(String.valueOf(cTripFlightRecordBase.getOrderId()),
translateFlightCTripStatusToRecordStatus(cTripFlightRecordBase.getOrderDetailType()),
cTripFlightRecordBase.getCreateTime());
}
}, () -> orderFlightRecord.loadComplianceInfoNot()
.loadRelatedOrderInfo(cTripFlightRecordBase.getOrderId(), //兼容测试环境没有申请单的情况
String.valueOf(cTripFlightRecordBase.getRecordId()),
@ -561,15 +586,28 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
orderDetailOptional.ifPresentOrElse(it -> {
orderHotelRecord.loadComplianceInfo(Optional.of(it)); // 加载违规信息
HotelOrderDetail hotelOrderDetail = it.getHotelOrderDetail();
orderHotelRecord.loadOrderNoInfo(it.getOrderId(), // 加载订单关联号信息
cTripHotelRecord.getRecordId(),
byOrderNo.isPresent() ? byOrderNo.get().getApproveOrderNo().getActualOrderNo() : orderNo, //兼容测试环境和正式环境的数据
hotelOrderDetail.getReceiptsNum(),
hotelOrderDetail.getOrderNo(),
hotelOrderDetail.getOrderNo());
orderHotelRecord.loadBasicOrderInfo(hotelOrderDetail.getOrderNo(), // 加载基础订单信息
translateHotelCTripStatusToRecordStatus(cTripHotelRecordBase.getDetailType()),
cTripHotelRecordBase.getCreateTime());
if (hotelOrderDetail != null) {
orderHotelRecord.loadOrderNoInfo(it.getOrderId(), // 加载订单关联号信息
cTripHotelRecord.getRecordId(),
byOrderNo.isPresent() ? byOrderNo.get().getApproveOrderNo().getActualOrderNo() : orderNo, //兼容测试环境和正式环境的数据
hotelOrderDetail.getReceiptsNum(),
hotelOrderDetail.getOrderNo(),
hotelOrderDetail.getOrderNo())
.loadBasicOrderInfo(String.valueOf(cTripHotelRecordBase.getOrderId()), // 加载基础订单信息
translateHotelCTripStatusToRecordStatus(cTripHotelRecordBase.getDetailType()),
cTripHotelRecordBase.getCreateTime());
} else {
orderHotelRecord.loadComplianceInfo(Optional.empty())
.loadOrderNoInfo(cTripHotelRecordBase.getOrderId(), //兼容测试环境不存在行程规划单的情况 // 加载订单关联号信息
cTripHotelRecord.getRecordId(),
orderNo,
cTripHotelRecord.getRouteOrderNo(),
String.valueOf(cTripHotelRecordBase.getOrderId()),
String.valueOf(cTripHotelRecordBase.getOrderId()))
.loadBasicOrderInfo(String.valueOf(cTripHotelRecordBase.getOrderId()), // 加载基础订单信息
translateHotelCTripStatusToRecordStatus(cTripHotelRecordBase.getDetailType()),
cTripHotelRecordBase.getCreateTime());
}
}, () -> orderHotelRecord.loadComplianceInfo(Optional.empty())
.loadOrderNoInfo(cTripHotelRecordBase.getOrderId(), //兼容测试环境不存在行程规划单的情况 // 加载订单关联号信息
cTripHotelRecord.getRecordId(),
@ -656,7 +694,6 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
orderHotelRecord.setOrderStatus("0");
}
}, () -> orderHotelRecord.setOrderStatus("0"));
return orderHotelRecord;
}

View File

@ -27,13 +27,10 @@ public interface JdbcRouteRepository extends CrudRepository<RouteOrder, Long> {
RouteOrder findByRouteOrderNo(String routeOrderNo);
Page<RouteOrder> findByUserIdAndRouteOrderNoContainingAndApproveOrderNo_ActualOrderNoNotNullOrApproveOrderNo_CreatorAndRouteOrderNoContainingAndApproveOrderNo_ActualOrderNoNotNull(String userId, String routeOrderNo, String approveOrderNo_creator, String routeOrderNo2, Pageable pageable);
Page<RouteOrder> findByUserIdAndApproveOrderNo_InstructionsContainingAndApproveOrderNo_ActualOrderNoNotNullOrApproveOrderNo_CreatorAndApproveOrderNo_InstructionsContainingAndApproveOrderNo_ActualOrderNoNotNull(String userId, String approveOrderNo_instructions, String approveOrderNo_creator, String approveOrderNo_instructions2, Pageable pageable);
Page<RouteOrder> findByUserIdAndApproveOrderNo_ActualOrderNoNotNullOrApproveOrderNo_CreatorAndApproveOrderNo_ActualOrderNoNotNull(String userId, String approveOrderNo_creator, Pageable pageable);
void deleteByUserId(String userId);

View File

@ -78,6 +78,7 @@ public class HotelOrderInfoEntity {
private String LowPriceRCInfo; //超标原因 可能是一个对象
private String LowPriceRC_VV;//超标原因是:其它 超标原因
private String AgreementRCInfo; //超标原因 可能是一个对象
private String LowPriceRC_W; //超标原因 可能是一个对象
private String TPMaxPrice; //入离日期内差标
// 后续字段含义类似可根据实际情况添加注释

View File

@ -163,7 +163,12 @@ public class CTripNoteController {
etaReason = hotelOrderInfoEntity.getLowPriceRC_VV();//超标原因
}
if (etaReason == null) {
etaReason = hotelOrderInfoEntity.getAgreementRCInfo();
String agreementRCInfo = hotelOrderInfoEntity.getAgreementRCInfo();
if(agreementRCInfo.startsWith("其他")){
etaReason = hotelOrderInfoEntity.getLowPriceRC_W();
} else {
etaReason = agreementRCInfo;
}
}
yield etaReason != null ? etaReason : NO_ETA_AVAILABLE;
} else {

View File

@ -247,7 +247,7 @@ public class CTripTest {
@Test
void search() {
BaseContext.setCurrentUser(user);
SearchOrderResponse response = orderSearchRequest.searchOrderResponseByOrderId("30686209959");
SearchOrderResponse response = orderSearchRequest.searchOrderResponseByOrderId("30386062604");
System.out.println(response);
}