|
@@ -163,11 +163,11 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
return 0L;
|
|
return 0L;
|
|
}
|
|
}
|
|
// 获取视频封面数据
|
|
// 获取视频封面数据
|
|
- List<MaterialCutFrame> cutFrameList = materialCutFrameService.getListByVideoSignature(videoItem.getSignature());
|
|
|
|
|
|
+ /* List<MaterialCutFrame> cutFrameList = materialCutFrameService.getListByVideoSignature(videoItem.getSignature());
|
|
if ((null == cutFrameList || cutFrameList.isEmpty())) {
|
|
if ((null == cutFrameList || cutFrameList.isEmpty())) {
|
|
log.info("未获取到视频封面=>videoSignature:{}", videoItem.getSignature());
|
|
log.info("未获取到视频封面=>videoSignature:{}", videoItem.getSignature());
|
|
continue;
|
|
continue;
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
//开始创建组+创意
|
|
//开始创建组+创意
|
|
String unitName = getName(strategy.getGroupName(), strategy, createType, videoItem.getPhotoName(), "unit", newCampaignId, appInfo.getAppId(), null);
|
|
String unitName = getName(strategy.getGroupName(), strategy, createType, videoItem.getPhotoName(), "unit", newCampaignId, appInfo.getAppId(), null);
|
|
JSONObject unitParams = createUnitParams(token, newCampaignId, strategy, unitName, appInfo.getAppId(), null);
|
|
JSONObject unitParams = createUnitParams(token, newCampaignId, strategy, unitName, appInfo.getAppId(), null);
|
|
@@ -197,7 +197,7 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
unitLevelOperationRecordService.saveOrUpdate(unitLevelOperationRecord);
|
|
unitLevelOperationRecordService.saveOrUpdate(unitLevelOperationRecord);
|
|
videoCnt--;
|
|
videoCnt--;
|
|
JSONObject creativeParams = creativeParams(token, unitId, videoItem, strategy, null);
|
|
JSONObject creativeParams = creativeParams(token, unitId, videoItem, strategy, null);
|
|
- createCreativeByImage(cutFrameList, token, creativeParams, newCampaignId, unitId, videoItem, strategy.getImageCnt(), strategy, strategyUuid, appInfo.getAppVersion());
|
|
|
|
|
|
+ createCreativeByImage(strategy.getImageCnt(), token, creativeParams, newCampaignId, unitId, videoItem, strategy.getImageCnt(), strategy, strategyUuid, appInfo.getAppVersion());
|
|
if (videoCnt <= 0) {
|
|
if (videoCnt <= 0) {
|
|
return videoCnt;
|
|
return videoCnt;
|
|
}
|
|
}
|
|
@@ -212,11 +212,11 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
}
|
|
}
|
|
for (KuaiShouVideoGet videoItem : allVideos) {
|
|
for (KuaiShouVideoGet videoItem : allVideos) {
|
|
// 获取视频封面数据
|
|
// 获取视频封面数据
|
|
- List<MaterialCutFrame> cutFrameList = materialCutFrameService.getListByVideoSignature(videoItem.getSignature());
|
|
|
|
|
|
+ /* List<MaterialCutFrame> cutFrameList = materialCutFrameService.getListByVideoSignature(videoItem.getSignature());
|
|
if ((null == cutFrameList || cutFrameList.isEmpty())) {
|
|
if ((null == cutFrameList || cutFrameList.isEmpty())) {
|
|
log.info("未获取到视频封面=>videoSignature:{}", videoItem.getSignature());
|
|
log.info("未获取到视频封面=>videoSignature:{}", videoItem.getSignature());
|
|
continue;
|
|
continue;
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
for (int i = 0; i < appIdArray.size(); i++) {
|
|
for (int i = 0; i < appIdArray.size(); i++) {
|
|
|
|
|
|
Boolean unitOverrun = getUnitOverrun(accountId);
|
|
Boolean unitOverrun = getUnitOverrun(accountId);
|
|
@@ -278,7 +278,7 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
unitLevelOperationRecordService.saveOrUpdate(unitLevelOperationRecord);
|
|
unitLevelOperationRecordService.saveOrUpdate(unitLevelOperationRecord);
|
|
videoCnt--;
|
|
videoCnt--;
|
|
JSONObject creativeParams = creativeParams(token, unitId, videoItem, strategy, null);
|
|
JSONObject creativeParams = creativeParams(token, unitId, videoItem, strategy, null);
|
|
- createCreativeByImage(cutFrameList, token, creativeParams, newCampaignId, unitId, videoItem, strategy.getImageCnt(), strategy, strategyUuid, null);
|
|
|
|
|
|
+ createCreativeByImage(strategy.getImageCnt(), token, creativeParams, newCampaignId, unitId, videoItem, strategy.getImageCnt(), strategy, strategyUuid, null);
|
|
if (videoCnt <= 0) {
|
|
if (videoCnt <= 0) {
|
|
return videoCnt;
|
|
return videoCnt;
|
|
}
|
|
}
|
|
@@ -362,11 +362,12 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
return 0L;
|
|
return 0L;
|
|
}
|
|
}
|
|
// 每个组,搭配5个创意
|
|
// 每个组,搭配5个创意
|
|
- List<MaterialCutFrame> cutFrameList = materialCutFrameService.getListByVideoSignature(videoItem.getSignature());
|
|
|
|
|
|
+ /* List<MaterialCutFrame> cutFrameList = materialCutFrameService.getListByVideoSignature(videoItem.getSignature());
|
|
if ((null == cutFrameList || cutFrameList.isEmpty())) {
|
|
if ((null == cutFrameList || cutFrameList.isEmpty())) {
|
|
log.info("未获取到视频封面=>videoSignature:{}", videoItem.getSignature());
|
|
log.info("未获取到视频封面=>videoSignature:{}", videoItem.getSignature());
|
|
continue;
|
|
continue;
|
|
- }
|
|
|
|
|
|
+ }*/
|
|
|
|
+
|
|
//获取组级渠道号
|
|
//获取组级渠道号
|
|
if (!Check.isNull(useChannel) && useChannel == 1 && "group".equals(level)) {
|
|
if (!Check.isNull(useChannel) && useChannel == 1 && "group".equals(level)) {
|
|
try {
|
|
try {
|
|
@@ -419,7 +420,7 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
channelService.callBackUpdateChannelRel(level, usedchannel.getChannelCode(), accountId, newCampaignId, unitId);
|
|
channelService.callBackUpdateChannelRel(level, usedchannel.getChannelCode(), accountId, newCampaignId, unitId);
|
|
}
|
|
}
|
|
JSONObject creativeParams = creativeParams(token, unitId, videoItem, strategy, usedchannel);//TODO 添加素材
|
|
JSONObject creativeParams = creativeParams(token, unitId, videoItem, strategy, usedchannel);//TODO 添加素材
|
|
- createCreativeByImage(cutFrameList, token, creativeParams, newCampaignId, unitId, videoItem, strategy.getImageCnt(), strategy, strategyUuid, null);
|
|
|
|
|
|
+ createCreativeByImage(strategy.getImageCnt(), token, creativeParams, newCampaignId, unitId, videoItem, strategy.getImageCnt(), strategy, strategyUuid, null);
|
|
if (videoCnt <= 0) {
|
|
if (videoCnt <= 0) {
|
|
return 0L;
|
|
return 0L;
|
|
}
|
|
}
|
|
@@ -1664,15 +1665,15 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
- private void createCreativeByImage(List<MaterialCutFrame> cutFrameList, CtopOauthToken token, JSONObject creativeParams,
|
|
|
|
|
|
+ private void createCreativeByImage(Integer imageCount, CtopOauthToken token, JSONObject creativeParams,
|
|
Long campaignId, Long unitId, KuaiShouVideoGet videoItem,
|
|
Long campaignId, Long unitId, KuaiShouVideoGet videoItem,
|
|
int imageNumber, AiKuaishouAdvertiserStrategy strategy, String uuid, String appVersion) throws InterruptedException {
|
|
int imageNumber, AiKuaishouAdvertiserStrategy strategy, String uuid, String appVersion) throws InterruptedException {
|
|
- if ((null != cutFrameList && !cutFrameList.isEmpty())) {
|
|
|
|
- for (int i = 0; i < cutFrameList.size(); i++) {
|
|
|
|
- String imageCode = cutFrameList.get(i).getSignature();
|
|
|
|
- String imageUrl = cutFrameList.get(i).getUrl();
|
|
|
|
|
|
+
|
|
|
|
+ for (int i = 0; i < imageCount; i++) {
|
|
|
|
+ /* String imageCode = cutFrameList.get(i).getSignature();
|
|
|
|
+ String imageUrl = cutFrameList.get(i).getUrl();
|
|
String imageToken = getImageToken(imageUrl, imageCode, token.getAccountId(), token.getAccessToken());
|
|
String imageToken = getImageToken(imageUrl, imageCode, token.getAccountId(), token.getAccessToken());
|
|
- creativeParams.put("image_token", imageToken);
|
|
|
|
|
|
+ creativeParams.put("image_token", imageToken);*/
|
|
createCreative(token, creativeParams, campaignId, unitId, i + 1, videoItem, strategy, uuid, appVersion);
|
|
createCreative(token, creativeParams, campaignId, unitId, i + 1, videoItem, strategy, uuid, appVersion);
|
|
Thread.sleep(200L);
|
|
Thread.sleep(200L);
|
|
imageNumber--;
|
|
imageNumber--;
|
|
@@ -1680,7 +1681,7 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
break;
|
|
break;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- }
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
private String getImageToken(String imageUrl, String imageCode, Long accountId, String token) {
|
|
private String getImageToken(String imageUrl, String imageCode, Long accountId, String token) {
|