wangyunpeng преди 4 седмици
родител
ревизия
caa813777f

+ 2 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/repository/longArticle/AccountRepository.java

@@ -12,4 +12,6 @@ public interface AccountRepository extends JpaRepository<Account, String> {
     List<Account> getByStatus(Integer status);
 
     Account getByGhId(String ghId);
+
+    Account getById(String accountId);
 }

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

@@ -497,6 +497,35 @@ public class ArticlePromotionService {
         }
     }
 
+    private void articleAddDependPlan(String produceId, ProducePlanDetailVO detail, String inputSourceValue,
+                                      String inputSourceLabel, Integer inputSourceType) {
+        try {
+            // 获取生产计划的详细信息
+            if (detail == null) {
+                FeishuMessageSender.sendWebHookMessage(FeishuRobotIdEnum.JOB.getRobotId(),
+                        "文章晋升ERROR:\n" +
+                                "articleAddDependPlan getProducePlan error: planId:" + produceId);
+                return;
+            }
+            // 获取依赖计划 ID 列表
+            List<ProducePlanInputSourceParam> inputSources = detail.getInputSourceGroups().get(0).getInputSources();
+            List<String> dependValues = new ArrayList<>();
+            for (ProducePlanInputSourceParam inputSource : inputSources) {
+                dependValues.add(inputSource.getInputSourceValue());
+            }
+            // 如果计划 ID 已存在,直接返回
+            if (dependValues.contains(inputSourceValue)) {
+                log.info("depend_value exist: {}", inputSourceValue);
+                return;
+            }
+            aigcProducePlanSaveService.save(inputSourceLabel, inputSourceValue, detail, inputSourceType);
+        } catch (Exception e) {
+            FeishuMessageSender.sendWebHookMessage(FeishuRobotIdEnum.JOB.getRobotId(),
+                    "文章晋升ERROR:\n" +
+                            "articleAddDependPlan error: " + e.getMessage());
+        }
+    }
+
     public void articleVideoPoolPromotion(Integer viewCountFilter, Double viewCountRateFilter,
                                           List<Integer> positionFilter, Integer poolLevel) {
         String dateStrFilter = DateUtils.getBeforeDaysDateStr("yyyyMMdd", 10);
@@ -610,6 +639,7 @@ public class ArticlePromotionService {
         List<CrawlerContent> crawlerContentList = aigcBaseMapper.getCrawlerContentByChannelContentIdIn(channelContentIds);
         Map<String, Long> crawlerContentMap = crawlerContentList.stream().collect(Collectors.toMap(
                 CrawlerContent::getChannelContentId, CrawlerContent::getId));
+        ProducePlanDetailVO detail = aigcProducePlanDetailService.articleGetProducePlanDetail(topProducePlanId);
         for (PublishContentDTO item : publishContentList) {
             if (TitleSimilarCheckUtil.isDuplicateContent(item.getTitle(), existsTitles, TitleSimilarCheckUtil.ARTICLE_PROMOTION_THRESHOLD)) {
                 continue;
@@ -620,7 +650,7 @@ public class ArticlePromotionService {
             if (Objects.isNull(crawlerContentId)) {
                 continue;
             }
-            articleAddDependPlan(topProducePlanId, String.valueOf(crawlerContentId), inputSourceLabel,
+            articleAddDependPlan(topProducePlanId, detail, String.valueOf(crawlerContentId), inputSourceLabel,
                     ProducePlanInputSourceTypeEnum.contentID.getVal());
         }
         return ReturnT.SUCCESS;

+ 1 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/RecommendService.java

@@ -250,7 +250,7 @@ public class RecommendService {
         return response;
     }
 
-    private void updateWaitingContentFilter(List<ArticleSortResponseDataItem> filterContentList) {
+    public void updateWaitingContentFilter(List<ArticleSortResponseDataItem> filterContentList) {
         if (CollectionUtils.isEmpty(filterContentList)) {
             return;
         }