修复携程酒店订单价格取值问题

This commit is contained in:
lulz1 2024-05-14 16:10:14 +08:00
parent d63bfb6b21
commit d88eced6a8
11 changed files with 66 additions and 39 deletions

View File

@ -243,11 +243,7 @@ public class OrderDetailQuery {
Double.parseDouble(hotelOrderDetail.getOrderAmount()) == 0) {
return null;
}
HotelOrderDetailDto orderDetailDto = HotelOrderDetailDto.copyFrom(hotelOrderDetail);
RouteOrder routeOrder = routeRepository.queryById(orderDetail.getRouteId());
orderDetailDto.setApplicantId(routeOrder.getUserId());
return orderDetailDto;
return HotelOrderDetailDto.copyFrom(hotelOrderDetail);
}
return null;
}
@ -269,10 +265,7 @@ public class OrderDetailQuery {
if (receiptsNum != null) {
trainOrderDetail.setReceiptsNum(reGetReceiptsNum(receiptsNum));
}
TrainOrderDetailDto orderDetailDto = TrainOrderDetailDto.copyFrom(trainOrderDetail);
RouteOrder routeOrder = routeRepository.queryById(orderDetail.getRouteId());
orderDetailDto.setApplicantId(routeOrder.getUserId());
return orderDetailDto;
return TrainOrderDetailDto.copyFrom(trainOrderDetail);
}
return null;
}
@ -307,11 +300,7 @@ public class OrderDetailQuery {
return null;
}
CarOrderDetailDto orderDetailDto = CarOrderDetailDto.copyFrom(carOrderDetail);
RouteOrder routeOrder = routeRepository.queryById(orderDetail.getRouteId());
orderDetailDto.setApplicantId(routeOrder.getUserId());
orderDetailDto.setMiles(carOrderDetail.getMileage());//打车里程数映射
return orderDetailDto;
return CarOrderDetailDto.copyFrom(carOrderDetail);
}
return null;
}
@ -332,6 +321,7 @@ public class OrderDetailQuery {
if (receiptsNum != null) {
flightOrderDetail.setReceiptsNum(reGetReceiptsNum(receiptsNum));
}
FlightOrderDetailDto orderDetailDto = FlightOrderDetailDto.copyFrom(flightOrderDetail);
String ticketNo = orderDetailDto.getTicketNo();
@ -344,9 +334,7 @@ public class OrderDetailQuery {
changedTicketNo = changedTicketNo.replace("-", "");
orderDetailDto.setChangedTicketNo(changedTicketNo);
}
RouteOrder routeOrder = routeRepository.queryById(orderDetail.getRouteId());
orderDetailDto.setApplicantId(routeOrder.getUserId());
return orderDetailDto;
return routeRepository.queryById(orderDetail.getRouteId());
}
return null;
}

View File

