1.修改订单明细认证接口 統一是否为协议酒店字段

This commit is contained in:
wanglf3 2024-03-13 15:32:26 +08:00
parent 7b488daa36
commit 799f9a2074
4 changed files with 71 additions and 48 deletions

View File

@ -106,7 +106,14 @@ public class OrderDetailController {
if (orderDetail.getProductType().equals(productType)) {
if (productType == 1) {
FlightOrderDetail flightOrderDetail = orderDetail.getFlightOrderDetail();
if (flightOrderDetail != null) {
String receiptsNum = flightOrderDetail.getReceiptsNum();
if (receiptsNum != null){
flightOrderDetail.setReceiptsNum(regetReceiptsNum(receiptsNum));
}
if (flightOrderDetail.getBelongSysType() != null && flightOrderDetail.getBelongSysType().equals(systemType)) {
orderDetailResList.add(flightOrderDetail);
} else {
@ -118,7 +125,10 @@ public class OrderDetailController {
if (productType == 2) {
HotelOrderDetail hotelOrderDetail = orderDetail.getHotelOrderDetail();
if (hotelOrderDetail != null) {
// orderDetailResList.add(hotelOrderDetail);
String receiptsNum = hotelOrderDetail.getReceiptsNum();
if (receiptsNum != null){
hotelOrderDetail.setReceiptsNum(regetReceiptsNum(receiptsNum));
}
if (hotelOrderDetail.getBelongSysType() != null && hotelOrderDetail.getBelongSysType().equals(systemType)) {
orderDetailResList.add(hotelOrderDetail);
@ -132,7 +142,10 @@ public class OrderDetailController {
if (productType == 3) {
TrainOrderDetail trainOrderDetail = orderDetail.getTrainOrderDetail();
if (trainOrderDetail != null) {
// orderDetailResList.add(trainOrderDetail);
String receiptsNum = trainOrderDetail.getReceiptsNum();
if (receiptsNum != null){
trainOrderDetail.setReceiptsNum(regetReceiptsNum(receiptsNum));
}
if (trainOrderDetail.getBelongSysType() != null && trainOrderDetail.getBelongSysType().equals(systemType)) {
orderDetailResList.add(trainOrderDetail);
} else {
@ -144,18 +157,19 @@ public class OrderDetailController {
if (productType == 4) {
CarOrderDetail carOrderDetail = orderDetail.getCarOrderDetail();
if (carOrderDetail != null) {
String receiptsNum = carOrderDetail.getReceiptsNum();
if (receiptsNum != null){
carOrderDetail.setReceiptsNum(regetReceiptsNum(receiptsNum));
}
if (carOrderDetail.getBelongSysType() != null && carOrderDetail.getBelongSysType().equals(systemType)) {
orderDetailResList.add(carOrderDetail);
} else {
orderDetailResList.add(carOrderDetail);
}
}
}
}
}
List<Object> newres2 = orderDetailResList.stream().skip((long) (pageNum - 1) * pageSize)
.limit(pageSize).toList();
@ -174,4 +188,11 @@ public class OrderDetailController {
PageResult<OrderDetailRes> orderDetailResPageResult = orderDetailPageQuery.orderDetailPageQuery(orderDetailQueryParam);
return Result.Success(SUCCESS, orderDetailResPageResult);
}
private String regetReceiptsNum(String receiptsNum){
String[] parts = receiptsNum.split("-");
String result = parts[1];
return result;
}
}

View File

@ -91,20 +91,16 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
flightOrderFeeDetail = flightOrderInfoEntity.getFlightOrderFeeDetailList().get(0);
}
String orderNo = flightOrderBasicInfo.getOrderID();
String journeyNo = flightOrderBasicInfo.getJourneyID();
RouteOrder routeOrder = routeRepository.findByOrderNo(journeyNo);
String sysCode = routeOrder.getApproveOrderNo().getSysCode();
Optional<OrderDetail> first = routeOrder
.getOrderDetails()
.stream()
.filter(orderDetail -> orderDetail.getOrderNo().equals(orderNo))
.findFirst();
FlightOrderDetail flightOrderDetail = new FlightOrderDetail();
// flightOrderDetail.setSupplier(SUPPLIER_C_TRIP_EXTENSION_NAME);
@ -129,11 +125,12 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
flightOrderDetail.setOrderNo(orderNo);
flightOrderDetail.setDetailId(orderNo);
first.ifPresent(orderDetail ->{
OrderEvent lastEvent = orderDetail.getLastEvent();
if(lastEvent != null){
flightOrderDetail.setOrderStatus(lastEvent.mapToOrderDetailStatus());
}}
first.ifPresent(orderDetail -> {
OrderEvent lastEvent = orderDetail.getLastEvent();
if (lastEvent != null) {
flightOrderDetail.setOrderStatus(lastEvent.mapToOrderDetailStatus());
}
}
);
if (flightOrderBasicInfo != null) {
@ -142,9 +139,9 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
flightOrderDetail.setOrderAmount(String.valueOf(flightOrderBasicInfo.getAmount()));
if (flightOrderBasicInfo.getPrepayType().equals("ACCNT")){
if (flightOrderBasicInfo.getPrepayType().equals("ACCNT")) {
flightOrderDetail.setPaymentType("0");
}else {
} else {
flightOrderDetail.setPaymentType("1");
}
//付款方式 ACCNT公司统付 其他类型个人支付
@ -208,7 +205,7 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
ApproveOrderNo approveOrderNo = routeOrder.getApproveOrderNo();
if (approveOrderNo != null) {
flightOrderDetail.setAccountCompanyId(approveOrderNo.getAccountCompany());
flightOrderDetail.setAccountCompanyId(approveOrderNo.getAccountCompanyCode());
flightOrderDetail.setAccountCompanyName(approveOrderNo.getAccountCompanyName());
flightOrderDetail.setReceiptsNum(routeOrder.getRouteOrderNo());
flightOrderDetail.setCostCenter(approveOrderNo.getCostCenter());
@ -279,9 +276,6 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
// }
hotelOrderDetail.setTrvaleSysType("XC");
// hotelOrderDetail.setOrderStatus(ORDER_DETAIL_STATUS_SUCCESS);
// hotelOrderDetail.setSupplier(SUPPLIER_C_TRIP_EXTENSION_NAME);
if (routeOrder != null) {
@ -319,11 +313,12 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
.stream()
.filter(orderDetail -> orderDetail.getOrderNo().equals(orderNo))
.findFirst();
first.ifPresent(orderDetail ->{
OrderEvent lastEvent = orderDetail.getLastEvent();
if(lastEvent != null){
hotelOrderDetail.setOrderStatus(lastEvent.mapToOrderDetailStatus());
}}
first.ifPresent(orderDetail -> {
OrderEvent lastEvent = orderDetail.getLastEvent();
if (lastEvent != null) {
hotelOrderDetail.setOrderStatus(lastEvent.mapToOrderDetailStatus());
}
}
);
if (user != null) {
@ -339,22 +334,16 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
customers.add(hotelOrderDetailCustomer);
hotelOrderDetail.setCustomers(customers);
}
if (approveOrderNo != null) {
hotelOrderDetail.setAccountCompanyId(approveOrderNo.getAccountCompany());
hotelOrderDetail.setAccountCompanyId(approveOrderNo.getAccountCompanyCode());
hotelOrderDetail.setAccountCompanyName(approveOrderNo.getAccountCompanyName());
hotelOrderDetail.setCostCenter(approveOrderNo.getCostCenter());
hotelOrderDetail.setProjectOrderNo(approveOrderNo.getProjectName());
}
if (hotelOrderInfoEntity != null){
if (hotelOrderInfoEntity != null) {
hotelOrderDetail.setOrderNo(hotelOrderInfoEntity.getOrderID()); //订单号
hotelOrderDetail.setDetailId(hotelOrderInfoEntity.getOrderID());
hotelOrderDetail.setReceiptsNum(routeOrder.getRouteOrderNo());
hotelOrderDetail.setCreateTime(hotelOrderInfoEntity.getOrderDate());
hotelOrderDetail.setCheckInCity(hotelOrderInfoEntity.getCityName());
hotelOrderDetail.setHotelName(hotelOrderInfoEntity.getHotelName());
@ -368,7 +357,6 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
hotelOrderDetail.setRoomTypeName(hotelOrderInfoEntity.getRoomName()); //房型
if (Double.parseDouble(hotelOrderInfoEntity.getSettlementACCNTAmt()) > 0) {
hotelOrderDetail.setCompanyAmount(hotelOrderInfoEntity.getSettlementACCNTAmt());
hotelOrderDetail.setCompanyRefundAmount(KEEP_TWO_DECIMAL_ZERO);
hotelOrderDetail.setPaymentType("0");
} else {
@ -401,15 +389,13 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
hotelOrderDetail.setPostServiceFee(hotelOrderInfoEntity.getServicefee());
hotelOrderDetail.setStandardItems(hotelOrderInfoEntity.getTPMaxPrice());
hotelOrderDetail.setOverStandardReason(hotelOrderInfoEntity.getLowPriceRCInfo());
hotelOrderDetail.setOverStandard(hotelOrderInfoEntity.getLowPriceRCInfo() == null ? "":""); //是否超标
hotelOrderDetail.setOverStandard(hotelOrderInfoEntity.getLowPriceRCInfo() == null ? "" : ""); //是否超标
if (hotelOrderInfoEntity.getHotelType().equals("协议酒店")){
if (hotelOrderInfoEntity.getHotelType().equals("协议酒店")) {
hotelOrderDetail.setAgreementHotel("");
}else {
} else {
hotelOrderDetail.setAgreementHotel("");
}
ClientInfo clientInfo = null;
if (!hotelOrderInfoEntity.getClientInfo().isEmpty()) {
clientInfo = hotelOrderInfoEntity.getClientInfo().get(0);
@ -418,13 +404,8 @@ public class CTripOrderExtensionFactoryImpl implements OrderExtensionFactory {
hotelOrderDetail.setBOOK_ORG_STRUCT_1(clientInfo.getDept1());
hotelOrderDetail.setBOOK_ORG_STRUCT_2(clientInfo.getDept2());
hotelOrderDetail.setBOOK_ORG_STRUCT_3(clientInfo.getDept3());
//
//
}
}
return hotelOrderDetail;
}

View File

@ -101,7 +101,7 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
FlightOrderDetail flightOrderDetail = new FlightOrderDetail();
if (approveOrderNo != null){
flightOrderDetail.setAccountCompanyId(approveOrderNo.getAccountCompany());
flightOrderDetail.setAccountCompanyId(approveOrderNo.getAccountCompanyCode());
flightOrderDetail.setAccountCompanyName(approveOrderNo.getAccountCompanyName());
flightOrderDetail.setCostCenter(approveOrderNo.getCostCenter());
flightOrderDetail.setProjectOrderNo(approveOrderNo.getProjectName());
@ -341,7 +341,9 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
ApproveOrderNo approveOrderNo = routeOrder.getApproveOrderNo();
if (approveOrderNo != null){
hotelOrderDetail.setAccountCompanyId(approveOrderNo.getAccountCompany());
// hotelOrderDetail.setAccountCompanyId(approveOrderNo.getAccountCompany());
hotelOrderDetail.setAccountCompanyId(approveOrderNo.getAccountCompanyCode());
hotelOrderDetail.setAccountCompanyName(approveOrderNo.getAccountCompanyName());
hotelOrderDetail.setCostCenter(approveOrderNo.getCostCenter());
hotelOrderDetail.setProjectOrderNo(approveOrderNo.getProjectName());
@ -474,7 +476,7 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
ApproveOrderNo approveOrderNo = routeOrder.getApproveOrderNo();
if (approveOrderNo != null){
trainOrderDetail.setAccountCompanyId(approveOrderNo.getAccountCompany());
trainOrderDetail.setAccountCompanyId(approveOrderNo.getAccountCompanyCode());
trainOrderDetail.setAccountCompanyName(approveOrderNo.getAccountCompanyName());
trainOrderDetail.setCostCenter(approveOrderNo.getCostCenter());
trainOrderDetail.setProjectOrderNo(approveOrderNo.getProjectName());
@ -606,7 +608,7 @@ public class LYOrderExtensionFactoryImpl implements OrderExtensionFactory {
ApproveOrderNo approveOrderNo = routeOrder.getApproveOrderNo();
if (approveOrderNo != null){
carOrderDetail.setAccountCompanyId(approveOrderNo.getAccountCompany());
carOrderDetail.setAccountCompanyId(approveOrderNo.getAccountCompanyCode());
carOrderDetail.setAccountCompanyName(approveOrderNo.getAccountCompanyName());
carOrderDetail.setCostCenter(approveOrderNo.getCostCenter());
carOrderDetail.setProjectOrderNo(approveOrderNo.getProjectName());

View File

@ -0,0 +1,19 @@
package com.chint.infrastructure.constant;
public class BelongSystemConstant {
public static final String TRAVAL_SYS_TYPE_CTRIP = "XC";
public static final String TRAVAL_SYS_TYPE_LY = "TC";
public static final String BELONG_SYS_CODE_FSSC = "CTrip";
public static final String BELONG_SYS_CODE_H3BPM = "CTrip";
public static final String SUPPLIER_C_TRIP_CN_NAME = "携程";
public static final String SUPPLIER_C_TRIP_EXTENSION_NAME = "携程预定";
public static final String SUPPLIER_C_TRIP_BPM_NAME = "携程商旅";
public static final String SUPPLIER_L_Y = "LY";
public static final String SUPPLIER_L_Y_CN_NAME = "同程";
public static final String SUPPLIER_L_Y_EXTENSION_NAME = "同程预定";
public static final String SUPPLIER_L_Y_BPM_NAME = "同程商旅";
}