diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRole.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRole.java index ff9275a1..80481573 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRole.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRole.java @@ -78,13 +78,13 @@ public class SysRole extends BaseEntity { * 菜单树选择项是否关联显示( 0:父子不互相关联显示 1:父子互相关联显示) */ @ApiModelProperty(value = "菜单树选择项是否关联显示( 0:父子不互相关联显示 1:父子互相关联显示)") - private Integer menuCheckStrictly; + private Boolean menuCheckStrictly; /** * 部门树选择项是否关联显示(0:父子不互相关联显示 1:父子互相关联显示 ) */ @ApiModelProperty(value = "部门树选择项是否关联显示(0:父子不互相关联显示 1:父子互相关联显示 )") - private Integer deptCheckStrictly; + private Boolean deptCheckStrictly; /** * 角色状态(0正常 1停用) @@ -136,34 +136,4 @@ public class SysRole extends BaseEntity { public boolean isAdmin() { return UserConstants.ADMIN_ID.equals(this.roleId); } - - public Boolean getMenuCheckStrictly() { - if (menuCheckStrictly == null) { - return null; - } - return menuCheckStrictly == 1; - } - - public void setMenuCheckStrictly(Boolean menuCheckStrictly) { - if (menuCheckStrictly == null) { - this.menuCheckStrictly = null; - return; - } - this.menuCheckStrictly = menuCheckStrictly ? 1 : 0; - } - - public Boolean getDeptCheckStrictly() { - if (deptCheckStrictly == null) { - return null; - } - return deptCheckStrictly == 1; - } - - public void setDeptCheckStrictly(Boolean deptCheckStrictly) { - if (deptCheckStrictly == null) { - this.deptCheckStrictly = null; - return; - } - this.deptCheckStrictly = deptCheckStrictly ? 1 : 0; - } } diff --git a/script/sql/postgres/postgres_ry_vue_4.X.sql b/script/sql/postgres/postgres_ry_vue_4.X.sql index 5c9c66b8..4bf4ec25 100644 --- a/script/sql/postgres/postgres_ry_vue_4.X.sql +++ b/script/sql/postgres/postgres_ry_vue_4.X.sql @@ -157,8 +157,8 @@ create table if not exists sys_role role_key varchar(100) not null, role_sort int4 not null, data_scope char default '1'::bpchar, - menu_check_strictly int2 default 1, - dept_check_strictly int2 default 1, + menu_check_strictly bool default true, + dept_check_strictly bool default true, status char not null, del_flag char default '0'::bpchar, create_by varchar(64) default ''::varchar, @@ -188,8 +188,8 @@ comment on column sys_role.remark is '备注'; -- ---------------------------- -- 初始化-角色信息表数据 -- ---------------------------- -insert into sys_role values('1', '超级管理员', 'admin', 1, 1, 1, 1, '0', '0', 'admin', now(), '', null, '超级管理员'); -insert into sys_role values('2', '普通角色', 'common', 2, 2, 1, 1, '0', '0', 'admin', now(), '', null, '普通角色'); +insert into sys_role values('1', '超级管理员', 'admin', 1, '1', 't', 't', '0', '0', 'admin', now(), '', null, '超级管理员'); +insert into sys_role values('2', '普通角色', 'common', 2, '2', 't', 't', '0', '0', 'admin', now(), '', null, '普通角色'); -- ---------------------------- diff --git a/script/sql/postgres/postgres_test.sql b/script/sql/postgres/postgres_test.sql index b1d0ecb8..29b4ea7a 100644 --- a/script/sql/postgres/postgres_test.sql +++ b/script/sql/postgres/postgres_test.sql @@ -77,8 +77,8 @@ INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (1510, '测试树表删除', 1506, 4, '#', '', 1, 0, 'F', '0', '0', 'demo:tree:remove', '#', 'admin', now(), '', NULL, ''); INSERT INTO sys_menu(menu_id, menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark) VALUES (1511, '测试树表导出', 1506, 5, '#', '', 1, 0, 'F', '0', '0', 'demo:tree:export', '#', 'admin', now(), '', NULL, ''); -INSERT INTO sys_role(role_id, role_name, role_key, role_sort, data_scope, menu_check_strictly, dept_check_strictly, status, del_flag, create_by, create_time, update_by, update_time, remark) VALUES (3, '本部门及以下', 'test1', 3, '4', 1, 1, '0', '0', 'admin', now(), 'admin', NULL, NULL); -INSERT INTO sys_role(role_id, role_name, role_key, role_sort, data_scope, menu_check_strictly, dept_check_strictly, status, del_flag, create_by, create_time, update_by, update_time, remark) VALUES (4, '仅本人', 'test2', 4, '5', 1, 1, '0', '0', 'admin', now(), 'admin', NULL, NULL); +INSERT INTO sys_role(role_id, role_name, role_key, role_sort, data_scope, menu_check_strictly, dept_check_strictly, status, del_flag, create_by, create_time, update_by, update_time, remark) VALUES (3, '本部门及以下', 'test1', 3, '4', 't', 't', '0', '0', 'admin', now(), 'admin', NULL, NULL); +INSERT INTO sys_role(role_id, role_name, role_key, role_sort, data_scope, menu_check_strictly, dept_check_strictly, status, del_flag, create_by, create_time, update_by, update_time, remark) VALUES (4, '仅本人', 'test2', 4, '5', 't', 't', '0', '0', 'admin', now(), 'admin', NULL, NULL); INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 1); INSERT INTO sys_role_menu(role_id, menu_id) VALUES (3, 5);