Browse Source

Merge branch 'wyp/1216-articlePromotion' of Server/long-article-recommend into master

wangyunpeng 7 tháng trước cách đây
mục cha
commit
f60a9e04a8

+ 13 - 11
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/ArticlePromotionService.java

@@ -146,16 +146,17 @@ public class ArticlePromotionService {
                 if (TitleSimilarCheckUtil.isDuplicateContent(title, visitedTitleList, TitleSimilarCheckUtil.ARTICLE_PROMOTION_THRESHOLD)) {
                     continue;
                 }
-                filterUrlList.add(url);
-                // 调用爬虫 detail 接口并保存数据
-                WxContentDetailResponse detail = getArticleDetail(url);
-                if (detail != null && StringUtils.hasText(detail.getChannelContentId())) {
-                    saveArticlePoolPromotionSource(detail.getChannelContentId(), wxSn, title, level);
+                // 能匹配到aigc发布记录则使用id抓取  否则使用url抓取
+                String publishContentId = articleService.getPublishContentByWxSn(wxSn);
+                if (StringUtils.hasText(publishContentId)) {
+                    publishContentIds.add(publishContentId);
+                    saveArticlePoolPromotionSource(Md5Util.encoderByMd5(publishContentId), wxSn, title, level);
                 } else {
-                    String publishContentId = articleService.getPublishContentByWxSn(wxSn);
-                    if (StringUtils.hasText(publishContentId)) {
-                        publishContentIds.add(publishContentId);
-                        saveArticlePoolPromotionSource(Md5Util.encoderByMd5(publishContentId), wxSn, title, level);
+                    filterUrlList.add(url);
+                    // 调用爬虫 detail 接口并保存数据
+                    WxContentDetailResponse detail = getArticleDetail(url);
+                    if (detail != null && StringUtils.hasText(detail.getChannelContentId())) {
+                        saveArticlePoolPromotionSource(detail.getChannelContentId(), wxSn, title, level);
                     }
                 }
             }
@@ -187,11 +188,12 @@ public class ArticlePromotionService {
     }
 
     private void sendFeishuJobFinishMessage(String accountNickName, Integer urlListSize, Integer contentListSize) {
+        log.info("articlePromotion finish: 晋级任务:{}, id晋级数量:{}, url晋级数量:{}", accountNickName, contentListSize, urlListSize);
         FeishuMessageSender.sendWebHookMessage(FeishuRobotIdEnum.DAILY.getRobotId(),
                 "【文章晋级job完成】\n" +
                         "晋级任务:" + accountNickName + "\n" +
-                        "url晋级数量:" + urlListSize + "\n" +
-                        "id晋级数量:" + contentListSize + "\n");
+                        "id晋级数量:" + contentListSize + "\n" +
+                        "url晋级数量:" + urlListSize + "\n");
     }
 
     private List<ProduceContentListItemVO> getProduceContentList(String accountNickName, String pos, String way) {