浏览代码

Merge branch 'test'

zhaoxian 3 年之前
父节点
当前提交
e70e53402a

+ 17 - 8
jeecg-boot-module-system/src/main/java/cn/com/ctop/kuaishou/modules/ai/service/impl/AiKuaishouAccountAutoVideoServiceImpl.java

@@ -43,22 +43,22 @@ public class AiKuaishouAccountAutoVideoServiceImpl extends ServiceImpl<AiKuaisho
     private ICtopOauthTokenService tokenService;
 
     @Override
-    public List<AiKuaishouAccountAutoVideo> getUpNewVideos(Long accountId, Integer channelType,  List<String>  keyword, Integer videoCnt, String statDate, String createType) {
+    public List<AiKuaishouAccountAutoVideo> getUpNewVideos(Long accountId, Integer channelType, List<String> keyword, Integer videoCnt, String statDate, String createType) {
         return autoVideoMapper.getUpNewVideos(accountId, channelType, keyword, videoCnt, statDate, createType);
     }
 
     @Override
-    public List<AiKuaishouAccountAutoVideo> getHistoryTopVideos(Long accountId, Integer channelType,  List<String>  keyword, Integer videoCnt, String statDate, String createType) {
+    public List<AiKuaishouAccountAutoVideo> getHistoryTopVideos(Long accountId, Integer channelType, List<String> keyword, Integer videoCnt, String statDate, String createType) {
         return autoVideoMapper.getHistoryTopVideos(accountId, channelType, keyword, videoCnt, createType, statDate);
     }
 
     @Override
-    public List<AiKuaishouAccountAutoVideo> getMissVideoByParams(Long accountId, Integer channelType,  List<String>  keyword, Integer videoCnt, String statDate) {
+    public List<AiKuaishouAccountAutoVideo> getMissVideoByParams(Long accountId, Integer channelType, List<String> keyword, Integer videoCnt, String statDate) {
         return autoVideoMapper.getZeroVideoByParams(accountId, channelType, keyword, videoCnt, statDate);
     }
 
     @Override
-    public List<AiKuaishouAccountAutoVideo> getHistoryCatchVideos(Long accountId, Integer channelType,  List<String>  keyword, Integer videoCnt, String statDate) {
+    public List<AiKuaishouAccountAutoVideo> getHistoryCatchVideos(Long accountId, Integer channelType, List<String> keyword, Integer videoCnt, String statDate) {
         return autoVideoMapper.getHistoryCatchVideos(accountId, channelType, keyword, videoCnt, statDate);
     }
 
@@ -107,18 +107,27 @@ public class AiKuaishouAccountAutoVideoServiceImpl extends ServiceImpl<AiKuaisho
                 log.error("获取快手视频列表数据异常:{},accountId:{}", message, token.getAccountId());
                 return;
             }
-            JSONArray details = resultJson.getJSONObject("data").getJSONArray("details");
-            if (null == details || details.size() <= 0) {
+            JSONArray videoList = resultJson.getJSONObject("data").getJSONArray("details");
+            if (null == videoList || videoList.size() <= 0) {
                 log.info("快手视频列表信息为空=》accountId:{}", token.getAccountId());
                 return;
             }
             Boolean doGet = true;
-            if (details.size() < pageSize) {
+            if (videoList.size() < pageSize) {
                 doGet = false;
             }
+            JSONArray details = new JSONArray();
+            for (int i = 0; i < videoList.size(); i++) {
+                JSONObject video = videoList.getJSONObject(i);
+                if (video != null && video.getInteger("new_status") == 1) {
+                    details.add(video);
+                }
+            }
+            if (Check.isNull(details) || details.isEmpty()) {
+                return;
+            }
 
             List<AiKuaishouAccountAutoVideo> videoGetList = new ArrayList<>();
-
             Long accountId = token.getAccountId();
             List<String> photoIds = autoVideoMapper.selectBatchByPhotoIds(details, date, accountId);
             for (int i = 0; i < details.size(); i++) {