fix(优惠券中心):携程接口优化
This commit is contained in:
+15
@@ -94,6 +94,21 @@ public class CtripOrderItem implements Serializable {
|
||||
*/
|
||||
private LocalDate useEndDate;
|
||||
|
||||
/**
|
||||
* 凭证ID(用于PayPreOrderConfirm)
|
||||
*/
|
||||
private String voucherId;
|
||||
|
||||
/**
|
||||
* 乘客ID(用于PayPreOrderConfirm)
|
||||
*/
|
||||
private String passengerId;
|
||||
|
||||
/**
|
||||
* 乘客凭证ID(用于PayPreOrderConfirm,与voucherId不同)
|
||||
*/
|
||||
private String passengerVoucherId;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
|
||||
+9
@@ -37,4 +37,13 @@ public interface CtripOrderItemMapper extends BaseMapper<CtripOrderItem> {
|
||||
* @return 订单项信息
|
||||
*/
|
||||
CtripOrderItem selectByOrderIdAndItemId(@Param("orderId") Long orderId, @Param("itemId") String itemId);
|
||||
|
||||
/**
|
||||
* 根据携程订单号和订单项编号查询订单项
|
||||
*
|
||||
* @param otaOrderId 携程订单号
|
||||
* @param itemId 订单项编号
|
||||
* @return 订单项信息
|
||||
*/
|
||||
CtripOrderItem selectByOtaOrderIdAndItemId(@Param("otaOrderId") String otaOrderId, @Param("itemId") String itemId);
|
||||
}
|
||||
+29
-54
@@ -3,96 +3,71 @@ package com.central.coupon.model;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 携程订单取消请求
|
||||
* 提供携程与供应商系统进行订单取消操作的接口
|
||||
* 携程取消订单请求模型
|
||||
* 参考文档: https://open.trip.com/apiplatform/order.jsp#operation/CancelOrder
|
||||
*/
|
||||
@Data
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class CtripCancelOrderRequest {
|
||||
|
||||
/**
|
||||
* 请求头
|
||||
*/
|
||||
@JsonProperty("header")
|
||||
private CtripHeader header;
|
||||
|
||||
/**
|
||||
* 请求体 - 可能是加密字符串或JSON对象
|
||||
*/
|
||||
@JsonProperty("body")
|
||||
private Object body;
|
||||
private String body; // 加密的请求体
|
||||
|
||||
/**
|
||||
* 携程请求头
|
||||
*/
|
||||
@Data
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public static class CtripHeader {
|
||||
@JsonProperty("accountId")
|
||||
private String accountId; // 供应商帐号,由携程分配
|
||||
private String accountId;
|
||||
|
||||
@JsonProperty("serviceName")
|
||||
private String serviceName; // 接口名称: CancelOrder
|
||||
private String serviceName;
|
||||
|
||||
@JsonProperty("requestTime")
|
||||
private String requestTime; // 请求时间(格式: yyyy-MM-dd HH:mm:ss)
|
||||
private String requestTime;
|
||||
|
||||
@JsonProperty("version")
|
||||
private String version; // 版本号, 1.0
|
||||
private String version;
|
||||
|
||||
@JsonProperty("sign")
|
||||
private String sign; // 签名
|
||||
private String sign;
|
||||
}
|
||||
|
||||
/**
|
||||
* 携程订单取消体
|
||||
*/
|
||||
@Data
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public static class CtripCancelOrderBody {
|
||||
@JsonProperty("sequenceId")
|
||||
private String sequenceId; // 携程处理批次流水号
|
||||
private String sequenceId; // 携程处理批次流水号
|
||||
|
||||
@JsonProperty("otaOrderId")
|
||||
private String otaOrderId; // 携程订单号
|
||||
private String otaOrderId; // 携程订单号
|
||||
|
||||
@JsonProperty("supplierOrderId")
|
||||
private String supplierOrderId; // 供应商订单号
|
||||
private String supplierOrderId; // 供应商订单号
|
||||
|
||||
@JsonProperty("cancelReason")
|
||||
private String cancelReason; // 取消原因
|
||||
|
||||
@JsonProperty("confirmType")
|
||||
private Integer confirmType; // 确认类型:1-仅通知,2-供应商确认
|
||||
private Integer confirmType; // 确认类型:1-仅通知,2-供应商确认
|
||||
|
||||
@JsonProperty("items")
|
||||
private List<CtripCancelOrderItem> items; // 订单项节点
|
||||
private List<CtripCancelOrderItem> items; // 取消的订单项列表
|
||||
}
|
||||
|
||||
/**
|
||||
* 携程订单取消项
|
||||
*/
|
||||
@Data
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public static class CtripCancelOrderItem {
|
||||
@JsonProperty("itemId")
|
||||
private String itemId; // 订单项编号
|
||||
@JsonProperty("PLU")
|
||||
private String PLU; // 供应商产品最小单位
|
||||
@JsonProperty("lastConfirmTime")
|
||||
private String lastConfirmTime; // 供应商最晚确认时间
|
||||
@JsonProperty("cancelType")
|
||||
private Integer cancelType; // 退订类型:0-全退,1-按份数部分退,2-按出行人部分退
|
||||
@JsonProperty("quantity")
|
||||
private Integer quantity; // 本次请求取消份数
|
||||
@JsonProperty("passengers")
|
||||
private List<CtripCancelPassenger> passengers; // 退订出行人节点
|
||||
@JsonProperty("amount")
|
||||
private BigDecimal amount; // 被取消的退款金额
|
||||
@JsonProperty("amountCurrency")
|
||||
private String amountCurrency; // 被取消的退款金额单位
|
||||
}
|
||||
|
||||
/**
|
||||
* 携程取消出行人信息
|
||||
*/
|
||||
@Data
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public static class CtripCancelPassenger {
|
||||
@JsonProperty("passengerId")
|
||||
private String passengerId; // 出行人编号
|
||||
private String itemId; // 订单项ID
|
||||
|
||||
@JsonProperty("cancelQuantity")
|
||||
private Integer cancelQuantity; // 取消数量
|
||||
}
|
||||
}
|
||||
+61
-44
@@ -1,75 +1,92 @@
|
||||
package com.central.coupon.model;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 携程订单取消响应
|
||||
* 当confirmType=2在取消发起时必须验证取消数量等于可退数量
|
||||
* 携程取消订单响应模型
|
||||
* 参考文档: https://open.trip.com/apiplatform/order.jsp#operation/CancelOrder
|
||||
*/
|
||||
@Data
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class CtripCancelOrderResponse {
|
||||
|
||||
/**
|
||||
* 返回头
|
||||
*/
|
||||
|
||||
@JsonProperty("header")
|
||||
private CtripResponseHeader header;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 返回体(传输时该字段需要AES加密)
|
||||
*/
|
||||
@JsonProperty("body")
|
||||
private CtripResponseBody body;
|
||||
|
||||
/**
|
||||
* 携程返回头
|
||||
*/
|
||||
private String body; // 加密的响应体
|
||||
|
||||
@Data
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public static class CtripResponseHeader {
|
||||
@JsonProperty("resultCode")
|
||||
private String resultCode; // 处理结果返回码
|
||||
private String resultCode;
|
||||
|
||||
@JsonProperty("resultMessage")
|
||||
private String resultMessage; // 处理结果返回信息
|
||||
private String resultMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* 携程返回体
|
||||
*/
|
||||
|
||||
@Data
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public static class CtripResponseBody {
|
||||
public static class CtripCancelOrderResponseBody {
|
||||
@JsonProperty("otaOrderId")
|
||||
private String otaOrderId; // 携程订单号
|
||||
|
||||
@JsonProperty("supplierOrderId")
|
||||
private String supplierOrderId; // 供应商订单号
|
||||
|
||||
@JsonProperty("supplierConfirmType")
|
||||
private Integer supplierConfirmType; // 供应商确认类型:1-取消已确认,2-取消待确认
|
||||
private Integer supplierConfirmType; // 供应商确认类型:1-确认,2-拒绝
|
||||
|
||||
@JsonProperty("items")
|
||||
private List<CtripResponseOrderItem> items; // 订单项节点
|
||||
private List<CtripCancelOrderResponseItem> items; // 订单项列表
|
||||
}
|
||||
|
||||
/**
|
||||
* 携程返回订单项
|
||||
*/
|
||||
|
||||
@Data
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public static class CtripResponseOrderItem {
|
||||
public static class CtripCancelOrderResponseItem {
|
||||
@JsonProperty("itemId")
|
||||
private String itemId; // 订单项编号
|
||||
private String itemId; // 订单项ID
|
||||
|
||||
@JsonProperty("useStartDate")
|
||||
private String useStartDate; // 使用开始日期
|
||||
|
||||
@JsonProperty("useEndDate")
|
||||
private String useEndDate; // 使用结束日期
|
||||
|
||||
@JsonProperty("orderStatus")
|
||||
private Integer orderStatus; // 订单状态:10-已取消
|
||||
|
||||
@JsonProperty("quantity")
|
||||
private Integer quantity; // 总数量
|
||||
|
||||
@JsonProperty("useQuantity")
|
||||
private Integer useQuantity; // 已使用数量
|
||||
|
||||
@JsonProperty("cancelQuantity")
|
||||
private Integer cancelQuantity; // 取消数量
|
||||
|
||||
@JsonProperty("passengers")
|
||||
private List<CtripPassenger> passengers; // 乘客信息
|
||||
|
||||
@JsonProperty("vouchers")
|
||||
private List<CtripVoucher> vouchers; // 已取消的凭证
|
||||
private List<CtripVoucher> vouchers; // 凭证信息
|
||||
}
|
||||
|
||||
/**
|
||||
* 携程凭证
|
||||
*/
|
||||
|
||||
@Data
|
||||
public static class CtripPassenger {
|
||||
@JsonProperty("passengerId")
|
||||
private String passengerId; // 乘客ID
|
||||
|
||||
@JsonProperty("passengerStatus")
|
||||
private Integer passengerStatus; // 乘客状态:2-已取消
|
||||
}
|
||||
|
||||
@Data
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public static class CtripVoucher {
|
||||
@JsonProperty("voucherId")
|
||||
private String voucherId; // 凭证编号
|
||||
private String voucherId; // 凭证ID
|
||||
|
||||
@JsonProperty("voucherStatus")
|
||||
private Integer voucherStatus; // 凭证状态:2-已取消
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -131,7 +131,7 @@ public interface ICtripOrderService {
|
||||
* @param body 取消订单体
|
||||
* @return 取消订单项响应列表
|
||||
*/
|
||||
java.util.List<CtripCancelOrderResponse.CtripResponseOrderItem> generateCancelOrderItems(
|
||||
java.util.List<CtripCancelOrderResponse.CtripCancelOrderResponseItem> generateCancelOrderItems(
|
||||
CtripCancelOrderRequest.CtripCancelOrderBody body);
|
||||
|
||||
/**
|
||||
|
||||
+27
-11
@@ -29,6 +29,8 @@ import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import com.central.coupon.util.CtripDecryptUtil;
|
||||
|
||||
/**
|
||||
* 携程订单服务实现类
|
||||
@@ -74,6 +76,12 @@ public class CtripOrderServiceImpl implements ICtripOrderService {
|
||||
@Autowired
|
||||
private CtripVoucherMapper ctripVoucherMapper;
|
||||
|
||||
@Autowired
|
||||
private ObjectMapper objectMapper;
|
||||
|
||||
@Autowired
|
||||
private CtripDecryptUtil ctripDecryptUtil;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public CtripCreateOrderResponse processCreateOrder(CtripCreateOrderRequest.CtripHeader header,
|
||||
@@ -114,9 +122,9 @@ public class CtripOrderServiceImpl implements ICtripOrderService {
|
||||
// 1. 验证取消数量
|
||||
if (body.getConfirmType() == 2) {
|
||||
for (CtripCancelOrderRequest.CtripCancelOrderItem item : body.getItems()) {
|
||||
if (!validateCancelQuantity(body.getOtaOrderId(), body.getSupplierOrderId(), item.getItemId(), item.getQuantity())) {
|
||||
log.error("取消数量验证失败,otaOrderId: {}, itemId: {}, quantity: {}",
|
||||
body.getOtaOrderId(), item.getItemId(), item.getQuantity());
|
||||
if (!validateCancelQuantity(body.getOtaOrderId(), body.getSupplierOrderId(), item.getItemId(), item.getCancelQuantity())) {
|
||||
log.error("取消数量验证失败,otaOrderId: {}, itemId: {}, cancelQuantity: {}",
|
||||
body.getOtaOrderId(), item.getItemId(), item.getCancelQuantity());
|
||||
return buildCancelErrorResponse(header, CtripResponseCodeUtil.CtripResponseCodes.ORDER_STATUS_ERROR, "取消数量大于可退数量");
|
||||
}
|
||||
}
|
||||
@@ -266,7 +274,7 @@ public class CtripOrderServiceImpl implements ICtripOrderService {
|
||||
CtripOrderItem orderItem = ctripOrderItemMapper.selectByOrderIdAndItemId(order.getId(), cancelItem.getItemId());
|
||||
if (orderItem != null) {
|
||||
// 更新订单项数量(减少取消的数量)
|
||||
int newQuantity = orderItem.getQuantity() - cancelItem.getQuantity();
|
||||
int newQuantity = orderItem.getQuantity() - cancelItem.getCancelQuantity();
|
||||
if (newQuantity >= 0) {
|
||||
orderItem.setQuantity(newQuantity);
|
||||
orderItem.setUpdateTime(LocalDateTime.now());
|
||||
@@ -762,14 +770,14 @@ public class CtripOrderServiceImpl implements ICtripOrderService {
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CtripCancelOrderResponse.CtripResponseOrderItem> generateCancelOrderItems(
|
||||
public List<CtripCancelOrderResponse.CtripCancelOrderResponseItem> generateCancelOrderItems(
|
||||
CtripCancelOrderRequest.CtripCancelOrderBody body) {
|
||||
log.info("开始生成取消订单项响应,otaOrderId: {}", body.getOtaOrderId());
|
||||
|
||||
List<CtripCancelOrderResponse.CtripResponseOrderItem> items = new ArrayList<>();
|
||||
List<CtripCancelOrderResponse.CtripCancelOrderResponseItem> items = new ArrayList<>();
|
||||
|
||||
for (CtripCancelOrderRequest.CtripCancelOrderItem item : body.getItems()) {
|
||||
CtripCancelOrderResponse.CtripResponseOrderItem responseItem = new CtripCancelOrderResponse.CtripResponseOrderItem();
|
||||
CtripCancelOrderResponse.CtripCancelOrderResponseItem responseItem = new CtripCancelOrderResponse.CtripCancelOrderResponseItem();
|
||||
responseItem.setItemId(item.getItemId());
|
||||
|
||||
// 生成已取消的凭证
|
||||
@@ -856,14 +864,22 @@ public class CtripOrderServiceImpl implements ICtripOrderService {
|
||||
response.setHeader(responseHeader);
|
||||
|
||||
// 设置响应体
|
||||
CtripCancelOrderResponse.CtripResponseBody responseBody = new CtripCancelOrderResponse.CtripResponseBody();
|
||||
responseBody.setSupplierConfirmType(1); // 取消已确认
|
||||
CtripCancelOrderResponse.CtripCancelOrderResponseBody responseBody = new CtripCancelOrderResponse.CtripCancelOrderResponseBody();
|
||||
responseBody.setOtaOrderId(body.getOtaOrderId());
|
||||
responseBody.setSupplierOrderId(body.getSupplierOrderId());
|
||||
|
||||
// 生成取消订单项响应
|
||||
List<CtripCancelOrderResponse.CtripResponseOrderItem> items = generateCancelOrderItems(body);
|
||||
List<CtripCancelOrderResponse.CtripCancelOrderResponseItem> items = generateCancelOrderItems(body);
|
||||
responseBody.setItems(items);
|
||||
|
||||
response.setBody(responseBody);
|
||||
// 加密响应体
|
||||
try {
|
||||
String encryptedBody = ctripDecryptUtil.encryptAES(objectMapper.writeValueAsString(responseBody));
|
||||
response.setBody(encryptedBody);
|
||||
} catch (Exception e) {
|
||||
log.error("加密响应体失败", e);
|
||||
return buildCancelErrorResponse(header, CtripResponseCodeUtil.CtripResponseCodes.SYSTEM_ERROR, "响应体加密失败");
|
||||
}
|
||||
|
||||
log.info("构建取消成功响应完成,otaOrderId: {}", body.getOtaOrderId());
|
||||
return response;
|
||||
|
||||
+67
-18
@@ -453,27 +453,35 @@ public class CtripDecryptUtil {
|
||||
sb.append(serviceName != null ? serviceName : "");
|
||||
sb.append(requestTime != null ? requestTime : "");
|
||||
|
||||
// 确保body是紧凑的JSON格式(无多余空格和换行)
|
||||
String compactBody = body;
|
||||
// 对于签名验证,直接使用原始body,不进行JSON格式化
|
||||
// 因为携程发送的body可能是加密字符串,不是JSON格式
|
||||
String bodyForSign = body;
|
||||
if (body != null) {
|
||||
try {
|
||||
// 尝试多种JSON处理方式
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
objectMapper.configure(com.fasterxml.jackson.core.JsonGenerator.Feature.WRITE_NUMBERS_AS_STRINGS, false);
|
||||
objectMapper.configure(com.fasterxml.jackson.databind.SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS, true);
|
||||
|
||||
// 先尝试解析为Map,然后重新序列化
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, Object> jsonMap = objectMapper.readValue(body, Map.class);
|
||||
compactBody = objectMapper.writeValueAsString(jsonMap);
|
||||
|
||||
log.debug("JSON格式化结果: {}", compactBody);
|
||||
} catch (Exception e) {
|
||||
log.warn("JSON格式化失败,使用原始body: {}", e.getMessage());
|
||||
compactBody = body;
|
||||
// 检查body是否是有效的JSON格式
|
||||
if (body.trim().startsWith("{") && body.trim().endsWith("}")) {
|
||||
try {
|
||||
// 只有确认是JSON格式时才进行格式化
|
||||
ObjectMapper objectMapper = new ObjectMapper();
|
||||
objectMapper.configure(com.fasterxml.jackson.core.JsonGenerator.Feature.WRITE_NUMBERS_AS_STRINGS, false);
|
||||
objectMapper.configure(com.fasterxml.jackson.databind.SerializationFeature.ORDER_MAP_ENTRIES_BY_KEYS, true);
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
Map<String, Object> jsonMap = objectMapper.readValue(body, Map.class);
|
||||
bodyForSign = objectMapper.writeValueAsString(jsonMap);
|
||||
|
||||
log.debug("JSON格式化结果: {}", bodyForSign);
|
||||
} catch (Exception e) {
|
||||
log.debug("JSON格式化失败,使用原始body: {}", e.getMessage());
|
||||
bodyForSign = body;
|
||||
}
|
||||
} else {
|
||||
// 不是JSON格式(可能是加密字符串),直接使用原始body
|
||||
log.debug("body不是JSON格式,直接使用原始body进行签名");
|
||||
bodyForSign = body;
|
||||
}
|
||||
}
|
||||
sb.append(compactBody != null ? compactBody : "");
|
||||
|
||||
sb.append(bodyForSign != null ? bodyForSign : "");
|
||||
sb.append(version != null ? version : "");
|
||||
// 使用账户密钥而不是单独的签名密钥
|
||||
sb.append(accountSecret != null ? accountSecret : "");
|
||||
@@ -564,4 +572,45 @@ public class CtripDecryptUtil {
|
||||
public String getAesIv() {
|
||||
return aesIv;
|
||||
}
|
||||
|
||||
/**
|
||||
* 测试特定场景的签名计算
|
||||
* 用于调试实际的携程请求
|
||||
*/
|
||||
public void testSpecificScenario() {
|
||||
try {
|
||||
log.info("=== 测试特定场景签名计算 ===");
|
||||
|
||||
// 使用日志中的实际数据
|
||||
String accountId = "c50a8f2a4a59c9e7";
|
||||
String serviceName = "QueryOrder";
|
||||
String requestTime = "2025-08-26 12:19:31";
|
||||
String encryptedBody = "eehodncdippnljpadokdehbpaheoaofpkmnlndpiablomiamepgkbgbiaghlhcffffoemepcnbnbnimkomidjidnlpfcaecakbocfpdpkmhcejelamhaplbofamkgaadlplpbhbfkmpckdioahheifjhgonkaimckfajdmnjjghofndadhkieacdgeakemiloehcaddlcpffidienipihmcdjbhicjggehakhflnbohhackfjjajoegafekfdgdcmopojmjmimbegcdoffpkifpemeoleaadfpknbjpomlcaimjpjjddcbeejeaidgjfhndhgnefhhagehicmfjppcpbigmoglpkbkadkcjlnfoaeooejhmbolendokblhfe";
|
||||
String version = "1.0";
|
||||
String expectedSign = "66be9cfafed2f88fd1418927ce2db876";
|
||||
|
||||
log.info("测试参数:");
|
||||
log.info(" accountId: {}", accountId);
|
||||
log.info(" serviceName: {}", serviceName);
|
||||
log.info(" requestTime: {}", requestTime);
|
||||
log.info(" encryptedBody长度: {}", encryptedBody.length());
|
||||
log.info(" version: {}", version);
|
||||
log.info(" expectedSign: {}", expectedSign);
|
||||
log.info(" accountSecret: {}", accountSecret);
|
||||
|
||||
// 计算签名
|
||||
String calculatedSign = generateSign(accountId, serviceName, requestTime, encryptedBody, version);
|
||||
|
||||
log.info("计算结果:");
|
||||
log.info(" calculatedSign: {}", calculatedSign);
|
||||
log.info(" isMatch: {}", calculatedSign != null && calculatedSign.equalsIgnoreCase(expectedSign));
|
||||
|
||||
// 详细调试
|
||||
Map<String, Object> debugInfo = debugSignCalculation(accountId, serviceName, requestTime, encryptedBody, version, expectedSign);
|
||||
log.info("调试信息: {}", debugInfo);
|
||||
|
||||
} catch (Exception e) {
|
||||
log.error("测试特定场景失败: {}", e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,9 @@
|
||||
total_price,
|
||||
currency,
|
||||
quantity,
|
||||
voucher_id,
|
||||
passenger_id,
|
||||
passenger_voucher_id,
|
||||
create_time,
|
||||
update_time,
|
||||
create_by,
|
||||
@@ -46,6 +49,9 @@
|
||||
total_price,
|
||||
currency,
|
||||
quantity,
|
||||
voucher_id,
|
||||
passenger_id,
|
||||
passenger_voucher_id,
|
||||
create_time,
|
||||
update_time,
|
||||
create_by,
|
||||
@@ -73,6 +79,9 @@
|
||||
total_price,
|
||||
currency,
|
||||
quantity,
|
||||
voucher_id,
|
||||
passenger_id,
|
||||
passenger_voucher_id,
|
||||
create_time,
|
||||
update_time,
|
||||
create_by,
|
||||
@@ -85,4 +94,37 @@
|
||||
AND deleted = 0
|
||||
</select>
|
||||
|
||||
<!-- 根据携程订单号和订单项编号查询订单项 -->
|
||||
<select id="selectByOtaOrderIdAndItemId" resultType="com.central.coupon.entity.CtripOrderItem">
|
||||
SELECT
|
||||
oi.id,
|
||||
oi.order_id,
|
||||
oi.item_id,
|
||||
oi.item_name,
|
||||
oi.item_type,
|
||||
oi.plu,
|
||||
oi.use_start_date,
|
||||
oi.use_end_date,
|
||||
oi.price,
|
||||
oi.sale_price,
|
||||
oi.total_price,
|
||||
oi.currency,
|
||||
oi.quantity,
|
||||
oi.voucher_id,
|
||||
oi.passenger_id,
|
||||
oi.passenger_voucher_id,
|
||||
oi.create_time,
|
||||
oi.update_time,
|
||||
oi.create_by,
|
||||
oi.update_by,
|
||||
oi.remark,
|
||||
oi.tenant_id
|
||||
FROM t_ctrip_order_item oi
|
||||
INNER JOIN t_ctrip_order o ON oi.order_id = o.id
|
||||
WHERE o.ota_order_id = #{otaOrderId}
|
||||
AND oi.item_id = #{itemId}
|
||||
AND oi.deleted = 0
|
||||
AND o.deleted = 0
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user