From a33898c2a0374c249862a2b996e33352e30c8caf Mon Sep 17 00:00:00 2001 From: KonBAI <1527468660@qq.com> Date: Sat, 2 Apr 2022 05:02:56 +0000 Subject: [PATCH] =?UTF-8?q?!167=20update=20=E4=BF=AE=E6=94=B9=E8=A7=92?= =?UTF-8?q?=E8=89=B2"=E8=8F=9C=E5=8D=95=E6=A0=91=E9=80=89=E6=8B=A9?= =?UTF-8?q?=E9=A1=B9"=E5=92=8C"=E9=83=A8=E9=97=A8=E6=A0=91=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E9=A1=B9"=E6=98=AF=E5=90=A6=E5=85=B3=E8=81=94?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=AD=97=E6=AE=B5=E4=B8=BABoolean=E7=B1=BB?= =?UTF-8?q?=E5=9E=8B=20*=20fix=20=E4=BF=AE=E6=94=B9=20postgres=20sql?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=EF=BC=8C=E5=A4=84=E7=90=86=E8=A7=92=E8=89=B2?= =?UTF-8?q?=E8=A1=A8=E5=AD=97=E6=AE=B5=E7=B1=BB=E5=9E=8B=E9=94=99=E8=AF=AF?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E3=80=82=20*=20fix=20=E4=BF=AE=E5=A4=8Dpostg?= =?UTF-8?q?reSQL=E6=96=B0=E5=A2=9E=E6=88=96=E6=9B=B4=E6=96=B0=E8=A7=92?= =?UTF-8?q?=E8=89=B2=E4=BF=A1=E6=81=AF=E6=8A=A5=E9=94=99=E3=80=82=E4=BF=AE?= =?UTF-8?q?=E6=94=B9=E8=A7=92=E8=89=B2"=E8=8F=9C=E5=8D=95=E6=A0=91?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E9=A1=B9"=E5=92=8C"=E9=83=A8=E9=97=A8?= =?UTF-8?q?=E6=A0=91=E9=80=89=E6=8B=A9=E9=A1=B9"=E6=98=AF=E5=90=A6?= =?UTF-8?q?=E5=85=B3=E8=81=94=E6=98=BE=E7=A4=BA=E5=AD=97=E6=AE=B5=E4=B8=BA?= =?UTF-8?q?Boolean=E7=B1=BB=E5=9E=8B=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../common/core/domain/entity/SysRole.java | 34 ++----------------- script/sql/postgres/postgres_ry_vue_4.X.sql | 8 ++--- script/sql/postgres/postgres_test.sql | 4 +-- 3 files changed, 8 insertions(+), 38 deletions(-) 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);