|
@@ -168,31 +168,31 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
|
if (Check.isNull(allVideos)) {
|
|
|
return videoCnt;
|
|
|
}
|
|
|
- for (int i = 0; i < appIdArray.size(); i++) {
|
|
|
- Long appId = appIdArray.getLong(i);
|
|
|
- if (Check.isNull(appId)) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- KuaiShouAppMultipleBids multipleBids = kuaiShouAppMultipleBidsService.getInfoByAccountAndAppId(accountId, appId);
|
|
|
- if (Check.isNull(multipleBids)) {
|
|
|
+ for (KuaiShouVideoGet videoItem : allVideos) {
|
|
|
+ // 获取视频封面数据
|
|
|
+ List<MaterialCutFrame> cutFrameList = materialCutFrameService.getListByVideoSignature(videoItem.getSignature());
|
|
|
+ if ((null == cutFrameList || cutFrameList.isEmpty())) {
|
|
|
+ log.info("未获取到视频封面=>videoSignature:{}", videoItem.getSignature());
|
|
|
continue;
|
|
|
}
|
|
|
- if (!Check.isNull(multipleBids.getTrackUrl())) {
|
|
|
- strategy.setClickTrackUrl(multipleBids.getTrackUrl());
|
|
|
- }
|
|
|
- Long newCampaignId = getCampaignId(strategy, token, replaceString, "TODAY", createType, appId, strategyUuid);
|
|
|
- for (KuaiShouVideoGet videoItem : allVideos) {
|
|
|
+ for (int i = 0; i < appIdArray.size(); i++) {
|
|
|
+ Long appId = appIdArray.getLong(i);
|
|
|
+ if (Check.isNull(appId)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ KuaiShouAppMultipleBids multipleBids = kuaiShouAppMultipleBidsService.getInfoByAccountAndAppId(accountId, appId);
|
|
|
+ if (Check.isNull(multipleBids)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (!Check.isNull(multipleBids.getTrackUrl())) {
|
|
|
+ strategy.setClickTrackUrl(multipleBids.getTrackUrl());
|
|
|
+ }
|
|
|
KuaishouAccountCreativeOverrunInfo overrunInfo = overrunInfoService.getByParams(accountId, DateUtils.formatDate(new Date()));
|
|
|
if (null != overrunInfo) {
|
|
|
log.info("该账户创意创建已超限=>accountId:{}", accountId);
|
|
|
return 0L;
|
|
|
}
|
|
|
- // 获取视频封面数据
|
|
|
- List<MaterialCutFrame> cutFrameList = materialCutFrameService.getListByVideoSignature(videoItem.getSignature());
|
|
|
- if ((null == cutFrameList || cutFrameList.isEmpty())) {
|
|
|
- log.info("未获取到视频封面=>videoSignature:{}", videoItem.getSignature());
|
|
|
- continue;
|
|
|
- }
|
|
|
+ Long newCampaignId = getCampaignId(strategy, token, replaceString, "TODAY", createType, appId, strategyUuid);
|
|
|
//开始创建组+创意
|
|
|
String unitName = getName(strategy.getGroupName(), strategy, createType, videoItem.getPhotoName(), "unit", newCampaignId, appId);
|
|
|
JSONObject unitParams = createUnitParams(token, newCampaignId, strategy, unitName, appId);
|
|
@@ -233,9 +233,7 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
}
|
|
|
-
|
|
|
} else {
|
|
|
//单一应用
|
|
|
String replaceString = KuaishouCreativeMatTypeEnum.getNameByType(strategy.getUnitType().toString() + createType.toString());
|
|
@@ -302,7 +300,6 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
|
return videoCnt;
|
|
|
}
|
|
|
|
|
|
-
|
|
|
/**
|
|
|
* 创建程序化创意
|
|
|
*
|
|
@@ -376,7 +373,6 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
|
return;
|
|
|
}
|
|
|
Long newCampaignId = getCampaignId(strategy, token, replaceString, "ALL_CAMPAIGN", createType, appInfo.getAppId(), strategyUuid);
|
|
|
-
|
|
|
//创建组+创意
|
|
|
List<List<KuaiShouVideoGet>> splitVideos = Lists.partition(allVideos, 5);
|
|
|
for (int j = 1; j < splitVideos.size() + 1; j++) {
|
|
@@ -420,21 +416,9 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
|
if (Check.isNull(allVideos)) {
|
|
|
return;
|
|
|
}
|
|
|
- for (int i = 0; i < appIdArray.size(); i++) {
|
|
|
- Long appId = appIdArray.getLong(i);
|
|
|
- if (Check.isNull(appId)) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- KuaiShouAppMultipleBids multipleBids = kuaiShouAppMultipleBidsService.getInfoByAccountAndAppId(accountId, appId);
|
|
|
- if (Check.isNull(multipleBids)) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- if (!Check.isNull(multipleBids.getTrackUrl())) {
|
|
|
- strategy.setClickTrackUrl(multipleBids.getTrackUrl());
|
|
|
- }
|
|
|
- Long newCampaignId = getCampaignId(strategy, token, replaceString, "TODAY", createType, appId, strategyUuid);
|
|
|
- List<List<KuaiShouVideoGet>> splitVideos = Lists.partition(allVideos, 5);
|
|
|
- for (int j = 1; j < splitVideos.size() + 1; j++) {
|
|
|
+ List<List<KuaiShouVideoGet>> splitVideos = Lists.partition(allVideos, 5);
|
|
|
+ for (int j = 1; j < splitVideos.size() + 1; j++) {
|
|
|
+ for (int i = 0; i < appIdArray.size(); i++) {
|
|
|
Object redisObj = redisUtil.get(key);
|
|
|
if (!Check.isNull(redisObj)) {
|
|
|
Integer value = (Integer) redisObj;
|
|
@@ -443,6 +427,18 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
|
|
|
return;
|
|
|
}
|
|
|
}
|
|
|
+ Long appId = appIdArray.getLong(i);
|
|
|
+ if (Check.isNull(appId)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ KuaiShouAppMultipleBids multipleBids = kuaiShouAppMultipleBidsService.getInfoByAccountAndAppId(accountId, appId);
|
|
|
+ if (Check.isNull(multipleBids)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (!Check.isNull(multipleBids.getTrackUrl())) {
|
|
|
+ strategy.setClickTrackUrl(multipleBids.getTrackUrl());
|
|
|
+ }
|
|
|
+ Long newCampaignId = getCampaignId(strategy, token, replaceString, "TODAY", createType, appId, strategyUuid);
|
|
|
//创建组
|
|
|
String unitName = getName(strategy.getGroupName(), strategy, createType, null, "unit", newCampaignId, appId);
|
|
|
JSONObject unitParams = createUnitParams(token, newCampaignId, strategy, unitName, appId);
|