update 优化 数据权限 减少二次校验查询
parent
76f95ba900
commit
1e55aadb2a
|
|
@ -51,11 +51,8 @@ public class RemoteDataScopeServiceImpl implements RemoteDataScopeService {
|
||||||
.apply(DataBaseHelper.findInSet(deptId, "ancestors")));
|
.apply(DataBaseHelper.findInSet(deptId, "ancestors")));
|
||||||
List<Long> ids = StreamUtils.toList(deptList, SysDept::getDeptId);
|
List<Long> ids = StreamUtils.toList(deptList, SysDept::getDeptId);
|
||||||
ids.add(deptId);
|
ids.add(deptId);
|
||||||
List<SysDept> list = deptMapper.selectList(new LambdaQueryWrapper<SysDept>()
|
if (CollUtil.isNotEmpty(ids)) {
|
||||||
.select(SysDept::getDeptId)
|
return StreamUtils.join(ids, Convert::toStr);
|
||||||
.in(SysDept::getDeptId, ids));
|
|
||||||
if (CollUtil.isNotEmpty(list)) {
|
|
||||||
return StreamUtils.join(list, d -> Convert.toStr(d.getDeptId()));
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue