|
@@ -1208,33 +1208,7 @@ public class XxlJobService {
|
|
|
thread.submit(() -> {
|
|
|
boolean success = false;
|
|
|
try {
|
|
|
- String value = redisTemplate.opsForValue().get(redisKey);
|
|
|
- if (StringUtils.hasText(value)) {
|
|
|
- return;
|
|
|
- }
|
|
|
- Account account = accountRepository.getById(item.getAccountId());
|
|
|
- List<Content> contentList = longArticleBaseMapper.getPublishContentGzhWaiting(item.getPlanId(), item.getAccountId());
|
|
|
- // 预处理过滤
|
|
|
- if (Objects.isNull(account) || CollectionUtil.isEmpty(contentList)) {
|
|
|
- return;
|
|
|
- }
|
|
|
- FilterParam filterParam = buildFilterParam(item.getPlanId(), account, contentList);
|
|
|
- FilterResult filterResult = filterService.filter(filterParam, true);
|
|
|
- if (CollectionUtil.isNotEmpty(filterResult.getFilterContent())) {
|
|
|
- List<ArticleSortResponseDataItem> filterContentList = new ArrayList<>();
|
|
|
- for (Content filterContent : filterResult.getFilterContent()) {
|
|
|
- ArticleSortResponseDataItem saveItem = new ArticleSortResponseDataItem();
|
|
|
- BeanUtils.copyProperties(filterContent, saveItem);
|
|
|
- filterContentList.add(saveItem);
|
|
|
- }
|
|
|
- log.info("ContentPreFilterJob success index:{} planId: {} accountId: {} filterContent: {}",
|
|
|
- finalIndex, item.getPlanId(), item.getAccountId(), filterContentList.size());
|
|
|
- recommendService.updateWaitingContentFilter(filterContentList);
|
|
|
- // 调用aigc publish_content待发布内容状态废弃
|
|
|
- LongArticleSystemFilterSortParam param = new LongArticleSystemFilterSortParam();
|
|
|
- param.setFilterSortContentList(buildFilterSortContentList(filterResult));
|
|
|
- aigcPublishContentDiscardService.filterSortContents(param);
|
|
|
- }
|
|
|
+ preFilter(item, redisKey, finalIndex);
|
|
|
success = true;
|
|
|
} catch (Exception e) {
|
|
|
log.error("ContentPreFilterJob error index:{} planId: {} accountId: {}",
|
|
@@ -1256,6 +1230,36 @@ public class XxlJobService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ public void preFilter(PublishPlanAccountDTO item, String redisKey, Integer finalIndex) {
|
|
|
+ String value = redisTemplate.opsForValue().get(redisKey);
|
|
|
+ if (StringUtils.hasText(value)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ Account account = accountRepository.getById(item.getAccountId());
|
|
|
+ List<Content> contentList = longArticleBaseMapper.getPublishContentGzhWaiting(item.getPlanId(), item.getAccountId());
|
|
|
+ // 预处理过滤
|
|
|
+ if (Objects.isNull(account) || CollectionUtil.isEmpty(contentList)) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ FilterParam filterParam = buildFilterParam(item.getPlanId(), account, contentList);
|
|
|
+ FilterResult filterResult = filterService.filter(filterParam, true);
|
|
|
+ if (CollectionUtil.isNotEmpty(filterResult.getFilterContent())) {
|
|
|
+ List<ArticleSortResponseDataItem> filterContentList = new ArrayList<>();
|
|
|
+ for (Content filterContent : filterResult.getFilterContent()) {
|
|
|
+ ArticleSortResponseDataItem saveItem = new ArticleSortResponseDataItem();
|
|
|
+ BeanUtils.copyProperties(filterContent, saveItem);
|
|
|
+ filterContentList.add(saveItem);
|
|
|
+ }
|
|
|
+ log.info("ContentPreFilterJob success index:{} planId: {} accountId: {} filterContent: {}",
|
|
|
+ finalIndex, item.getPlanId(), item.getAccountId(), filterContentList.size());
|
|
|
+ recommendService.updateWaitingContentFilter(filterContentList);
|
|
|
+ // 调用aigc publish_content待发布内容状态废弃
|
|
|
+ LongArticleSystemFilterSortParam param = new LongArticleSystemFilterSortParam();
|
|
|
+ param.setFilterSortContentList(buildFilterSortContentList(filterResult));
|
|
|
+ aigcPublishContentDiscardService.filterSortContents(param);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private List<LongArticleSystemFilterSortContentParam> buildFilterSortContentList(FilterResult filterResult) {
|
|
|
List<LongArticleSystemFilterSortContentParam> contentList = new ArrayList<>();
|
|
|
for (Content filterContent : filterResult.getFilterContent()) {
|