Ver Fonte

渠道号——修改

zhaoxian há 3 anos atrás
pai
commit
6f866472fa

+ 15 - 1
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouAccountAutoDoServiceImpl.java

@@ -977,6 +977,7 @@ public class AiKuaishouAccountAutoDoServiceImpl implements IAiKuaishouAccountAut
         Long accountId = strategy.getAccountId();
         KuaishouChannel channel = null;
         /*获取组级渠道号*/
+         /*
         channel = getChannel("group", accountId, appName);
         if (Check.isNull(channel)) {
             log.error("****** 获取组级渠道号失败");
@@ -987,6 +988,7 @@ public class AiKuaishouAccountAutoDoServiceImpl implements IAiKuaishouAccountAut
         if (!Check.isNull(items) && !items.isEmpty()) {
             strategy.setMaterialKeyword(items.get(0).getKeyword());
         }
+        */
 
         //待建素材集 redis key值
         String date = DateUtils.formatDate(new Date());
@@ -1009,6 +1011,11 @@ public class AiKuaishouAccountAutoDoServiceImpl implements IAiKuaishouAccountAut
         Integer unitCode = null;
         String unitMessage = null;
         for (AiKuaishouAccountAutoVideo videoItem : targetsAndVideos) {
+            channel = getChannel("group", accountId, appName);
+            if (Check.isNull(channel)) {
+                log.error("****** 获取组级渠道号失败");
+                return videoCnt;
+            }
             boolean unitOverrun = getUnitOverrun(accountId);
             if (unitOverrun) {
                 log.error("****** 账户({})创建广告组超限", accountId);
@@ -1082,7 +1089,7 @@ public class AiKuaishouAccountAutoDoServiceImpl implements IAiKuaishouAccountAut
     private Integer addProgramByGroupChannel(AiKuaishouAccountAutoStrategy strategy, String appName, Integer videoType, CtopOauthToken token, Long newCampaignId, Long appId, Integer videoCnt, String uuid) throws Exception {
         Long accountId = strategy.getAccountId();
         /*获取组级渠道号*/
-        KuaishouChannel channel = getChannel("group", accountId, appName);
+        /*KuaishouChannel channel = getChannel("group", accountId, appName);
         if (Check.isNull(channel)) {
             log.error("****** 获取组级渠道号失败");
             return videoCnt;
@@ -1092,6 +1099,7 @@ public class AiKuaishouAccountAutoDoServiceImpl implements IAiKuaishouAccountAut
         if (!Check.isNull(items) && !items.isEmpty()) {
             strategy.setMaterialKeyword(items.get(0).getKeyword());
         }
+        */
         String date = DateUtils.formatDate(new Date());
 
         //程序化创建创意超限标识,redis key值
@@ -1142,6 +1150,12 @@ public class AiKuaishouAccountAutoDoServiceImpl implements IAiKuaishouAccountAut
                 removeProRedisVideos(successVideoList, videoKey);
                 return 0;
             }
+            /*获取组级渠道号*/
+            KuaishouChannel channel = getChannel("group", accountId, appName);
+            if (Check.isNull(channel)) {
+                log.error("****** 获取组级渠道号失败");
+                return videoCnt;
+            }
 
             Object redisObj = redisUtil.get(programKey);
             if (!Check.isNull(redisObj)) {