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 在店铺内唯一命中」匹配店铺商品,