|
@@ -280,11 +280,11 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
|
|
|
|
|
|
|
|
/*基础创意*/
|
|
/*基础创意*/
|
|
-
|
|
|
|
|
|
+ JSONObject ad_data = new JSONObject();
|
|
//行业类别
|
|
//行业类别
|
|
String thirdIndustryId = strategy.getCreativeThirdIndustryId();
|
|
String thirdIndustryId = strategy.getCreativeThirdIndustryId();
|
|
if(!Check.isNull(thirdIndustryId)){
|
|
if(!Check.isNull(thirdIndustryId)){
|
|
- params.put("third_industry_id",thirdIndustryId);
|
|
|
|
|
|
+ ad_data.put("third_industry_id",thirdIndustryId);
|
|
}
|
|
}
|
|
|
|
|
|
//关键词 添加随机关键词逻辑
|
|
//关键词 添加随机关键词逻辑
|
|
@@ -293,82 +293,83 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
String [] keywords = adKeywords.split(",");
|
|
String [] keywords = adKeywords.split(",");
|
|
if(keywords.length>0){
|
|
if(keywords.length>0){
|
|
if(keywords.length<=20){
|
|
if(keywords.length<=20){
|
|
- params.put("ad_keywords",keywords);
|
|
|
|
|
|
+ ad_data.put("ad_keywords",keywords);
|
|
}else {
|
|
}else {
|
|
List<String>keywordList = Arrays.asList(keywords);
|
|
List<String>keywordList = Arrays.asList(keywords);
|
|
Collections.shuffle(keywordList);
|
|
Collections.shuffle(keywordList);
|
|
List<String> getKeyWords = keywordList.subList(0,20);
|
|
List<String> getKeyWords = keywordList.subList(0,20);
|
|
- params.put("ad_keywords",getKeyWords);
|
|
|
|
|
|
+ ad_data.put("ad_keywords",getKeyWords);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
//广告来源
|
|
//广告来源
|
|
String source = strategy.getCreativeSource();
|
|
String source = strategy.getCreativeSource();
|
|
if(!Check.isNull(source)){
|
|
if(!Check.isNull(source)){
|
|
- params.put("source",source);
|
|
|
|
|
|
+ ad_data.put("source",source);
|
|
}
|
|
}
|
|
//推广抖音号
|
|
//推广抖音号
|
|
String iesCoreUserId = strategy.getCreativeIesCoreUserId();
|
|
String iesCoreUserId = strategy.getCreativeIesCoreUserId();
|
|
if(!Check.isNull(iesCoreUserId)){
|
|
if(!Check.isNull(iesCoreUserId)){
|
|
- params.put("ies_core_user_id",iesCoreUserId);
|
|
|
|
|
|
+ ad_data.put("ies_core_user_id",iesCoreUserId);
|
|
}
|
|
}
|
|
//主页作品列表隐藏广告内容
|
|
//主页作品列表隐藏广告内容
|
|
Integer isFeedAndFavSee = strategy.getCreativeIsFeedAndFavSee();
|
|
Integer isFeedAndFavSee = strategy.getCreativeIsFeedAndFavSee();
|
|
if(null!=isFeedAndFavSee&&isFeedAndFavSee!=0){
|
|
if(null!=isFeedAndFavSee&&isFeedAndFavSee!=0){
|
|
- params.put("is_feed_and_fav_see",isFeedAndFavSee);
|
|
|
|
|
|
+ ad_data.put("is_feed_and_fav_see",isFeedAndFavSee);
|
|
}
|
|
}
|
|
//是否开启自动生成素材
|
|
//是否开启自动生成素材
|
|
Integer creativeAutoGenerateSwitch = strategy.getCreativeAutoGenerateSwitch();
|
|
Integer creativeAutoGenerateSwitch = strategy.getCreativeAutoGenerateSwitch();
|
|
if(null!=creativeAutoGenerateSwitch&&creativeAutoGenerateSwitch!=1){
|
|
if(null!=creativeAutoGenerateSwitch&&creativeAutoGenerateSwitch!=1){
|
|
- params.put("creative_auto_generate_switch",creativeAutoGenerateSwitch);
|
|
|
|
|
|
+ ad_data.put("creative_auto_generate_switch",creativeAutoGenerateSwitch);
|
|
}
|
|
}
|
|
//是否自动生成视频素材
|
|
//是否自动生成视频素材
|
|
Integer isPresentedVideo = strategy.getCreativeIsPresentedVideo();
|
|
Integer isPresentedVideo = strategy.getCreativeIsPresentedVideo();
|
|
if(null!=isPresentedVideo&&isPresentedVideo!=0){
|
|
if(null!=isPresentedVideo&&isPresentedVideo!=0){
|
|
- params.put("is_presented_video",isPresentedVideo);
|
|
|
|
|
|
+ ad_data.put("is_presented_video",isPresentedVideo);
|
|
}
|
|
}
|
|
//是否开启衍生计划
|
|
//是否开启衍生计划
|
|
Integer generateDerivedAd = strategy.getCreativeGenerateDerivedAd();
|
|
Integer generateDerivedAd = strategy.getCreativeGenerateDerivedAd();
|
|
if(null!=generateDerivedAd&&generateDerivedAd!=0){
|
|
if(null!=generateDerivedAd&&generateDerivedAd!=0){
|
|
- params.put("generate_derived_ad",generateDerivedAd);
|
|
|
|
|
|
+ ad_data.put("generate_derived_ad",generateDerivedAd);
|
|
}
|
|
}
|
|
//搭配试玩素材url
|
|
//搭配试玩素材url
|
|
String playableUrl = strategy.getCreativePlayableUrl();
|
|
String playableUrl = strategy.getCreativePlayableUrl();
|
|
if(!Check.isNull(playableUrl)){
|
|
if(!Check.isNull(playableUrl)){
|
|
- params.put("playable_url",playableUrl);
|
|
|
|
|
|
+ ad_data.put("playable_url",playableUrl);
|
|
}
|
|
}
|
|
//应用名
|
|
//应用名
|
|
String appName = strategy.getCreativeAppName();
|
|
String appName = strategy.getCreativeAppName();
|
|
if(!Check.isNull(appName)){
|
|
if(!Check.isNull(appName)){
|
|
- params.put("app_name",appName);
|
|
|
|
|
|
+ ad_data.put("app_name",appName);
|
|
}
|
|
}
|
|
//Android应用下载详情页
|
|
//Android应用下载详情页
|
|
String webUrl = strategy.getCreativeWebUrl();
|
|
String webUrl = strategy.getCreativeWebUrl();
|
|
if(!Check.isNull(webUrl)){
|
|
if(!Check.isNull(webUrl)){
|
|
- params.put("web_url",webUrl);
|
|
|
|
|
|
+ ad_data.put("web_url",webUrl);
|
|
}
|
|
}
|
|
//落地页链接
|
|
//落地页链接
|
|
if(!Check.isNull(strategy.getAdExternalUrl())){
|
|
if(!Check.isNull(strategy.getAdExternalUrl())){
|
|
- params.put("external_url",strategy.getAdExternalUrl());
|
|
|
|
|
|
+ ad_data.put("external_url",strategy.getAdExternalUrl());
|
|
}
|
|
}
|
|
|
|
|
|
//是否关闭评论,0为开启,1为关闭,默认值:0
|
|
//是否关闭评论,0为开启,1为关闭,默认值:0
|
|
Integer isCommentDisable = strategy.getCreativeIsCommentDisable();
|
|
Integer isCommentDisable = strategy.getCreativeIsCommentDisable();
|
|
if(!Check.isNull(isCommentDisable)&&isCommentDisable!=0){
|
|
if(!Check.isNull(isCommentDisable)&&isCommentDisable!=0){
|
|
- params.put("is_comment_disable",isCommentDisable);
|
|
|
|
|
|
+ ad_data.put("is_comment_disable",isCommentDisable);
|
|
}
|
|
}
|
|
//允许客户端下载视频功能
|
|
//允许客户端下载视频功能
|
|
Integer adDownloadStatus = strategy.getCreativeDownloadStatus();
|
|
Integer adDownloadStatus = strategy.getCreativeDownloadStatus();
|
|
if(!Check.isNull(adDownloadStatus)&&adDownloadStatus!=0){
|
|
if(!Check.isNull(adDownloadStatus)&&adDownloadStatus!=0){
|
|
- params.put("ad_download_status",adDownloadStatus);
|
|
|
|
|
|
+ ad_data.put("ad_download_status",adDownloadStatus);
|
|
}
|
|
}
|
|
//创意展现方式
|
|
//创意展现方式
|
|
String creativeDisplayMode = strategy.getCreativeDisplayMode();
|
|
String creativeDisplayMode = strategy.getCreativeDisplayMode();
|
|
if(!Check.isNull(creativeDisplayMode)){
|
|
if(!Check.isNull(creativeDisplayMode)){
|
|
- params.put("creative_display_mode",creativeDisplayMode);
|
|
|
|
|
|
+ ad_data.put("creative_display_mode",creativeDisplayMode);
|
|
}
|
|
}
|
|
- JSONObject ad_data = new JSONObject();
|
|
|
|
- ad_data.put("ad_data",params);
|
|
|
|
|
|
+ params.put("ad_data",ad_data);
|
|
|
|
+
|
|
|
|
+ JSONObject creObj = new JSONObject();
|
|
|
|
|
|
JSONArray titleArray = new JSONArray();
|
|
JSONArray titleArray = new JSONArray();
|
|
List<BytedanceVideoSlogenInfo> slogenInfos = slogenInfoService.listByParams(videoInfo.getSignature(),1);
|
|
List<BytedanceVideoSlogenInfo> slogenInfos = slogenInfoService.listByParams(videoInfo.getSignature(),1);
|
|
@@ -384,7 +385,11 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
if(null!=creativeWordsIds&&!creativeWordsIds.trim().equals("")){
|
|
if(null!=creativeWordsIds&&!creativeWordsIds.trim().equals("")){
|
|
JSONArray creativeWordsArray = JSON.parseArray(creativeWordsIds);
|
|
JSONArray creativeWordsArray = JSON.parseArray(creativeWordsIds);
|
|
if(null!=creativeWordsArray&&!creativeWordsArray.isEmpty()){
|
|
if(null!=creativeWordsArray&&!creativeWordsArray.isEmpty()){
|
|
- JSONObject creativeObject = new JSONObject();
|
|
|
|
|
|
+ for (Object creative : creativeWordsArray) {
|
|
|
|
+ JSONObject creativeObject = new JSONObject();
|
|
|
|
+ creativeObject.put("word_id",creative);
|
|
|
|
+ creativeWordsArray.add(creativeObject);
|
|
|
|
+ }
|
|
titleObject.put("word_list",creativeWordsArray);
|
|
titleObject.put("word_list",creativeWordsArray);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -444,7 +449,7 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
}
|
|
}
|
|
|
|
|
|
if(!Check.isNull(titleArray)){
|
|
if(!Check.isNull(titleArray)){
|
|
- params.put("title_materials",titleArray);
|
|
|
|
|
|
+ creObj.put("title_materials",titleArray);
|
|
}
|
|
}
|
|
JSONArray imageMaterials = new JSONArray();
|
|
JSONArray imageMaterials = new JSONArray();
|
|
JSONObject object = new JSONObject();
|
|
JSONObject object = new JSONObject();
|
|
@@ -462,29 +467,26 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
}
|
|
}
|
|
object.put("image_info",image_info);
|
|
object.put("image_info",image_info);
|
|
imageMaterials.add(object);
|
|
imageMaterials.add(object);
|
|
- params.put("image_materials",imageMaterials);
|
|
|
|
|
|
+ creObj.put("image_materials",imageMaterials);
|
|
}
|
|
}
|
|
|
|
|
|
if ("video".equalsIgnoreCase(videoInfo.getMaterialType())){
|
|
if ("video".equalsIgnoreCase(videoInfo.getMaterialType())){
|
|
//视频
|
|
//视频
|
|
object.put("image_mode",strategy.getCreativeImageMode());
|
|
object.put("image_mode",strategy.getCreativeImageMode());
|
|
JSONObject videoObj = new JSONObject();
|
|
JSONObject videoObj = new JSONObject();
|
|
- JSONObject vidIdObj = new JSONObject();
|
|
|
|
- vidIdObj.put("video_id",videoInfo.getVid());
|
|
|
|
- videoObj.put("video_info",vidIdObj);
|
|
|
|
//视频封面
|
|
//视频封面
|
|
JSONObject imgObj = new JSONObject();
|
|
JSONObject imgObj = new JSONObject();
|
|
//获取视频封面id
|
|
//获取视频封面id
|
|
String imageId = getSuggestImageId(token,videoInfo.getVid());
|
|
String imageId = getSuggestImageId(token,videoInfo.getVid());
|
|
if(!Check.isNull(imageId)){
|
|
if(!Check.isNull(imageId)){
|
|
- JSONObject imgId = new JSONObject();
|
|
|
|
- imgId.put("image_id",imageId);
|
|
|
|
- imgObj.put("image_info",imgId);
|
|
|
|
|
|
+ imgObj.put("image_id",imageId);
|
|
}
|
|
}
|
|
object.put("image_info",imgObj);
|
|
object.put("image_info",imgObj);
|
|
object.put("video_info",videoObj);
|
|
object.put("video_info",videoObj);
|
|
|
|
+
|
|
imageMaterials.add(object);
|
|
imageMaterials.add(object);
|
|
- params.put("video_materials",imageMaterials);
|
|
|
|
|
|
+
|
|
|
|
+ creObj.put("video_materials",imageMaterials);
|
|
}
|
|
}
|
|
|
|
|
|
//副标题
|
|
//副标题
|
|
@@ -492,9 +494,8 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
if(!Check.isNull(subTitle)){
|
|
if(!Check.isNull(subTitle)){
|
|
JSONObject titleObj = new JSONObject();
|
|
JSONObject titleObj = new JSONObject();
|
|
titleObj.put("sub_title",subTitle);
|
|
titleObj.put("sub_title",subTitle);
|
|
- params.put("sub_title_material",titleObj);
|
|
|
|
|
|
+ creObj.put("sub_title_material",titleObj);
|
|
}
|
|
}
|
|
-
|
|
|
|
//组件id
|
|
//组件id
|
|
JSONArray component = new JSONArray();
|
|
JSONArray component = new JSONArray();
|
|
String componentIdStr = strategy.getComponentId();
|
|
String componentIdStr = strategy.getComponentId();
|
|
@@ -504,8 +505,9 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
obj.put("component_id",new Long(strId));
|
|
obj.put("component_id",new Long(strId));
|
|
component.add(obj);
|
|
component.add(obj);
|
|
}
|
|
}
|
|
- params.put("component_materials",component);
|
|
|
|
|
|
+ creObj.put("component_materials",component);
|
|
|
|
|
|
|
|
+ params.put("creative",creObj);
|
|
return params;
|
|
return params;
|
|
|
|
|
|
}
|
|
}
|
|
@@ -575,14 +577,16 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
//点击监测链接
|
|
//点击监测链接
|
|
String actionTrackUrl = strategy.getCreativeActionTrackUrl();
|
|
String actionTrackUrl = strategy.getCreativeActionTrackUrl();
|
|
if(!Check.isNull(actionTrackUrl)){
|
|
if(!Check.isNull(actionTrackUrl)){
|
|
- params.put("action_track_url",actionTrackUrl);
|
|
|
|
|
|
+ params.put("action_track_url",new String[]{actionTrackUrl});
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
//广告位大类
|
|
//广告位大类
|
|
if (!Check.isNull(strategy.getInventoryCatalog())){
|
|
if (!Check.isNull(strategy.getInventoryCatalog())){
|
|
params.put("inventory_catalog",strategy.getInventoryCatalog());
|
|
params.put("inventory_catalog",strategy.getInventoryCatalog());
|
|
- }
|
|
|
|
|
|
+ }else{
|
|
|
|
+ params.put("inventory_catalog","MANUAL");
|
|
|
|
+ }
|
|
|
|
|
|
//广告投放位置
|
|
//广告投放位置
|
|
String inventoryType = strategy.getCreativeInventoryType();
|
|
String inventoryType = strategy.getCreativeInventoryType();
|
|
@@ -599,6 +603,8 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
//优选广告位
|
|
//优选广告位
|
|
if (!Check.isNull(strategy.getCreativeSmartInventory())){
|
|
if (!Check.isNull(strategy.getCreativeSmartInventory())){
|
|
params.put("smart_inventory",strategy.getCreativeSmartInventory());
|
|
params.put("smart_inventory",strategy.getCreativeSmartInventory());
|
|
|
|
+ }else{
|
|
|
|
+ params.put("smart_inventory","NORMAL");
|
|
}
|
|
}
|
|
|
|
|
|
// 投放形式
|
|
// 投放形式
|
|
@@ -1520,11 +1526,11 @@ public class AiBytedanceAdvertiserStrategyServiceImpl extends ServiceImpl<AiByte
|
|
aiBytedanceAdvertiserStrategy.setStatus(0);
|
|
aiBytedanceAdvertiserStrategy.setStatus(0);
|
|
|
|
|
|
//添加素材信息
|
|
//添加素材信息
|
|
- MaterialImageInfo imageInfo = new MaterialImageInfo();
|
|
|
|
|
|
+ /* MaterialImageInfo imageInfo = new MaterialImageInfo();
|
|
imageInfo.setUrl(aiBytedanceAdvertiserStrategy.getImageUrl());
|
|
imageInfo.setUrl(aiBytedanceAdvertiserStrategy.getImageUrl());
|
|
imageInfo.setUserId(aiBytedanceAdvertiserStrategy.getUserId());
|
|
imageInfo.setUserId(aiBytedanceAdvertiserStrategy.getUserId());
|
|
materialImageInfoService.initImageCode(imageInfo);
|
|
materialImageInfoService.initImageCode(imageInfo);
|
|
-
|
|
|
|
|
|
+*/
|
|
|
|
|
|
|
|
|
|
aiBytedanceAdvertiserStrategyMapper.insert(aiBytedanceAdvertiserStrategy);
|
|
aiBytedanceAdvertiserStrategyMapper.insert(aiBytedanceAdvertiserStrategy);
|