进度+文件上传重构+文件权限控制

This commit is contained in:
2025-05-10 22:17:04 +08:00
parent ca3724ff32
commit 9825e0ba1d
49 changed files with 758 additions and 664 deletions

View File

@@ -73,4 +73,55 @@ CREATE TABLE `oa_project_schedule_step` (
CONSTRAINT `fk_project_step_main` FOREIGN KEY (`schedule_id`)
REFERENCES `oa_project_schedule` (`schedule_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='项目进度步骤跟踪表';
``
``
create table if not exists oa_project_schedule_step
(
track_id bigint auto_increment comment '跟踪记录主键'
primary key,
accessory varchar(500) null comment '文件列表',
schedule_id bigint not null comment '所属项目进度ID',
step_order int not null comment '步骤序号',
step_name varchar(64) not null comment '步骤名称(冗余存储模板名称)',
plan_start datetime null comment '计划开始',
plan_end datetime null comment '计划完成',
actual_start datetime null,
actual_end datetime null,
status int default 0 null comment '0进行中 1完成 2暂停',
create_by varchar(64) null,
create_time datetime default CURRENT_TIMESTAMP null,
update_by varchar(64) null,
update_time datetime default CURRENT_TIMESTAMP null on update CURRENT_TIMESTAMP,
del_flag char default '0' null,
header varchar(40) null comment '进度负责人',
use_flag int default 1 null comment '使用标志 1为使用',
batch_id int null comment '批次号',
constraint uniq_schedule_order
unique (schedule_id, step_order,use_flag),
constraint fk_project_step_main
foreign key (schedule_id) references oa_project_schedule (schedule_id)
)
comment '项目进度步骤跟踪表' charset = utf8mb4;
ALTER TABLE oa_project_schedule_step -- 将其替换成上一步查到的 TABLE_NAME
DROP FOREIGN KEY uniq_schedule_order;
-- 1) 删除旧唯一索引
ALTER TABLE oa_project_schedule_step
DROP INDEX uniq_schedule_order;
-- 3.1 新建包含 use_flag 的唯一索引
ALTER TABLE oa_project_schedule_step
ADD UNIQUE KEY uniq_schedule_order_new (schedule_id, step_order, use_flag);
SELECT
rc.CONSTRAINT_NAME,
rc.TABLE_NAME,
kcu.COLUMN_NAME
FROM information_schema.REFERENTIAL_CONSTRAINTS rc
JOIN information_schema.KEY_COLUMN_USAGE kcu
ON rc.CONSTRAINT_NAME = kcu.CONSTRAINT_NAME
WHERE rc.REFERENCED_TABLE_NAME = ''
AND rc.CONSTRAINT_SCHEMA = DATABASE();