|
|
|
@ -16,14 +16,12 @@
|
|
|
|
|
*/ |
|
|
|
|
package org.springblade.system.service.impl; |
|
|
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import org.springblade.core.cache.utils.CacheUtil; |
|
|
|
|
import org.springblade.core.log.exception.ServiceException; |
|
|
|
|
import org.springblade.core.mp.base.BaseServiceImpl; |
|
|
|
|
import org.springblade.core.tenant.BladeTenantProperties; |
|
|
|
|
import org.springblade.core.tenant.TenantId; |
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
|
import org.springblade.core.tool.constant.BladeConstant; |
|
|
|
@ -67,7 +65,6 @@ public class TenantServiceImpl extends BaseServiceImpl<TenantMapper, Tenant> imp
|
|
|
|
|
private final IRoleMenuService roleMenuService; |
|
|
|
|
private final IDictBizService dictBizService; |
|
|
|
|
private final IUserClient userClient; |
|
|
|
|
private final BladeTenantProperties tenantProperties; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public IPage<Tenant> selectTenantPage(IPage<Tenant> page, Tenant tenant) { |
|
|
|
@ -184,16 +181,15 @@ public class TenantServiceImpl extends BaseServiceImpl<TenantMapper, Tenant> imp
|
|
|
|
|
public boolean setting(Integer accountNumber, Date expireTime, String ids) { |
|
|
|
|
CacheUtil.clear(SYS_CACHE); |
|
|
|
|
Func.toLongList(ids).forEach(id -> { |
|
|
|
|
LambdaUpdateWrapper<Tenant> luw = Wrappers.<Tenant>update().lambda() |
|
|
|
|
.set(Tenant::getAccountNumber, accountNumber) |
|
|
|
|
.set(Tenant::getExpireTime, expireTime) |
|
|
|
|
.eq(Tenant::getId, id); |
|
|
|
|
if (tenantProperties.getLicense()) { |
|
|
|
|
Kv kv = Kv.create().set("accountNumber", accountNumber).set("expireTime", expireTime).set("id", id); |
|
|
|
|
String licenseKey = DesUtil.encryptToHex(JsonUtil.toJson(kv), DES_KEY); |
|
|
|
|
luw.set(Tenant::getLicenseKey, licenseKey); |
|
|
|
|
} |
|
|
|
|
update(luw); |
|
|
|
|
Kv kv = Kv.create().set("accountNumber", accountNumber).set("expireTime", expireTime).set("id", id); |
|
|
|
|
String licenseKey = DesUtil.encryptToHex(JsonUtil.toJson(kv), DES_KEY); |
|
|
|
|
update( |
|
|
|
|
Wrappers.<Tenant>update().lambda() |
|
|
|
|
.set(Tenant::getAccountNumber, accountNumber) |
|
|
|
|
.set(Tenant::getExpireTime, expireTime) |
|
|
|
|
.set(Tenant::getLicenseKey, licenseKey) |
|
|
|
|
.eq(Tenant::getId, id) |
|
|
|
|
); |
|
|
|
|
}); |
|
|
|
|
return true; |
|
|
|
|
} |
|
|
|
|