WMS_MAIN/database/migrations/20260918100000-add-create-work-order-to-reply.js
liufumingren 806e739267 feat(inbox): v2 规则引擎完善(help 指令/建单开关/系统回复)并修复拦截日志误写仓库 ID
- functions.js: 拦截/取消拦截波次感知写订单日志 businessId 误用仓库 ID,改为订单 ID
  (生产订单 JY2026091813795 已发起拦截但订单详情查不到拦截日志的根因)
- rules/v2/processor/config/functionSync: 新增 help 指令、create_work_order=0 时跳过
  工单登记、系统级回复与无单号提示、白名单范围修正
- after_sale_reply 模型 + 6 个迁移: create_work_order 字段与相关配置种子
- return_unpack: 列表 count 统计修复、分页排序追加主键防重漏行、视频附加 camera_name
- methods/system.json + changes + sync 脚本: 接口文档与权限同步
2026-09-18 22:38:57 +08:00

35 lines
1.1 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';
/**
* wms_after_sale_reply 增加 create_work_order 列(幂等)。
*
* 语义:是否登记工单。1=函数正常创建售后工单(默认);
* 0=函数照常执行(符合入参即执行),但函数内部跳过工单登记
* (引擎注入 ctx.inboxContext.skip_work_order 标记,建单函数在建单前检查)。
*/
const TABLE = 'wms_after_sale_reply';
module.exports = {
up: async (queryInterface, Sequelize) => {
const tables = await queryInterface.showAllTables();
const exists = tables.some(t => (typeof t === 'string' ? t : t.tableName) === TABLE);
if (!exists) return;
const columns = await queryInterface.describeTable(TABLE);
if (columns.create_work_order) return;
await queryInterface.addColumn(TABLE, 'create_work_order', {
type: Sequelize.TINYINT(1),
allowNull: false,
defaultValue: 1,
comment: '是否登记工单:1=函数正常创建工单(默认),0=函数照常执行但内部跳过工单登记',
after: 'is_reply',
});
},
down: async () => {
// 不回退(新列无副作用)
},
};