|
@@ -416,14 +416,14 @@ public class AiKuaishouAccountAutoDoServiceImpl implements IAiKuaishouAccountAut
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 更新广告组数
|
|
|
|
|
|
+ * 更新广告组编号数
|
|
*/
|
|
*/
|
|
private void updateVideoStatus(String key) {
|
|
private void updateVideoStatus(String key) {
|
|
Integer unitCnt = (Integer) redisUtil.get(key);
|
|
Integer unitCnt = (Integer) redisUtil.get(key);
|
|
if (Check.isNull(unitCnt)) {
|
|
if (Check.isNull(unitCnt)) {
|
|
redisUtil.set(key, 1, 100000L);
|
|
redisUtil.set(key, 1, 100000L);
|
|
} else {
|
|
} else {
|
|
- redisUtil.set(key, unitCnt + 1, 100000L);
|
|
|
|
|
|
+ redisUtil.set(key, unitCnt - 1, 100000L);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1006,6 +1006,8 @@ public class AiKuaishouAccountAutoDoServiceImpl implements IAiKuaishouAccountAut
|
|
|
|
|
|
//记录创建成功的素材,待最后执行删除redis
|
|
//记录创建成功的素材,待最后执行删除redis
|
|
List<AiKuaishouAccountAutoVideo> successVideoList = new ArrayList<>();
|
|
List<AiKuaishouAccountAutoVideo> successVideoList = new ArrayList<>();
|
|
|
|
+ Integer unitCode = null;
|
|
|
|
+ String unitMessage = null;
|
|
for (AiKuaishouAccountAutoVideo videoItem : targetsAndVideos) {
|
|
for (AiKuaishouAccountAutoVideo videoItem : targetsAndVideos) {
|
|
boolean unitOverrun = getUnitOverrun(accountId);
|
|
boolean unitOverrun = getUnitOverrun(accountId);
|
|
if (unitOverrun) {
|
|
if (unitOverrun) {
|
|
@@ -1020,8 +1022,7 @@ public class AiKuaishouAccountAutoDoServiceImpl implements IAiKuaishouAccountAut
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
- Integer unitCode = null;
|
|
|
|
- String unitMessage = null;
|
|
|
|
|
|
+
|
|
String unitName = getName(strategy.getGroupName(), strategy, videoType, videoItem.getPhotoName(), "unit", newCampaignId, videoItem.getAutoTargetId(), appId, channel);
|
|
String unitName = getName(strategy.getGroupName(), strategy, videoType, videoItem.getPhotoName(), "unit", newCampaignId, videoItem.getAutoTargetId(), appId, channel);
|
|
Result<Object> result = createUnitParams(token, newCampaignId, strategy, unitName, appId, channel, videoItem.getAutoTargetId());
|
|
Result<Object> result = createUnitParams(token, newCampaignId, strategy, unitName, appId, channel, videoItem.getAutoTargetId());
|
|
if (result.getCode() != CommonConstant.SC_OK_200) {
|
|
if (result.getCode() != CommonConstant.SC_OK_200) {
|
|
@@ -1068,7 +1069,7 @@ public class AiKuaishouAccountAutoDoServiceImpl implements IAiKuaishouAccountAut
|
|
}
|
|
}
|
|
}
|
|
}
|
|
removeRedisVideos(successVideoList, videoKey);
|
|
removeRedisVideos(successVideoList, videoKey);
|
|
- if (videoCnt > 0) {
|
|
|
|
|
|
+ if (videoCnt > 0 && unitCode == 0) {
|
|
return addCustomByGroupChannel(strategy, appName, videoType, token, newCampaignId, appId, videoCnt, strategyUuid);
|
|
return addCustomByGroupChannel(strategy, appName, videoType, token, newCampaignId, appId, videoCnt, strategyUuid);
|
|
}
|
|
}
|
|
return videoCnt;
|
|
return videoCnt;
|
|
@@ -1132,6 +1133,8 @@ public class AiKuaishouAccountAutoDoServiceImpl implements IAiKuaishouAccountAut
|
|
|
|
|
|
//记录创建成功的素材,待最后执行删除redis
|
|
//记录创建成功的素材,待最后执行删除redis
|
|
List<List<AiKuaishouAccountAutoVideo>> successVideoList = new ArrayList<>();
|
|
List<List<AiKuaishouAccountAutoVideo>> successVideoList = new ArrayList<>();
|
|
|
|
+ Integer unitCode = null;
|
|
|
|
+ String unitMessage = null;
|
|
for (List<AiKuaishouAccountAutoVideo> videos : targetsAndVideos) {
|
|
for (List<AiKuaishouAccountAutoVideo> videos : targetsAndVideos) {
|
|
boolean unitOverrun = getUnitOverrun(accountId);
|
|
boolean unitOverrun = getUnitOverrun(accountId);
|
|
if (unitOverrun) {
|
|
if (unitOverrun) {
|
|
@@ -1150,8 +1153,7 @@ public class AiKuaishouAccountAutoDoServiceImpl implements IAiKuaishouAccountAut
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- Integer unitCode = null;
|
|
|
|
- String unitMessage = null;
|
|
|
|
|
|
+
|
|
String unitName = getName(strategy.getGroupName(), strategy, videoType, null, "unit", newCampaignId, appId, videos.get(0).getAutoTargetId(), channel);
|
|
String unitName = getName(strategy.getGroupName(), strategy, videoType, null, "unit", newCampaignId, appId, videos.get(0).getAutoTargetId(), channel);
|
|
Result<Object> result = createUnitParams(token, newCampaignId, strategy, unitName, appId, channel, videos.get(0).getAutoTargetId());
|
|
Result<Object> result = createUnitParams(token, newCampaignId, strategy, unitName, appId, channel, videos.get(0).getAutoTargetId());
|
|
if (result.getCode() != CommonConstant.SC_OK_200) {
|
|
if (result.getCode() != CommonConstant.SC_OK_200) {
|
|
@@ -1199,7 +1201,7 @@ public class AiKuaishouAccountAutoDoServiceImpl implements IAiKuaishouAccountAut
|
|
}
|
|
}
|
|
//删除已使用的素材
|
|
//删除已使用的素材
|
|
removeProRedisVideos(successVideoList, videoKey);
|
|
removeProRedisVideos(successVideoList, videoKey);
|
|
- if (videoCnt > 0) {
|
|
|
|
|
|
+ if (videoCnt > 0 && unitCode == 0) {
|
|
return addProgramByGroupChannel(strategy, appName, videoType, token, newCampaignId, appId, videoCnt, uuid);
|
|
return addProgramByGroupChannel(strategy, appName, videoType, token, newCampaignId, appId, videoCnt, uuid);
|
|
}
|
|
}
|
|
return videoCnt;
|
|
return videoCnt;
|