oms/backend/database/migrations/20261123100000-add-has-own-waybill-to-external-print-platforms.js
liufumingren 2b8fcc2286 外部打单平台增加「是否自带运单」
- external_print_platforms 新增 has_own_waybill(默认 0),同步接口契约与前端类型
- 自带运单的平台取号时复用平台已确认运单号(WaybillCodes),只重新拉取打印数据,不分配新面单
- 平台属性查询补齐 has_own_waybill,更新店管家取号文档并补测试

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-11-23 21:13:48 +08:00

25 lines
979 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'use strict';
/**
* 外部打单平台增加「是否自带运单」。
*
* 自带运单的平台:订单在平台侧已经出号,OMS 取号时直接复用平台已有运单号(只重新拉取打印数据),
* 不再分配新面单;未带运单的平台保持原有「每次真实取号」的口径。
* 与 fetch_waybill_no 的关系:自带运单的平台同样需要回平台取号(把已有运单号回给 WMS),
* 因此 has_own_waybill=1 时 fetch_waybill_no 也应为 1。
*/
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.addColumn('external_print_platforms', 'has_own_waybill', {
type: Sequelize.TINYINT,
allowNull: false,
defaultValue: 0,
comment: '是否自带运单:1是(取号时复用平台已有运单号,不分配新面单) 0否',
});
},
async down(queryInterface) {
await queryInterface.removeColumn('external_print_platforms', 'has_own_waybill');
},
};