From 7e93899b07106208e879abae1b98bcea482e48d0 Mon Sep 17 00:00:00 2001 From: smallchill Date: Wed, 3 Jun 2020 15:31:34 +0800 Subject: [PATCH] =?UTF-8?q?:zap:=20=E4=BC=98=E5=8C=96=E7=A7=9F=E6=88=B7?= =?UTF-8?q?=E7=BC=93=E5=AD=98=E5=88=B7=E6=96=B0=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/springblade/system/controller/TenantController.java | 5 ----- .../springblade/system/service/impl/TenantServiceImpl.java | 2 ++ 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/controller/TenantController.java b/blade-service/blade-system/src/main/java/org/springblade/system/controller/TenantController.java index 2e5b4230..0756b9fe 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/controller/TenantController.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/controller/TenantController.java @@ -23,7 +23,6 @@ import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; import io.swagger.annotations.*; import lombok.AllArgsConstructor; import org.springblade.core.boot.ctrl.BladeController; -import org.springblade.core.cache.utils.CacheUtil; import org.springblade.core.mp.support.Condition; import org.springblade.core.mp.support.Query; import org.springblade.core.secure.BladeUser; @@ -43,8 +42,6 @@ import java.util.Date; import java.util.List; import java.util.Map; -import static org.springblade.core.cache.constant.CacheConstant.SYS_CACHE; - /** * 控制器 * @@ -122,7 +119,6 @@ public class TenantController extends BladeController { @ApiOperation(value = "新增或修改", notes = "传入tenant") @PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) public R submit(@Valid @RequestBody Tenant tenant) { - CacheUtil.clear(SYS_CACHE); return R.status(tenantService.submitTenant(tenant)); } @@ -135,7 +131,6 @@ public class TenantController extends BladeController { @ApiOperation(value = "逻辑删除", notes = "传入ids") @PreAuth(RoleConstant.HAS_ROLE_ADMINISTRATOR) public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) { - CacheUtil.clear(SYS_CACHE); return R.status(tenantService.removeTenant(Func.toLongList(ids))); } diff --git a/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/TenantServiceImpl.java b/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/TenantServiceImpl.java index 8f7e98d4..c187b7c4 100644 --- a/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/TenantServiceImpl.java +++ b/blade-service/blade-system/src/main/java/org/springblade/system/service/impl/TenantServiceImpl.java @@ -79,6 +79,7 @@ public class TenantServiceImpl extends BaseServiceImpl imp @Override @Transactional(rollbackFor = Exception.class) public boolean submitTenant(Tenant tenant) { + CacheUtil.clear(SYS_CACHE); if (Func.isEmpty(tenant.getId())) { List tenants = baseMapper.selectList(Wrappers.query().lambda().eq(Tenant::getIsDeleted, BladeConstant.DB_NOT_DELETED)); List codes = tenants.stream().map(Tenant::getTenantId).collect(Collectors.toList()); @@ -164,6 +165,7 @@ public class TenantServiceImpl extends BaseServiceImpl imp @Override @Transactional(rollbackFor = Exception.class) public boolean removeTenant(List ids) { + CacheUtil.clear(SYS_CACHE); List tenantList = this.list(Wrappers.query().lambda().in(Tenant::getId, ids)); List tenantIds = tenantList.stream().map(tenant -> Func.toStr(tenant.getTenantId())).distinct().collect(Collectors.toList()); if (tenantIds.contains(BladeConstant.ADMIN_TENANT_ID)) {