|
|
@ -34,6 +34,7 @@ import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.context.annotation.Lazy; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
import org.springframework.validation.annotation.Validated; |
|
|
|
|
|
|
|
import javax.annotation.Resource; |
|
|
@ -95,7 +96,7 @@ public class TenantServiceImpl implements TenantService { |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@DSTransactional // 多数据源,使用 @DSTransactional 保证本地事务,以及数据源的切换
|
|
|
|
@Transactional |
|
|
|
public Long createTenant(TenantCreateReqVO createReqVO) { |
|
|
|
// 校验租户名称是否重复
|
|
|
|
validTenantNameDuplicate(createReqVO.getName(), null); |
|
|
@ -137,7 +138,7 @@ public class TenantServiceImpl implements TenantService { |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@DSTransactional |
|
|
|
@Transactional |
|
|
|
public void updateTenant(TenantUpdateReqVO updateReqVO) { |
|
|
|
// 校验存在
|
|
|
|
TenantDO tenant = validateUpdateTenant(updateReqVO.getId()); |
|
|
@ -170,7 +171,7 @@ public class TenantServiceImpl implements TenantService { |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
@DSTransactional |
|
|
|
@Transactional |
|
|
|
public void updateTenantRoleMenu(Long tenantId, Set<Long> menuIds) { |
|
|
|
TenantUtils.execute(tenantId, () -> { |
|
|
|
// 获得所有角色
|
|
|
|