WMS_MAIN/app/model/inbox_arrival_register.js
liufumingren c2a761ca26 feat(inbox): 新增开门/到货/进场/离场车牌登记与 extend_props 持久化
- functions 新增 openDoor/registerLicensePlate/enter/departure(规则表+权限分组)
- 到货登记表 wms_inbox_arrival_register(含消费字段,离场闭环,货主收货群优先推送)
- 回执 extend_props 持久化落库与定时补发送下发(重推兜底回读)
- 车牌提取正则兼容异体字(粤/粵)
- 售后类型/关键字/函数/回复 v2 模型与迁移
- INBOX V2 HTTP 测试报告与指南
2026-09-17 02:41:43 +08:00

72 lines
2.0 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';
/**
* 到货登记 Model。
* 货主/仓库群发送"到货+车牌号"时,AI 提取车牌号并登记,
* 记录货主ID、仓库ID、登记时间(created_at)、车牌号。
* @param {Object} app Egg.js Application 实例。
* @return {Object} Sequelize Model 定义。
*/
module.exports = app => {
const { BIGINT, STRING } = app.Sequelize;
const InboxArrivalRegister = app.model.define('inbox_arrival_register', {
id: {
type: BIGINT.UNSIGNED,
primaryKey: true,
autoIncrement: true,
allowNull: false,
comment: '主键ID',
},
warehouse_id: {
type: BIGINT.UNSIGNED,
allowNull: false,
comment: '仓库ID(数据隔离维度)',
},
store_id: {
type: BIGINT.UNSIGNED,
allowNull: true,
comment: '货主ID(仓库群登记时无货主,允许为空)',
},
license_plate: {
type: STRING(20),
allowNull: false,
comment: '车牌号',
},
consumed: {
type: app.Sequelize.TINYINT(1),
allowNull: false,
defaultValue: 0,
comment: '是否已消费(离场登记)0=未消费 1=已消费',
},
consumed_at: {
type: app.Sequelize.DATE,
allowNull: true,
comment: '消费时间(离场时间)',
},
created_at: {
type: app.Sequelize.DATE,
allowNull: false,
defaultValue: app.Sequelize.literal('CURRENT_TIMESTAMP'),
comment: '登记时间',
},
updated_at: {
type: app.Sequelize.DATE,
allowNull: false,
defaultValue: app.Sequelize.literal('CURRENT_TIMESTAMP'),
comment: '更新时间',
},
}, {
tableName: 'wms_inbox_arrival_register',
timestamps: true,
createdAt: 'created_at',
updatedAt: 'updated_at',
// 表无 deleted_at 列,必须显式关闭全局 define 的 paranoid 默认值,
// 否则 findAll/findOne 会拼出 deleted_at 字段导致 Unknown column 报错
paranoid: false,
comment: '到货登记表(货主ID、仓库ID、登记时间、车牌号)',
});
return InboxArrivalRegister;
};