|
@@ -6,7 +6,6 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.google.common.base.Joiner;
|
|
|
-import com.google.gson.JsonObject;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.jeecg.common.api.vo.Result;
|
|
|
import org.jeecg.common.util.DateUtils;
|
|
@@ -107,21 +106,11 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
|
log.info("获取{}视频素材为空=>accountId:{}",BytedanceCreativeMatTypeEnum.getNameByType(createType+""),token.getAccountId());
|
|
|
return videoCnt;
|
|
|
}
|
|
|
+ log.info("获取{}视频素材个数:{}=>accountId:{}",BytedanceCreativeMatTypeEnum.getNameByType(createType+""),videoInfos.size(),token.getAccountId());
|
|
|
|
|
|
for (ByteDanceVideoInfo video:videoInfos) {
|
|
|
- //1:过滤掉所有不存在于视频库的数据
|
|
|
- MaterialInfo materialInfo = materialInfoService.getParams(video.getSignature(),1);
|
|
|
- if(null == materialInfo){
|
|
|
- continue;
|
|
|
- }
|
|
|
- //过滤掉所有未绑定文案的数据
|
|
|
- List<BytedanceVideoSlogenInfo>slogenInfos = slogenInfoService.listByParams(video.getSignature(),1);
|
|
|
- if(null == slogenInfos||slogenInfos.isEmpty()){
|
|
|
- continue;
|
|
|
- }
|
|
|
Integer useDplinkIndex = strategy.getDpLinkIndexUsed();
|
|
|
if(null==useDplinkIndex||useDplinkIndex.equals(0)){
|
|
|
- Long dpIndex ;
|
|
|
AiBytedanceAdDplinkInfo adDplinkInfo = adDplinkInfoService.getlatestDpLinkInfo(strategy.getId(),strategy.getAccountId(),1);
|
|
|
if(null == adDplinkInfo){
|
|
|
adDplinkInfo = new AiBytedanceAdDplinkInfo();
|
|
@@ -148,7 +137,7 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
|
//计划名称
|
|
|
String adName = getAdName(strategy,null,video);
|
|
|
//计算本次出价
|
|
|
- BigDecimal currentCpaBid = StringUtils.getRandomAdCpaBid(strategy.getAdBidCreateType(),strategy.getAdMaxBid(),strategy.getAdMinBid(),strategy.getAdStepBid(),adDplinkInfo.getAdBid());
|
|
|
+ BigDecimal currentCpaBid = StringUtils.getRandomAdCpaBid(strategy.getAdBidCreateType(),strategy.getAdMaxBid(),strategy.getAdMinBid(),strategy.getAdStepBid(),adDplinkInfo.getAdBid(),strategy.getAdCpaBid());
|
|
|
JSONObject adParams = getAdParams(strategy,adName,campaignId,currentCpaBid);
|
|
|
Long adId = createAdInfo(token,strategy,adParams);
|
|
|
if(null == adId){
|
|
@@ -170,6 +159,8 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
|
log.info("创意创建失败:code==>{};message==>{}",code,message);
|
|
|
continue;
|
|
|
}
|
|
|
+ BytedanceAiVideoCreativeLog creativeLog = new BytedanceAiVideoCreativeLog(strategy,adId,campaignId,video);
|
|
|
+ videoCreativeLogService.saveOrUpdate(creativeLog);
|
|
|
videoCnt --;
|
|
|
if(videoCnt<=0){
|
|
|
return 0L;
|
|
@@ -207,7 +198,7 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
|
//计划名称
|
|
|
String adName = getAdName(strategy,dplinkCode,video);
|
|
|
//计算本次出价
|
|
|
- BigDecimal currentCpaBid = StringUtils.getRandomAdCpaBid(strategy.getAdBidCreateType(),strategy.getAdMaxBid(),strategy.getAdMinBid(),strategy.getAdStepBid(),adDplinkInfo.getAdBid());
|
|
|
+ BigDecimal currentCpaBid = StringUtils.getRandomAdCpaBid(strategy.getAdBidCreateType(),strategy.getAdMaxBid(),strategy.getAdMinBid(),strategy.getAdStepBid(),adDplinkInfo.getAdBid(),strategy.getAdCpaBid());
|
|
|
adDplinkInfo.setAdBid(currentCpaBid);
|
|
|
JSONObject adParams = getAdParams(strategy,adName,campaignId,currentCpaBid);
|
|
|
Long adId = createAdInfo(token,strategy,adParams);
|
|
@@ -223,11 +214,10 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
|
JSONObject creativeParams = getCreativeParams(strategy,adId,video,token);
|
|
|
log.info("创意创建参数:{}",creativeParams);
|
|
|
JSONObject creativeObject = marketingService.creativeCreate(token,adId,creativeParams);
|
|
|
+ log.info("创意创建返回数据:{}",creativeObject);
|
|
|
if(null!=creativeObject.getInteger("code")&&creativeObject.getInteger("code")!=0){
|
|
|
String message = creativeObject.getString("message");
|
|
|
Integer code = creativeObject.getInteger("code");
|
|
|
- //创建创意失败
|
|
|
- log.info("创意创建失败:code==>{};message==>{}",code,message);
|
|
|
continue;
|
|
|
}
|
|
|
BytedanceAiVideoCreativeLog creativeLog = new BytedanceAiVideoCreativeLog(strategy,adId,campaignId,video);
|
|
@@ -1005,13 +995,13 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
|
private List<ByteDanceVideoInfo> getVideoInfoByCreateType(Long projectId,AiBytedanceAdvertiserStrategy strategy, String startTime, String endTime, Integer createType, Long videoCnt) {
|
|
|
//1:上新素材 2:跑量素材 3:遗漏素材 4:打捞素材
|
|
|
if(createType == 1||createType == 3){
|
|
|
- return videoInfoService.listByParams(strategy.getAccountId(),startTime,endTime,videoCnt,0);
|
|
|
+ return videoInfoService.listByParams(projectId,strategy.getAccountId(),startTime,endTime,videoCnt,0);
|
|
|
}else if(createType == 2){
|
|
|
startTime = startTime.substring(0,10);
|
|
|
endTime = endTime.substring(0,10);
|
|
|
return videoInfoService.topMatByParams(projectId,strategy.getAccountId(),startTime,endTime,videoCnt);
|
|
|
}else if(createType == 4){
|
|
|
- return videoInfoService.listByParams(strategy.getAccountId(),startTime,endTime,videoCnt,20);
|
|
|
+ return videoInfoService.listByParams(projectId,strategy.getAccountId(),startTime,endTime,videoCnt,20);
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
@@ -1507,12 +1497,12 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
|
|
|
|
/**
|
|
|
*
|
|
|
- * @description:获取橙子建站站点列表
|
|
|
+ * 获取橙子建站站点列表
|
|
|
* https://www.chengzijianzhan.com/tetris/page/XXXXXXXXXXXXX/(其中XX是建站ID,拼装后就可获得投放的URL/预览URL)
|
|
|
* Android应用下载详情页 当广告计划app_type为"APP_ANDROID"时, 必填
|
|
|
* @param accountId
|
|
|
- * @return: org.jeecg.common.api.vo.Result
|
|
|
- * @author: zianY
|
|
|
+ * @return org.jeecg.common.api.vo.Result
|
|
|
+ * @author zianY
|
|
|
*/
|
|
|
@Override
|
|
|
public Result getChengZiSite(String accountId) {
|