diff --git a/lingxing/src/main/java/common/ecommerce/lingxing/LingxingApi.java b/lingxing/src/main/java/common/ecommerce/lingxing/LingxingApi.java index e4e4e82..ee149f2 100644 --- a/lingxing/src/main/java/common/ecommerce/lingxing/LingxingApi.java +++ b/lingxing/src/main/java/common/ecommerce/lingxing/LingxingApi.java @@ -23,6 +23,18 @@ public enum LingxingApi { /** 亚马逊 SC 店铺列表(企业已授权的全部 SC 店铺)。GET,非分页。 */ SHOP_LIST_AMAZON_SC("/erp/sc/data/seller/lists", 1), + /** 亚马逊 VC 店铺列表。POST,offset/length 分页,上限 200。 */ + SHOP_LIST_AMAZON_VC("/basicOpen/platformAuth/vcSeller/pageList", 1), + + /** 亚马逊 VC 订单列表(DF / PO / DI)。POST,offset/length 分页,上限 200。 */ + ORDER_LIST_AMAZON_VC("/basicOpen/platformOrder/vcOrder/pageList", 1), + + /** 亚马逊 VC 订单详情【DF】。POST,入参 vc_store_id + purchase_order_number。 */ + ORDER_DETAIL_DF_AMAZON_VC("/basicOpen/platformOrder/vcOrderDf/detail", 1), + + /** 亚马逊 VC 订单详情【PO】。POST,入参 local_po_number。 */ + ORDER_DETAIL_PO_AMAZON_VC("/basicOpen/platformOrder/vcOrderPo/detail", 1), + /** 亚马逊 SC Listing 列表。POST,offset/length 分页,上限 1000。 */ LISTING_AMAZON_SC("/erp/sc/data/mws/listing", 1), diff --git a/lingxing/src/main/java/common/ecommerce/lingxing/LingxingConstants.java b/lingxing/src/main/java/common/ecommerce/lingxing/LingxingConstants.java index 3b7a3a7..f7fde15 100644 --- a/lingxing/src/main/java/common/ecommerce/lingxing/LingxingConstants.java +++ b/lingxing/src/main/java/common/ecommerce/lingxing/LingxingConstants.java @@ -28,6 +28,8 @@ public final class LingxingConstants { /** 亚马逊 SC 的领星 platform_code。 */ public static final int PLATFORM_CODE_AMAZON = 10001; + /** 亚马逊 VC 的领星 platform_code。 */ + public static final int PLATFORM_CODE_AMAZON_VC = 10035; /** 多平台订单列表令牌桶:10 req/s(亚马逊/VC/Walmart 接口是 1 req/s)。 */ public static final int ORDER_LIST_PER_SECOND = 10; @@ -44,6 +46,11 @@ public final class LingxingConstants { /** 亚马逊 FBM 订单分页 length:文档默认 100,未给上限,按默认值取。 */ public static final int FBM_MAX_PAGE_SIZE = 100; + /** 亚马逊 VC 接口(店铺 / 订单列表)分页 length 上限。 */ + public static final int VC_MAX_PAGE_SIZE = 200; + /** 亚马逊 VC 订单查询时间跨度上限:90 天。 */ + public static final int VC_MAX_QUERY_DAYS = 90; + /** 结算交易明细分页 length 上限。 */ public static final int SETTLEMENT_MAX_PAGE_SIZE = 10000; /** 结算时间查询跨度上限:7 天(双闭区间)。 */ diff --git a/lingxing/src/main/java/common/ecommerce/lingxing/platform/LingxingSubPlatforms.java b/lingxing/src/main/java/common/ecommerce/lingxing/platform/LingxingSubPlatforms.java index b31e11f..c931ed8 100644 --- a/lingxing/src/main/java/common/ecommerce/lingxing/platform/LingxingSubPlatforms.java +++ b/lingxing/src/main/java/common/ecommerce/lingxing/platform/LingxingSubPlatforms.java @@ -3,6 +3,8 @@ package common.ecommerce.lingxing.platform; import common.ecommerce.error.ChannelException; import common.ecommerce.http.JacksonJsonCodec; import common.ecommerce.http.OkHttpTransport; +import common.ecommerce.lingxing.platform.amazon.AmazonScSubPlatform; +import common.ecommerce.lingxing.platform.amazon.AmazonVcSubPlatform; import common.ecommerce.model.Platform; import common.ecommerce.lingxing.platform.walmart.WalmartSubPlatform; @@ -30,8 +32,8 @@ public final class LingxingSubPlatforms { static { Map map = new EnumMap(Platform.class); register(map, new WalmartSubPlatform(SHARED_TRANSPORT, SHARED_JSON)); - register(map, new common.ecommerce.lingxing.platform.amazon.AmazonScSubPlatform( - SHARED_TRANSPORT, SHARED_JSON)); + register(map, new AmazonScSubPlatform(SHARED_TRANSPORT, SHARED_JSON)); + register(map, new AmazonVcSubPlatform(SHARED_TRANSPORT, SHARED_JSON)); // eBay、SHEIN… 落地后继续 register(...) BY_PLATFORM = Collections.unmodifiableMap(map); } diff --git a/lingxing/src/main/java/common/ecommerce/lingxing/platform/amazon/AmazonVcSubPlatform.java b/lingxing/src/main/java/common/ecommerce/lingxing/platform/amazon/AmazonVcSubPlatform.java new file mode 100644 index 0000000..a4eadbc --- /dev/null +++ b/lingxing/src/main/java/common/ecommerce/lingxing/platform/amazon/AmazonVcSubPlatform.java @@ -0,0 +1,42 @@ +package common.ecommerce.lingxing.platform.amazon; + +import common.ecommerce.http.HttpTransport; +import common.ecommerce.http.JacksonJsonCodec; +import common.ecommerce.lingxing.platform.LingxingSubPlatform; +import common.ecommerce.lingxing.platform.amazon.vc.order.VcOrderSource; +import common.ecommerce.lingxing.platform.amazon.vc.shop.VcShopSource; +import common.ecommerce.lingxing.platform.order.LingxingOrderSource; +import common.ecommerce.lingxing.platform.shop.LingxingShopSource; +import common.ecommerce.model.Platform; + +/** + * 领星 · 亚马逊 VC 子平台:店铺与订单,只做能力组合。 + * + *

VC 目前没有商品与结算接口;能力由 Source 是否装配决定, + * 未装配的能力不会被声明。

+ */ +public final class AmazonVcSubPlatform implements LingxingSubPlatform { + + private final LingxingOrderSource orders; + private final LingxingShopSource shops; + + public AmazonVcSubPlatform(HttpTransport transport, JacksonJsonCodec json) { + this.orders = new VcOrderSource(); + this.shops = new VcShopSource(); + } + + @Override + public Platform platform() { + return Platform.AMAZON_VC; + } + + @Override + public LingxingOrderSource orderSource() { + return orders; + } + + @Override + public LingxingShopSource shopSource() { + return shops; + } +} diff --git a/lingxing/src/main/java/common/ecommerce/lingxing/platform/amazon/vc/dto/VcOrderDetailItemDto.java b/lingxing/src/main/java/common/ecommerce/lingxing/platform/amazon/vc/dto/VcOrderDetailItemDto.java new file mode 100644 index 0000000..f1da52f --- /dev/null +++ b/lingxing/src/main/java/common/ecommerce/lingxing/platform/amazon/vc/dto/VcOrderDetailItemDto.java @@ -0,0 +1,102 @@ +package common.ecommerce.lingxing.platform.amazon.vc.dto; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Getter; +import lombok.Setter; + +/** + * 领星 · 亚马逊 VC 订单详情的商品行(DF / PO 共用)。 + * + *

两套详情接口的字段高度重合,只有 {@code waiting_shipped_amount} 与 + * {@code to_ship_amount} 的区别,用同一个 DTO 接收,未知字段忽略。

+ */ +@Getter +@Setter +@JsonIgnoreProperties(ignoreUnknown = true) +public class VcOrderDetailItemDto { + + @JsonProperty("sequence_number") + private String sequenceNumber; + + @JsonProperty("asin") + private String asin; + + @JsonProperty("asin_url") + private String asinUrl; + + /** 平台 MSKU。 */ + @JsonProperty("msku") + private String msku; + + @JsonProperty("item_name") + private String itemName; + + @JsonProperty("large_main_image_url") + private String largeMainImageUrl; + + @JsonProperty("medium_main_image_url") + private String mediumMainImageUrl; + + @JsonProperty("small_main_image_url") + private String smallMainImageUrl; + + @JsonProperty("pic_url") + private String picUrl; + + @JsonProperty("local_sku") + private String localSku; + + @JsonProperty("local_name") + private String localName; + + /** 采购量;文档类型是 string。 */ + @JsonProperty("purchase_amount") + private String purchaseAmount; + + @JsonProperty("shipped_amount") + private String shippedAmount; + + /** DF 的待发货量。 */ + @JsonProperty("waiting_shipped_amount") + private String waitingShippedAmount; + + /** PO 的待发货量。 */ + @JsonProperty("to_ship_amount") + private String toShipAmount; + + @JsonProperty("available_amount") + private Integer availableAmount; + + /** 单价。 */ + @JsonProperty("unit_price") + private String unitPrice; + + /** 成本价。 */ + @JsonProperty("net_price") + private String netPrice; + + @JsonProperty("net_price_currency_code") + private String netPriceCurrencyCode; + + @JsonProperty("tax_amount") + private String taxAmount; + + @JsonProperty("tax_amount_currency_code") + private String taxAmountCurrencyCode; + + @JsonProperty("tax_rate") + private String taxRate; + + @JsonProperty("tax_rate_percent") + private String taxRatePercent; + + @JsonProperty("deal_total_price") + private String dealTotalPrice; + + @JsonProperty("deal_unit_price") + private String dealUnitPrice; + + @JsonProperty("is_back_order_allowed") + private String isBackOrderAllowed; +} diff --git a/lingxing/src/main/java/common/ecommerce/lingxing/platform/amazon/vc/dto/VcOrderDfDetailDto.java b/lingxing/src/main/java/common/ecommerce/lingxing/platform/amazon/vc/dto/VcOrderDfDetailDto.java new file mode 100644 index 0000000..19b3688 --- /dev/null +++ b/lingxing/src/main/java/common/ecommerce/lingxing/platform/amazon/vc/dto/VcOrderDfDetailDto.java @@ -0,0 +1,102 @@ +package common.ecommerce.lingxing.platform.amazon.vc.dto; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Getter; +import lombok.Setter; + +import java.util.ArrayList; +import java.util.List; + +/** + * 领星 · 亚马逊 VC 订单详情【DF】 + * ({@code /basicOpen/platformOrder/vcOrderDf/detail} 的 {@code data})。 + * + *

{@code data} 是对象,不是数组。

+ */ +@Getter +@Setter +@JsonIgnoreProperties(ignoreUnknown = true) +public class VcOrderDfDetailDto { + + @JsonProperty("vc_store_id") + private String vcStoreId; + + @JsonProperty("seller_name") + private String sellerName; + + @JsonProperty("local_po_number") + private String localPoNumber; + + @JsonProperty("purchase_order_number") + private String purchaseOrderNumber; + + /** 下单时间。 */ + @JsonProperty("purchase_order_date") + private String purchaseOrderDate; + + /** New / SHIPPED / ACCEPTED / CANCELED。 */ + @JsonProperty("purchase_order_state") + private String purchaseOrderState; + + /** 0 DF、1 PO。 */ + @JsonProperty("purchase_order_type") + private String purchaseOrderType; + + @JsonProperty("bill_to_party_id") + private String billToPartyId; + + @JsonProperty("ship_from_party_id") + private String shipFromPartyId; + + @JsonProperty("related_warehouse_id") + private String relatedWarehouseId; + + @JsonProperty("related_warehouse_name") + private String relatedWarehouseName; + + @JsonProperty("ship_method") + private String shipMethod; + + /** 要求发货时间。 */ + @JsonProperty("ship_window_time") + private String shipWindowTime; + + /** 承诺送达时间。 */ + @JsonProperty("promised_delivery_date") + private String promisedDeliveryDate; + + @JsonProperty("is_pslip_required") + private String isPslipRequired; + + @JsonProperty("is_gift") + private String isGift; + + @JsonProperty("is_scheduled_delivery_shipment") + private String isScheduledDeliveryShipment; + + @JsonProperty("is_priority_shipment") + private String isPriorityShipment; + + @JsonProperty("message_to_customer") + private String messageToCustomer; + + @JsonProperty("total_price") + private String totalPrice; + + @JsonProperty("currency_code") + private String currencyCode; + + @JsonProperty("currency_icon") + private String currencyIcon; + + /** 货物数量;文档类型是 string。 */ + @JsonProperty("item_amount") + private String itemAmount; + + @JsonProperty("remark") + private String remark; + + @JsonProperty("items") + private List items = new ArrayList(); +} diff --git a/lingxing/src/main/java/common/ecommerce/lingxing/platform/amazon/vc/dto/VcOrderDto.java b/lingxing/src/main/java/common/ecommerce/lingxing/platform/amazon/vc/dto/VcOrderDto.java new file mode 100644 index 0000000..d2fb3a9 --- /dev/null +++ b/lingxing/src/main/java/common/ecommerce/lingxing/platform/amazon/vc/dto/VcOrderDto.java @@ -0,0 +1,120 @@ +package common.ecommerce.lingxing.platform.amazon.vc.dto; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Getter; +import lombok.Setter; + +import java.util.ArrayList; +import java.util.List; + +/** + * 领星 · 亚马逊 VC 订单列表条目 + * ({@code /basicOpen/platformOrder/vcOrder/pageList} 的 {@code data[]})。 + * + *

列表已经带商品行与订单总额,可以直接映射成统一订单;详情接口补充 + * 发货窗口、仓库、收件方等信息。

+ */ +@Getter +@Setter +@JsonIgnoreProperties(ignoreUnknown = true) +public class VcOrderDto { + + @JsonProperty("gmt_create") + private String gmtCreate; + + @JsonProperty("gmt_modified") + private String gmtModified; + + /** 领星订单 id。 */ + @JsonProperty("id") + private String id; + + /** 订单编号,平台单号,参与 canonicalKey。 */ + @JsonProperty("purchase_order_number") + private String purchaseOrderNumber; + + /** 客户订单号(DF 类型)。 */ + @JsonProperty("customer_order_number") + private String customerOrderNumber; + + /** VC 店铺 id。 */ + @JsonProperty("vc_store_id") + private String vcStoreId; + + @JsonProperty("seller_name") + private String sellerName; + + /** 订单类型:0 DF、1 PO、2 DI。 */ + @JsonProperty("purchase_order_type") + private Integer purchaseOrderType; + + /** DF:New / SHIPPED / ACCEPTED / CANCELLED;PO:Acknowledged / Closed。 */ + @JsonProperty("purchase_order_state") + private String purchaseOrderState; + + /** 订单流转状态:0 待处理、1 待发货、2 已完成、3 已取消。 */ + @JsonProperty("purchase_order_process_state") + private Integer purchaseOrderProcessState; + + /** 订单下单时间。 */ + @JsonProperty("purchase_order_date") + private String purchaseOrderDate; + + @JsonProperty("ack_status") + private Integer ackStatus; + + @JsonProperty("ack_status_desc") + private String ackStatusDesc; + + @JsonProperty("ack_update_time") + private String ackUpdateTime; + + /** DF 要求发货时间。 */ + @JsonProperty("ship_window_time") + private String shipWindowTime; + + /** PO 要求起始发货时间。 */ + @JsonProperty("ship_window_start") + private String shipWindowStart; + + /** PO 要求截止发货时间;文档字段名是 ship_windows_end。 */ + @JsonProperty("ship_windows_end") + private String shipWindowsEnd; + + @JsonProperty("total_price") + private String totalPrice; + + @JsonProperty("currency_code") + private String currencyCode; + + @JsonProperty("currency_icon") + private String currencyIcon; + + /** 货物总数量。 */ + @JsonProperty("item_amount") + private Integer itemAmount; + + /** 本地 PO 号,PO 详情接口的入参。 */ + @JsonProperty("local_po_number") + private String localPoNumber; + + @JsonProperty("ship_to_party_id") + private String shipToPartyId; + + @JsonProperty("remark") + private String remark; + + @JsonProperty("shipment_confirm_status") + private Integer shipmentConfirmStatus; + + @JsonProperty("shipment_label_status") + private Integer shipmentLabelStatus; + + @JsonProperty("print_num") + private Integer printNum; + + /** 商品行。 */ + @JsonProperty("purchase_order_sku_list") + private List purchaseOrderSkuList = new ArrayList(); +} diff --git a/lingxing/src/main/java/common/ecommerce/lingxing/platform/amazon/vc/dto/VcOrderItemDto.java b/lingxing/src/main/java/common/ecommerce/lingxing/platform/amazon/vc/dto/VcOrderItemDto.java new file mode 100644 index 0000000..7282bf4 --- /dev/null +++ b/lingxing/src/main/java/common/ecommerce/lingxing/platform/amazon/vc/dto/VcOrderItemDto.java @@ -0,0 +1,111 @@ +package common.ecommerce.lingxing.platform.amazon.vc.dto; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Getter; +import lombok.Setter; + +/** + * 领星 · 亚马逊 VC 订单列表的商品行 + * ({@code data[].purchase_order_sku_list[]})。 + */ +@Getter +@Setter +@JsonIgnoreProperties(ignoreUnknown = true) +public class VcOrderItemDto { + + @JsonProperty("id") + private String id; + + @JsonProperty("vc_store_id") + private String vcStoreId; + + @JsonProperty("asin") + private String asin; + + @JsonProperty("parent_asin") + private String parentAsin; + + @JsonProperty("item_name") + private String itemName; + + /** 采购量。 */ + @JsonProperty("purchase_amount") + private Integer purchaseAmount; + + @JsonProperty("sequence_number") + private String sequenceNumber; + + /** 平台商品编码(Vendor SKU)。 */ + @JsonProperty("vendor_product_id") + private String vendorProductId; + + @JsonProperty("local_po_number") + private String localPoNumber; + + @JsonProperty("purchase_order_number") + private String purchaseOrderNumber; + + /** 单价。 */ + @JsonProperty("unit_price") + private String unitPrice; + + /** 成本价。 */ + @JsonProperty("net_price") + private String netPrice; + + @JsonProperty("net_price_currency_code") + private String netPriceCurrencyCode; + + /** 税额。 */ + @JsonProperty("tax_amount") + private String taxAmount; + + @JsonProperty("tax_amount_currency_code") + private String taxAmountCurrencyCode; + + @JsonProperty("tax_rate") + private String taxRate; + + @JsonProperty("tax_rate_percent") + private String taxRatePercent; + + @JsonProperty("deal_total_price") + private String dealTotalPrice; + + @JsonProperty("deal_unit_price") + private String dealUnitPrice; + + @JsonProperty("shipped_amount") + private Integer shippedAmount; + + @JsonProperty("to_ship_amount") + private Integer toShipAmount; + + @JsonProperty("local_name") + private String localName; + + @JsonProperty("local_sku") + private String localSku; + + @JsonProperty("product_id") + private String productId; + + @JsonProperty("available_amount") + private Integer availableAmount; + + @JsonProperty("asin_url") + private String asinUrl; + + @JsonProperty("pic_url") + private String picUrl; + + @JsonProperty("accepted_quantity") + private Integer acceptedQuantity; + + @JsonProperty("rejected_quantity") + private Integer rejectedQuantity; + + @JsonProperty("received_quantity") + private Integer receivedQuantity; +} diff --git a/lingxing/src/main/java/common/ecommerce/lingxing/platform/amazon/vc/dto/VcOrderPoDetailDto.java b/lingxing/src/main/java/common/ecommerce/lingxing/platform/amazon/vc/dto/VcOrderPoDetailDto.java new file mode 100644 index 0000000..553ddf2 --- /dev/null +++ b/lingxing/src/main/java/common/ecommerce/lingxing/platform/amazon/vc/dto/VcOrderPoDetailDto.java @@ -0,0 +1,92 @@ +package common.ecommerce.lingxing.platform.amazon.vc.dto; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Getter; +import lombok.Setter; + +import java.util.ArrayList; +import java.util.List; + +/** + * 领星 · 亚马逊 VC 订单详情【PO】 + * ({@code /basicOpen/platformOrder/vcOrderPo/detail} 的 {@code data})。 + * + *

PO 详情按 {@code local_po_number} 查询,不是按订单编号。

+ */ +@Getter +@Setter +@JsonIgnoreProperties(ignoreUnknown = true) +public class VcOrderPoDetailDto { + + @JsonProperty("vc_store_id") + private String vcStoreId; + + @JsonProperty("seller_name") + private String sellerName; + + @JsonProperty("purchase_order_number") + private String purchaseOrderNumber; + + /** 本地 PO 号,PO 详情接口的入参。 */ + @JsonProperty("local_po_number") + private String localPoNumber; + + @JsonProperty("purchase_order_date") + private String purchaseOrderDate; + + /** Acknowledged / Closed。 */ + @JsonProperty("purchase_order_state") + private String purchaseOrderState; + + /** 0 待处理、1 确认中、2 确认成功、3 确认失败。 */ + @JsonProperty("purchase_order_process_state") + private String purchaseOrderProcessState; + + @JsonProperty("payment_method") + private String paymentMethod; + + /** 0 DF、1 PO。 */ + @JsonProperty("purchase_order_type") + private String purchaseOrderType; + + @JsonProperty("remark") + private String remark; + + @JsonProperty("related_warehouse_id") + private String relatedWarehouseId; + + @JsonProperty("related_warehouse_name") + private String relatedWarehouseName; + + @JsonProperty("ship_to_party_id") + private String shipToPartyId; + + @JsonProperty("total_price") + private String totalPrice; + + @JsonProperty("currency_code") + private String currencyCode; + + @JsonProperty("currency_icon") + private String currencyIcon; + + /** 货物数量;文档类型是 string。 */ + @JsonProperty("item_amount") + private String itemAmount; + + @JsonProperty("ship_window_start") + private String shipWindowStart; + + @JsonProperty("ship_window_end") + private String shipWindowEnd; + + @JsonProperty("delivery_window_start") + private String deliveryWindowStart; + + @JsonProperty("delivery_window_end") + private String deliveryWindowEnd; + + @JsonProperty("items") + private List items = new ArrayList(); +} diff --git a/lingxing/src/main/java/common/ecommerce/lingxing/platform/amazon/vc/dto/VcShopDto.java b/lingxing/src/main/java/common/ecommerce/lingxing/platform/amazon/vc/dto/VcShopDto.java new file mode 100644 index 0000000..4bfa968 --- /dev/null +++ b/lingxing/src/main/java/common/ecommerce/lingxing/platform/amazon/vc/dto/VcShopDto.java @@ -0,0 +1,56 @@ +package common.ecommerce.lingxing.platform.amazon.vc.dto; + +import com.fasterxml.jackson.annotation.JsonIgnoreProperties; +import com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Getter; +import lombok.Setter; + +/** + * 领星 · 亚马逊 VC 店铺({@code /basicOpen/platformAuth/vcSeller/pageList} 的 {@code data[]})。 + * + *

唯一键是 {@code vc_store_id},VC 订单接口与详情接口都用它指定店铺。

+ */ +@Getter +@Setter +@JsonIgnoreProperties(ignoreUnknown = true) +public class VcShopDto { + + /** 账号 id。 */ + @JsonProperty("account_id") + private Long accountId; + + /** SELLER_ID。 */ + @JsonProperty("seller_id") + private String sellerId; + + /** 账号名称。 */ + @JsonProperty("account_name") + private String accountName; + + /** 站点简称,如 na。 */ + @JsonProperty("region") + private String region; + + /** 站点名称,如 北美洲。 */ + @JsonProperty("region_name") + private String regionName; + + /** VC 店铺 id,唯一键。 */ + @JsonProperty("vc_store_id") + private String vcStoreId; + + /** 店铺名称。 */ + @JsonProperty("name") + private String name; + + /** + * 店铺授权服务状态: + * -1 删除、0 暂停同步、1 正常同步、2 授权异常。 + */ + @JsonProperty("status") + private Integer status; + + /** 站点 id。 */ + @JsonProperty("mid") + private Integer mid; +} diff --git a/lingxing/src/main/java/common/ecommerce/lingxing/platform/amazon/vc/order/VcOrderSource.java b/lingxing/src/main/java/common/ecommerce/lingxing/platform/amazon/vc/order/VcOrderSource.java new file mode 100644 index 0000000..cb97de4 --- /dev/null +++ b/lingxing/src/main/java/common/ecommerce/lingxing/platform/amazon/vc/order/VcOrderSource.java @@ -0,0 +1,411 @@ +package common.ecommerce.lingxing.platform.amazon.vc.order; + +import com.fasterxml.jackson.databind.JsonNode; + +import common.ecommerce.error.ChannelException; +import common.ecommerce.error.ValidationException; +import common.ecommerce.http.HttpRequest; +import common.ecommerce.http.HttpResponse; +import common.ecommerce.lingxing.LingxingApi; +import common.ecommerce.lingxing.LingxingConstants; +import common.ecommerce.lingxing.http.LingxingEnvelope; +import common.ecommerce.lingxing.mapper.LingxingOrderMapper; +import common.ecommerce.lingxing.platform.LingxingCall; +import common.ecommerce.lingxing.platform.amazon.vc.dto.VcOrderDetailItemDto; +import common.ecommerce.lingxing.platform.amazon.vc.dto.VcOrderDfDetailDto; +import common.ecommerce.lingxing.platform.amazon.vc.dto.VcOrderDto; +import common.ecommerce.lingxing.platform.amazon.vc.dto.VcOrderItemDto; +import common.ecommerce.lingxing.platform.amazon.vc.dto.VcOrderPoDetailDto; +import common.ecommerce.lingxing.platform.order.LingxingOrderSource; +import common.ecommerce.model.ChannelProvider; +import common.ecommerce.model.account.ChannelAccount; +import common.ecommerce.model.order.OrderLine; +import common.ecommerce.model.order.SalesOrder; +import common.ecommerce.model.order.SalesOrderQuery; +import common.ecommerce.model.support.Money; +import common.ecommerce.model.support.Page; +import common.ecommerce.model.support.PlatformTime; + +import java.time.Instant; +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.time.ZoneId; +import java.time.format.DateTimeFormatter; +import java.time.format.DateTimeParseException; +import java.time.temporal.ChronoUnit; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +/** + * 领星 · 亚马逊 VC 订单。 + * + *

列表 {@link LingxingApi#ORDER_LIST_AMAZON_VC} 同时覆盖 DF / PO / DI, + * 并且已经返回商品行与订单总额。详情分两个接口:

+ *
    + *
  • {@link LingxingApi#ORDER_DETAIL_DF_AMAZON_VC}:入参 {@code vc_store_id} + {@code purchase_order_number}
  • + *
  • {@link LingxingApi#ORDER_DETAIL_PO_AMAZON_VC}:入参 {@code local_po_number}
  • + *
+ * + *

{@link #order} 先用列表的 {@code search_field=purchase_order_number} 查出订单类型与 + * {@code local_po_number},再按类型走对应详情;DI 没有详情接口,直接用列表数据。

+ * + *

时区待核对:文档没有标注 {@code purchase_order_date} 的时区, + * 查询日期与时间解析都按领星系统时间(北京时间)处理。

+ */ +public final class VcOrderSource implements LingxingOrderSource { + + private static final DateTimeFormatter DATE = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + private static final DateTimeFormatter DATE_TIME = DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"); + + /** 文档未注明时区,按 ERP 系统时间(北京时间)解释,待真实报文核对。 */ + private static final ZoneId SYSTEM_ZONE = PlatformTime.BEIJING_ZONE; + + private static final int TYPE_DF = 0; + private static final int TYPE_PO = 1; + private static final int TYPE_DI = 2; + + /** 查询时间类型:3 = 订单更新时间,与 updatedAfter/updatedBefore 对齐。 */ + private static final int SEARCH_FIELD_TIME_UPDATE = 3; + + private static final String OP_PULL = "salesOrders.pull.vc"; + private static final String OP_GET = "salesOrders.get.vc"; + + @Override + public Page orders(LingxingCall call, SalesOrderQuery query) { + ChannelAccount account = call.ctx().account(); + ZoneId zone = ZoneId.of(account.marketplaceZone()); + + Instant from = query.updatedAfter(); + Instant to = query.updatedBefore() != null ? query.updatedBefore() : Instant.now(call.ctx().clock()); + + LocalDate endDate = LocalDateTime.ofInstant(to, SYSTEM_ZONE).toLocalDate(); + // 文档:start_date 是开区间(按日期理解),多取一天避免漏掉起始日 + LocalDate startDate = LocalDateTime.ofInstant(from, SYSTEM_ZONE).toLocalDate().minusDays(1); + // 文档:查询区间最长 90 天 + if (ChronoUnit.DAYS.between(startDate, endDate) > LingxingConstants.VC_MAX_QUERY_DAYS) { + startDate = endDate.minusDays(LingxingConstants.VC_MAX_QUERY_DAYS); + } + + int length = Math.min(query.pageSize() <= 0 ? 20 : query.pageSize(), + LingxingConstants.VC_MAX_PAGE_SIZE); + int offset = query.cursor() == null ? 0 : Integer.parseInt(query.cursor()); + + Map body = new LinkedHashMap(); + body.put("purchase_order_type", Arrays.asList(TYPE_DF, TYPE_PO, TYPE_DI)); + body.put("offset", offset); + body.put("length", length); + body.put("search_field_time", SEARCH_FIELD_TIME_UPDATE); + body.put("start_date", DATE.format(startDate)); + body.put("end_date", DATE.format(endDate)); + if (trimToNull(account.externalStoreId()) != null) { + body.put("vc_store_ids", Collections.singletonList(account.externalStoreId().trim())); + } + + HttpRequest req = call.signed(LingxingApi.ORDER_LIST_AMAZON_VC, body, OP_PULL); + HttpResponse resp = call.execute(req); + LingxingEnvelope envelope = call.envelope(resp, OP_PULL); + + List dtos = call.json().listAt(envelope.body(), "data", VcOrderDto.class); + List orders = new ArrayList(dtos.size()); + for (VcOrderDto dto : dtos) { + try { + orders.add(toSalesOrder(dto, account, zone)); + } catch (RuntimeException e) { + throw mappingFailure(e, envelope, call, OP_PULL); + } + } + + int nextOffset = offset + dtos.size(); + boolean hasMore = dtos.size() >= length + && (envelope.total() < 0 || nextOffset < envelope.total()); + return Page.of(orders, hasMore ? String.valueOf(nextOffset) : null); + } + + @Override + public SalesOrder order(LingxingCall call, String channelOrderId) { + ChannelAccount account = call.ctx().account(); + ZoneId zone = ZoneId.of(account.marketplaceZone()); + + VcOrderDto summary = findOrder(call, channelOrderId); + if (summary == null) { + throw ChannelException.builder() + .message("lingxing vc order not found: " + channelOrderId) + .operation(OP_GET) + .provider(ChannelProvider.LINGXING.name()) + .omsStoreId(call.ctx().omsStoreId()) + .requestId(call.ctx().requestId()) + .platformCode(channelOrderId) + .retryable(false) + .build(); + } + + int type = summary.getPurchaseOrderType() == null ? -1 : summary.getPurchaseOrderType(); + if (type == TYPE_DF) { + VcOrderDfDetailDto detail = dfDetail(call, summary); + if (detail != null) { + return toSalesOrder(detail, account, zone); + } + } else if (type == TYPE_PO) { + String localPoNumber = trimToNull(summary.getLocalPoNumber()); + if (localPoNumber != null) { + VcOrderPoDetailDto detail = poDetail(call, localPoNumber); + if (detail != null) { + return toSalesOrder(detail, account, zone); + } + } + } + + // DI 没有详情接口;详情返回空时也退回列表数据(列表已带完整商品行) + return toSalesOrder(summary, account, zone); + } + + // ---------------------------------------------------------------- requests + + /** 用订单编号精确搜索,拿到订单类型与 local_po_number。 */ + private VcOrderDto findOrder(LingxingCall call, String channelOrderId) { + ChannelAccount account = call.ctx().account(); + Map body = new LinkedHashMap(); + body.put("purchase_order_type", Arrays.asList(TYPE_DF, TYPE_PO, TYPE_DI)); + body.put("offset", 0); + body.put("length", 20); + body.put("search_field", "purchase_order_number"); + body.put("search_value", Collections.singletonList(channelOrderId)); + if (trimToNull(account.externalStoreId()) != null) { + body.put("vc_store_ids", Collections.singletonList(account.externalStoreId().trim())); + } + + HttpRequest req = call.signed(LingxingApi.ORDER_LIST_AMAZON_VC, body, OP_GET); + HttpResponse resp = call.execute(req); + LingxingEnvelope envelope = call.envelope(resp, OP_GET); + + List dtos = call.json().listAt(envelope.body(), "data", VcOrderDto.class); + return dtos.isEmpty() ? null : dtos.get(0); + } + + private VcOrderDfDetailDto dfDetail(LingxingCall call, VcOrderDto summary) { + Map body = new LinkedHashMap(); + body.put("vc_store_id", firstNonBlank(summary.getVcStoreId(), + call.ctx().account().externalStoreId())); + body.put("purchase_order_number", summary.getPurchaseOrderNumber()); + + HttpRequest req = call.signed(LingxingApi.ORDER_DETAIL_DF_AMAZON_VC, body, OP_GET); + HttpResponse resp = call.execute(req); + LingxingEnvelope envelope = call.envelope(resp, OP_GET); + + JsonNode data = call.json().nodeAt(envelope.body(), "data"); + if (data == null || data.isNull()) { + return null; + } + return call.json().mapper().convertValue(data, VcOrderDfDetailDto.class); + } + + private VcOrderPoDetailDto poDetail(LingxingCall call, String localPoNumber) { + Map body = new LinkedHashMap(); + body.put("local_po_number", localPoNumber); + + HttpRequest req = call.signed(LingxingApi.ORDER_DETAIL_PO_AMAZON_VC, body, OP_GET); + HttpResponse resp = call.execute(req); + LingxingEnvelope envelope = call.envelope(resp, OP_GET); + + JsonNode data = call.json().nodeAt(envelope.body(), "data"); + if (data == null || data.isNull()) { + return null; + } + return call.json().mapper().convertValue(data, VcOrderPoDetailDto.class); + } + + // ---------------------------------------------------------------- mapping + + private SalesOrder toSalesOrder(VcOrderDto dto, ChannelAccount account, ZoneId zone) { + String orderId = firstNonBlank(dto.getPurchaseOrderNumber(), + dto.getCustomerOrderNumber(), dto.getId()); + if (orderId == null) { + throw new IllegalArgumentException("lingxing vc order has no purchase_order_number"); + } + String currency = trimToNull(dto.getCurrencyCode()); + + List lines = new ArrayList(); + List items = safe(dto.getPurchaseOrderSkuList()); + for (int i = 0; i < items.size(); i++) { + VcOrderItemDto item = items.get(i); + String lineCurrency = firstNonBlank(item.getNetPriceCurrencyCode(), + item.getTaxAmountCurrencyCode(), currency); + String sku = firstNonBlank(item.getVendorProductId(), item.getLocalSku(), item.getAsin()); + lines.add(OrderLine.builder() + .lineId(firstNonBlank(item.getId(), item.getSequenceNumber(), + item.getVendorProductId(), "line-" + i)) + .platformSku(sku == null ? "" : sku) + .quantity(item.getPurchaseAmount() == null ? 0 : item.getPurchaseAmount()) + .unitPrice(moneyOrNull(item.getUnitPrice(), lineCurrency)) + .tax(moneyOrNull(item.getTaxAmount(), + firstNonBlank(item.getTaxAmountCurrencyCode(), currency))) + .build()); + } + + Instant occur = parseSystemTime(firstNonBlank(dto.getPurchaseOrderDate(), dto.getGmtCreate())); + + return SalesOrder.builder() + .omsStoreId(account.omsStoreId()) + .channelOrderId(orderId) + .status(dto.getPurchaseOrderState()) + .buyerName(null) + .shipToCountryCode(null) + .lines(lines) + .totalAmount(moneyOrNull(dto.getTotalPrice(), currency)) + .occurredAt(requireOccurredAt(occur, orderId, zone)) + .sourceProvider(ChannelProvider.LINGXING) + .sourceAccountId(trimToNull(dto.getVcStoreId())) + .build(); + } + + private SalesOrder toSalesOrder(VcOrderDfDetailDto dto, ChannelAccount account, ZoneId zone) { + String orderId = requireOrderId(dto.getPurchaseOrderNumber()); + String currency = trimToNull(dto.getCurrencyCode()); + + List lines = new ArrayList(); + List items = safe(dto.getItems()); + for (int i = 0; i < items.size(); i++) { + lines.add(toLine(items.get(i), currency, i)); + } + + return buildOrder(account, zone, orderId, dto.getPurchaseOrderState(), + dto.getVcStoreId(), dto.getTotalPrice(), currency, lines, + dto.getPurchaseOrderDate()); + } + + private SalesOrder toSalesOrder(VcOrderPoDetailDto dto, ChannelAccount account, ZoneId zone) { + String orderId = requireOrderId(dto.getPurchaseOrderNumber()); + String currency = trimToNull(dto.getCurrencyCode()); + + List lines = new ArrayList(); + List items = safe(dto.getItems()); + for (int i = 0; i < items.size(); i++) { + lines.add(toLine(items.get(i), currency, i)); + } + + return buildOrder(account, zone, orderId, dto.getPurchaseOrderState(), + dto.getVcStoreId(), dto.getTotalPrice(), currency, lines, + dto.getPurchaseOrderDate()); + } + + private static OrderLine toLine(VcOrderDetailItemDto item, String headerCurrency, int index) { + String lineCurrency = firstNonBlank(item.getNetPriceCurrencyCode(), + item.getTaxAmountCurrencyCode(), headerCurrency); + String sku = firstNonBlank(item.getMsku(), item.getLocalSku(), item.getAsin()); + return OrderLine.builder() + .lineId(firstNonBlank(item.getSequenceNumber(), item.getAsin(), + item.getMsku(), "line-" + index)) + .platformSku(sku == null ? "" : sku) + .quantity(parseInt(item.getPurchaseAmount())) + .unitPrice(moneyOrNull(item.getUnitPrice(), lineCurrency)) + .tax(moneyOrNull(item.getTaxAmount(), + firstNonBlank(item.getTaxAmountCurrencyCode(), headerCurrency))) + .build(); + } + + private static SalesOrder buildOrder(ChannelAccount account, ZoneId zone, String orderId, + String status, String vcStoreId, String totalPrice, + String currency, List lines, String orderDate) { + Instant occur = parseSystemTime(orderDate); + return SalesOrder.builder() + .omsStoreId(account.omsStoreId()) + .channelOrderId(orderId) + .status(status) + .buyerName(null) + .shipToCountryCode(null) + .lines(lines) + .totalAmount(moneyOrNull(totalPrice, currency)) + .occurredAt(requireOccurredAt(occur, orderId, zone)) + .sourceProvider(ChannelProvider.LINGXING) + .sourceAccountId(trimToNull(vcStoreId)) + .build(); + } + + // ---------------------------------------------------------------- internals + + private static String requireOrderId(String value) { + String orderId = trimToNull(value); + if (orderId == null) { + throw new IllegalArgumentException("lingxing vc order has no purchase_order_number"); + } + return orderId; + } + + /** 文档没写时区,按 {@link #SYSTEM_ZONE} 解释;缺失或格式不对返回 null。 */ + private static Instant parseSystemTime(String value) { + String text = trimToNull(value); + if (text == null) { + return null; + } + try { + return LocalDateTime.parse(text, DATE_TIME).atZone(SYSTEM_ZONE).toInstant(); + } catch (DateTimeParseException e) { + return null; + } + } + + private static PlatformTime requireOccurredAt(Instant occur, String orderId, ZoneId zone) { + if (occur == null) { + throw new IllegalArgumentException( + "lingxing vc order has no parseable purchase_order_date: " + orderId); + } + return PlatformTime.of(occur, zone); + } + + private static ValidationException mappingFailure(RuntimeException e, LingxingEnvelope envelope, + LingxingCall call, String operation) { + return new ValidationException(ChannelException.builder() + .message("lingxing vc order mapping failed: " + e.getMessage()) + .operation(operation) + .provider(ChannelProvider.LINGXING.name()) + .omsStoreId(call.ctx().omsStoreId()) + .requestId(call.ctx().requestId()) + .rawResponse(envelope.body()), e); + } + + private static Money moneyOrNull(String value, String currency) { + String cleaned = LingxingOrderMapper.cleanAmount(value); + if (cleaned == null || trimToNull(currency) == null) { + return null; + } + return Money.of(cleaned, currency.trim().toUpperCase()); + } + + private static int parseInt(String value) { + String text = trimToNull(value); + if (text == null) { + return 0; + } + try { + return Integer.parseInt(text); + } catch (NumberFormatException e) { + return 0; + } + } + + private static List safe(List in) { + return in == null ? Collections.emptyList() : in; + } + + private static String firstNonBlank(String... values) { + for (String value : values) { + String trimmed = trimToNull(value); + if (trimmed != null) { + return trimmed; + } + } + return null; + } + + private static String trimToNull(String value) { + if (value == null) { + return null; + } + String trimmed = value.trim(); + return trimmed.isEmpty() ? null : trimmed; + } +} diff --git a/lingxing/src/main/java/common/ecommerce/lingxing/platform/amazon/vc/shop/VcShopSource.java b/lingxing/src/main/java/common/ecommerce/lingxing/platform/amazon/vc/shop/VcShopSource.java new file mode 100644 index 0000000..25708c5 --- /dev/null +++ b/lingxing/src/main/java/common/ecommerce/lingxing/platform/amazon/vc/shop/VcShopSource.java @@ -0,0 +1,74 @@ +package common.ecommerce.lingxing.platform.amazon.vc.shop; + +import common.ecommerce.capability.AggregatorCapable.SubChannel; +import common.ecommerce.http.HttpRequest; +import common.ecommerce.http.HttpResponse; +import common.ecommerce.lingxing.LingxingApi; +import common.ecommerce.lingxing.LingxingConstants; +import common.ecommerce.lingxing.http.LingxingEnvelope; +import common.ecommerce.lingxing.platform.LingxingCall; +import common.ecommerce.lingxing.platform.amazon.vc.dto.VcShopDto; +import common.ecommerce.lingxing.platform.shop.LingxingShopSource; +import common.ecommerce.model.Platform; + +import java.util.ArrayList; +import java.util.Collections; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; + +/** + * 领星 · 亚马逊 VC 店铺列表。 + * + *

接口 {@code /basicOpen/platformAuth/vcSeller/pageList}:POST,{@code offset}/{@code length} + * 分页,length 默认 20、上限 200,令牌桶 1 req/s。

+ * + *

{@link LingxingShopSource#shops(LingxingCall)} 要返回全量店铺,所以这里内部翻页, + * 直到返回不足一页或达到 {@code total}。

+ */ +public final class VcShopSource implements LingxingShopSource { + + /** 店铺授权服务状态:1 = 正常同步。 */ + private static final int STATUS_ACTIVE = 1; + + private static final String OP = "shops.list.vc"; + + @Override + public List shops(LingxingCall call) { + int length = LingxingConstants.VC_MAX_PAGE_SIZE; + int offset = 0; + List out = new ArrayList(); + + while (true) { + Map body = new LinkedHashMap(); + body.put("offset", offset); + body.put("length", length); + + HttpRequest req = call.signed(LingxingApi.SHOP_LIST_AMAZON_VC, body, OP); + HttpResponse resp = call.execute(req); + LingxingEnvelope envelope = call.envelope(resp, OP); + + List shops = call.json().listAt(envelope.body(), "data", VcShopDto.class); + for (VcShopDto shop : shops) { + if (shop.getVcStoreId() == null + || shop.getStatus() == null || shop.getStatus() != STATUS_ACTIVE) { + continue; + } + out.add(new SubChannel( + LingxingConstants.PLATFORM_CODE_AMAZON_VC, + shop.getVcStoreId(), + Platform.AMAZON_VC, + shop.getName() == null ? shop.getSellerId() : shop.getName())); + } + + offset += shops.size(); + boolean exhausted = shops.size() < length + || (envelope.total() >= 0 && offset >= envelope.total()); + if (exhausted) { + break; + } + } + + return Collections.unmodifiableList(out); + } +} diff --git a/lingxing/src/test/java/common/ecommerce/lingxing/adapter/LingxingLiveSmokeTest.java b/lingxing/src/test/java/common/ecommerce/lingxing/adapter/LingxingLiveSmokeTest.java index a485eda..7f12655 100644 --- a/lingxing/src/test/java/common/ecommerce/lingxing/adapter/LingxingLiveSmokeTest.java +++ b/lingxing/src/test/java/common/ecommerce/lingxing/adapter/LingxingLiveSmokeTest.java @@ -211,6 +211,60 @@ class LingxingLiveSmokeTest { } } + /** + * 第 5 步(亚马逊 VC):先列 VC 店铺拿 vc_store_id,再拉订单列表,最后取一单详情。 + * + *

VC 详情分 DF / PO 两个接口,{@code get()} 会先按订单编号查出类型再分派。

+ */ + @Test + void listsAmazonVcShopsAndPullsOrders() { + requireCredentials(); + LingxingAdapter adapter = adapter(); + + String vcStoreId = firstVcShopId(adapter); + if (vcStoreId == null) { + return; + } + + ChannelContext ctx = context(vcAccount(vcStoreId), "smoke-vc-orders-"); + Instant to = Instant.now(); + Instant from = to.minus(Duration.ofDays(2)); + Page page = adapter.pull(ctx, SalesOrderQuery.builder() + .updatedAfter(from) + .updatedBefore(to) + .pageSize(20) + .build()); + + System.out.println("[vc orders] vc_store_id=" + vcStoreId + + " window=" + from + " .. " + to + + " items=" + page.size() + " nextCursor=" + page.nextCursor()); + for (SalesOrder o : page.items()) { + System.out.println(" " + o.channelOrderId() + + " status=" + o.status() + + " total=" + o.totalAmount() + + " lines=" + o.lines().size() + + " utc=" + o.occurredAt().utc()); + } + + if (page.items().isEmpty()) { + System.out.println("[vc orders] 窗口内没有订单,跳过详情核验"); + return; + } + + SalesOrder first = page.items().get(0); + SalesOrder detail = adapter.get(ctx, SalesOrderRef.of(first.channelOrderId())); + System.out.println("[vc detail] " + detail.channelOrderId() + + " status=" + detail.status() + + " total=" + detail.totalAmount() + + " lines=" + detail.lines().size()); + for (common.ecommerce.model.order.OrderLine line : detail.lines()) { + System.out.println(" sku=" + line.platformSku() + + " qty=" + line.quantity() + + " unit=" + line.unitPrice() + + " tax=" + line.tax()); + } + } + /** 第 6 步(结算):拉一页亚马逊结算交易明细。 */ @Test void pullsAmazonSettlements() { @@ -279,6 +333,19 @@ class LingxingLiveSmokeTest { return shops.isEmpty() ? null : shops.get(0).externalStoreId(); } + /** 列出亚马逊 VC 店铺并返回第一家 vc_store_id;没有授权店铺时返回 null。 */ + private String firstVcShopId(LingxingAdapter adapter) { + ChannelAccount discovery = vcAccount("0"); + List shops = adapter.listSubChannels(context(discovery, "smoke-vc-shops-")); + System.out.println("[vc shops] count=" + shops.size()); + for (SubChannel shop : shops) { + System.out.println(" vc_store_id=" + shop.externalStoreId() + + " name=" + shop.name() + + " platform=" + shop.platform()); + } + return shops.isEmpty() ? null : shops.get(0).externalStoreId(); + } + private ChannelContext context(ChannelAccount account, String prefix) { return ChannelContext.of(account, connection(), prefix + System.currentTimeMillis(), Clock.systemUTC()); @@ -298,6 +365,10 @@ class LingxingLiveSmokeTest { return account(Platform.AMAZON_SC, LingxingConstants.PLATFORM_CODE_AMAZON, sid); } + private ChannelAccount vcAccount(String vcStoreId) { + return account(Platform.AMAZON_VC, LingxingConstants.PLATFORM_CODE_AMAZON_VC, vcStoreId); + } + private ChannelAccount account(Platform platform, int platformCode, String storeId) { return ChannelAccount.builder() .key(AccountKey.of(ChannelProvider.LINGXING, platform, "oms-smoke-001"))