Browse Source
上一版按文档只实现了部分字段,这次对齐到 schema 全量: 一单多件 api.add_order_multiple: - 补 gzh(trackingNumber)/ face_base64(labelContentBase64)/ shop_name / sfp;order_type=wayfair 时前两者必填,缺失在下单前拦下, 不再等仓返回看不懂的错误 - 移除 remark:该接口 schema 没有这个字段,之前是多发的 新增转运 fba.do_fba: - 补 4 个单附件(product_label_att / ctn_label_att / express_label_att / pallet_label_att)、2 个数组附件(other_att / bol_att)、 express_print_copies - products 明细补 fn_sku / ctn_sku / remark 模型配套: - OutboundCommand 增加 trackingNumber / labelContentBase64 / shopName / sfp - TransferCommand 增加 6 个附件字段与快递份数;TransferLine 增加三方 SKU、 箱标 SKU 与备注(保留原两参构造,YQN 不受影响) - 新增 TransferAttachment 承载 upload.files 返回的附件元数据, SDK 只搬运、不下载不落盘 字段覆盖已与文档逐项核对:两个接口均无缺、无多。 Co-Authored-By: Claude Code <noreply@anthropic.com>feature/supplier-lingxing
8 changed files with 618 additions and 10 deletions
@ -0,0 +1,122 @@ |
|||||||
|
package common.ecommerce.warehouse.model; |
||||||
|
|
||||||
|
import java.util.Objects; |
||||||
|
|
||||||
|
/** |
||||||
|
* 仓方文件上传后的附件元数据。 |
||||||
|
* |
||||||
|
* <p>信仓的转运 / 订单附件要求先用 {@code upload.files} 上传,再把返回的对象原样放进 |
||||||
|
* 对应字段({@code product_label_att} 等)。SDK <b>不下载、不解析、不落盘</b>, |
||||||
|
* 只做字段搬运。</p> |
||||||
|
*/ |
||||||
|
public final class TransferAttachment { |
||||||
|
|
||||||
|
/** 存储类型,如 {@code aliyun_oss}。 */ |
||||||
|
private final String type; |
||||||
|
/** bucket 名。 */ |
||||||
|
private final String bucket; |
||||||
|
/** 对象键。 */ |
||||||
|
private final String fileName; |
||||||
|
/** 可访问 URL。 */ |
||||||
|
private final String fileUrl; |
||||||
|
/** 文件类型(如 pdf / png);部分仓必填。 */ |
||||||
|
private final String fileType; |
||||||
|
/** 原始文件名。 */ |
||||||
|
private final String name; |
||||||
|
|
||||||
|
private TransferAttachment(Builder b) { |
||||||
|
this.type = b.type; |
||||||
|
this.bucket = b.bucket; |
||||||
|
this.fileName = require(b.fileName, "fileName"); |
||||||
|
this.fileUrl = b.fileUrl; |
||||||
|
this.fileType = b.fileType; |
||||||
|
this.name = b.name; |
||||||
|
} |
||||||
|
|
||||||
|
public static Builder builder() { |
||||||
|
return new Builder(); |
||||||
|
} |
||||||
|
|
||||||
|
/** 存储类型;可能为 null。 */ |
||||||
|
public String type() { |
||||||
|
return type; |
||||||
|
} |
||||||
|
|
||||||
|
/** bucket 名;可能为 null。 */ |
||||||
|
public String bucket() { |
||||||
|
return bucket; |
||||||
|
} |
||||||
|
|
||||||
|
/** 对象键;必填。 */ |
||||||
|
public String fileName() { |
||||||
|
return fileName; |
||||||
|
} |
||||||
|
|
||||||
|
/** 可访问 URL;可能为 null。 */ |
||||||
|
public String fileUrl() { |
||||||
|
return fileUrl; |
||||||
|
} |
||||||
|
|
||||||
|
/** 文件类型;可能为 null。 */ |
||||||
|
public String fileType() { |
||||||
|
return fileType; |
||||||
|
} |
||||||
|
|
||||||
|
/** 原始文件名;可能为 null。 */ |
||||||
|
public String name() { |
||||||
|
return name; |
||||||
|
} |
||||||
|
|
||||||
|
private static String require(String v, String n) { |
||||||
|
Objects.requireNonNull(v, n); |
||||||
|
if (v.trim().isEmpty()) { |
||||||
|
throw new IllegalArgumentException(n + " must not be blank"); |
||||||
|
} |
||||||
|
return v.trim(); |
||||||
|
} |
||||||
|
|
||||||
|
public static final class Builder { |
||||||
|
|
||||||
|
private String type; |
||||||
|
private String bucket; |
||||||
|
private String fileName; |
||||||
|
private String fileUrl; |
||||||
|
private String fileType; |
||||||
|
private String name; |
||||||
|
|
||||||
|
public Builder type(String v) { |
||||||
|
this.type = v; |
||||||
|
return this; |
||||||
|
} |
||||||
|
|
||||||
|
public Builder bucket(String v) { |
||||||
|
this.bucket = v; |
||||||
|
return this; |
||||||
|
} |
||||||
|
|
||||||
|
/** 对象键;必填。 */ |
||||||
|
public Builder fileName(String v) { |
||||||
|
this.fileName = v; |
||||||
|
return this; |
||||||
|
} |
||||||
|
|
||||||
|
public Builder fileUrl(String v) { |
||||||
|
this.fileUrl = v; |
||||||
|
return this; |
||||||
|
} |
||||||
|
|
||||||
|
public Builder fileType(String v) { |
||||||
|
this.fileType = v; |
||||||
|
return this; |
||||||
|
} |
||||||
|
|
||||||
|
public Builder name(String v) { |
||||||
|
this.name = v; |
||||||
|
return this; |
||||||
|
} |
||||||
|
|
||||||
|
public TransferAttachment build() { |
||||||
|
return new TransferAttachment(this); |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
Loading…
Reference in new issue