admin/sql/migrate_t_order_template_mapping.sql
zzh 9ab112a36e feat(order): 下单模板映射与 Excel 批量导入小包创建
新增专线小包标准模板生成、自定义列映射 API,并将 /order/upload 改为按映射解析 Excel 后走 CreateParcelCoreAsync;列表查询时自动补齐标准模板种子数据。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-08 16:42:22 +08:00

13 lines
919 B
SQL
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.

-- 下单模板:自定义映射与样例文件
ALTER TABLE `t_order_template`
ADD COLUMN `StandardTemplateKey` VARCHAR(64) NULL COMMENT '映射所依据的标准模板 TemplateKey' AFTER `TemplateKey`,
ADD COLUMN `MappingStatus` VARCHAR(16) NULL COMMENT 'draft/ready;标准模板为 ready' AFTER `StandardTemplateKey`,
ADD COLUMN `SourceFileName` VARCHAR(256) NULL COMMENT '客户上传样例文件名' AFTER `MappingStatus`,
ADD COLUMN `SourceFilePath` VARCHAR(512) NULL COMMENT '样例文件相对路径 /uploads/...' AFTER `SourceFileName`,
ADD COLUMN `SourceHeadersJson` TEXT NULL COMMENT '客户 Excel 表头 JSON 数组' AFTER `SourceFilePath`,
ADD COLUMN `ColumnMappingJson` TEXT NULL COMMENT '标准字段与客户列映射 JSON' AFTER `SourceHeadersJson`;
UPDATE `t_order_template`
SET `MappingStatus` = 'ready'
WHERE `Type` = 'standard' AND (`MappingStatus` IS NULL OR `MappingStatus` = '');