admin/sql/seed_doc_number_extract_20261114.sql
zzh 13997ae5d0
All checks were successful
Build and Deploy / deploy (push) Successful in 1m17s
feat: 单号规则支持截取模式,扫描条码按规则解析后再查单
新增 Generate/Extract 模式、匹配预览与运营扫描链路接入,并补充迁移种子与解析单测。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-14 19:28:10 +08:00

28 lines
959 B
SQL
Raw Permalink 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.

-- =============================================================================
-- seed_doc_number_extract_20261114.sql
-- 扫描截取示例(默认禁用):USPS 长码取右 22 位。
-- 可重复执行。前置:migrate_doc_number_rule_extract_20261114.sql
-- =============================================================================
INSERT INTO `t_doc_number_rule` (
`DocType`, `RuleMode`, `RuleName`, `Formula`, `MatchPattern`,
`ProductCode`, `ChannelCode`, `CountryCode`,
`Priority`, `Status`, `Remark`, `IsDeleted`, `CreateUserId`
)
SELECT
'ScanExtract',
'Extract',
'示例-USPS长码右22位',
'RIGHT:22',
'prefix:420',
NULL, NULL, NULL,
100,
1,
'示例禁用;启用前请按实际条码样例调整 MatchPattern / Formula(MID/REGEX)。',
0, 0
FROM DUAL
WHERE NOT EXISTS (
SELECT 1 FROM `t_doc_number_rule`
WHERE `IsDeleted` = 0 AND `RuleMode` = 'Extract' AND `RuleName` = '示例-USPS长码右22位'
);