WMS_MAIN/database/migrations/20260916192100-fix-plate-regexp.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

28 lines
1013 B
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';
/**
* 修正"车牌提取"规则正则(开发库已插入旧正则,生产幂等)。
*
* 问题:旧正则 alternation 顺序导致新能源 6 位尾号被截断
* ("粤BD12345" 匹配成 "粤BD1234")。
* 修正:新能源分支 [DF][A-HJ-NP-Z0-9]{5} 前置优先,传统 5 位尾号分支靠后。
*/
const TABLE = 'wms_inbox_number_rule';
const FIXED_REGEXP = '[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼使领][A-HJ-NP-Z][·.]?(?:[DF][A-HJ-NP-Z0-9]{5}|[A-HJ-NP-Z0-9]{4}[A-HJ-NP-Z0-9挂学警港澳])';
module.exports = {
up: async queryInterface => {
await queryInterface.sequelize.query(
'UPDATE `' + TABLE + '` SET `regexp` = :regexp, updated_at = NOW() WHERE name = :name',
{ replacements: { name: '车牌提取', regexp: FIXED_REGEXP } }
);
},
// eslint-disable-next-line no-unused-vars
down: async queryInterface => {
// 回滚不做(旧正则有截断缺陷,不回退)
},
};