- functions 新增 openDoor/registerLicensePlate/enter/departure(规则表+权限分组) - 到货登记表 wms_inbox_arrival_register(含消费字段,离场闭环,货主收货群优先推送) - 回执 extend_props 持久化落库与定时补发送下发(重推兜底回读) - 车牌提取正则兼容异体字(粤/粵) - 售后类型/关键字/函数/回复 v2 模型与迁移 - INBOX V2 HTTP 测试报告与指南
65 lines
1.6 KiB
JavaScript
65 lines
1.6 KiB
JavaScript
'use strict';
|
||
|
||
module.exports = app => {
|
||
const { STRING, INTEGER, BIGINT, DATE } = app.Sequelize;
|
||
|
||
const InboxNumberRule = app.model.define('inboxNumberRule', {
|
||
id: {
|
||
type: BIGINT(20).UNSIGNED,
|
||
primaryKey: true,
|
||
autoIncrement: true,
|
||
comment: '主键',
|
||
},
|
||
name: {
|
||
type: STRING(100),
|
||
allowNull: false,
|
||
comment: '规则名称,如:运单号提取/收货单号提取/平台订单号提取',
|
||
},
|
||
target: {
|
||
type: STRING(50),
|
||
allowNull: false,
|
||
comment: '提取目标类型:waybill_no/receiving_no/entry_order_no/stockout_no/order_no/source_order_codes/express_name/plate_no',
|
||
},
|
||
regexp: {
|
||
type: STRING(500),
|
||
allowNull: false,
|
||
comment: '取号正则(JS 正则源字符串,不含首尾斜杠,支持全局匹配)',
|
||
},
|
||
sort_order: {
|
||
type: INTEGER(11),
|
||
allowNull: false,
|
||
defaultValue: 0,
|
||
comment: '规则尝试顺序,数值小者优先',
|
||
},
|
||
created_at: {
|
||
type: DATE,
|
||
comment: '创建时间',
|
||
},
|
||
updated_at: {
|
||
type: DATE,
|
||
comment: '更新时间',
|
||
},
|
||
}, {
|
||
tableName: 'wms_inbox_number_rule',
|
||
underscored: true,
|
||
timestamps: true,
|
||
createdAt: 'created_at',
|
||
updatedAt: 'updated_at',
|
||
paranoid: false,
|
||
comment: '取号规则表(站内信消息中正则提取单据号)',
|
||
indexes: [
|
||
{
|
||
unique: true,
|
||
fields: [ 'name' ],
|
||
name: 'uk_name',
|
||
},
|
||
{
|
||
fields: [ 'target' ],
|
||
name: 'idx_target',
|
||
},
|
||
],
|
||
});
|
||
|
||
return InboxNumberRule;
|
||
};
|