|
@@ -145,22 +145,32 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
if(null == adId){
|
|
if(null == adId){
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
- adDplinkInfo.setAdId(adId);
|
|
|
|
- adDplinkInfo.setAccountId(strategy.getAccountId());
|
|
|
|
- adDplinkInfo.setStatus(1);
|
|
|
|
- adDplinkInfo.setStrategyId(strategy.getId());
|
|
|
|
- adDplinkInfoService.save(adDplinkInfo);
|
|
|
|
|
|
+
|
|
//3:创建创意
|
|
//3:创建创意
|
|
JSONObject creativeParams = getCreativeParams(strategy,adId,video,token);
|
|
JSONObject creativeParams = getCreativeParams(strategy,adId,video,token);
|
|
log.info("账户id:{};创意创建参数:{}",strategy.getAccountId(),creativeParams);
|
|
log.info("账户id:{};创意创建参数:{}",strategy.getAccountId(),creativeParams);
|
|
JSONObject creativeObject = marketingService.creativeCreate(token,adId,creativeParams);
|
|
JSONObject creativeObject = marketingService.creativeCreate(token,adId,creativeParams);
|
|
if(null!=creativeObject.getInteger("code")&&creativeObject.getInteger("code")!=0){
|
|
if(null!=creativeObject.getInteger("code")&&creativeObject.getInteger("code")!=0){
|
|
|
|
+ List<Long> adIds = new ArrayList<>();
|
|
|
|
+ adIds.add(adId);
|
|
|
|
+ Result resultDeletePlan = marketingService.updPlanStatus(token,adIds,"delete");
|
|
|
|
+ if (!resultDeletePlan.isSuccess()){
|
|
|
|
+ log.info("广告计划删除失败:message==>{}",resultDeletePlan.getMessage());
|
|
|
|
+ }
|
|
|
|
+
|
|
String message = creativeObject.getString("message");
|
|
String message = creativeObject.getString("message");
|
|
Integer code = creativeObject.getInteger("code");
|
|
Integer code = creativeObject.getInteger("code");
|
|
//创建创意失败
|
|
//创建创意失败
|
|
log.info("账户id:{};创意创建失败:code==>{};message==>{}",strategy.getAccountId(),code,message);
|
|
log.info("账户id:{};创意创建失败:code==>{};message==>{}",strategy.getAccountId(),code,message);
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ adDplinkInfo.setAdId(adId);
|
|
|
|
+ adDplinkInfo.setAccountId(strategy.getAccountId());
|
|
|
|
+ adDplinkInfo.setStatus(1);
|
|
|
|
+ adDplinkInfo.setStrategyId(strategy.getId());
|
|
|
|
+ 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 --;
|
|
@@ -207,23 +217,30 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
if(null == adId){
|
|
if(null == adId){
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
- adDplinkInfo.setAdId(adId);
|
|
|
|
- adDplinkInfo.setAccountId(strategy.getAccountId());
|
|
|
|
- adDplinkInfo.setStatus(1);
|
|
|
|
- adDplinkInfo.setStrategyId(strategy.getId());
|
|
|
|
- adDplinkInfoService.save(adDplinkInfo);
|
|
|
|
//3:创建创意
|
|
//3:创建创意
|
|
JSONObject creativeParams = getCreativeParams(strategy,adId,video,token);
|
|
JSONObject creativeParams = getCreativeParams(strategy,adId,video,token);
|
|
log.info("创意创建参数:{}",creativeParams);
|
|
log.info("创意创建参数:{}",creativeParams);
|
|
JSONObject creativeObject = marketingService.creativeCreate(token,adId,creativeParams);
|
|
JSONObject creativeObject = marketingService.creativeCreate(token,adId,creativeParams);
|
|
log.info("创意创建返回数据:{}",creativeObject);
|
|
log.info("创意创建返回数据:{}",creativeObject);
|
|
if(null!=creativeObject.getInteger("code")&&creativeObject.getInteger("code")!=0){
|
|
if(null!=creativeObject.getInteger("code")&&creativeObject.getInteger("code")!=0){
|
|
|
|
+ List<Long> adIds = new ArrayList<>();
|
|
|
|
+ adIds.add(adId);
|
|
|
|
+ Result resultDeletePlan = marketingService.updPlanStatus(token,adIds,"delete");
|
|
|
|
+ if (!resultDeletePlan.isSuccess()){
|
|
|
|
+ log.info("广告计划删除失败:message==>{}",resultDeletePlan.getMessage());
|
|
|
|
+ }
|
|
String message = creativeObject.getString("message");
|
|
String message = creativeObject.getString("message");
|
|
Integer code = creativeObject.getInteger("code");
|
|
Integer code = creativeObject.getInteger("code");
|
|
//创建创意失败
|
|
//创建创意失败
|
|
log.info("账户id:{};创意创建失败:code==>{};message==>{}",strategy.getAccountId(),code,message);
|
|
log.info("账户id:{};创意创建失败:code==>{};message==>{}",strategy.getAccountId(),code,message);
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ adDplinkInfo.setAdId(adId);
|
|
|
|
+ adDplinkInfo.setAccountId(strategy.getAccountId());
|
|
|
|
+ adDplinkInfo.setStatus(1);
|
|
|
|
+ adDplinkInfo.setStrategyId(strategy.getId());
|
|
|
|
+ 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 --;
|
|
@@ -732,6 +749,7 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
params.put("exclude_flow_package",excludeFlowPackage);
|
|
params.put("exclude_flow_package",excludeFlowPackage);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+
|
|
if(!Check.isNull(strategy.getAdPlatform())){
|
|
if(!Check.isNull(strategy.getAdPlatform())){
|
|
String[] platform = strategy.getAdPlatform().split(",");
|
|
String[] platform = strategy.getAdPlatform().split(",");
|
|
if(platform.length>0){
|
|
if(platform.length>0){
|