|
@@ -442,7 +442,7 @@ public class KuaishouBatchCreativePreviewServiceImpl extends ServiceImpl<Kuaisho
|
|
createJson.put("creative_name", creativePreview.getCreativeName()); // 创意名称
|
|
createJson.put("creative_name", creativePreview.getCreativeName()); // 创意名称
|
|
if (!Check.isNull(creativePreview.getPhotoId())) {
|
|
if (!Check.isNull(creativePreview.getPhotoId())) {
|
|
createJson.put("photo_id", creativePreview.getPhotoId()); // 视频ID
|
|
createJson.put("photo_id", creativePreview.getPhotoId()); // 视频ID
|
|
- KuaiShouVideoGet video = videoGetService.getVideoByPhotoId(Long.valueOf(creativePreview.getPhotoId()));
|
|
|
|
|
|
+ KuaiShouVideoGet video = videoGetService.getVideoByPhotoId(creativePreview.getPhotoId());
|
|
if (Check.isNull(video)) {
|
|
if (Check.isNull(video)) {
|
|
log.info("账户:{},photoId:{} 没有查询到视频,素材类型指定为竖版视频", oauthToken.getAccountId(), creativePreview.getPhotoId());
|
|
log.info("账户:{},photoId:{} 没有查询到视频,素材类型指定为竖版视频", oauthToken.getAccountId(), creativePreview.getPhotoId());
|
|
createJson.put("creative_material_type", 1); // 素材类型
|
|
createJson.put("creative_material_type", 1); // 素材类型
|
|
@@ -524,7 +524,7 @@ public class KuaishouBatchCreativePreviewServiceImpl extends ServiceImpl<Kuaisho
|
|
/**
|
|
/**
|
|
* 根据预览数据创建广告创意(批量)
|
|
* 根据预览数据创建广告创意(批量)
|
|
*/
|
|
*/
|
|
- private void createMoreCreative(CtopOauthToken oauthToken, List<KuaishouBatchCreativePreview> creativePreviewList, Long campaignId, Long unitId) throws Exception {
|
|
|
|
|
|
+ private void createMoreCreative(CtopOauthToken oauthToken, List<KuaishouBatchCreativePreview> creativePreviewList, Long unitId, Long campaignId) throws Exception {
|
|
KuaishouBatchCreativePreview updateStatus = new KuaishouBatchCreativePreview();
|
|
KuaishouBatchCreativePreview updateStatus = new KuaishouBatchCreativePreview();
|
|
updateStatus.setCampaignId(campaignId);
|
|
updateStatus.setCampaignId(campaignId);
|
|
updateStatus.setUnitId(unitId);
|
|
updateStatus.setUnitId(unitId);
|
|
@@ -553,40 +553,29 @@ public class KuaishouBatchCreativePreviewServiceImpl extends ServiceImpl<Kuaisho
|
|
List<JSONObject> creatives = new ArrayList<>();
|
|
List<JSONObject> creatives = new ArrayList<>();
|
|
for (KuaishouBatchCreativePreview preview : creativePreviewList) {
|
|
for (KuaishouBatchCreativePreview preview : creativePreviewList) {
|
|
JSONObject creative = new JSONObject();
|
|
JSONObject creative = new JSONObject();
|
|
- creative.put("creative_name", creativePreview.getCreativeName()); // 创意名称
|
|
|
|
- if (!Check.isNull(creativePreview.getPhotoId())) {
|
|
|
|
- creative.put("photo_id", creativePreview.getPhotoId()); // 视频ID
|
|
|
|
- KuaiShouVideoGet video = videoGetService.getVideoByPhotoId(Long.valueOf(creativePreview.getPhotoId()));
|
|
|
|
- if (Check.isNull(video)) {
|
|
|
|
- log.info("账户:{},photoId:{} 没有查询到视频,素材类型指定为竖版视频", oauthToken.getAccountId(), creativePreview.getPhotoId());
|
|
|
|
- creative.put("creative_material_type", 1); // 素材类型
|
|
|
|
- } else {
|
|
|
|
- if (0 == video.getIsKaiPing()) {
|
|
|
|
- creative.put("creative_material_type", 11);// 11-开屏视频
|
|
|
|
- creative.put("splash_photo_ids", JSONObject.parseArray(creativePreview.getSplashPhotoIds())); // 安卓下载中间页ID
|
|
|
|
- } else {
|
|
|
|
- creative.put("creative_material_type", video.getMaterialType());//1:竖版视频 2:横版视频
|
|
|
|
- }
|
|
|
|
- }
|
|
|
|
|
|
+ creative.put("creative_name", preview.getCreativeName()); // 创意名称
|
|
|
|
+ if (!Check.isNull(preview.getSplashPhotoIds())) {
|
|
|
|
+ creative.put("creative_material_type", 11);// 11-开屏视频
|
|
|
|
+ creative.put("splash_photo_ids", JSONObject.parseArray(preview.getSplashPhotoIds())); // 安卓下载中间页ID
|
|
}
|
|
}
|
|
- if (!Check.isNull(creativePreview.getImageTokens())) {
|
|
|
|
- creative.put("image_tokens", Arrays.asList(creativePreview.getImageTokens()));
|
|
|
|
- creative.put("creative_material_type", creativePreview.getMaterialType());
|
|
|
|
|
|
+ if (!Check.isNull(preview.getImageTokens())) {
|
|
|
|
+ creative.put("image_tokens", Arrays.asList(preview.getImageTokens()));
|
|
|
|
+ creative.put("creative_material_type", preview.getMaterialType());
|
|
}
|
|
}
|
|
- if (!Check.isNull(creativePreview.getActionBarText())) {
|
|
|
|
- creative.put("action_bar_text", creativePreview.getActionBarText()); // 行动号召按钮文案
|
|
|
|
|
|
+ if (!Check.isNull(preview.getActionBarText())) {
|
|
|
|
+ creative.put("action_bar_text", preview.getActionBarText()); // 行动号召按钮文案
|
|
}
|
|
}
|
|
- if (!Check.isNull(creativePreview.getDescription())) {
|
|
|
|
- creative.put("description", creativePreview.getDescription()); // 广告语
|
|
|
|
|
|
+ if (!Check.isNull(preview.getDescription())) {
|
|
|
|
+ creative.put("description", preview.getDescription()); // 广告语
|
|
}
|
|
}
|
|
- if (!Check.isNull(creativePreview.getStickerTitle())) {
|
|
|
|
- creative.put("sticker_title", creativePreview.getStickerTitle()); // 封面广告语标题
|
|
|
|
|
|
+ if (!Check.isNull(preview.getStickerTitle())) {
|
|
|
|
+ creative.put("sticker_title", preview.getStickerTitle()); // 封面广告语标题
|
|
}
|
|
}
|
|
- if (!Check.isNull(creativePreview.getOverlayType())) {
|
|
|
|
- creative.put("overlay_type", creativePreview.getOverlayType()); // 贴纸样式类型
|
|
|
|
|
|
+ if (!Check.isNull(preview.getOverlayType())) {
|
|
|
|
+ creative.put("overlay_type", preview.getOverlayType()); // 贴纸样式类型
|
|
}
|
|
}
|
|
- if (!Check.isNull(creativePreview.getSiteId())) {
|
|
|
|
- creative.put("site_id", creativePreview.getSiteId()); // 安卓下载中间页ID
|
|
|
|
|
|
+ if (!Check.isNull(preview.getSiteId())) {
|
|
|
|
+ creative.put("site_id", preview.getSiteId()); // 安卓下载中间页ID
|
|
}
|
|
}
|
|
creatives.add(creative);
|
|
creatives.add(creative);
|
|
}
|
|
}
|
|
@@ -612,6 +601,7 @@ public class KuaishouBatchCreativePreviewServiceImpl extends ServiceImpl<Kuaisho
|
|
updateStatus.setId(preview.getId());
|
|
updateStatus.setId(preview.getId());
|
|
creativePreviewMapper.updateById(updateStatus);
|
|
creativePreviewMapper.updateById(updateStatus);
|
|
}
|
|
}
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -647,7 +637,7 @@ public class KuaishouBatchCreativePreviewServiceImpl extends ServiceImpl<Kuaisho
|
|
JSONObject photo = new JSONObject();
|
|
JSONObject photo = new JSONObject();
|
|
photo.put("photo_id", photoId);//视频 ID
|
|
photo.put("photo_id", photoId);//视频 ID
|
|
photo.put("cover_image_token", null);//封面图片 token,通过上传图片接口获得,不传值则直接使用视频的首帧作为封面图片
|
|
photo.put("cover_image_token", null);//封面图片 token,通过上传图片接口获得,不传值则直接使用视频的首帧作为封面图片
|
|
- KuaiShouVideoGet video = videoGetService.getVideoByPhotoId(Long.valueOf(photoId));
|
|
|
|
|
|
+ KuaiShouVideoGet video = videoGetService.getVideoByPhotoId(photoId);
|
|
if (Check.isNull(video)) {
|
|
if (Check.isNull(video)) {
|
|
log.info("账户:{},photoId:{} 没有查询到视频,素材类型指定为竖版视频", oauthToken.getAccountId(), photoId);
|
|
log.info("账户:{},photoId:{} 没有查询到视频,素材类型指定为竖版视频", oauthToken.getAccountId(), photoId);
|
|
photo.put("creative_material_type", 1);
|
|
photo.put("creative_material_type", 1);
|