修复续费时同步更新租户套餐
This commit is contained in:
@@ -200,10 +200,16 @@ public class TenantServiceImpl implements TenantService {
|
|||||||
throw exception(TENANT_BALANCE_NOT_ENOUGH);
|
throw exception(TENANT_BALANCE_NOT_ENOUGH);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ObjectUtil.notEqual(targetTenant.getPackageId(), updateReqVO.getPackageId())) {
|
||||||
|
targetTenant.setPackageId(tenantAgencyPackage.getId());
|
||||||
|
tenantMapper.updateById(targetTenant);
|
||||||
|
}
|
||||||
|
|
||||||
if (balanceService.consumption(tenantAgencyPackage.getId(), targetTenant.getId(), updateReqVO.getRemark())) {
|
if (balanceService.consumption(tenantAgencyPackage.getId(), targetTenant.getId(), updateReqVO.getRemark())) {
|
||||||
log.info("代理: {} 续费租户:{} 成功,套餐 Id:{}", currentTenantId,targetTenant.getId(),updateReqVO.getPackageId());
|
log.info("代理: {} 续费租户:{} 成功,套餐 Id:{}", currentTenantId,targetTenant.getId(),updateReqVO.getPackageId());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (targetTenant.getCrawlExpireTime().isBefore(LocalDateTime.now())){
|
if (targetTenant.getCrawlExpireTime().isBefore(LocalDateTime.now())){
|
||||||
targetTenant.setCrawlExpireTime(LocalDateTime.now().plusDays(tenantAgencyPackage.getDays()));
|
targetTenant.setCrawlExpireTime(LocalDateTime.now().plusDays(tenantAgencyPackage.getDays()));
|
||||||
targetTenant.setStatus(CommonStatusEnum.ENABLE.getStatus());
|
targetTenant.setStatus(CommonStatusEnum.ENABLE.getStatus());
|
||||||
@@ -230,6 +236,8 @@ public class TenantServiceImpl implements TenantService {
|
|||||||
targetTenant.setBrotherExpireTime(targetTenant.getBrotherExpireTime().plusDays(tenantAgencyPackage.getDays()));
|
targetTenant.setBrotherExpireTime(targetTenant.getBrotherExpireTime().plusDays(tenantAgencyPackage.getDays()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int updateInitialUserCount = userMapper.updateByIdWithRenwal(targetTenantUser);
|
int updateInitialUserCount = userMapper.updateByIdWithRenwal(targetTenantUser);
|
||||||
if (updateInitialUserCount <= 0) {
|
if (updateInitialUserCount <= 0) {
|
||||||
throw exception(TENANT_UPDATE_INITIAL_USER_INFO_FAIL);
|
throw exception(TENANT_UPDATE_INITIAL_USER_INFO_FAIL);
|
||||||
|
|||||||
Reference in New Issue
Block a user