Explorar o código

项目自动化调试,优化逻辑

zhaoxian %!s(int64=3) %!d(string=hai) anos
pai
achega
25f1366168

+ 12 - 16
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouProjectCreateCreativeServiceImpl.java

@@ -148,21 +148,17 @@ public class AiKuaishouProjectCreateCreativeServiceImpl implements IAiKuaishouPr
                     programUnitCnt = 300 / imageCnt;
                 }
             }
-            //素材来源 1-上新素材,2-高质量素材,3-遗漏素材,4-历史打捞
-            List<Integer> sourceMaterial = JSONObject.parseObject(strategy.getSourceMaterial(), List.class);
             //创意制作方式,0-不限,4-自定义,7-程序化创意
-            for (Integer createType : sourceMaterial) {
-                if (strategy.getUnitType() == 4) {
-                    this.autoCreateCreative(strategy, createType, customUnitCnt, 1);
-                } else if (strategy.getUnitType() == 7) {
-                    this.autoCreateProgramCreative(strategy, createType, programUnitCnt, 1);
-                } else {
-                    this.autoCreateCreative(strategy, createType, customUnitCnt, 1);
-                    this.autoCreateProgramCreative(strategy, createType, programUnitCnt, 1);
-                }
+            if (strategy.getUnitType() == 4) {
+                this.autoCreateCreative(strategy, 1, customUnitCnt, 1);
+            } else if (strategy.getUnitType() == 7) {
+                this.autoCreateProgramCreative(strategy, 1, programUnitCnt, 1);
+            } else {
+                this.autoCreateCreative(strategy, 1, customUnitCnt, 1);
+                this.autoCreateProgramCreative(strategy, 1, programUnitCnt, 1);
             }
         } catch (Exception e) {
-            log.error("项目自动化创建异常", e);
+            log.error("检查匹配异常", e);
         }
     }
 
@@ -238,7 +234,7 @@ public class AiKuaishouProjectCreateCreativeServiceImpl implements IAiKuaishouPr
      * 程序化上新
      */
     @Override
-    public void projectProgramAutomaticCreates(KuaishouProjectStrategy strategy,Integer type) {
+    public void projectProgramAutomaticCreates(KuaishouProjectStrategy strategy, Integer type) {
         try {
             Integer programUnitCnt = strategy.getCustomUnitCnt();
             if (Check.isNull(programUnitCnt)) {
@@ -252,7 +248,7 @@ public class AiKuaishouProjectCreateCreativeServiceImpl implements IAiKuaishouPr
             log.info("{}可创建组总数:{}", strategy.getAccountId(), programUnitCnt);
             this.autoCreateCreative(strategy, type, programUnitCnt, 2);
         } catch (Exception e) {
-            log.error("项目自动创建自定义上新异常", e);
+            log.error("项目自动创建程序化上新异常", e);
         }
     }
 
@@ -292,7 +288,7 @@ public class AiKuaishouProjectCreateCreativeServiceImpl implements IAiKuaishouPr
                 List<KuaiShouVideoGet> newVideos = getVideosByParams(strategy, startTime, endTime, null, createType, Long.valueOf(videoCnt));
                 if (null == newVideos || newVideos.isEmpty()) {
                     log.info("账户:{},{} 到 {} 未获取到相应素材({})", accountId, startTime, endTime, replaceString);
-                    insertAccountOperationRecord(strategy, "账户在" + startTime + "~" + endTime + "时间段内未获取到相应素材(" + replaceString + ")", operationType, 0);
+//                    insertAccountOperationRecord(strategy, "账户在" + startTime + "~" + endTime + "时间段内未获取到相应素材(" + replaceString + ")", operationType, 0);
                     return videoCnt;
                 }
                 Long appId = null;
@@ -433,7 +429,7 @@ public class AiKuaishouProjectCreateCreativeServiceImpl implements IAiKuaishouPr
                 //单一应用
                 List<KuaiShouVideoGet> allVideos = getVideosByParams(strategy, startTime, endTime, null, createType, Long.valueOf(videoCnt));
                 if (null == allVideos) {
-                    insertAccountOperationRecord(strategy, "账户在" + startTime + "~" + endTime + "时间段内未获取到相应素材(" + replaceString + ")", operationType, 0);
+//                    insertAccountOperationRecord(strategy, "账户在" + startTime + "~" + endTime + "时间段内未获取到相应素材(" + replaceString + ")", operationType, 0);
                     return;
                 }
                 Long appId = null;