Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
eshiled-new
/
ne-shield-usercenter
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit a0d35d23
authored
May 10, 2022
by
levphon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
V1.7.0 结清数据控制
1 parent
df2e2f6b
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
113 additions
and
0 deletions
src/main/java/cn/com/glsx/shield/modules/entity/RoleBizDataPermission.java
src/main/java/cn/com/glsx/shield/modules/mapper/RoleBizDataPermissionMapper.java
src/main/java/cn/com/glsx/shield/modules/model/param/RoleBO.java
src/main/java/cn/com/glsx/shield/modules/service/RoleService.java
src/main/resources/mapper/RoleBizDataPermissionMapper.xml
src/main/java/cn/com/glsx/shield/modules/entity/RoleBizDataPermission.java
0 → 100644
View file @
a0d35d2
package
cn
.
com
.
glsx
.
shield
.
modules
.
entity
;
import
com.glsx.plat.mybatis.base.BaseEntity
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.Table
;
@Data
@Table
(
name
=
"t_role_biz_data_permission"
)
public
class
RoleBizDataPermission
extends
BaseEntity
{
/**
* 角色id
*/
@Column
(
name
=
"role_id"
)
private
Long
roleId
;
/**
* 关联id
*/
@Column
(
name
=
"ref_id"
)
private
Long
refId
;
/**
* 权限类型:0预留,1结清数据
*/
private
Integer
type
;
/**
* 可见度:1可见,2默认不可见
*/
private
Integer
visibility
;
}
\ No newline at end of file
\ No newline at end of file
src/main/java/cn/com/glsx/shield/modules/mapper/RoleBizDataPermissionMapper.java
0 → 100644
View file @
a0d35d2
package
cn
.
com
.
glsx
.
shield
.
modules
.
mapper
;
import
cn.com.glsx.shield.modules.entity.RoleBizDataPermission
;
import
com.glsx.plat.mybatis.mapper.CommonBaseMapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
@Mapper
public
interface
RoleBizDataPermissionMapper
extends
CommonBaseMapper
<
RoleBizDataPermission
>
{
List
<
RoleBizDataPermission
>
selectByRoleId
(
@Param
(
"roleId"
)
Long
roleId
);
int
updateVisibilityByRoleIdAndType
(
@Param
(
"roleId"
)
Long
roleId
,
@Param
(
"type"
)
Integer
type
,
@Param
(
"visibility"
)
Integer
visibility
);
}
\ No newline at end of file
\ No newline at end of file
src/main/java/cn/com/glsx/shield/modules/model/param/RoleBO.java
View file @
a0d35d2
...
@@ -45,6 +45,16 @@ public class RoleBO implements Serializable {
...
@@ -45,6 +45,16 @@ public class RoleBO implements Serializable {
private
Integer
rolePermissionType
;
private
Integer
rolePermissionType
;
/**
/**
* 业务数据权限(1结清数据)
*/
private
Integer
bizPermissionType
;
/**
* 业务数据权限可见度(1可见,2不可见)
*/
private
Integer
bizPermissionVisibility
;
/**
* 可见数据权限租户id列表
* 可见数据权限租户id列表
*/
*/
private
String
permTenants
;
private
String
permTenants
;
...
...
src/main/java/cn/com/glsx/shield/modules/service/RoleService.java
View file @
a0d35d2
...
@@ -210,6 +210,11 @@ public class RoleService {
...
@@ -210,6 +210,11 @@ public class RoleService {
roleDataPermissionMapper
.
insertList
(
permTenantList
);
roleDataPermissionMapper
.
insertList
(
permTenantList
);
}
}
//业务数据权限
if
(
roleBO
.
getBizPermissionType
()
!=
null
)
{
// TODO: 2022/5/10
}
//角色菜单
//角色菜单
List
<
Long
>
menuIdList
=
getFixMenuIds
(
roleBO
.
getMenuIdList
());
List
<
Long
>
menuIdList
=
getFixMenuIds
(
roleBO
.
getMenuIdList
());
...
@@ -263,6 +268,11 @@ public class RoleService {
...
@@ -263,6 +268,11 @@ public class RoleService {
roleDataPermissionMapper
.
insertList
(
permTenantList
);
roleDataPermissionMapper
.
insertList
(
permTenantList
);
}
}
//业务数据权限
if
(
roleBO
.
getBizPermissionType
()
!=
null
)
{
// TODO: 2022/5/10
}
//角色菜单
//角色菜单
roleMenuMapper
.
logicDelByRoleId
(
role
.
getId
());
roleMenuMapper
.
logicDelByRoleId
(
role
.
getId
());
...
...
src/main/resources/mapper/RoleBizDataPermissionMapper.xml
0 → 100644
View file @
a0d35d2
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.com.glsx.shield.modules.mapper.RoleBizDataPermissionMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"cn.com.glsx.shield.modules.entity.RoleBizDataPermission"
>
<!--
WARNING - @mbg.generated
-->
<id
column=
"id"
jdbcType=
"INTEGER"
property=
"id"
/>
<result
column=
"role_id"
jdbcType=
"INTEGER"
property=
"roleId"
/>
<result
column=
"ref_id"
jdbcType=
"INTEGER"
property=
"refId"
/>
<result
column=
"type"
jdbcType=
"TINYINT"
property=
"type"
/>
<result
column=
"visibility"
jdbcType=
"TINYINT"
property=
"visibility"
/>
<result
column=
"del_flag"
jdbcType=
"TINYINT"
property=
"delFlag"
/>
<result
column=
"created_date"
jdbcType=
"TIMESTAMP"
property=
"createdDate"
/>
<result
column=
"created_by"
jdbcType=
"INTEGER"
property=
"createdBy"
/>
<result
column=
"updated_date"
jdbcType=
"TIMESTAMP"
property=
"updatedDate"
/>
<result
column=
"updated_by"
jdbcType=
"INTEGER"
property=
"updatedBy"
/>
</resultMap>
<sql
id=
"Base_Column_List"
>
<!--
WARNING - @mbg.generated
-->
id, role_id, ref_id, `type`, visibility, del_flag, created_date, created_by, updated_date,
updated_by
</sql>
<select
id=
"selectByRoleId"
resultMap=
"BaseResultMap"
>
select
<include
refid=
"Base_Column_List"
/>
from t_role_biz_data_permission
where del_flag = 0
and role_id = #{roleId}
</select>
<update
id=
"updateVisibilityByRoleIdAndType"
>
update t_role_biz_data_permission
set visibility = #{visibility}
where role_id = #{roleId}
and type = #{type}
</update>
</mapper>
\ No newline at end of file
\ No newline at end of file
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment