|
@@ -16,6 +16,7 @@ import org.jeecg.modules.bytedance.advertise.entity.*;
|
|
|
import org.jeecg.modules.bytedance.advertise.enums.BytedanceCreativeMatTypeEnum;
|
|
|
import org.jeecg.modules.bytedance.advertise.mapper.AiBytedanceAdvertiserStrategyMapper;
|
|
|
import org.jeecg.modules.bytedance.advertise.mapper.BytedanceAreaInfoMapper;
|
|
|
+import org.jeecg.modules.bytedance.advertise.mapper.RuleDataAccountMapper;
|
|
|
import org.jeecg.modules.bytedance.advertise.service.*;
|
|
|
import org.jeecg.modules.bytedance.advertise.vo.AdConvertQueryVo;
|
|
|
import org.jeecg.modules.bytedance.advertise.vo.AdGroupSearchVo;
|
|
@@ -1208,7 +1209,8 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
|
return marketingService.getToolConvertQuery(token,adConvertQueryVo);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+ @Resource
|
|
|
+ private RuleDataAccountMapper ruleDataAccountMapper;
|
|
|
/**
|
|
|
*
|
|
|
* @description: 添加配置 信息
|
|
@@ -1219,6 +1221,22 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
|
*/
|
|
|
@Override
|
|
|
public Result addBytedanceStrategy(AiBytedanceAdvertiserStrategy aiBytedanceAdvertiserStrategy) {
|
|
|
+ //预算金额不能低于当前已消费金额的105%
|
|
|
+ QueryWrapper<RuleDataAccount> ruleDataAccountQueryWrapper = new QueryWrapper<>();
|
|
|
+ ruleDataAccountQueryWrapper.eq("account_id",aiBytedanceAdvertiserStrategy.getAccountId());
|
|
|
+ //获取消耗 余额
|
|
|
+ RuleDataAccount ruleDataAccountVo = ruleDataAccountMapper.selectOne(ruleDataAccountQueryWrapper);
|
|
|
+ // 值 为0 不限预算
|
|
|
+ // !0 指定预算
|
|
|
+ if (!aiBytedanceAdvertiserStrategy.getAccountBudget().equals(new BigDecimal("0"))){
|
|
|
+ // 前者 < 后者
|
|
|
+ int a = aiBytedanceAdvertiserStrategy.getAccountBudget().compareTo(ruleDataAccountVo.getCost().multiply(new BigDecimal(1.05)));
|
|
|
+ if (a == -1){
|
|
|
+ return Result.errorMsg("预算金额不能低于当前已消费金额的105%");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
// 数据入库 string[] 转 string
|
|
|
//商品卖点
|
|
|
aiBytedanceAdvertiserStrategy.setCreativeProductSellingPoints(org.apache.commons.lang3.StringUtils.join(aiBytedanceAdvertiserStrategy.getProductSellingPoints(), ","));
|