|
@@ -118,6 +118,8 @@ public class ArticlePromotionService {
|
|
|
aigcCrawlerPlanSaveService.createArticleUrlPlan(planName, urlList, tag, CrawlerModeEnum.ContentIDs.getVal());
|
|
|
return;
|
|
|
}
|
|
|
+ List<String> publishContentIds = new ArrayList<>();
|
|
|
+ List<String> filterUrlList = new ArrayList<>();
|
|
|
try {
|
|
|
String level = pos.equals("【1】") ? contentPoolType.get(0) : contentPoolType.get(1);
|
|
|
String produceId = produceConfig.get(accountNickName).get(pos).get(way).trim();
|
|
@@ -129,8 +131,6 @@ public class ArticlePromotionService {
|
|
|
Set<String> visitedUrlIdList = contentList.stream().map(content -> getUrlId(content.getReferContentLink()))
|
|
|
.collect(Collectors.toSet());
|
|
|
// 筛选URL和标题
|
|
|
- List<String> publishContentIds = new ArrayList<>();
|
|
|
- List<String> filterUrlList = new ArrayList<>();
|
|
|
for (DatastatSortStrategy item : list) {
|
|
|
String url = item.getLink();
|
|
|
String urlId = getUrlId(item.getLink());
|
|
@@ -155,32 +155,42 @@ public class ArticlePromotionService {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- if (filterUrlList.isEmpty()) {
|
|
|
- log.info("url_list empty: " + accountNickName + ", " + pos + ", " + way);
|
|
|
- return;
|
|
|
- }
|
|
|
- String planName = String.format("%d_%s_%s_%s【%s】_%s", filterUrlList.size(), today, accountNickName, pos, way, today);
|
|
|
- log.info("url_len: " + list.size() + ", " + filterUrlList.size());
|
|
|
- IdNameVO<String> planInfo = aigcCrawlerPlanSaveService.createArticleUrlPlan(planName, filterUrlList, tag, CrawlerModeEnum.ContentIDs.getVal());
|
|
|
- if (StringUtils.hasText(produceId)) {
|
|
|
- articleAddDependPlan(produceId, planInfo.getId(), planInfo.getName());
|
|
|
+ if (CollectionUtils.isNotEmpty(filterUrlList)) {
|
|
|
+ String planName = String.format("%d_%s_%s_%s【%s】_%s", filterUrlList.size(), today, accountNickName, pos, way, today);
|
|
|
+ log.info("url_len: " + list.size() + ", " + filterUrlList.size());
|
|
|
+ IdNameVO<String> planInfo = aigcCrawlerPlanSaveService.createArticleUrlPlan(planName, filterUrlList, tag, CrawlerModeEnum.ContentIDs.getVal());
|
|
|
+ if (StringUtils.hasText(produceId)) {
|
|
|
+ articleAddDependPlan(produceId, planInfo.getId(), planInfo.getName());
|
|
|
+ }
|
|
|
+ log.info("{}, {}, produce plan not exist: {}, {}, {}", planInfo.getName(), planInfo.getId(), accountNickName, pos, way);
|
|
|
}
|
|
|
- log.info("{}, {}, produce plan not exist: {}, {}, {}", planInfo.getName(), planInfo.getId(), accountNickName, pos, way);
|
|
|
if (CollectionUtils.isNotEmpty(publishContentIds)) {
|
|
|
- planName = String.format("%d_%s_%s_%s【%s】_%s", publishContentIds.size(), today, accountNickName, pos, way, today);
|
|
|
- planInfo = aigcCrawlerPlanSaveService.createArticleUrlPlan(planName, publishContentIds, tag, CrawlerModeEnum.PublishContentIds.getVal());
|
|
|
+ String planName = String.format("%d_%s_%s_%s【%s】_%s", publishContentIds.size(), today, accountNickName, pos, way, today);
|
|
|
+ IdNameVO<String> planInfo = aigcCrawlerPlanSaveService.createArticleUrlPlan(planName, publishContentIds, tag, CrawlerModeEnum.PublishContentIds.getVal());
|
|
|
if (StringUtils.hasText(produceId)) {
|
|
|
articleAddDependPlan(produceId, planInfo.getId(), planInfo.getName());
|
|
|
}
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
log.error("articlePromotion error: ", e);
|
|
|
- FeishuMessageSender.sendWebHookMessage(FeishuRobotIdEnum.JOB.getRobotId(),
|
|
|
- "文章晋升ERROR:\n" +
|
|
|
- "articlePromotion error: " + e.getMessage());
|
|
|
+ FeishuMessageSender.sendWebHookMessage(FeishuRobotIdEnum.DAILY.getRobotId(),
|
|
|
+ "【文章晋升ERROR】\n" +
|
|
|
+ "晋级任务:" + accountNickName + "\n" +
|
|
|
+ "articlePromotion error: " + e.getMessage() + "\n"
|
|
|
+ + "<at user_id=\"all\">所有人</at> ");
|
|
|
+ } finally {
|
|
|
+ sendFeishuJobFinishMessage(accountNickName, filterUrlList.size(), publishContentIds.size());
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ private void sendFeishuJobFinishMessage(String accountNickName, Integer urlListSize, Integer contentListSize) {
|
|
|
+ FeishuMessageSender.sendWebHookMessage(FeishuRobotIdEnum.DAILY.getRobotId(),
|
|
|
+ "【文章晋级job完成】\n" +
|
|
|
+ "晋级任务:" + accountNickName + "\n" +
|
|
|
+ "url晋级数量:" + urlListSize + "\n" +
|
|
|
+ "id晋级数量:" + contentListSize + "\n");
|
|
|
+ }
|
|
|
+
|
|
|
private List<ProduceContentListItemVO> getProduceContentList(String accountNickName, String pos, String way) {
|
|
|
List<String> planIdList = getProducePlanIdList(accountNickName, pos, way);
|
|
|
CommonListDataVO<ProduceContentListItemVO> contentData = getProduceContentListByPlanIdList(planIdList);
|