mirror of
https://github.com/dromara/RuoYi-Vue-Plus.git
synced 2025-09-24 07:19:46 +08:00
fix 修复数据权限问题
This commit is contained in:
@ -13,6 +13,14 @@ import java.util.List;
|
||||
*/
|
||||
public interface SysDeptMapper extends BaseMapper<SysDept> {
|
||||
|
||||
/**
|
||||
* 查询部门管理数据
|
||||
*
|
||||
* @param dept 部门信息
|
||||
* @return 部门信息集合
|
||||
*/
|
||||
public List<SysDept> selectDeptList(SysDept dept);
|
||||
|
||||
/**
|
||||
* 根据角色ID查询部门树信息
|
||||
*
|
||||
|
@ -12,6 +12,13 @@ import java.util.List;
|
||||
*/
|
||||
public interface SysRoleMapper extends BaseMapper<SysRole> {
|
||||
|
||||
/**
|
||||
* 根据条件分页查询角色数据
|
||||
*
|
||||
* @param role 角色信息
|
||||
* @return 角色数据集合信息
|
||||
*/
|
||||
public List<SysRole> selectRoleList(SysRole role);
|
||||
|
||||
/**
|
||||
* 根据用户ID查询角色
|
||||
|
@ -48,15 +48,7 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper, SysDept> impl
|
||||
@Override
|
||||
@DataScope(deptAlias = "d")
|
||||
public List<SysDept> selectDeptList(SysDept dept) {
|
||||
Object dataScope = dept.getParams().get("dataScope");
|
||||
return list(new LambdaQueryWrapper<SysDept>()
|
||||
.eq(dept.getParentId() != null && dept.getParentId() != 0,
|
||||
SysDept::getParentId, dept.getParentId())
|
||||
.like(StrUtil.isNotBlank(dept.getDeptName()), SysDept::getDeptName, dept.getDeptName())
|
||||
.eq(StrUtil.isNotBlank(dept.getStatus()), SysDept::getStatus, dept.getStatus())
|
||||
.apply(dataScope != null, dataScope != null ? dataScope.toString() : null)
|
||||
.orderByAsc(SysDept::getParentId)
|
||||
.orderByAsc(SysDept::getOrderNum));
|
||||
return baseMapper.selectDeptList(dept);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -49,20 +49,7 @@ public class SysRoleServiceImpl extends ServiceImpl<SysRoleMapper, SysRole> impl
|
||||
@Override
|
||||
@DataScope(deptAlias = "d")
|
||||
public List<SysRole> selectRoleList(SysRole role) {
|
||||
Map<String, Object> params = role.getParams();
|
||||
Object dataScope = params.get("dataScope");
|
||||
return list(new LambdaQueryWrapper<SysRole>()
|
||||
.like(StrUtil.isNotBlank(role.getRoleName()), SysRole::getRoleName, role.getRoleName())
|
||||
.eq(StrUtil.isNotBlank(role.getStatus()), SysRole::getStatus, role.getStatus())
|
||||
.like(StrUtil.isNotBlank(role.getRoleKey()), SysRole::getRoleKey, role.getRoleKey())
|
||||
.apply(Validator.isNotEmpty(params.get("beginTime")),
|
||||
"date_format(create_time,'%y%m%d') >= date_format({0},'%y%m%d')",
|
||||
params.get("beginTime"))
|
||||
.apply(Validator.isNotEmpty(params.get("endTime")),
|
||||
"date_format(create_time,'%y%m%d') <= date_format({0},'%y%m%d')",
|
||||
params.get("endTime"))
|
||||
.apply(dataScope != null, dataScope != null ? dataScope.toString() : null)
|
||||
.orderByAsc(SysRole::getRoleSort));
|
||||
return baseMapper.selectRoleList(role);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user