feat: Enhance department management with parent ID validation and department scope handling

This commit is contained in:
2026-07-16 09:25:35 +08:00
parent e21e51de8a
commit 8dea752d48
7 changed files with 81 additions and 14 deletions

View File

@@ -1257,7 +1257,7 @@ create table "ks_db3"."sys_dept"
"dept_id" bigint not null,
"parent_id" bigint default 0
null,
"ancestors" varchar(50) default ''
"ancestors" text default ''
null,
"dept_name" varchar(30) default ''
null,
@@ -2633,4 +2633,3 @@ comment on table "ks_db3"."sys_user_role" is '用户和角色关联表';
comment on column "ks_db3"."sys_user_role"."role_id" is '角色id';
comment on column "ks_db3"."sys_user_role"."user_id" is '用户id';

View File

@@ -5,7 +5,7 @@ drop table if exists sys_dept;
create table sys_dept (
dept_id bigint(20) not null auto_increment comment '部门id',
parent_id bigint(20) default 0 comment '父部门id',
ancestors varchar(50) default '' comment '祖级列表',
ancestors varchar(1000) default '' comment '祖级列表',
dept_name varchar(30) default '' comment '部门名称',
order_num int(4) default 0 comment '显示顺序',
leader varchar(20) default null comment '负责人',
@@ -698,4 +698,4 @@ create table gen_table_column (
update_by varchar(64) default '' comment '更新者',
update_time datetime comment '更新时间',
primary key (column_id)
) engine=innodb auto_increment=1 comment = '代码生成业务表字段';
) engine=innodb auto_increment=1 comment = '代码生成业务表字段';