You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

333 lines
10 KiB

package common.ecommerce.xincang.dto;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.math.BigDecimal;
/**
* 信仓报文结构。
*
* <p>字段名以 Apifox「OMS接口文档V2」为准。信仓全局响应外层统一为
* {@code {"rst": ..., "errno": 0, "err": "", "trace_id": "..."}},这里只放登录接口用到的部分。
* 字段差异只改本类,不动适配器与领域模型。</p>
*/
public final class XincangDtos {
private XincangDtos() {
}
/**
* 登录响应({@code GET /api.login})。
*
* <p>注意与业务接口不同:登录的 {@code rst} <b>没有</b> {@code code/msg/data} 包裹,
* 而是直接给出客户与 token 字段。</p>
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public static final class LoginResponse {
/** 登录结果;业务失败时可能为 null。 */
@JsonProperty("rst")
public LoginResult rst;
/** 0 表示成功。 */
@JsonProperty("errno")
public Integer errno;
/** 错误描述;成功时为空串。 */
@JsonProperty("err")
public String err;
/** 信仓侧链路号。 */
@JsonProperty("trace_id")
public String traceId;
}
/** 登录结果的 {@code rst} 部分。 */
@JsonIgnoreProperties(ignoreUnknown = true)
public static final class LoginResult {
/** 客户 id。 */
@JsonProperty("id")
public String customerId;
/** 回显的 APIKEY,正常等于登录用的 appkey。 */
@JsonProperty("api_client_id")
public String apiClientId;
/** 回显的 APISECRET;不需要也不应落盘,仅用于排障时核对身份。 */
@JsonProperty("api_client_secret")
public String apiClientSecret;
/** 过期时间,北京时间 {@code yyyy-MM-dd HH:mm:ss}。 */
@JsonProperty("token_expire_time")
public String tokenExpireTime;
/** 令牌本体(形如 {@code {D0A7A4FB-...}})。 */
@JsonProperty("token")
public String token;
}
/**
* 新增 / 更新产品请求({@code POST api.add_product} / {@code api.update_product})。
*
* <p>信仓这两个接口的 {@code token} 放在 <b>请求体</b>里(文档 required 列表含 {@code token});
* 新增接口的 query 里同时也收一份,见 {@code XincangRequestFactory}。</p>
*
* <p>单位:金额美元、尺寸英寸、重量磅;与统一模型(cm / g)的换算在
* {@code XincangProductMapper}。</p>
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public static final class ProductRequest {
/** 令牌。 */
@JsonProperty("token")
public String token;
/** 产品 SKU。 */
@JsonProperty("product_no")
public String productNo;
/** 中文名。 */
@JsonProperty("chn_name")
public String chnName;
/** 金额,美元,最长两位小数。 */
@JsonProperty("amount")
public BigDecimal amount;
/** 产品条码。 */
@JsonProperty("bar_code")
public String barCode;
/** 毛重,磅,最长四位小数。 */
@JsonProperty("weight_lbs")
public BigDecimal weightLbs;
/** 装箱率 / 箱率。 */
@JsonProperty("packing_rate")
public Integer packingRate;
/** 长,英寸,最长四位小数。 */
@JsonProperty("size_l_ln")
public BigDecimal sizeLLn;
/** 宽,英寸,最长四位小数。 */
@JsonProperty("size_w_ln")
public BigDecimal sizeWLn;
/** 高,英寸,最长四位小数。 */
@JsonProperty("size_h_ln")
public BigDecimal sizeHLn;
/** 备注。 */
@JsonProperty("remark")
public String remark;
/** 仓库码(信仓 {@code ckm})。 */
@JsonProperty("ckm")
public String ckm;
/** 产品类型:1 普货 / 2 配件 / 3 危险品;不传默认 1。 */
@JsonProperty("product_type")
public Integer productType;
/** 产品品类:0 其它 / 1 家具 / 2 食品 / 3 汽配 / 4 服饰 / 5 化妆品 / 6 鞋类 / 7 玩具 / 8 电子 / 9 数码。 */
@JsonProperty("product_category")
public Integer productCategory;
/** 产品图片;需先调 {@code upload.files}。统一模型暂不承载图片,通常为 null。 */
@JsonProperty("product_image")
public ProductImage productImage;
}
/** 产品图片(OSS 元数据)。 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public static final class ProductImage {
/** 存储类型,如 {@code aliyun_oss}。 */
@JsonProperty("type")
public String type;
/** bucket 名。 */
@JsonProperty("bucket")
public String bucket;
/** 对象键。 */
@JsonProperty("file_name")
public String fileName;
/** 可访问 URL。 */
@JsonProperty("file_url")
public String fileUrl;
}
/**
* 产品列表响应({@code GET api.productlist})中 {@code rst.data[]} 的元素。
*
* <p>只声明判断「是否已存在、处于什么状态」需要的字段。</p>
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public static final class ProductListItem {
/** 产品 SKU。 */
@JsonProperty("product_no")
public String productNo;
/** 产品状态:0 临时产品 / 1 正式产品。 */
@JsonProperty("state")
public String state;
}
/**
* 新增订单(一单多件)请求中的一条商品。
*
* <p>信仓把整组商品 JSON 序列化后放进 multipart 的 {@code products} 字段。</p>
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public static final class OrderProduct {
/** 产品 SKU。 */
@JsonProperty("product_sku")
public String productSku;
/** 数量(字符串)。 */
@JsonProperty("sku_count")
public String skuCount;
}
/**
* 新增订单(一单多件)响应中的 {@code rst}。
*/
@JsonIgnoreProperties(ignoreUnknown = true)
public static final class OrderResult {
/** 信仓系统单号(DS-...)。 */
@JsonProperty("order_no")
public String orderNo;
/** 信仓内部订单 id。 */
@JsonProperty("order_id")
public String orderId;
}
/**
* 新增转运请求({@code POST fba.do_fba})。
*
* <p>附件字段(产品贴 / 外箱贴 / 托盘贴 / BOL)要求先用 {@code upload.files} 上传,
* 再把它返回的 {@code data.data} 对象原样放进来;统一模型不承载附件,本轮不发送。</p>
*/
@JsonInclude(JsonInclude.Include.NON_NULL)
public static final class TransferRequest {
/** 转运单号(业务侧),必填。 */
@JsonProperty("fba_no")
public String fbaNo;
/** PO 号,必填。 */
@JsonProperty("po")
public String po;
/** 发货仓(仓方字典名称),必填。 */
@JsonProperty("from_warehouse_name")
public String fromWarehouseName;
/** 目的仓(仓方字典名称),必填。 */
@JsonProperty("dest_warehouse_name")
public String destWarehouseName;
/** 其它仓库名;目的仓选「其他仓库」时填。 */
@JsonProperty("other_warehouse")
public String otherWarehouse;
/** 转运类型(订单类型字典值),必填。 */
@JsonProperty("order_type")
public String orderType;
/** 转运类型(转运类型字典值),必填。 */
@JsonProperty("delivery_mode")
public String deliveryMode;
/** 转运方式 / 配送方式(字典值),必填。 */
@JsonProperty("delivery_way")
public String deliveryWay;
/** 预约发货时间 {@code yyyy-MM-dd}。 */
@JsonProperty("pre_send_time")
public String preSendTime;
/** 标签需求,多选用英文逗号分隔,如 {@code 产品贴,外箱标签}。 */
@JsonProperty("label_requirement")
public String labelRequirement;
/** 是否需要打托:{@code 是} / {@code 否}。 */
@JsonProperty("is_pallet")
public String isPallet;
/** 产品明细 JSON 字符串。 */
@JsonProperty("products")
public String products;
/** 备注。 */
@JsonProperty("remark")
public String remark;
/** 产品贴打印份数。 */
@JsonProperty("product_print_copies")
public String productPrintCopies;
/** 外箱贴打印份数。 */
@JsonProperty("ctn_print_copies")
public String ctnPrintCopies;
/** 托盘贴打印份数。 */
@JsonProperty("pallet_print_copies")
public String palletPrintCopies;
}
/** 新增转运请求里的产品明细(序列化进 {@code products} 字符串)。 */
@JsonInclude(JsonInclude.Include.NON_NULL)
public static final class TransferProduct {
/** 产品 SKU,必填。 */
@JsonProperty("product_no")
public String productNo;
/** 数量(字符串),必填。 */
@JsonProperty("sku_count")
public String skuCount;
/** 备注。 */
@JsonProperty("remark")
public String remark;
}
/** 转运单创建结果 {@code rst}。 */
@JsonIgnoreProperties(ignoreUnknown = true)
public static final class TransferResult {
/** 信仓转运单号(LTL...),审核时传它。 */
@JsonProperty("order_no")
public String orderNo;
}
/** 新增订单响应外层,用于取 {@code rst}。 */
@JsonIgnoreProperties(ignoreUnknown = true)
public static final class OrderResponse {
/** 下单结果;业务失败时为 null。 */
@JsonProperty("rst")
public OrderResult rst;
}
/** 新增转运响应外层,用于取 {@code rst}。 */
@JsonIgnoreProperties(ignoreUnknown = true)
public static final class TransferResponse {
/** 转运结果;业务失败时为 null。 */
@JsonProperty("rst")
public TransferResult rst;
}
}