From a33898c2a0374c249862a2b996e33352e30c8caf Mon Sep 17 00:00:00 2001
From: KonBAI <1527468660@qq.com>
Date: 星期六, 02 四月 2022 13:02:56 +0800
Subject: [PATCH] !167 update 修改角色"菜单树选择项"和"部门树选择项"是否关联显示字段为Boolean类型 * fix 修改 postgres sql脚本,处理角色表字段类型错误问题。 * fix 修复postgreSQL新增或更新角色信息报错。修改角色"菜单树选择项"和"部门树选择项"是否关联显示字段为Boolean类型。
---
script/sql/postgres/postgres_ry_vue_4.X.sql | 8 ++++----
script/sql/postgres/postgres_test.sql | 4 ++--
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysRole.java | 34 ++--------------------------------
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 ff9275a..8048157 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 @@
* 鑿滃崟鏍戦�夋嫨椤规槸鍚﹀叧鑱旀樉绀猴紙 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姝e父 1鍋滅敤锛�
@@ -135,35 +135,5 @@
@ApiModelProperty(value = "鏄惁绠$悊鍛�")
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 5c9c66b..4bf4ec2 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 @@
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 @@
-- ----------------------------
-- 鍒濆鍖�-瑙掕壊淇℃伅琛ㄦ暟鎹�
-- ----------------------------
-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 b1d0ecb..29b4ea7 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, 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);
--
Gitblit v1.9.3