liufumingren
|
55f766f643
|
fix(stockout): 出库单确认按来源分流回传,运单号口径收敛为复数
- storage.stockout.confirm 出站回传改为按 source_type 分流(复用 order_async.js 既有分流实现):
QM→奇门 taobao.qimen.stockout.confirm;API→OpenAPI 回调 stockout.confirm(appKey 按货主合约
反查 wms_store_warehouse(auth_status=2) + wms_api_app(启用且 callback_url 非空));
WMS 等内部来源无需外部通知、直接视为成功。修复此前 API 来源出库单被硬编码发往奇门、
遭「-1 无法匹配货主」拒绝后无法确认(跳过出站同样走失败分支)的问题。
- storage.stockout.confirm 运单号校验与回传改为以复数 waybill_codes 为准(对齐奇门
packages.package[].expressCode 多运单模型,不使用 deliveryOrder.expressCode);
单数 waybill_code 已弃用,仅在复数缺失时回退单数兼容存量单;失败文案改为 (waybill_codes)。
- storage.stockout.updateExpress 以 waybill_codes 为准,单数 waybill_code 降级为镜像字段
(传非空复数时镜像首个、传空数组/null 时同步置 NULL、同时传两列时复数优先);
仅传单数的旧调用方行为不变。
- app/service/systems/order_async.js 新增 3 个可复用实例方法(buildStockoutConfirmRequest /
notifyStockoutExternal / resolveOpenApiAppByStore),薄封装既有模块级实现,
未改动原函数及其既有调用方。
- 新增回归测试:stockout.confirm.outbound.test.js(8 条,覆盖 API/QM/WMS 三路来源、多运单复数
回传、存量单单数回退)、stockout.updateExpress.test.js(7 条,覆盖复数镜像与兼容行为)。
- 同步 methods/system.json 与 methods/changes/system.json(storage.stockout.confirm /
storage.stockout.updateExpress)。
|
2026-09-15 15:40:39 +08:00 |
|