|
@@ -77,7 +77,6 @@ public class TenantServiceImpl extends BaseServiceImpl<TenantMapper, Tenant> imp
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public boolean submitTenant(Tenant tenant) {
|
|
public boolean submitTenant(Tenant tenant) {
|
|
|
- CacheUtil.clear(SYS_CACHE);
|
|
|
|
|
if (Func.isEmpty(tenant.getId())) {
|
|
if (Func.isEmpty(tenant.getId())) {
|
|
|
List<Tenant> tenants = baseMapper.selectList(Wrappers.<Tenant>query().lambda().eq(Tenant::getIsDeleted, BladeConstant.DB_NOT_DELETED));
|
|
List<Tenant> tenants = baseMapper.selectList(Wrappers.<Tenant>query().lambda().eq(Tenant::getIsDeleted, BladeConstant.DB_NOT_DELETED));
|
|
|
List<String> codes = tenants.stream().map(Tenant::getTenantId).collect(Collectors.toList());
|
|
List<String> codes = tenants.stream().map(Tenant::getTenantId).collect(Collectors.toList());
|
|
@@ -149,15 +148,16 @@ public class TenantServiceImpl extends BaseServiceImpl<TenantMapper, Tenant> imp
|
|
|
user.setIsDeleted(BladeConstant.DB_NOT_DELETED);
|
|
user.setIsDeleted(BladeConstant.DB_NOT_DELETED);
|
|
|
userService.submit(user);
|
|
userService.submit(user);
|
|
|
}
|
|
}
|
|
|
|
|
+ CacheUtil.clear(SYS_CACHE, tenant.getTenantId());
|
|
|
return super.saveOrUpdate(tenant);
|
|
return super.saveOrUpdate(tenant);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public boolean removeTenant(List<Long> ids) {
|
|
public boolean removeTenant(List<Long> ids) {
|
|
|
- CacheUtil.clear(SYS_CACHE);
|
|
|
|
|
- List<Tenant> tenantList = this.list(Wrappers.<Tenant>query().lambda().in(Tenant::getId, ids));
|
|
|
|
|
- List<String> tenantIds = tenantList.stream().map(tenant -> Func.toStr(tenant.getTenantId())).distinct().collect(Collectors.toList());
|
|
|
|
|
|
|
+ List<String> tenantIds = this.list(Wrappers.<Tenant>query().lambda().in(Tenant::getId, ids))
|
|
|
|
|
+ .stream().map(tenant -> Func.toStr(tenant.getTenantId())).distinct().collect(Collectors.toList());
|
|
|
|
|
+ CacheUtil.clear(SYS_CACHE, tenantIds);
|
|
|
if (tenantIds.contains(BladeConstant.ADMIN_TENANT_ID)) {
|
|
if (tenantIds.contains(BladeConstant.ADMIN_TENANT_ID)) {
|
|
|
throw new ServiceException("不可删除管理租户!");
|
|
throw new ServiceException("不可删除管理租户!");
|
|
|
}
|
|
}
|
|
@@ -168,7 +168,9 @@ public class TenantServiceImpl extends BaseServiceImpl<TenantMapper, Tenant> imp
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public boolean setting(Integer accountNumber, Date expireTime, String ids) {
|
|
public boolean setting(Integer accountNumber, Date expireTime, String ids) {
|
|
|
- CacheUtil.clear(SYS_CACHE);
|
|
|
|
|
|
|
+ List<String> tenantIds = this.list(Wrappers.<Tenant>query().lambda().in(Tenant::getId, ids))
|
|
|
|
|
+ .stream().map(tenant -> Func.toStr(tenant.getTenantId())).distinct().collect(Collectors.toList());
|
|
|
|
|
+ CacheUtil.clear(SYS_CACHE, tenantIds);
|
|
|
Func.toLongList(ids).forEach(id -> {
|
|
Func.toLongList(ids).forEach(id -> {
|
|
|
Kv kv = Kv.create().set("accountNumber", accountNumber).set("expireTime", expireTime).set("id", id);
|
|
Kv kv = Kv.create().set("accountNumber", accountNumber).set("expireTime", expireTime).set("id", id);
|
|
|
String licenseKey = DesUtil.encryptToHex(JsonUtil.toJson(kv), DES_KEY);
|
|
String licenseKey = DesUtil.encryptToHex(JsonUtil.toJson(kv), DES_KEY);
|