wangyunpeng 10 часов назад
Родитель
Сommit
79bdcb6a9f

+ 5 - 2
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/recall/RecallService.java

@@ -460,8 +460,11 @@ public class RecallService implements ApplicationContextAware {
         // 获取历史已发布文章所属头条内容
         Set<String> ghIds = hisArticleList.stream().map(Article::getGhId).collect(Collectors.toSet());
         Set<String> appMsgIds = hisArticleList.stream().map(Article::getAppMsgId).collect(Collectors.toSet());
-        List<Article> firstIndexHisArticleList = articleMapper.getByGhIdInAndAppMsgIdInAndItemIndexAndTypeEqualsAndStatusEquals(
-                ghIds, appMsgIds, 1, type, 1);
+        List<Article> firstIndexHisArticleList = new ArrayList<>();
+        if (CollectionUtils.isEmpty(ghIds) || CollectionUtils.isEmpty(appMsgIds)) {
+            firstIndexHisArticleList = articleMapper.getByGhIdInAndAppMsgIdInAndItemIndexAndTypeEqualsAndStatusEquals(
+                    ghIds, appMsgIds, 1, type, 1);
+        }
         Map<String, Map<String, Article>> firstIndexHisArticleMap = firstIndexHisArticleList.stream()
                 .collect(Collectors.groupingBy(Article::getGhId, Collectors.toMap(Article::getAppMsgId, o -> o, (a, b) -> a)));
         // 获取发布账号 位置历史均值