瀏覽代碼

Merge remote-tracking branch 'origin/master'

yumeng 3 年之前
父節點
當前提交
f378fbd21d

+ 5 - 2
module-job-kuaishou/src/main/java/cn/com/ctop/job/kuaishou/handler/KuaishouVideoRelateCreativesJob.java

@@ -40,6 +40,7 @@ public class KuaishouVideoRelateCreativesJob {
 
     /**
      * 视频库-更新视频关联创意数
+     *
      * @throws Exception
      */
     @XxlJob("kuaishouVideoRelateCreativesJob")
@@ -90,7 +91,7 @@ public class KuaishouVideoRelateCreativesJob {
             int count = 0;
             for (KuaiShouVideoGet video : KuaiShouVideoGets) {
                 count++;
-                if (count < 20) {
+                if (count < 19) {
                     photoIds.add(video.getPhotoId());
                     statdateMap.put(video.getPhotoId(), video);
                 } else {
@@ -101,7 +102,9 @@ public class KuaishouVideoRelateCreativesJob {
                     count = 0;
                 }
             }
-            dateList.add(photoIds);
+            if (photoIds.size() > 0) {
+                dateList.add(photoIds);
+            }
             kuaishouVideoRelateCreativesService.videoRelateCreatives(accountId, dateList, statdateMap);
         }
     }

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

@@ -101,6 +101,13 @@ public class KuaishouVideoDirectionalPackageController {
             if (!Check.isNull(requestJson.getJSONArray("keyword"))) {
                 directionalPackage.setKeyword(JSONObject.toJSONString(requestJson.getJSONArray("keyword")));
             }
+            if("0".equals(requestJson.getJSONObject("allForm").getString("behaviorInterest"))){
+                directionalPackage.setSceneType("[]");
+                directionalPackage.setTimeType(-1);
+                directionalPackage.setStrengthType(0);
+                directionalPackage.setLabel("[]");
+                directionalPackage.setInterestLabel("[]");
+            }
             kuaishouVideoDirectionalPackageService.saveOrUpdate(directionalPackage);
             String id = "";
             if (!Check.isNull(directionalPackage.getId())) {

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

@@ -254,8 +254,6 @@ public class AiKuaishouProjectCreateCreativeServiceImpl implements IAiKuaishouPr
 
     /**
      * 创建自定义创意
-
-
      *
      * @param strategy   账户配置信息
      * @param createType 创意创建类型 1:素材上新 2:历史高质量 3:历史遗漏素材 4:历史打捞
@@ -295,7 +293,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()+" 00:00:01", "yyyy-MM-dd HH:mm:ss"), DateUtils.parseDate(newVideo.getPutEndTime()+" 23:59:59", "yyyy-MM-dd HH:mm:ss"));
+                        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);
                         }
@@ -462,7 +460,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()+" 00:00:01", "yyyy-MM-dd HH:mm:ss"), DateUtils.parseDate(newVideo.getPutEndTime()+" 23:59:59", "yyyy-MM-dd HH:mm:ss"));
+                        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);
                         }
@@ -1200,13 +1198,10 @@ public class AiKuaishouProjectCreateCreativeServiceImpl implements IAiKuaishouPr
                     if (!checkList(dir.getInterestLabel(), target.getInterestLabel())) {
                         continue;
                     }
-                    if (!checkList(dir.getInterestLabel(), target.getInterestLabel())) {
-                        continue;
-                    }
                     if (!checkList(dir.getSceneType(), target.getSceneType())) {
                         continue;
                     }
-                    if (!Check.isNull(dir.getTimeType())) {
+                    if (!Check.isNull(dir.getTimeType()) && dir.getTimeType() != -1) {
                         if (dir.getTimeType() != target.getTimeType()) {
                             continue;
                         }

+ 1 - 1
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/mapper/xml/KuaiShouVideoGetMapper.xml

@@ -94,7 +94,7 @@
 
     <select id="selectPhotoIdsByAccountId" parameterType="java.lang.Long"
             resultType="cn.com.ctop.kuaishou.modules.batch.entity.KuaiShouVideoGet">
-        select *
+        select photo_id,stat_date,channel_type
         from ctop_kuaishou_video_get
         where account_id = #{accountId}
           and status = 0

+ 12 - 10
module-kuaishou/src/main/java/cn/com/ctop/kuaishou/modules/batch/service/impl/KuaishouVideoRelateCreativesServiceImpl.java

@@ -136,7 +136,7 @@ public class KuaishouVideoRelateCreativesServiceImpl extends ServiceImpl<Kuaisho
                             kuaishouVideoRelateCreativesMapper.insertBatch(videolist);
                         }
                     } else {
-                        log.info("频库-视频关联创意数查询失败,accountId:{},返回信息:{}", accountId, resultJson);
+                        log.info("频库-视频关联创意数查询失败,入参:{},返回结果:{}", params, resultJson);
                     }
                 }
             }
@@ -151,17 +151,17 @@ public class KuaishouVideoRelateCreativesServiceImpl extends ServiceImpl<Kuaisho
     }
 
     @Override
-    public List<KuaishouVideoRelateCreatives> listByParams(Long accountId,Integer matNum) {
+    public List<KuaishouVideoRelateCreatives> listByParams(Long accountId, Integer matNum) {
         QueryWrapper<KuaishouVideoRelateCreatives> queryWrapper = new QueryWrapper<>();
-        if(null!=accountId&&accountId!=0){
-            queryWrapper.eq("account_id",accountId);
+        if (null != accountId && accountId != 0) {
+            queryWrapper.eq("account_id", accountId);
         }
-        if(null == matNum||matNum == 0){
+        if (null == matNum || matNum == 0) {
             matNum = 10;
         }
-        queryWrapper.le("creative_count",30);
+        queryWrapper.le("creative_count", 30);
         queryWrapper.orderByDesc("stat_date");
-        queryWrapper.last("limit "+matNum);
+        queryWrapper.last("limit " + matNum);
         return this.list(queryWrapper);
     }
 
@@ -188,18 +188,20 @@ public class KuaishouVideoRelateCreativesServiceImpl extends ServiceImpl<Kuaisho
             int count = 0;
             for (KuaiShouVideoGet video : KuaiShouVideoGets) {
                 count++;
-                if (count < 20) {
+                if (count < 19) {
                     photoIds.add(video.getPhotoId());
                     statdateMap.put(video.getPhotoId(), video);
                 } else {
                     photoIds.add(video.getPhotoId());
-                    statdateMap.put(video.getPhotoId(),video);
+                    statdateMap.put(video.getPhotoId(), video);
                     dateList.add(photoIds);
                     photoIds = new JSONArray();
                     count = 0;
                 }
             }
-            dateList.add(photoIds);
+            if (photoIds.size() > 0) {
+                dateList.add(photoIds);
+            }
             this.videoRelateCreatives(accountId, dateList, statdateMap);
         }
     }