From 661254dfa4217191ed65544edfea32a024c0b7f0 Mon Sep 17 00:00:00 2001 From: liufumingren Date: Tue, 24 Nov 2026 00:35:43 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BA=97=E5=B0=8F=E7=A7=98=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E6=94=B6=E4=BB=B6=E4=BA=BA=EF=BC=9A=E8=B7=A8=E5=A2=83=E5=8D=95?= =?UTF-8?q?=E5=8C=BA=E5=8E=BF/=E8=A1=97=E9=81=93=E7=94=A8=20"-"=20?= =?UTF-8?q?=E5=8D=A0=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 跨境单(Shopify 等)地址没有区县/街道,area/town 统一写 "-",保证下游必填项有值 - 同步更新接入文档与单测 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- backend/app/lib/printPlatform/dxm.js | 5 +++-- backend/test/app/lib/printPlatformDxm.test.js | 5 +++-- 店小秘接入.md | 6 +++++- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/backend/app/lib/printPlatform/dxm.js b/backend/app/lib/printPlatform/dxm.js index 95207bb..1a52531 100644 --- a/backend/app/lib/printPlatform/dxm.js +++ b/backend/app/lib/printPlatform/dxm.js @@ -620,8 +620,9 @@ class DxmService extends PrintPlatformService { email: String(addr.email || ''), province: String(addr.province || ''), city: String(addr.city || ''), - area: String(addr.district || ''), - town: '', + // 跨境单(Shopify 等)地址没有区县/街道:用 "-" 占位,保证下游(审核/推 WMS/面单)必填项有值 + area: String(addr.district || '').trim() || '-', + town: '-', masked: !!addr.hasAsterisk, }, remark: String(data.sellerComment || data.orderRemark || '') || null, diff --git a/backend/test/app/lib/printPlatformDxm.test.js b/backend/test/app/lib/printPlatformDxm.test.js index c68a698..837374f 100644 --- a/backend/test/app/lib/printPlatformDxm.test.js +++ b/backend/test/app/lib/printPlatformDxm.test.js @@ -372,8 +372,9 @@ describe('printPlatform/dxm listOrders', () => { email: '', province: 'Illinois', city: 'Collinsville', - area: '', - town: '', + // 跨境单没有区县/街道,用 "-" 占位 + area: '-', + town: '-', masked: false, }); diff --git a/店小秘接入.md b/店小秘接入.md index 3144612..a3e574d 100644 --- a/店小秘接入.md +++ b/店小秘接入.md @@ -205,7 +205,11 @@ POST /api/package/list.json (x-www-form-urlencoded) OMS 实现(`dxm.js#listOrders`): - 按 `totalPage` 逐页拉(每页 100),**一个包裹 = 一张 OMS 订单**,`external_order_id` = 包裹ID; -- `total_amount` / `pay_amount` = `orderAmount + shipAmount`;收件人取 `dxmPackageAddr`; +- `total_amount` / `pay_amount` = `orderAmount + shipAmount`; +- 收件人取 `dxmPackageAddr`:`contactPerson`→姓名、`phoneNumber`/`mobile`→电话、`province`→省(州)、 + `city`→市、`district`→区县、`detailAddress`+`address2`→详细地址、`country`→`country_code`、 + `zip`→`zip_code`、`email`→`email`; + **跨境单没有区县/街道,`area`/`town` 用 `-` 占位**(下游必填项、面单打印都需要有值),不做中英文转换; - 明细跳过 `cancelFlag=true` 的行; - **订单明细只给平台规格ID**(`productId`/`vid`/`stockProductId` 都是规格ID),不给平台商品ID, 因此明细的 `outer_item_id` 留空,由 `lib/shopProductMatch` 按「规格ID 在店铺内唯一命中」匹配店铺商品,