diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/DeptServiceImpl.java b/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/DeptServiceImpl.java index d4eddbc2..c4f8138b 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/DeptServiceImpl.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/DeptServiceImpl.java @@ -155,7 +155,11 @@ public class DeptServiceImpl extends ServiceImpl implements ID @Override public List search(String deptName, Long parentId) { + String tenantId = AuthUtil.getTenantId(); LambdaQueryWrapper queryWrapper = Wrappers.query().lambda(); + if (Func.isNotEmpty(tenantId)) { + queryWrapper.eq(Dept::getTenantId, tenantId); + } if (Func.isNotEmpty(deptName)) { queryWrapper.like(Dept::getDeptName, deptName); } diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/RoleServiceImpl.java b/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/RoleServiceImpl.java index c4122b27..11cea6f5 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/RoleServiceImpl.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/RoleServiceImpl.java @@ -203,6 +203,7 @@ public class RoleServiceImpl extends ServiceImpl implements IR @Override public List search(String roleName, Long parentId) { + String tenantId = AuthUtil.getTenantId(); LambdaQueryWrapper queryWrapper = Wrappers.query().lambda(); if (Func.isNotEmpty(roleName)) { queryWrapper.like(Role::getRoleName, roleName); @@ -210,6 +211,9 @@ public class RoleServiceImpl extends ServiceImpl implements IR if (Func.isNotEmpty(parentId) && parentId > 0L) { queryWrapper.eq(Role::getParentId, parentId); } + if (Func.isNotEmpty(tenantId)) { + queryWrapper.eq(Role::getTenantId, tenantId); + } List roleList = baseMapper.selectList(queryWrapper); return RoleWrapper.build().listNodeVO(roleList); }