- functions 新增 openDoor/registerLicensePlate/enter/departure(规则表+权限分组) - 到货登记表 wms_inbox_arrival_register(含消费字段,离场闭环,货主收货群优先推送) - 回执 extend_props 持久化落库与定时补发送下发(重推兜底回读) - 车牌提取正则兼容异体字(粤/粵) - 售后类型/关键字/函数/回复 v2 模型与迁移 - INBOX V2 HTTP 测试报告与指南
54 lines
1.7 KiB
JavaScript
54 lines
1.7 KiB
JavaScript
'use strict';
|
||
|
||
/**
|
||
* 创建到货登记表 wms_inbox_arrival_register。
|
||
*
|
||
* 用途:货主/仓库群发送"到货+车牌号"时,AI 提取车牌号并登记,
|
||
* 记录货主ID、仓库ID、登记时间(created_at)、车牌号。
|
||
*
|
||
* 索引:
|
||
* idx_warehouse_plate(仓库+车牌查询某车牌在该仓库的登记记录)
|
||
* idx_store_id(按货主查询)
|
||
*/
|
||
|
||
module.exports = {
|
||
// eslint-disable-next-line no-unused-vars
|
||
async up(queryInterface, Sequelize) {
|
||
const { BIGINT, STRING, DATE } = Sequelize;
|
||
await queryInterface.createTable('wms_inbox_arrival_register', {
|
||
id: {
|
||
type: BIGINT(20).UNSIGNED,
|
||
primaryKey: true,
|
||
autoIncrement: true,
|
||
allowNull: false,
|
||
comment: '主键ID',
|
||
},
|
||
warehouse_id: {
|
||
type: BIGINT(20).UNSIGNED,
|
||
allowNull: false,
|
||
comment: '仓库ID(数据隔离维度)',
|
||
},
|
||
store_id: {
|
||
type: BIGINT(20).UNSIGNED,
|
||
allowNull: true,
|
||
comment: '货主ID(仓库群登记时无货主,允许为空)',
|
||
},
|
||
license_plate: {
|
||
type: STRING(20),
|
||
allowNull: false,
|
||
comment: '车牌号',
|
||
},
|
||
created_at: { type: DATE, allowNull: false, comment: '登记时间' },
|
||
updated_at: { type: DATE, allowNull: false, comment: '更新时间' },
|
||
});
|
||
|
||
await queryInterface.addIndex('wms_inbox_arrival_register', [ 'warehouse_id', 'license_plate' ], { name: 'idx_warehouse_plate' });
|
||
await queryInterface.addIndex('wms_inbox_arrival_register', [ 'store_id' ], { name: 'idx_store_id' });
|
||
},
|
||
|
||
// eslint-disable-next-line no-unused-vars
|
||
async down(queryInterface, Sequelize) {
|
||
await queryInterface.dropTable('wms_inbox_arrival_register');
|
||
},
|
||
};
|