添加dmp参数

master
bynt 2 years ago
parent 22e92da2a2
commit b253e9c6ba

@ -128,5 +128,10 @@ public class Company extends BaseEntity implements Serializable {
@Column(name = "talk_call_fee") @Column(name = "talk_call_fee")
private Double talkCallFee; private Double talkCallFee;
@ApiModelProperty("dmp投放费用")
@Column(name = "dmp_delivery_fee")
private Double dmpDeliveryFee;
} }

@ -3,6 +3,8 @@ package com.baiye.modules.system.domain.vo;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import java.util.Date; import java.util.Date;
/** /**
@ -36,6 +38,9 @@ public class CompanyComboVO {
@ApiModelProperty("拓客去显号价格") @ApiModelProperty("拓客去显号价格")
private Double talkCallFee; private Double talkCallFee;
@ApiModelProperty("dmp投放费用")
private Double dmpDeliveryFee;
@ApiModelProperty("坐席号") @ApiModelProperty("坐席号")
private Integer seatNumber; private Integer seatNumber;

@ -5,7 +5,6 @@ import lombok.Data;
import javax.validation.constraints.DecimalMax; import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin; import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
/** /**
@ -43,4 +42,9 @@ public class CompanyComboDTO {
@DecimalMin(value = "0.0") @DecimalMin(value = "0.0")
@DecimalMax(value = "999.0") @DecimalMax(value = "999.0")
private Double talkCallFee; private Double talkCallFee;
@ApiModelProperty("dmp投放费用")
@DecimalMin(value = "0.0")
@DecimalMax(value = "999.0")
private Double dmpDeliveryFee;
} }

@ -226,5 +226,4 @@ public class CompanyServiceImpl implements CompanyService {
} }
return PageUtil.toPage(comboVOList, page.getTotalElements()); return PageUtil.toPage(comboVOList, page.getTotalElements());
} }
} }

@ -53,8 +53,6 @@ public class DeliveryBalanceTask {
/** /**
* 821 * 821
*
*
*/ */
@Scheduled(cron = "0 0/30 8-21 * * ? ") @Scheduled(cron = "0 0/30 8-21 * * ? ")
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
@ -72,9 +70,8 @@ public class DeliveryBalanceTask {
Long userId = list.get(DefaultNumberConstants.ZERO_NUMBER).getUserId(); Long userId = list.get(DefaultNumberConstants.ZERO_NUMBER).getUserId();
Company companyByUserId = companyService.findCompanyByUserId(userId); Company companyByUserId = companyService.findCompanyByUserId(userId);
if (ObjectUtil.isNotNull(companyByUserId) if (ObjectUtil.isNotNull(companyByUserId)
&& ObjectUtil.isNotNull(companyByUserId.getTemplateId())
// 判断价格 // 判断价格
&& ObjectUtil.isNotNull(companyByUserId.getDeliveryCallFee())) { && ObjectUtil.isNotNull(companyByUserId.getDmpDeliveryFee())) {
// 每次100000 数据 // 每次100000 数据
List<List<TaskImei>> lists = Lists.partition List<List<TaskImei>> lists = Lists.partition
(list, DefaultNumberConstants.ONE_HUNDRED_THOUSAND); (list, DefaultNumberConstants.ONE_HUNDRED_THOUSAND);
@ -82,7 +79,7 @@ public class DeliveryBalanceTask {
for (List<TaskImei> taskImeiList : lists) { for (List<TaskImei> taskImeiList : lists) {
// 大于100 进行兑换 // 大于100 进行兑换
if (taskImeiList.size() >= DefaultNumberConstants.ONE_HUNDRED) { if (taskImeiList.size() >= DefaultNumberConstants.ONE_HUNDRED) {
BigDecimal decimal = NumberUtil.mul(companyByUserId.getDeliveryCallFee(), BigDecimal.valueOf(taskImeiList.size())); BigDecimal decimal = NumberUtil.mul(companyByUserId.getDmpDeliveryFee(), BigDecimal.valueOf(taskImeiList.size()));
BigDecimal sub = NumberUtil.sub(companyByUserId.getUserBalance(), decimal); BigDecimal sub = NumberUtil.sub(companyByUserId.getUserBalance(), decimal);
// 判断余额 // 判断余额
if (sub.compareTo(BigDecimal.valueOf if (sub.compareTo(BigDecimal.valueOf

Loading…
Cancel
Save