新增: - order.recheckOrder.interceptScan: 拦截扫描接口,入参运单号,查express标记退回,处理工单,更新订单拦截状态 - afterSale.createInterceptWorkOrdersAndNotify: 共享方法,幂等创建工单+通知快递群 修复: - confirmIntercept: 补运单is_back同步(仅限is_intercept=Y),补工单创建+通知 - batchIntercept: 补运单is_intercept同步,补工单创建+通知 - batchUnintercept: 补运单is_intercept/is_back清除 - Qimen/OpenAPI cancel: 补运单is_intercept同步,补工单创建+通知 - interceptScan: 删除死查询,加空指针兜底 文档: - methods/system.json: interceptScan + confirmIntercept 完整API文档 - methods/changes/system.json: 变更记录
28 lines
1.2 KiB
JavaScript
28 lines
1.2 KiB
JavaScript
'use strict';
|
||
|
||
const TABLE_NAME = 'wms_after_sale_detail';
|
||
|
||
module.exports = {
|
||
up: async queryInterface => {
|
||
// 将 step_status 从 TINYINT 改为 VARCHAR(20),与 wms_after_sale.status 枚举保持一致
|
||
// 使用原生 SQL 一步完成:改类型 + 更新已有数据为 processing
|
||
await queryInterface.sequelize.query(
|
||
`ALTER TABLE \`${TABLE_NAME}\` MODIFY COLUMN step_status VARCHAR(20) NOT NULL DEFAULT 'processing' COMMENT '步骤记录时售后主表的状态,与 wms_after_sale.status 一致: pending | processing | pending_feedback | completed | closed | cancelled'`
|
||
);
|
||
// 已有数据(原 TINYINT 值)统一回填为 processing
|
||
await queryInterface.sequelize.query(
|
||
`UPDATE \`${TABLE_NAME}\` SET step_status = 'processing'`
|
||
);
|
||
},
|
||
|
||
down: async queryInterface => {
|
||
// 回退:先更新数据,再改回 TINYINT
|
||
await queryInterface.sequelize.query(
|
||
`UPDATE \`${TABLE_NAME}\` SET step_status = '2'`
|
||
);
|
||
await queryInterface.sequelize.query(
|
||
`ALTER TABLE \`${TABLE_NAME}\` MODIFY COLUMN step_status TINYINT(3) UNSIGNED NOT NULL DEFAULT 2 COMMENT '步骤状态:0=待开始,1=进行中,2=已完成,3=已跳过'`
|
||
);
|
||
},
|
||
};
|