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

View File

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

View File

@ -545,7 +545,9 @@ public class OrderQuery {
Stream<RouteOrder> stream = routeOrders.stream(); Stream<RouteOrder> stream = routeOrders.stream();
if (queryData.getSupplierName() != null) { if (queryData.getSupplierName() != null) {
stream = stream 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 return stream
.filter(order -> order.reloadStatus().getOrderStatus().equals(ORDER_STATUS_APPROVAL)) .filter(order -> order.reloadStatus().getOrderStatus().equals(ORDER_STATUS_APPROVAL))

View File

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

View File

@ -27,13 +27,10 @@ public interface JdbcRouteRepository extends CrudRepository<RouteOrder, Long> {
RouteOrder findByRouteOrderNo(String routeOrderNo); RouteOrder findByRouteOrderNo(String routeOrderNo);
Page<RouteOrder> findByUserIdAndRouteOrderNoContainingAndApproveOrderNo_ActualOrderNoNotNullOrApproveOrderNo_CreatorAndRouteOrderNoContainingAndApproveOrderNo_ActualOrderNoNotNull(String userId, String routeOrderNo, String approveOrderNo_creator, String routeOrderNo2, Pageable pageable); 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_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); Page<RouteOrder> findByUserIdAndApproveOrderNo_ActualOrderNoNotNullOrApproveOrderNo_CreatorAndApproveOrderNo_ActualOrderNoNotNull(String userId, String approveOrderNo_creator, Pageable pageable);
void deleteByUserId(String userId); void deleteByUserId(String userId);

View File

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

View File

@ -163,7 +163,12 @@ public class CTripNoteController {
etaReason = hotelOrderInfoEntity.getLowPriceRC_VV();//超标原因 etaReason = hotelOrderInfoEntity.getLowPriceRC_VV();//超标原因
} }
if (etaReason == null) { 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; yield etaReason != null ? etaReason : NO_ETA_AVAILABLE;
} else { } else {

View File

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