|
@@ -4,9 +4,10 @@ import cn.hutool.core.collection.CollUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
-import lombok.RequiredArgsConstructor;
|
|
|
|
|
|
|
+import com.vber.common.core.constant.CacheNames;
|
|
|
import com.vber.common.core.constant.TenantConstants;
|
|
import com.vber.common.core.constant.TenantConstants;
|
|
|
import com.vber.common.core.exception.ServiceException;
|
|
import com.vber.common.core.exception.ServiceException;
|
|
|
|
|
+import com.vber.common.core.service.TenantPackageService;
|
|
|
import com.vber.common.core.utils.MapstructUtils;
|
|
import com.vber.common.core.utils.MapstructUtils;
|
|
|
import com.vber.common.core.utils.StringUtils;
|
|
import com.vber.common.core.utils.StringUtils;
|
|
|
import com.vber.common.mybatis.core.page.PageQuery;
|
|
import com.vber.common.mybatis.core.page.PageQuery;
|
|
@@ -18,6 +19,9 @@ import com.vber.system.domain.vo.SysTenantPackageVo;
|
|
|
import com.vber.system.mapper.SysTenantMapper;
|
|
import com.vber.system.mapper.SysTenantMapper;
|
|
|
import com.vber.system.mapper.SysTenantPackageMapper;
|
|
import com.vber.system.mapper.SysTenantPackageMapper;
|
|
|
import com.vber.system.service.ISysTenantPackageService;
|
|
import com.vber.system.service.ISysTenantPackageService;
|
|
|
|
|
+import lombok.RequiredArgsConstructor;
|
|
|
|
|
+import org.springframework.cache.annotation.CacheEvict;
|
|
|
|
|
+import org.springframework.cache.annotation.Cacheable;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
|
@@ -32,7 +36,7 @@ import java.util.List;
|
|
|
*/
|
|
*/
|
|
|
@RequiredArgsConstructor
|
|
@RequiredArgsConstructor
|
|
|
@Service
|
|
@Service
|
|
|
-public class SysTenantPackageServiceImpl implements ISysTenantPackageService {
|
|
|
|
|
|
|
+public class SysTenantPackageServiceImpl implements ISysTenantPackageService, TenantPackageService {
|
|
|
|
|
|
|
|
private final SysTenantPackageMapper baseMapper;
|
|
private final SysTenantPackageMapper baseMapper;
|
|
|
private final SysTenantMapper tenantMapper;
|
|
private final SysTenantMapper tenantMapper;
|
|
@@ -103,6 +107,7 @@ public class SysTenantPackageServiceImpl implements ISysTenantPackageService {
|
|
|
* 修改租户套餐
|
|
* 修改租户套餐
|
|
|
*/
|
|
*/
|
|
|
@Override
|
|
@Override
|
|
|
|
|
+ @CacheEvict(cacheNames = CacheNames.SYS_TENANT_PACKAGE_NAME, key = "#bo.packageId")
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
public Boolean updateByBo(SysTenantPackageBo bo) {
|
|
public Boolean updateByBo(SysTenantPackageBo bo) {
|
|
|
SysTenantPackage update = MapstructUtils.convert(bo, SysTenantPackage.class);
|
|
SysTenantPackage update = MapstructUtils.convert(bo, SysTenantPackage.class);
|
|
@@ -142,4 +147,11 @@ public class SysTenantPackageServiceImpl implements ISysTenantPackageService {
|
|
|
}
|
|
}
|
|
|
return baseMapper.deleteBatchIds(ids) > 0;
|
|
return baseMapper.deleteBatchIds(ids) > 0;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ @Cacheable(cacheNames = CacheNames.SYS_TENANT_PACKAGE_NAME, key = "#packageId")
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public String getPackageName(Long packageId) {
|
|
|
|
|
+ SysTenantPackage sysTenantPackage = baseMapper.selectOne(new LambdaQueryWrapper<SysTenantPackage>().eq(SysTenantPackage::getPackageId, packageId));
|
|
|
|
|
+ return sysTenantPackage.getPackageName();
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|