|
@@ -153,6 +153,13 @@ public class ArticleService {
|
|
|
if (Objects.nonNull(publishContent)) {
|
|
|
publishContentId = publishContent.getId();
|
|
|
channelContentId = publishContent.getCrawlerChannelContentId();
|
|
|
+ } else {
|
|
|
+ publishContentList = aigcBaseMapper.getLateNearestPublishContent(publishAccount.getId(), publishTimestamp);
|
|
|
+ publishContent = findPublishContent(publishContentList, article.getTitle(), publishTimestamp);
|
|
|
+ if (Objects.nonNull(publishContent)) {
|
|
|
+ publishContentId = publishContent.getId();
|
|
|
+ channelContentId = publishContent.getCrawlerChannelContentId();
|
|
|
+ }
|
|
|
}
|
|
|
log.info("syncAigcIdByWxSn titleMatch finish");
|
|
|
if (Objects.isNull(channelContentId)) {
|
|
@@ -172,6 +179,9 @@ public class ArticleService {
|
|
|
private PublishContent findPublishContent(List<PublishContent> publishContentList,
|
|
|
String title,
|
|
|
Long publishTimestamp) {
|
|
|
+ if (CollectionUtils.isEmpty(publishContentList)) {
|
|
|
+ return null;
|
|
|
+ }
|
|
|
Map<String, PublishContent> publishContentMap = publishContentList.stream().collect(
|
|
|
Collectors.toMap(PublishContent::getId, publishContent -> publishContent));
|
|
|
List<String> publishContentIds = publishContentList.stream().map(PublishContent::getId).collect(Collectors.toList());
|
|
@@ -262,6 +272,17 @@ public class ArticleService {
|
|
|
result.setRootPublishContentId(publishContent.getId());
|
|
|
result.setRootProduceContentId(publishContent.getSourceId());
|
|
|
channelContentId = publishContent.getCrawlerChannelContentId();
|
|
|
+ } else {
|
|
|
+ publishContentList = aigcBaseMapper.getLateNearestPublishContent(publishAccount.getId(), publishTimestamp);
|
|
|
+ publishContent = findPublishContent(publishContentList, title, publishTimestamp);
|
|
|
+ if (Objects.nonNull(publishContent)) {
|
|
|
+ if (!StringUtils.hasText(sourcePublishContentId)) {
|
|
|
+ result.setSourcePublishContentId(publishContent.getId());
|
|
|
+ }
|
|
|
+ result.setRootPublishContentId(publishContent.getId());
|
|
|
+ result.setRootProduceContentId(publishContent.getSourceId());
|
|
|
+ channelContentId = publishContent.getCrawlerChannelContentId();
|
|
|
+ }
|
|
|
}
|
|
|
// channelContentId未被修改,说明未找到
|
|
|
if (channelContentId.equals(crawlerContent.getChannelContentId())) {
|
|
@@ -307,9 +328,13 @@ public class ArticleService {
|
|
|
List<PublishContent> publishContentList = aigcBaseMapper.getNearestPublishContent(publishAccount.getId(), publishTimestamp, 100);
|
|
|
PublishContent publishContent = findPublishContent(publishContentList, task.getTitle(), publishTimestamp);
|
|
|
if (Objects.isNull(publishContent)) {
|
|
|
- task.setDeleted(StatusEnum.ONE.getCode());
|
|
|
- articlePoolPromotionSourceRepository.save(task);
|
|
|
- continue;
|
|
|
+ publishContentList = aigcBaseMapper.getLateNearestPublishContent(publishAccount.getId(), publishTimestamp);
|
|
|
+ publishContent = findPublishContent(publishContentList, task.getTitle(), publishTimestamp);
|
|
|
+ if (Objects.isNull(publishContent)) {
|
|
|
+ task.setDeleted(StatusEnum.ONE.getCode());
|
|
|
+ articlePoolPromotionSourceRepository.save(task);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
}
|
|
|
RootPublishContentVO source = getRootPublishContent(publishContent.getCrawlerChannelContentId(), null, publishContent.getId(), publishContent.getSourceId(), 0);
|
|
|
// 更新
|
|
@@ -424,7 +449,7 @@ public class ArticleService {
|
|
|
List<ProducePlanExeRecord> produceContentList = aigcBaseMapper.getAllByProducePlanId(producePlanIds);
|
|
|
List<String> channelContentIds = produceContentList.stream().map(ProducePlanExeRecord::getChannelContentId).distinct().collect(Collectors.toList());
|
|
|
List<ArticleCategory> articleCategoryList = articleCategoryRepository.getAllByChannelContentIdIn(channelContentIds);
|
|
|
- List<String> articleCategoryIds = articleCategoryList.stream().map(ArticleCategory::getChannelContentId).collect(Collectors.toList());
|
|
|
+ List<String> articleCategoryIds = articleCategoryList.stream().map(ArticleCategory::getChannelContentId).collect(Collectors.toList());
|
|
|
List<ProduceContentCrawlerVO> list = produceContentList.stream().filter(o -> !articleCategoryIds.contains(o.getChannelContentId())).map(o -> {
|
|
|
ProduceContentCrawlerVO item = new ProduceContentCrawlerVO();
|
|
|
item.setChannelContentId(o.getChannelContentId());
|
|
@@ -507,6 +532,12 @@ public class ArticleService {
|
|
|
PublishContent publishContent = findPublishContent(publishContentList, article.getTitle(), publishTimestamp);
|
|
|
if (Objects.nonNull(publishContent)) {
|
|
|
return publishContent.getId();
|
|
|
+ } else {
|
|
|
+ publishContentList = aigcBaseMapper.getLateNearestPublishContent(publishAccount.getId(), publishTimestamp);
|
|
|
+ publishContent = findPublishContent(publishContentList, article.getTitle(), publishTimestamp);
|
|
|
+ if (Objects.nonNull(publishContent)) {
|
|
|
+ return publishContent.getId();
|
|
|
+ }
|
|
|
}
|
|
|
return null;
|
|
|
}
|