mirror of
https://gitee.com/dromara/RuoYi-Cloud-Plus.git
synced 2025-09-03 19:16:07 +00:00
update 优化 数据权限 减少二次校验查询
This commit is contained in:
@@ -51,11 +51,8 @@ public class RemoteDataScopeServiceImpl implements RemoteDataScopeService {
|
||||
.apply(DataBaseHelper.findInSet(deptId, "ancestors")));
|
||||
List<Long> ids = StreamUtils.toList(deptList, SysDept::getDeptId);
|
||||
ids.add(deptId);
|
||||
List<SysDept> list = deptMapper.selectList(new LambdaQueryWrapper<SysDept>()
|
||||
.select(SysDept::getDeptId)
|
||||
.in(SysDept::getDeptId, ids));
|
||||
if (CollUtil.isNotEmpty(list)) {
|
||||
return StreamUtils.join(list, d -> Convert.toStr(d.getDeptId()));
|
||||
if (CollUtil.isNotEmpty(ids)) {
|
||||
return StreamUtils.join(ids, Convert::toStr);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
Reference in New Issue
Block a user