From 5df0e755b8c283b69a949026e8408cd07c4a01d3 Mon Sep 17 00:00:00 2001 From: smallchill Date: Tue, 7 Dec 2021 02:24:36 +0800 Subject: [PATCH] =?UTF-8?q?:zap:=20=E6=B5=81=E7=A8=8B=E6=9D=A1=E4=BB=B6?= =?UTF-8?q?=E6=9F=A5=E8=AF=A2=E5=A2=9E=E5=8A=A0=E7=A7=9F=E6=88=B7=E8=BF=87?= =?UTF-8?q?=E6=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/springblade/system/service/impl/DeptServiceImpl.java | 4 ++++ .../org/springblade/system/service/impl/RoleServiceImpl.java | 4 ++++ 2 files changed, 8 insertions(+) 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); }