20260914224947
This commit is contained in:
1 parent
63514476d7
commit
d26afb5fec
69 files changed
+158
-1008
No files matched your search
+17
-10
@@ -993,7 +993,7 @@ create table dbo.bf_files (
|
||||
mx_fileext varchar(50) null, -- 扩展名(小写、不含点)
|
||||
mx_mapfilename nvarchar(500) null, -- 访问地址:本地为 {url-prefix}/{org}/{yyyy}/{MM}/{dd}/{uuid}.{ext},OSS 为完整 URL
|
||||
mx_moduleid varchar(50) null, -- 业务模块编码(s_module.b_id)
|
||||
mx_cate_id varchar(50) null, -- 文件分类(bf_files_cateid.b_id)
|
||||
mx_cate_id bigint null, -- 文件分类(bf_files_category.b_id,雪花主键)
|
||||
mx_xh int not null default 0, -- 排序号(保留;当前实现固定 0,列表按 subid 倒序)
|
||||
mx_sh tinyint not null default 0, -- 审核标识(保留;当前实现固定 0)
|
||||
mx_shuser_id varchar(50) null, -- 审核人(保留)
|
||||
@@ -1011,19 +1011,24 @@ create table dbo.bf_files (
|
||||
create index ix_bf_files_host
|
||||
on dbo.bf_files (father, mx_moduleid, mx_cate_id, mx_xh, subid);
|
||||
|
||||
-- 文件分类表
|
||||
create table dbo.bf_files_cateid (
|
||||
b_id varchar(50) not null primary key, -- 分类编码
|
||||
b_name nvarchar(50) null, -- 分类名称
|
||||
b_files_type varchar(50) null, -- 允许的扩展名(逗号分隔,空 = 不限;保留)
|
||||
-- 文件分类表(按模块划分;b_module_id 为空表示跨模块通用分类)
|
||||
create table dbo.bf_files_category (
|
||||
b_id bigint not null primary key, -- 主键(雪花,新增行由前端 nextIdApi 生成)
|
||||
b_module_id varchar(50) null, -- 归属模块(s_module.b_id);NULL = 通用分类
|
||||
b_name nvarchar(50) not null, -- 分类名称
|
||||
b_i18n varchar(150) null, -- 多语言资源键(s_i18n.b_key)
|
||||
b_files_type varchar(50) null, -- 允许的扩展名(逗号分隔,空 = 不限;预留)
|
||||
b_xh int not null default 0, -- 显示顺序
|
||||
b_canuse tinyint not null default 1, -- 是否启用(0/1)
|
||||
b_bz nvarchar(200) null, -- 备注
|
||||
b_inputuser_id varchar(50) null, -- 创建人
|
||||
b_inputdatetime datetime2 null, -- 创建时间
|
||||
b_updateuser_id varchar(50) null, -- 最后修改人
|
||||
b_updatedatetime datetime2 null -- 最后修改时间
|
||||
b_created_by varchar(50) null, -- 创建人(用户账号)
|
||||
b_created_at datetime2 null, -- 创建时间
|
||||
b_updated_by varchar(50) null, -- 最后修改人
|
||||
b_updated_at datetime2 null -- 最后修改时间
|
||||
);
|
||||
|
||||
create index ix_bf_files_category_module
|
||||
on dbo.bf_files_category (b_module_id, b_canuse, b_xh, b_id);
|
||||
```
|
||||
|
||||
要点:
|
||||
@@ -1032,6 +1037,8 @@ create table dbo.bf_files_cateid (
|
||||
- **宿主关联**:`father` 存宿主业务主键(业务表 `b_id`,bigint 雪花),不建外键;删除业务数据时由业务层级联清理附件(先删存储、后删行)。
|
||||
- **存储地址**:`mx_mapfilename` 即访问地址,前端预览 / 下载直接使用。本地模式写入 `{fms.file.local.url-prefix}/{orgId}/{yyyy}/{MM}/{dd}/{uuid}.{ext}`,物理文件落在 `{fms.file.local.storage-dir}` 下的同路径;OSS 模式写入 g3oss 返回的完整 URL。
|
||||
- **保留字段**:`mx_sh*`(审核)、`mx_cut*`(缩略图)、`mx_orderid`、`mx_bz`、`mx_xh` 沿用旧库结构,当前实现未使用(写 0 / 空值),保留以兼容历史数据迁移。
|
||||
- **分类归属模块**:`bf_files_category.b_module_id` 指定分类所属模块,不填(NULL)为跨模块通用分类;分类树按当前模块过滤(`b_module_id IS NULL OR b_module_id = 当前模块`)。分类主键与 `bf_files.mx_cate_id` 类型保持一致(bigint 雪花)。
|
||||
- **风格**:分类表按新版字典表风格(应用层雪花主键、`b_created_*` 审计列、`b_canuse tinyint`);`bf_files` 的 `subid` / `father` / `mx_*` 列名已被前后端实现引用,保持现状。表名 `bf_*` 属于"明确的业务域前缀",符合第 1 节表名规范。
|
||||
- **旧库遗留**:`bf_files_type`(模块文件类型 / 数量配置)在旧库存在,但新旧系统均未使用,不迁移。
|
||||
|
||||
存储配置(`application.yaml`):
|
||||
|
||||
Reference in new issue
Block a user