修复问题
parent
b043fa6c2d
commit
ded6eead74
|
@ -65,6 +65,8 @@ public class TenantSecretKeyServiceImpl implements ITenantSecretKeyService {
|
|||
@Resource
|
||||
private ITenantPlatformService tenantPlatformService;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 登录
|
||||
*
|
||||
|
@ -220,11 +222,7 @@ public class TenantSecretKeyServiceImpl implements ITenantSecretKeyService {
|
|||
if (insertedTenantSecretKey > 0) {
|
||||
for (TenantPlatform tenantPlatform : createTenantDTO.getTenantPlatforms()) {
|
||||
|
||||
TenantPlatform platformById = tenantPlatformService.selectTenantPlatformById(tenantPlatform.getId());
|
||||
// 成本比平台成本大
|
||||
if (platformById.getCost().compareTo(tenantPlatform.getCost())>0){
|
||||
throw new BaseException("成本比例不允许比最低比例小");
|
||||
}
|
||||
|
||||
|
||||
tenantPlatform.setTenantId(tenantSecretKey.getId());
|
||||
tenantPlatform.setCreateBy(createTenantDTO.getAccount());
|
||||
|
|
|
@ -10,6 +10,7 @@ import com.ff.base.core.domain.AjaxResult;
|
|||
import com.ff.base.core.page.TableDataInfo;
|
||||
import com.ff.base.enums.OperationType;
|
||||
import com.ff.base.enums.QuotaType;
|
||||
import com.ff.base.exception.base.BaseException;
|
||||
import com.ff.base.system.domain.TenantPlatform;
|
||||
import com.ff.base.system.dto.CreateTenantDTO;
|
||||
import com.ff.base.system.dto.TenantSecretKeyDTO;
|
||||
|
@ -22,10 +23,12 @@ import com.ff.base.utils.ip.IpUtils;
|
|||
import com.ff.base.system.domain.TenantSecretKey;
|
||||
import com.ff.common.domain.TenantAgentPlatform;
|
||||
import com.ff.common.dto.BalanceChangesDTO;
|
||||
import com.ff.common.service.ITenantAgentPlatformService;
|
||||
import com.ff.common.service.ITenantGameQuotaService;
|
||||
import com.ff.base.system.service.ITenantSecretKeyService;
|
||||
import com.ff.base.system.service.ITenantPlatformService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
@ -56,7 +59,8 @@ public class AgentController extends BaseController {
|
|||
@Resource
|
||||
private ITenantPlatformService tenantPlatformService;
|
||||
|
||||
|
||||
@Resource
|
||||
private ITenantAgentPlatformService tenantAgentPlatformService;
|
||||
/**
|
||||
* 列表
|
||||
*
|
||||
|
@ -99,6 +103,11 @@ public class AgentController extends BaseController {
|
|||
//构造租户的充值信息
|
||||
List<TenantPlatform> tenantPlatforms = new ArrayList<>();
|
||||
for (TenantAgentPlatform tenantAgentPlatform : agentCreateTenantDTO.getTenantAgentPlatforms()) {
|
||||
TenantAgentPlatform agentPlatform = tenantAgentPlatformService.selectTenantAgentPlatformById(tenantAgentPlatform.getId());
|
||||
// 成本比平台成本大
|
||||
if (agentPlatform.getCost().compareTo(tenantAgentPlatform.getCost())>0){
|
||||
throw new BaseException("成本比例不允许比最低比例小");
|
||||
}
|
||||
TenantPlatform tenantPlatform = new TenantPlatform();
|
||||
BeanUtils.copyProperties(tenantAgentPlatform, tenantPlatform);
|
||||
tenantPlatforms.add(tenantPlatform);
|
||||
|
|
Loading…
Reference in New Issue