Commit a0d35d23 by levphon

V1.7.0 结清数据控制

1 parent df2e2f6b
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
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
...@@ -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;
......
...@@ -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());
......
<?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
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!