WMS_MAIN/app/model/order_wave_strategy_match.js
liufumingren 9c2b254206 1
Co-authored-by: Copilot <copilot@github.com>
2026-05-11 08:44:27 +08:00

54 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.

// app/model/order_wave_strategy_match.js
'use strict';
module.exports = app => {
const { BIGINT, INTEGER, DATE } = app.Sequelize;
const OrderWaveStrategyMatch = app.model.define('wms_order_wave_strategy_match', {
id: {
type: BIGINT,
primaryKey: true,
autoIncrement: true,
allowNull: false,
comment: '主键',
},
warehouse_id: {
type: INTEGER(10),
allowNull: false,
comment: '仓库ID',
},
order_id: {
type: BIGINT,
allowNull: false,
comment: '订单ID,逻辑关联分仓主表,不做物理外键',
},
strategy_id: {
type: INTEGER(10),
allowNull: false,
comment: '命中的波次策略ID',
},
create_time: {
type: DATE,
allowNull: false,
defaultValue: app.Sequelize.literal('CURRENT_TIMESTAMP'),
comment: '写入时间',
},
}, {
tableName: 'wms_order_wave_strategy_match',
timestamps: false,
comment: '订单波次策略命中明细表,记录每个订单命中的全部策略',
indexes: [
{
name: 'idx_warehouse_order',
fields: [ 'warehouse_id', 'order_id' ],
},
{
name: 'idx_warehouse_strategy',
fields: [ 'warehouse_id', 'strategy_id' ],
},
],
});
return OrderWaveStrategyMatch;
};