修复携程酒店订单价格取值问题
This commit is contained in:
parent
d63bfb6b21
commit
d88eced6a8
|
@ -243,11 +243,7 @@ public class OrderDetailQuery {
|
||||||
Double.parseDouble(hotelOrderDetail.getOrderAmount()) == 0) {
|
Double.parseDouble(hotelOrderDetail.getOrderAmount()) == 0) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
return HotelOrderDetailDto.copyFrom(hotelOrderDetail);
|
||||||
HotelOrderDetailDto orderDetailDto = HotelOrderDetailDto.copyFrom(hotelOrderDetail);
|
|
||||||
RouteOrder routeOrder = routeRepository.queryById(orderDetail.getRouteId());
|
|
||||||
orderDetailDto.setApplicantId(routeOrder.getUserId());
|
|
||||||
return orderDetailDto;
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -269,10 +265,7 @@ public class OrderDetailQuery {
|
||||||
if (receiptsNum != null) {
|
if (receiptsNum != null) {
|
||||||
trainOrderDetail.setReceiptsNum(reGetReceiptsNum(receiptsNum));
|
trainOrderDetail.setReceiptsNum(reGetReceiptsNum(receiptsNum));
|
||||||
}
|
}
|
||||||
TrainOrderDetailDto orderDetailDto = TrainOrderDetailDto.copyFrom(trainOrderDetail);
|
return TrainOrderDetailDto.copyFrom(trainOrderDetail);
|
||||||
RouteOrder routeOrder = routeRepository.queryById(orderDetail.getRouteId());
|
|
||||||
orderDetailDto.setApplicantId(routeOrder.getUserId());
|
|
||||||
return orderDetailDto;
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -307,11 +300,7 @@ public class OrderDetailQuery {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
CarOrderDetailDto orderDetailDto = CarOrderDetailDto.copyFrom(carOrderDetail);
|
return CarOrderDetailDto.copyFrom(carOrderDetail);
|
||||||
RouteOrder routeOrder = routeRepository.queryById(orderDetail.getRouteId());
|
|
||||||
orderDetailDto.setApplicantId(routeOrder.getUserId());
|
|
||||||
orderDetailDto.setMiles(carOrderDetail.getMileage());//打车里程数映射
|
|
||||||
return orderDetailDto;
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -332,6 +321,7 @@ public class OrderDetailQuery {
|
||||||
if (receiptsNum != null) {
|
if (receiptsNum != null) {
|
||||||
flightOrderDetail.setReceiptsNum(reGetReceiptsNum(receiptsNum));
|
flightOrderDetail.setReceiptsNum(reGetReceiptsNum(receiptsNum));
|
||||||
}
|
}
|
||||||
|
|
||||||
FlightOrderDetailDto orderDetailDto = FlightOrderDetailDto.copyFrom(flightOrderDetail);
|
FlightOrderDetailDto orderDetailDto = FlightOrderDetailDto.copyFrom(flightOrderDetail);
|
||||||
|
|
||||||
String ticketNo = orderDetailDto.getTicketNo();
|
String ticketNo = orderDetailDto.getTicketNo();
|
||||||
|
@ -344,9 +334,7 @@ public class OrderDetailQuery {
|
||||||
changedTicketNo = changedTicketNo.replace("-", "");
|
changedTicketNo = changedTicketNo.replace("-", "");
|
||||||
orderDetailDto.setChangedTicketNo(changedTicketNo);
|
orderDetailDto.setChangedTicketNo(changedTicketNo);
|
||||||
}
|
}
|
||||||
RouteOrder routeOrder = routeRepository.queryById(orderDetail.getRouteId());
|
return routeRepository.queryById(orderDetail.getRouteId());
|
||||||
orderDetailDto.setApplicantId(routeOrder.getUserId());
|
|
||||||
return orderDetailDto;
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -91,7 +91,7 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
||||||
}
|
}
|
||||||
|
|
||||||
carOrderDetail.setTrvaleSysType(TRAVAL_SYS_TYPE_CTRIP);
|
carOrderDetail.setTrvaleSysType(TRAVAL_SYS_TYPE_CTRIP);
|
||||||
if(carOrderDetail.getOrderNo() == null || carOrderDetail.getDetailId() == null){
|
if (carOrderDetail.getOrderNo() == null || carOrderDetail.getDetailId() == null) {
|
||||||
carOrderDetail.setOrderNo(orderNo);
|
carOrderDetail.setOrderNo(orderNo);
|
||||||
carOrderDetail.setDetailId(orderNo);
|
carOrderDetail.setDetailId(orderNo);
|
||||||
}
|
}
|
||||||
|
@ -170,7 +170,7 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
||||||
BasicInfo flightOrderBasicInfo = flightOrderInfoEntity.getBasicInfo();
|
BasicInfo flightOrderBasicInfo = flightOrderInfoEntity.getBasicInfo();
|
||||||
String orderNo = flightOrderBasicInfo.getOrderID();
|
String orderNo = flightOrderBasicInfo.getOrderID();
|
||||||
String journeyNo = flightOrderBasicInfo.getJourneyID();
|
String journeyNo = flightOrderBasicInfo.getJourneyID();
|
||||||
RouteOrder routeOrder = routeRequestDomainService.getRouteOrder(journeyNo);
|
RouteOrder routeOrder = routeRequestDomainService.getRouteOrder(journeyNo);
|
||||||
|
|
||||||
Optional<OrderDetail> first = routeOrder
|
Optional<OrderDetail> first = routeOrder
|
||||||
.getOrderDetails()
|
.getOrderDetails()
|
||||||
|
@ -196,7 +196,7 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
||||||
|
|
||||||
flightOrderDetail.setTrvaleSysType(TRAVAL_SYS_TYPE_CTRIP);
|
flightOrderDetail.setTrvaleSysType(TRAVAL_SYS_TYPE_CTRIP);
|
||||||
updateFlightOrderDetailData(flightOrderDetail, flightOrderInfoEntity);
|
updateFlightOrderDetailData(flightOrderDetail, flightOrderInfoEntity);
|
||||||
if(flightOrderDetail.getOrderNo() == null || flightOrderDetail.getDetailId() == null){
|
if (flightOrderDetail.getOrderNo() == null || flightOrderDetail.getDetailId() == null) {
|
||||||
flightOrderDetail.setOrderNo(orderNo);
|
flightOrderDetail.setOrderNo(orderNo);
|
||||||
flightOrderDetail.setDetailId(orderNo);
|
flightOrderDetail.setDetailId(orderNo);
|
||||||
}
|
}
|
||||||
|
@ -377,7 +377,7 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
||||||
Optional<OrderDetail> byOrderNo = orderDetailRepository.findByOrderNo(orderNo);
|
Optional<OrderDetail> byOrderNo = orderDetailRepository.findByOrderNo(orderNo);
|
||||||
String journeyNo = hotelOrderInfoEntity.getJourneyNo();
|
String journeyNo = hotelOrderInfoEntity.getJourneyNo();
|
||||||
|
|
||||||
RouteOrder routeOrder = routeRequestDomainService.getRouteOrder(journeyNo).reloadStatus();
|
RouteOrder routeOrder = routeRequestDomainService.getRouteOrder(journeyNo).reloadStatus();
|
||||||
ApproveOrderNo approveOrderNo = null;
|
ApproveOrderNo approveOrderNo = null;
|
||||||
User user = null;
|
User user = null;
|
||||||
|
|
||||||
|
@ -404,7 +404,6 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
||||||
}
|
}
|
||||||
if (sysCode.equals(BELONG_SYS_CODE_H3BPM)) {
|
if (sysCode.equals(BELONG_SYS_CODE_H3BPM)) {
|
||||||
hotelOrderDetail.setBelongSysType(BELONG_SYS_TYPE_H3BPM);
|
hotelOrderDetail.setBelongSysType(BELONG_SYS_TYPE_H3BPM);
|
||||||
|
|
||||||
}
|
}
|
||||||
if (sysCode.equals(BELONG_SYS_CODE_XNFSSC)) {
|
if (sysCode.equals(BELONG_SYS_CODE_XNFSSC)) {
|
||||||
hotelOrderDetail.setBelongSysType(BELONG_SYS_TYPE_XNFSSC);
|
hotelOrderDetail.setBelongSysType(BELONG_SYS_TYPE_XNFSSC);
|
||||||
|
@ -487,14 +486,21 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
||||||
hotelOrderDetail.setRoomTypeName(hotelOrderInfoEntity.getRoomName()); //房型
|
hotelOrderDetail.setRoomTypeName(hotelOrderInfoEntity.getRoomName()); //房型
|
||||||
|
|
||||||
if (Double.parseDouble(hotelOrderInfoEntity.getAmount()) > 0) {
|
if (Double.parseDouble(hotelOrderInfoEntity.getAmount()) > 0) {
|
||||||
hotelOrderDetail.setOrderAmount(hotelOrderInfoEntity.getAmount());
|
HotelOrderInfoEntity.PaymentInfoEntity paymentInfo = hotelOrderInfoEntity.getPaymentInfo();
|
||||||
// hotelOrderDetail.setRefundAmount(KEEP_TWO_DECIMAL_ZERO);
|
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 {
|
} else {
|
||||||
hotelOrderDetail.setOrderAmount(KEEP_TWO_DECIMAL_ZERO);
|
hotelOrderDetail.setOrderAmount(KEEP_TWO_DECIMAL_ZERO);
|
||||||
// hotelOrderDetail.setRefundAmount(hotelOrderInfoEntity.getAmount());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
hotelOrderDetail.setPreServiceFee(hotelOrderInfoEntity.getFrontendServiceFee());
|
hotelOrderDetail.setPreServiceFee(hotelOrderInfoEntity.getFrontendServiceFee());
|
||||||
hotelOrderDetail.setPostServiceFee(hotelOrderInfoEntity.getAfterServiceFee());
|
hotelOrderDetail.setPostServiceFee(hotelOrderInfoEntity.getAfterServiceFee());
|
||||||
hotelOrderDetail.setStandardItems(hotelOrderInfoEntity.getTPMaxPrice());
|
hotelOrderDetail.setStandardItems(hotelOrderInfoEntity.getTPMaxPrice());
|
||||||
|
@ -537,7 +543,7 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
|
||||||
|
|
||||||
hotelOrderDetail.setTrvaleSysType(TRAVAL_SYS_TYPE_CTRIP);
|
hotelOrderDetail.setTrvaleSysType(TRAVAL_SYS_TYPE_CTRIP);
|
||||||
|
|
||||||
if(hotelOrderDetail.getOrderNo() == null || hotelOrderDetail.getDetailId() == null){
|
if (hotelOrderDetail.getOrderNo() == null || hotelOrderDetail.getDetailId() == null) {
|
||||||
hotelOrderDetail.setOrderNo(orderNo);
|
hotelOrderDetail.setOrderNo(orderNo);
|
||||||
hotelOrderDetail.setDetailId(orderNo);
|
hotelOrderDetail.setDetailId(orderNo);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
package com.chint.interfaces.rest.amap.request;
|
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.FinishedOrderDto;
|
||||||
import com.chint.interfaces.rest.amap.dto.settlement.FinishedOrderResponse;
|
import com.chint.interfaces.rest.amap.dto.settlement.FinishedOrderResponse;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import java.time.LocalDateTime;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
@ -24,8 +26,8 @@ public class SettleBillRequest {
|
||||||
*
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public List<FinishedOrderResponse> pageFinishedOrder(String dsStart, String dsEnd) {
|
public List<FinishedOrderResponse.ListElement> pageFinishedOrder(String dsStart, String dsEnd) {
|
||||||
List<FinishedOrderResponse> result=new ArrayList<>();
|
List<FinishedOrderResponse.ListElement> result = new ArrayList<>();
|
||||||
FinishedOrderDto finishedOrderDto = new FinishedOrderDto();
|
FinishedOrderDto finishedOrderDto = new FinishedOrderDto();
|
||||||
finishedOrderDto.setDsStart(dsStart);
|
finishedOrderDto.setDsStart(dsStart);
|
||||||
finishedOrderDto.setDsEnd(dsEnd);
|
finishedOrderDto.setDsEnd(dsEnd);
|
||||||
|
@ -34,11 +36,25 @@ public class SettleBillRequest {
|
||||||
finishedOrderDto.setPageSize(100);
|
finishedOrderDto.setPageSize(100);
|
||||||
do {
|
do {
|
||||||
finishedOrderDto.setPageNum(page);
|
finishedOrderDto.setPageNum(page);
|
||||||
FinishedOrderResponse finishedOrderResponse = amapRequest.post(baseUrl + FINISHED_ORDER_URL, finishedOrderDto, FinishedOrderResponse.class);
|
FinishedOrderResponse finishedOrderResponse = amapRequest
|
||||||
result.add(finishedOrderResponse);
|
.post(baseUrl + FINISHED_ORDER_URL, finishedOrderDto, FinishedOrderResponse.class);
|
||||||
flag = finishedOrderResponse.getData().getHasNextPage();//是否有下一页
|
FinishedOrderResponse.Data data = finishedOrderResponse.getData();
|
||||||
|
if (data != null && data.getList() != null && !data.getList().isEmpty()) {
|
||||||
|
result.addAll(data.getList());
|
||||||
|
}
|
||||||
|
flag = data.getHasNextPage();//是否有下一页
|
||||||
page++;
|
page++;
|
||||||
} while (flag);
|
} while (flag);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<FinishedOrderResponse.ListElement> amapRecordLastMonth(){
|
||||||
|
String lastMonthStr = DateTimeUtil.lastMonthStr();
|
||||||
|
LocalDateTime firstDayOfMonth = DateTimeUtil.firstDayOfMonth(lastMonthStr);
|
||||||
|
LocalDateTime endDayOfMonth = DateTimeUtil.endDayOfMonth(lastMonthStr);
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -159,6 +159,8 @@ public class CarOrderDetailDto implements Serializable {
|
||||||
if(cancellationFee != null){
|
if(cancellationFee != null){
|
||||||
carOrderDetailDto.setCancelFee(cancellationFee);
|
carOrderDetailDto.setCancelFee(cancellationFee);
|
||||||
}
|
}
|
||||||
|
carOrderDetailDto.setApplicantId(carOrderDetail.getBookingUserCode());
|
||||||
|
carOrderDetailDto.setMiles(carOrderDetail.getMileage());//打车里程数映射
|
||||||
return carOrderDetailDto;
|
return carOrderDetailDto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -213,7 +213,7 @@ public class FlightOrderDetailDto implements Serializable {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
FlightOrderDetailDto flightOrderDetailDto = BeanUtil.copyProperties(flightOrderDetail, FlightOrderDetailDto.class);
|
FlightOrderDetailDto flightOrderDetailDto = BeanUtil.copyProperties(flightOrderDetail, FlightOrderDetailDto.class);
|
||||||
|
flightOrderDetailDto.setApplicantId(flightOrderDetail.getBookingUserCode());
|
||||||
return flightOrderDetailDto;
|
return flightOrderDetailDto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -166,6 +166,7 @@ public class HotelOrderDetailDto implements Serializable {
|
||||||
hotelOrderDetailDto.setCustomers(
|
hotelOrderDetailDto.setCustomers(
|
||||||
hotelOrderDetail.getCustomers().stream().distinct().toList()
|
hotelOrderDetail.getCustomers().stream().distinct().toList()
|
||||||
);
|
);
|
||||||
|
hotelOrderDetailDto.setApplicantId(hotelOrderDetail.getBookingUserCode());
|
||||||
return hotelOrderDetailDto;
|
return hotelOrderDetailDto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -179,6 +179,7 @@ public class TrainOrderDetailDto implements Serializable {
|
||||||
if(Double.parseDouble(trainOrderDetail.getRefundCost()) > 0) {
|
if(Double.parseDouble(trainOrderDetail.getRefundCost()) > 0) {
|
||||||
trainOrderDetailDto.setChangeCost(trainOrderDetail.getRefundCost());
|
trainOrderDetailDto.setChangeCost(trainOrderDetail.getRefundCost());
|
||||||
}
|
}
|
||||||
|
trainOrderDetailDto.setApplicantId(trainOrderDetail.getBookingUserCode());
|
||||||
return trainOrderDetailDto;
|
return trainOrderDetailDto;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,6 @@ public class HotelOrderInfoEntity {
|
||||||
private String FrontendServiceFee; // 前端服务费
|
private String FrontendServiceFee; // 前端服务费
|
||||||
private String AfterServiceFee; // 前端服务费
|
private String AfterServiceFee; // 前端服务费
|
||||||
|
|
||||||
|
|
||||||
private String HotelType; // 酒店类型
|
private String HotelType; // 酒店类型
|
||||||
private String HotelName; // 酒店名称
|
private String HotelName; // 酒店名称
|
||||||
private String HotelEnName; // 酒店英文名称
|
private String HotelEnName; // 酒店英文名称
|
||||||
|
@ -79,7 +78,7 @@ public class HotelOrderInfoEntity {
|
||||||
private String LowPriceRC_VV;//超标原因是:其它 超标原因
|
private String LowPriceRC_VV;//超标原因是:其它 超标原因
|
||||||
private String AgreementRCInfo; //超标原因 可能是一个对象
|
private String AgreementRCInfo; //超标原因 可能是一个对象
|
||||||
private String LowPriceRC_W; //超标原因 可能是一个对象
|
private String LowPriceRC_W; //超标原因 可能是一个对象
|
||||||
|
private PaymentInfoEntity PaymentInfo;
|
||||||
private String TPMaxPrice; //入离日期内差标
|
private String TPMaxPrice; //入离日期内差标
|
||||||
// 后续字段含义类似,可根据实际情况添加注释
|
// 后续字段含义类似,可根据实际情况添加注释
|
||||||
|
|
||||||
|
@ -90,6 +89,21 @@ public class HotelOrderInfoEntity {
|
||||||
|
|
||||||
private List<PaymentReceived> PaymentReceivedList;
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -94,8 +94,7 @@ public class AmapTest {
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void pageFinishedOrder() {
|
public void pageFinishedOrder() {
|
||||||
List<FinishedOrderResponse> responses = settleBillRequest.pageFinishedOrder("20240401", "20240431");
|
// List<FinishedOrderResponse> responses = settleBillRequest.pageFinishedOrder("20240401", "20240431");
|
||||||
System.out.println(responses);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -246,7 +246,7 @@ public class CTripTest {
|
||||||
@Test
|
@Test
|
||||||
void search() {
|
void search() {
|
||||||
BaseContext.setCurrentUser(user);
|
BaseContext.setCurrentUser(user);
|
||||||
SearchOrderResponse response = orderSearchRequest.searchOrderResponseByOrderId("31445559547");
|
SearchOrderResponse response = orderSearchRequest.searchOrderResponseByOrderId("31900510524");
|
||||||
System.out.println(response);
|
System.out.println(response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -302,7 +302,7 @@ class RouteApplicationTests {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void loginSignProd() {
|
void loginSignProd() {
|
||||||
String sfno = "0001018592";
|
String sfno = "001001002";
|
||||||
String syscode = "FSSC";
|
String syscode = "FSSC";
|
||||||
String billcode = "CLSQ240225000099";
|
String billcode = "CLSQ240225000099";
|
||||||
String companycode = "正泰集团股份有限公司";
|
String companycode = "正泰集团股份有限公司";
|
||||||
|
|
Loading…
Reference in New Issue