diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysDataScopeServiceImpl.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysDataScopeServiceImpl.java index 9c5a2122..d7ba934f 100644 --- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysDataScopeServiceImpl.java +++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/service/impl/SysDataScopeServiceImpl.java @@ -49,11 +49,8 @@ public class SysDataScopeServiceImpl implements ISysDataScopeService { .apply(DataBaseHelper.findInSet(deptId, "ancestors"))); List ids = StreamUtils.toList(deptList, SysDept::getDeptId); ids.add(deptId); - List list = deptMapper.selectList(new LambdaQueryWrapper() - .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; }