Browse Source
真实 /pb/mp/order/v2/list 响应与文档摘录不一致,原 DTO 字段名全部落空, channelOrderId 为 null,导致 SalesOrder 构造抛 NPE。 - 订单字段改为 global_order_no / amount_currency / status / item_info / platform_info / transaction_info - 平台单号从 platform_info[] 取,合并单排序后取第一个,保证 canonicalKey 稳定 - 收货国家取 platform_info[].store_Country_code - 下单时间取 global_purchase_time,缺失时回落 platform_info[].purchase_time - 金额清洗币种符号与千分位(¥49.16 → 49.16) - 夹具与映射测试按真实结构重写feature/supplier-lingxing
7 changed files with 452 additions and 166 deletions
@ -0,0 +1,54 @@
@@ -0,0 +1,54 @@
|
||||
package common.ecommerce.lingxing.dto; |
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
||||
import com.fasterxml.jackson.annotation.JsonProperty; |
||||
import lombok.Getter; |
||||
import lombok.Setter; |
||||
|
||||
/** |
||||
* 领星订单的平台单信息({@code data.list[].platform_info[]})。 |
||||
* |
||||
* <p>注意 {@code platform_code} 在这里是<b>字符串</b>(如 {@code "10008"}), |
||||
* 而请求参数里是整数数组。</p> |
||||
*/ |
||||
@Getter |
||||
@Setter |
||||
@JsonIgnoreProperties(ignoreUnknown = true) |
||||
public class LingxingPlatformInfoDto { |
||||
|
||||
/** 平台 CODE,字符串形态。 */ |
||||
@JsonProperty("platform_code") |
||||
private String platformCode; |
||||
|
||||
/** 平台订单唯一标识;Shopify 下与 platform_order_name 不同。 */ |
||||
@JsonProperty("platform_order_no") |
||||
private String platformOrderNo; |
||||
|
||||
/** 平台订单编号(核对平台单号用这个)。 */ |
||||
@JsonProperty("platform_order_name") |
||||
private String platformOrderName; |
||||
|
||||
/** 收货国家二字码。注意官方字段名里 C 是大写。 */ |
||||
@JsonProperty("store_Country_code") |
||||
private String storeCountryCode; |
||||
|
||||
/** 平台单状态。 */ |
||||
@JsonProperty("status") |
||||
private String status; |
||||
|
||||
/** 平台支付状态。 */ |
||||
@JsonProperty("payment_status") |
||||
private String paymentStatus; |
||||
|
||||
/** 平台发货状态。 */ |
||||
@JsonProperty("shipping_status") |
||||
private String shippingStatus; |
||||
|
||||
/** 平台订购时间,epoch 秒。 */ |
||||
@JsonProperty("purchase_time") |
||||
private Long purchaseTime; |
||||
|
||||
/** 平台发货时间,epoch 秒。 */ |
||||
@JsonProperty("delivery_time") |
||||
private Long deliveryTime; |
||||
} |
||||
@ -0,0 +1,30 @@
@@ -0,0 +1,30 @@
|
||||
package common.ecommerce.lingxing.dto; |
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
||||
import com.fasterxml.jackson.annotation.JsonProperty; |
||||
import lombok.Getter; |
||||
import lombok.Setter; |
||||
|
||||
/** |
||||
* 领星订单的交易信息({@code data.list[].transaction_info[]})。 |
||||
* |
||||
* <p>金额是带币种符号的字符串(如 {@code "¥49.16"}),由 mapper 清洗后再转 |
||||
* {@link common.ecommerce.model.support.Money}。</p> |
||||
*/ |
||||
@Getter |
||||
@Setter |
||||
@JsonIgnoreProperties(ignoreUnknown = true) |
||||
public class LingxingTransactionInfoDto { |
||||
|
||||
/** 订单总额。 */ |
||||
@JsonProperty("order_total_amount") |
||||
private String orderTotalAmount; |
||||
|
||||
/** 商品金额。 */ |
||||
@JsonProperty("order_item_amount") |
||||
private String orderItemAmount; |
||||
|
||||
/** 折扣金额。 */ |
||||
@JsonProperty("discount_amount") |
||||
private String discountAmount; |
||||
} |
||||
Loading…
Reference in new issue