@ -91,7 +91,7 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
}
carOrderDetail.setTrvaleSysType(TRAVAL_SYS_TYPE_CTRIP);
if(carOrderDetail.getOrderNo() == null || carOrderDetail.getDetailId() == null){
if (carOrderDetail.getOrderNo() == null || carOrderDetail.getDetailId() == null) {
carOrderDetail.setOrderNo(orderNo);
carOrderDetail.setDetailId(orderNo);
}
@ -196,7 +196,7 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
flightOrderDetail.setTrvaleSysType(TRAVAL_SYS_TYPE_CTRIP);
updateFlightOrderDetailData(flightOrderDetail, flightOrderInfoEntity);
if(flightOrderDetail.getOrderNo() == null || flightOrderDetail.getDetailId() == null){
if (flightOrderDetail.getOrderNo() == null || flightOrderDetail.getDetailId() == null) {
flightOrderDetail.setOrderNo(orderNo);
flightOrderDetail.setDetailId(orderNo);
}
@ -404,7 +404,6 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
}
if (sysCode.equals(BELONG_SYS_CODE_H3BPM)) {
hotelOrderDetail.setBelongSysType(BELONG_SYS_TYPE_H3BPM);
}
if (sysCode.equals(BELONG_SYS_CODE_XNFSSC)) {
hotelOrderDetail.setBelongSysType(BELONG_SYS_TYPE_XNFSSC);
@ -487,14 +486,21 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
hotelOrderDetail.setRoomTypeName(hotelOrderInfoEntity.getRoomName()); //房型
if (Double.parseDouble(hotelOrderInfoEntity.getAmount()) > 0) {
hotelOrderDetail.setOrderAmount(hotelOrderInfoEntity.getAmount());
// hotelOrderDetail.setRefundAmount(KEEP_TWO_DECIMAL_ZERO);
HotelOrderInfoEntity.PaymentInfoEntity paymentInfo = hotelOrderInfoEntity.getPaymentInfo();
if (paymentInfo != null && paymentInfo.getPaymentItemList() != null && !paymentInfo.getPaymentItemList().isEmpty()) {
List<HotelOrderInfoEntity.PaymentItem> paymentItemList = paymentInfo.getPaymentItemList();
if (hotelOrderDetail.getOrderAmount() == null || hotelOrderDetail.getOrderAmount().isEmpty()) {
hotelOrderDetail.setOrderAmount(KEEP_TWO_DECIMAL_ZERO);
}
for (HotelOrderInfoEntity.PaymentItem paymentItem : paymentItemList) {
hotelOrderDetail.setOrderAmount(BigDecimalCalculator.add(hotelOrderDetail.getOrderAmount(),
String.valueOf(paymentItem.getAmount())));
}
}
} else {
hotelOrderDetail.setOrderAmount(KEEP_TWO_DECIMAL_ZERO);
// hotelOrderDetail.setRefundAmount(hotelOrderInfoEntity.getAmount());
}
hotelOrderDetail.setPreServiceFee(hotelOrderInfoEntity.getFrontendServiceFee());
hotelOrderDetail.setPostServiceFee(hotelOrderInfoEntity.getAfterServiceFee());
hotelOrderDetail.setStandardItems(hotelOrderInfoEntity.getTPMaxPrice());
@ -537,7 +543,7 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
hotelOrderDetail.setTrvaleSysType(TRAVAL_SYS_TYPE_CTRIP);
if(hotelOrderDetail.getOrderNo() == null || hotelOrderDetail.getDetailId() == null){
if (hotelOrderDetail.getOrderNo() == null || hotelOrderDetail.getDetailId() == null) {
hotelOrderDetail.setOrderNo(orderNo);
hotelOrderDetail.setDetailId(orderNo);
}

View File

@ -1,11 +1,13 @@
package com.chint.interfaces.rest.amap.request;
import com.chint.infrastructure.util.DateTimeUtil;
import com.chint.interfaces.rest.amap.dto.settlement.FinishedOrderDto;
import com.chint.interfaces.rest.amap.dto.settlement.FinishedOrderResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import java.time.LocalDateTime;
import java.util.ArrayList;
import java.util.List;
@ -24,8 +26,8 @@ public class SettleBillRequest {
*
* @return
*/
public List<FinishedOrderResponse> pageFinishedOrder(String dsStart, String dsEnd) {
List<FinishedOrderResponse> result=new ArrayList<>();
public List<FinishedOrderResponse.ListElement> pageFinishedOrder(String dsStart, String dsEnd) {
List<FinishedOrderResponse.ListElement> result = new ArrayList<>();
FinishedOrderDto finishedOrderDto = new FinishedOrderDto();
finishedOrderDto.setDsStart(dsStart);
finishedOrderDto.setDsEnd(dsEnd);
@ -34,11 +36,25 @@ public class SettleBillRequest {
finishedOrderDto.setPageSize(100);
do {
finishedOrderDto.setPageNum(page);
FinishedOrderResponse finishedOrderResponse = amapRequest.post(baseUrl + FINISHED_ORDER_URL, finishedOrderDto, FinishedOrderResponse.class);
result.add(finishedOrderResponse);
flag = finishedOrderResponse.getData().getHasNextPage();//是否有下一页
FinishedOrderResponse finishedOrderResponse = amapRequest
.post(baseUrl + FINISHED_ORDER_URL, finishedOrderDto, FinishedOrderResponse.class);
FinishedOrderResponse.Data data = finishedOrderResponse.getData();
if (data != null && data.getList() != null && !data.getList().isEmpty()) {
result.addAll(data.getList());
}
flag = data.getHasNextPage();//是否有下一页
page++;
} while (flag);
return result;
}
public List<FinishedOrderResponse.ListElement> amapRecordLastMonth(){
String lastMonthStr = DateTimeUtil.lastMonthStr();
LocalDateTime firstDayOfMonth = DateTimeUtil.firstDayOfMonth(lastMonthStr);
LocalDateTime endDayOfMonth = DateTimeUtil.endDayOfMonth(lastMonthStr);
return null;
}
}

View File

@ -159,6 +159,8 @@ public class CarOrderDetailDto implements Serializable {
if(cancellationFee != null){
carOrderDetailDto.setCancelFee(cancellationFee);
}
carOrderDetailDto.setApplicantId(carOrderDetail.getBookingUserCode());
carOrderDetailDto.setMiles(carOrderDetail.getMileage());//打车里程数映射
return carOrderDetailDto;
}
}

View File

@ -213,7 +213,7 @@ public class FlightOrderDetailDto implements Serializable {
return null;
}
FlightOrderDetailDto flightOrderDetailDto = BeanUtil.copyProperties(flightOrderDetail, FlightOrderDetailDto.class);
flightOrderDetailDto.setApplicantId(flightOrderDetail.getBookingUserCode());
return flightOrderDetailDto;
}
}

View File

@ -166,6 +166,7 @@ public class HotelOrderDetailDto implements Serializable {
hotelOrderDetailDto.setCustomers(
hotelOrderDetail.getCustomers().stream().distinct().toList()
);
hotelOrderDetailDto.setApplicantId(hotelOrderDetail.getBookingUserCode());
return hotelOrderDetailDto;
}
}

View File

@ -179,6 +179,7 @@ public class TrainOrderDetailDto implements Serializable {
if(Double.parseDouble(trainOrderDetail.getRefundCost()) > 0) {
trainOrderDetailDto.setChangeCost(trainOrderDetail.getRefundCost());
}
trainOrderDetailDto.setApplicantId(trainOrderDetail.getBookingUserCode());
return trainOrderDetailDto;
}
}

