Explorar o código

历史高质量素材可选择是否搭建

yumeng %!s(int64=4) %!d(string=hai) anos
pai
achega
8b68eece39

+ 7 - 3
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/controller/AiKuaishouCreateCreativeController.java

@@ -155,9 +155,13 @@ public class AiKuaishouCreateCreativeController {
             if (Check.isNull(videoCnt)) {
                 throw new Exception("视频数量不能为空");
             }
-            kuaishouProgramTopCreativeAutoService.submit(() -> {
-                createCreativeService.autoCreateProgramCreative(strategy, 2, videoCnt);
-            });
+            if (strategy.getHistoryTop() == 0) {
+                kuaishouProgramTopCreativeAutoService.submit(() -> {
+                    createCreativeService.autoCreateProgramCreative(strategy, 2, videoCnt);
+                });
+            } else {
+                log.info("历史高质量暂停搭建,accountId:{}", strategy.getAccountId());
+            }
             returnJson.put("code", 0);
             returnJson.put("message", "异步创建中");
         } catch (Exception e) {

+ 1 - 0
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/entity/AiKuaishouAdvertiserStrategy.java

@@ -375,6 +375,7 @@ public class AiKuaishouAdvertiserStrategy {
     private Long customUnitCnt;
     private Long programUnitCnt;
     private String materialKeyword;
+    private Integer historyTop;
 
     @TableField(exist = false)
     private String authName;

+ 5 - 6
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouCreateCreativeServiceImpl.java

@@ -380,7 +380,6 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
 
     @Override
     public void customCreativeSupplement(AiKuaishouAdvertiserStrategy strategy, Integer hour) throws ParseException {
-
         Long customUnitCnt = strategy.getCustomUnitCnt();
         if (Check.isNull(customUnitCnt)) {
             Integer imageCnt = strategy.getImageCnt();
@@ -403,9 +402,11 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
             remindCnt = this.autoCreateCreative(strategy, 3, remindCnt);
         }
         if (remindCnt >= 1) {
-            log.info("{}组创建不足,剩余需要创建个数{},使用高质量素材创建", strategy.getAccountId(), remindCnt);
-            //高质量素材
-            remindCnt = this.autoCreateCreative(strategy, 2, remindCnt);
+            if (strategy.getHistoryTop() == 0) {
+                log.info("{}组创建不足,剩余需要创建个数{},使用高质量素材创建", strategy.getAccountId(), remindCnt);
+                //高质量素材
+                remindCnt = this.autoCreateCreative(strategy, 2, remindCnt);
+            }
         }
         if (remindCnt >= 1) {
             //历史打捞素材
@@ -1097,8 +1098,6 @@ public class AiKuaishouCreateCreativeServiceImpl implements IAiKuaishouCreateCre
     }
 
 
-
-
     private void createCreativeByImage(List<MaterialCutFrame> cutFrameList, CtopOauthToken token, JSONObject creativeParams,
                                        Long campaignId, Long unitId, KuaiShouVideoGet videoItem,
                                        int imageNumber, AiKuaishouAdvertiserStrategy strategy, String uuid, String appVersion) {