- 盘点明细/记录支持未知商品(stock_id 可空)与库位范围,模式/状态口径修正 - 新增静态盘点任务、公告相关模型与迁移,stock_warehouse 增加预警数量 - methods/system.json 同步盘点接口文档;headers platform 微信端取值 wx 修正为 miniprogram
58 lines
1.4 KiB
JavaScript
58 lines
1.4 KiB
JavaScript
'use strict';
|
||
|
||
module.exports = app => {
|
||
const { BIGINT, DATE } = app.Sequelize;
|
||
|
||
const StockStaticCheckTask = app.model.define('stock_static_check_task', {
|
||
id: {
|
||
type: BIGINT(20).UNSIGNED,
|
||
primaryKey: true,
|
||
autoIncrement: true,
|
||
comment: '主键ID',
|
||
},
|
||
stock_id: {
|
||
type: BIGINT(20).UNSIGNED,
|
||
allowNull: false,
|
||
comment: '商品ID,关联 wms_stock_warehouse.id',
|
||
},
|
||
task_time: {
|
||
type: DATE,
|
||
allowNull: false,
|
||
comment: '创建盘点任务时间(有记录即表示已为该静态商品创建过盘点任务)',
|
||
},
|
||
created_at: {
|
||
type: DATE,
|
||
allowNull: false,
|
||
comment: '创建时间',
|
||
},
|
||
updated_at: {
|
||
type: DATE,
|
||
allowNull: false,
|
||
comment: '更新时间',
|
||
},
|
||
deleted_at: {
|
||
type: DATE,
|
||
defaultValue: null,
|
||
comment: '软删除时间',
|
||
},
|
||
}, {
|
||
tableName: 'wms_stock_static_check_task',
|
||
freezeTableName: true,
|
||
timestamps: false,
|
||
paranoid: true,
|
||
comment: '静态商品盘点任务关联表(记录是否已为静态商品创建盘点任务,避免重复创建)',
|
||
indexes: [
|
||
{
|
||
name: 'idx_stock_task_time',
|
||
fields: [ 'stock_id', 'task_time' ],
|
||
},
|
||
{
|
||
name: 'idx_task_time',
|
||
fields: [ 'task_time' ],
|
||
},
|
||
],
|
||
});
|
||
|
||
return StockStaticCheckTask;
|
||
};
|