View File

@ -29,7 +29,6 @@ public class HotelOrderInfoEntity {
private String FrontendServiceFee; // 前端服务费
private String AfterServiceFee; // 前端服务费
private String HotelType; // 酒店类型
private String HotelName; // 酒店名称
private String HotelEnName; // 酒店英文名称
@ -79,7 +78,7 @@ public class HotelOrderInfoEntity {
private String LowPriceRC_VV;//超标原因是:其它 超标原因
private String AgreementRCInfo; //超标原因 可能是一个对象
private String LowPriceRC_W; //超标原因 可能是一个对象
private PaymentInfoEntity PaymentInfo;
private String TPMaxPrice; //入离日期内差标
// 后续字段含义类似可根据实际情况添加注释
@ -90,6 +89,21 @@ public class HotelOrderInfoEntity {
private List<PaymentReceived> PaymentReceivedList;
@Data
public static class PaymentInfoEntity {
private List<PaymentItem> paymentItemList;
private Double originalTotalAmountExclude;
}
@Data
public static class PaymentItem {
private String prePayType;
private String paymentStatus;
private String currency;
private Double exchange;
private Double amount;
}
}

View File

@ -94,8 +94,7 @@ public class AmapTest {
*/
@Test
public void pageFinishedOrder() {
List<FinishedOrderResponse> responses = settleBillRequest.pageFinishedOrder("20240401", "20240431");
System.out.println(responses);
// List<FinishedOrderResponse> responses = settleBillRequest.pageFinishedOrder("20240401", "20240431");
}
@Test

View File

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

View File

@ -302,7 +302,7 @@ class RouteApplicationTests {
@Test
void loginSignProd() {
String sfno = "0001018592";
String sfno = "001001002";
String syscode = "FSSC";
String billcode = "CLSQ240225000099";
String companycode = "正泰集团股份有限公司";