fix: 新增用户时报错,租户id查询

V0.5.x
jay 2023-08-08 15:58:14 +08:00
parent 841f6a82e4
commit dc67b35d74
1 changed files with 4 additions and 2 deletions

View File

@ -44,7 +44,9 @@ public class SysTenantServiceImpl implements ISysTenantService {
@Cacheable(cacheNames = CacheNames.SYS_TENANT, key = "#tenantId")
@Override
public SysTenantVo queryByTenantId(String tenantId) {
SysTenant tenant = sysTenantData.findById(Long.valueOf(tenantId));
SysTenant sysTenant = new SysTenant();
sysTenant.setTenantId(tenantId);
SysTenant tenant = sysTenantData.findOneByCondition(sysTenant);
return MapstructUtils.convert(tenant,SysTenantVo.class);
}
@ -97,7 +99,7 @@ public class SysTenantServiceImpl implements ISysTenantService {
@Override
public boolean checkAccountBalance(String tenantId) {
SysTenantVo tenant = SpringUtils.getAopProxy(this).queryByTenantId(tenantId);
SysTenantVo tenant = this.queryByTenantId(tenantId);
// 如果余额为-1代表不限制
if (tenant.getAccountCount() == -1) {
return true;