- workbench: 工作台成员拆分 wms_workbench_member 表,下线 barcode 字段,新增绑定/移除成员接口 - order: 订单配送新增 wave_scope 波次范围字段与历史回填,自动分配快递排除备注与储位分配限制修复 - storage.transaction.list: 重写为 wms_storage_transaction 逐条明细查询,消除聚合慢查询 - stock.report: 分页默认生效、排序白名单扩充、where.stock_id 数组兼容修复 - storage.entry: quickInbound/commit 新增 noNeedNotice 通知开关 - storage.inventory.list: stock_query 支持数组多关键字并集匹配 - store: 手工单回传通知策略 notify_manual_sync - docs: 同步接口文档与变更记录、路由表;test: 补充快递排除与储位分配限制测试
72 lines
1.7 KiB
JavaScript
72 lines
1.7 KiB
JavaScript
'use strict';
|
||
|
||
module.exports = app => {
|
||
const { STRING, BIGINT, DATE } = app.Sequelize;
|
||
|
||
const WorkbenchMember = app.model.define('workbench_member', {
|
||
id: {
|
||
type: BIGINT(20).UNSIGNED,
|
||
primaryKey: true,
|
||
autoIncrement: true,
|
||
comment: '主键ID',
|
||
},
|
||
workbench_id: {
|
||
type: BIGINT(20).UNSIGNED,
|
||
allowNull: false,
|
||
comment: '工作台ID,关联 wms_workbench.id',
|
||
},
|
||
user_id: {
|
||
type: BIGINT(20).UNSIGNED,
|
||
allowNull: true,
|
||
comment: '账号ID,关联 wms_account.id;非系统账号用户为 NULL',
|
||
},
|
||
user_name: {
|
||
type: STRING(128),
|
||
allowNull: true,
|
||
comment: '成员名称快照(非系统账号用户显示名)',
|
||
},
|
||
created_at: {
|
||
type: DATE,
|
||
allowNull: false,
|
||
comment: '创建时间',
|
||
},
|
||
updated_at: {
|
||
type: DATE,
|
||
allowNull: false,
|
||
comment: '更新时间',
|
||
},
|
||
deleted_at: {
|
||
type: DATE,
|
||
allowNull: true,
|
||
comment: '软删除时间',
|
||
},
|
||
}, {
|
||
tableName: 'wms_workbench_member',
|
||
timestamps: true,
|
||
createdAt: 'created_at',
|
||
updatedAt: 'updated_at',
|
||
paranoid: true,
|
||
deletedAt: 'deleted_at',
|
||
comment: '工作台成员/用户登录副表',
|
||
indexes: [
|
||
{ name: 'idx_workbench_id', fields: [ 'workbench_id' ] },
|
||
{ name: 'idx_user_id', fields: [ 'user_id' ] },
|
||
],
|
||
});
|
||
|
||
WorkbenchMember.associate = () => {
|
||
app.model.WorkbenchMember.belongsTo(app.model.Workbench, {
|
||
foreignKey: 'workbench_id',
|
||
targetKey: 'id',
|
||
as: 'workbench',
|
||
});
|
||
app.model.WorkbenchMember.belongsTo(app.model.Account, {
|
||
foreignKey: 'user_id',
|
||
targetKey: 'id',
|
||
as: 'user',
|
||
});
|
||
};
|
||
|
||
return WorkbenchMember;
|
||
};
|