Przeglądaj źródła

项目自动投放策略,素材筛选添加可用时间限制

zhaoxian 3 lat temu
rodzic
commit
b61530bf2c

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

@@ -254,6 +254,8 @@ public class AiKuaishouProjectCreateCreativeServiceImpl implements IAiKuaishouPr
 
     /**
      * 创建自定义创意
+
+
      *
      * @param strategy   账户配置信息
      * @param createType 创意创建类型 1:素材上新 2:历史高质量 3:历史遗漏素材 4:历史打捞
@@ -293,7 +295,7 @@ public class AiKuaishouProjectCreateCreativeServiceImpl implements IAiKuaishouPr
                 List<KuaiShouVideoGet> newVideos = new ArrayList<>();
                 for (KuaiShouVideoGet newVideo : newVideoList) {
                     if (!Check.isNull(newVideo.getPutEndTime()) && !Check.isNull(newVideo.getPutStartTime())) {
-                        boolean b = DateUtils.checkTimeLimit(new Date(), DateUtils.parseDate(newVideo.getPutStartTime(), "yyyy-MM-dd"), DateUtils.parseDate(newVideo.getPutEndTime(), "yyyy-MM-dd"));
+                        boolean b = DateUtils.checkTimeLimit(new Date(), DateUtils.parseDate(newVideo.getPutStartTime()+" 00:00:01", "yyyy-MM-dd HH:mm:ss"), DateUtils.parseDate(newVideo.getPutEndTime()+" 23:59:59", "yyyy-MM-dd HH:mm:ss"));
                         if (b) {
                             newVideos.add(newVideo);
                         }
@@ -460,7 +462,7 @@ public class AiKuaishouProjectCreateCreativeServiceImpl implements IAiKuaishouPr
                 List<KuaiShouVideoGet> allVideos = new ArrayList<>();
                 for (KuaiShouVideoGet newVideo : allVideoList) {
                     if (!Check.isNull(newVideo.getPutEndTime()) && !Check.isNull(newVideo.getPutStartTime())) {
-                        boolean b = DateUtils.checkTimeLimit(new Date(), DateUtils.parseDate(newVideo.getPutStartTime(), "yyyy-MM-dd"), DateUtils.parseDate(newVideo.getPutEndTime(), "yyyy-MM-dd"));
+                        boolean b = DateUtils.checkTimeLimit(new Date(), DateUtils.parseDate(newVideo.getPutStartTime()+" 00:00:01", "yyyy-MM-dd HH:mm:ss"), DateUtils.parseDate(newVideo.getPutEndTime()+" 23:59:59", "yyyy-MM-dd HH:mm:ss"));
                         if (b) {
                             allVideos.add(newVideo);
                         }
@@ -1225,11 +1227,19 @@ public class AiKuaishouProjectCreateCreativeServiceImpl implements IAiKuaishouPr
     }
 
     private boolean checkList(String videoTarget, String target) {
+        if (Check.isNull(videoTarget)) {
+            //素材是不限,直接返回true。
+            return true;
+        }
         List videoList = JSONObject.parseObject(videoTarget, List.class);
         if (Check.isNull(videoList)) {
             //素材是不限,直接返回true。
             return true;
         }
+        if (Check.isNull(target)) {
+            //计划定向是不限,素材非不限,直接返回false。
+            return false;
+        }
         List list = JSONObject.parseObject(target, List.class);
         if (Check.isNull(list)) {
             //计划定向是不限,素材非不限,直接返回false。