oms/backend/database/migrations/20260915000500-drop-create-channel-from-order-deliveries.js
liufumingren 11e7b26ced feat(backend): 发货单模块与 WMS 定时推送队列
- 发货单主表/明细表(order_deliveries / order_delivery_items)控制器与模型
- 表头金额与明细派生字段重算(utils/recalcOrderDelivery.js)
- 状态流转:审核/驳回/取消/恢复/作废、批量审核、批量切换仓库
- 审核入队 + 定时推送:service/orderDeliveryPush.js(乐观锁 CAS 防重、失败重试上限 3 次、业务失败退回待审核)+ schedule/orderDeliveryPush.js
- 收件人 AI 智能识别(service/ai.js,DeepSeek)
- 相关迁移:建表、站内字段、明细表、订单类型默认值、快递字典、菜单种子、历史数据搬迁
2026-09-13 02:23:47 +08:00

35 lines
1.3 KiB
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';
/**
* 移除发货单的「创建渠道」字段(order_deliveries.create_channel)
*
* 原因:该字段是 WMS 侧自己的口径 —— WMS 按调用通道自动写入
* - 奇门通道固定 'QM'
* - openapi 通道固定 'API'
* OMS 一律通过 WMS openapi 调用,渠道由 WMS 侧落库,OMS 保存无意义,故整体移除。
*
* 连带影响(已同步代码):
* - `need_oms_waybill` 不再按渠道判断(OMS 即 API 通道,WMS 侧该开关即生效)
* - 历史搬迁迁移 20260915000300 的 INSERT 列表已同步去掉该列,保证可重复执行
*/
module.exports = {
async up(queryInterface) {
const cols = await queryInterface.describeTable('order_deliveries');
if (cols.create_channel) {
await queryInterface.removeColumn('order_deliveries', 'create_channel');
}
},
async down(queryInterface, Sequelize) {
const cols = await queryInterface.describeTable('order_deliveries');
if (!cols.create_channel) {
await queryInterface.addColumn('order_deliveries', 'create_channel', {
type: Sequelize.STRING(20),
allowNull: false,
defaultValue: 'MANUAL',
comment: '创建渠道:MANUAL 人工 / QM 奇门 / API 开放接口(已废弃,渠道由 WMS 侧写入)',
});
}
},
};