|
@@ -79,7 +79,7 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
IAiBytedanceAutocreateLogService iBytedanceAutocreateLogService;
|
|
IAiBytedanceAutocreateLogService iBytedanceAutocreateLogService;
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public Long createCreative(CtopOauthToken token, AiBytedanceAdvertiserStrategy strategy, Integer createType, Long videoCnt, String openUrl) {
|
|
|
|
|
|
+ public synchronized Long createCreative(CtopOauthToken token, AiBytedanceAdvertiserStrategy strategy, Integer createType, Long videoCnt, String openUrl) {
|
|
UserAllocation userAllocation = userAllocationService.getByAccountId(strategy.getAccountId());
|
|
UserAllocation userAllocation = userAllocationService.getByAccountId(strategy.getAccountId());
|
|
if(null == userAllocation||userAllocation.getAccountStatus()!=0){
|
|
if(null == userAllocation||userAllocation.getAccountStatus()!=0){
|
|
log.info("此账户不存在或者已经被关闭=>accountId:{}", token.getAccountId());
|
|
log.info("此账户不存在或者已经被关闭=>accountId:{}", token.getAccountId());
|
|
@@ -106,7 +106,6 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
if(timeEnd != 0){
|
|
if(timeEnd != 0){
|
|
endTime = DateUtils.formatDateTime(now + timeEnd * 60 * 1000L);
|
|
endTime = DateUtils.formatDateTime(now + timeEnd * 60 * 1000L);
|
|
}
|
|
}
|
|
- //List<ByteDanceVideoInfo> videoInfos = getVideoInfoByCreateType(userAllocation.getProjectId(),strategy,startTime,endTime,createType,videoCnt);
|
|
|
|
List<ByteDanceVideoInfo> videoInfos = getvideoOrImageInfoByCreateType(userAllocation.getProjectId(),strategy,startTime,endTime,createType,videoCnt);
|
|
List<ByteDanceVideoInfo> videoInfos = getvideoOrImageInfoByCreateType(userAllocation.getProjectId(),strategy,startTime,endTime,createType,videoCnt);
|
|
if(null == videoInfos||videoInfos.isEmpty()){
|
|
if(null == videoInfos||videoInfos.isEmpty()){
|
|
log.info("获取{}视频素材为空=>accountId:{}",BytedanceCreativeMatTypeEnum.getNameByType(createType+""),token.getAccountId());
|
|
log.info("获取{}视频素材为空=>accountId:{}",BytedanceCreativeMatTypeEnum.getNameByType(createType+""),token.getAccountId());
|
|
@@ -159,10 +158,8 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
}
|
|
}
|
|
//计划名称
|
|
//计划名称
|
|
String adName = getAdName(strategy,null,video,userAllocation.getProjectId());
|
|
String adName = getAdName(strategy,null,video,userAllocation.getProjectId());
|
|
- log.info("计划原名称=============>>>>>>>>>>{};长度为{}",adName,StringUtils.length(adName));
|
|
|
|
//截取 计划名称
|
|
//截取 计划名称
|
|
adName = StringUtils.adNameSubMaterial(adName);
|
|
adName = StringUtils.adNameSubMaterial(adName);
|
|
- log.info("计划截取后名称===========>>>>>>>>>>{};长度为{}",adName,StringUtils.length(adName));
|
|
|
|
//计算本次出价
|
|
//计算本次出价
|
|
BigDecimal currentCpaBid = StringUtils.getRandomAdCpaBid(strategy.getAdBidCreateType(),strategy.getAdMaxBid(),strategy.getAdMinBid(),strategy.getAdStepBid(),adDplinkInfo.getAdBid(),strategy.getAdCpaBid());
|
|
BigDecimal currentCpaBid = StringUtils.getRandomAdCpaBid(strategy.getAdBidCreateType(),strategy.getAdMaxBid(),strategy.getAdMinBid(),strategy.getAdStepBid(),adDplinkInfo.getAdBid(),strategy.getAdCpaBid());
|
|
JSONObject adParams = getAdParams(strategy,adName,campaignId,currentCpaBid);
|
|
JSONObject adParams = getAdParams(strategy,adName,campaignId,currentCpaBid);
|
|
@@ -311,9 +308,6 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
adDplinkInfoService.save(adDplinkInfo);
|
|
adDplinkInfoService.save(adDplinkInfo);
|
|
BytedanceAiVideoCreativeLog creativeLog = new BytedanceAiVideoCreativeLog(strategy,adId,campaignId,video);
|
|
BytedanceAiVideoCreativeLog creativeLog = new BytedanceAiVideoCreativeLog(strategy,adId,campaignId,video);
|
|
videoCreativeLogService.saveOrUpdate(creativeLog);
|
|
videoCreativeLogService.saveOrUpdate(creativeLog);
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
videoCnt --;
|
|
videoCnt --;
|
|
if(videoCnt<=0){
|
|
if(videoCnt<=0){
|
|
return 0L;
|
|
return 0L;
|