|
@@ -122,10 +122,6 @@ public class ArticleVideoAuditService {
|
|
|
}
|
|
|
|
|
|
public Page<ArticleVideoAuditListVO> next(ArticleVideoAuditListParam param) {
|
|
|
- if (Objects.nonNull(param.getSourceProducePlan())) {
|
|
|
- param.setPageSize(1);
|
|
|
- return list(param);
|
|
|
- }
|
|
|
Page<ArticleVideoAuditListVO> result = new Page<>();
|
|
|
|
|
|
String lockKey = "article-pool-audit-lock";
|
|
@@ -442,18 +438,21 @@ public class ArticleVideoAuditService {
|
|
|
break;
|
|
|
}
|
|
|
}
|
|
|
+ List<String> excludeContentIds = new ArrayList<>();
|
|
|
List<String> nextList = redisTemplate.opsForList().range(nextListRedisKey, 0, -1);
|
|
|
Map<String, List<LongArticleTitleAudit>> nextListPoolCountMap = new HashMap<>();
|
|
|
if (CollectionUtils.isNotEmpty(nextList)) {
|
|
|
List<String> nextListIds = nextList.stream().map(item -> JSONObject.parseObject(item).getString("id")).collect(Collectors.toList());
|
|
|
List<LongArticleTitleAudit> auditQueueList = titleAuditRepository.getByContentIdIn(new ArrayList<>(nextListIds));
|
|
|
nextListPoolCountMap = auditQueueList.stream().collect(Collectors.groupingBy(item -> ContentPoolEnum.from(item.getFlowPoolLevel()).getContentPool()));
|
|
|
+ excludeContentIds.addAll(nextListIds);
|
|
|
}
|
|
|
Set<String> auditQueueIds = redisTemplate.opsForZSet().rangeByScore(auditQueueRedisKey, 0, 100);
|
|
|
Map<String, List<LongArticleTitleAudit>> auditQueuePoolCountMap = new HashMap<>();
|
|
|
if (CollectionUtils.isNotEmpty(auditQueueIds)) {
|
|
|
List<LongArticleTitleAudit> auditQueueList = titleAuditRepository.getByContentIdIn(new ArrayList<>(auditQueueIds));
|
|
|
auditQueuePoolCountMap = auditQueueList.stream().collect(Collectors.groupingBy(item -> ContentPoolEnum.from(item.getFlowPoolLevel()).getContentPool()));
|
|
|
+ excludeContentIds.addAll(auditQueueIds);
|
|
|
}
|
|
|
// 每日配置发送量不足添加
|
|
|
for (Map.Entry<String, Integer> entry : dailyAuditPoolCount.entrySet()) {
|
|
@@ -465,13 +464,13 @@ public class ArticleVideoAuditService {
|
|
|
List<LongArticleTitleAudit> nextListPool = nextListPoolCountMap.getOrDefault(poolEnum.getContentPool(), new ArrayList<>());
|
|
|
int needCount = entry.getValue() - (totalCount + auditQueueList.size() + nextListPool.size());
|
|
|
if (needCount > 0) {
|
|
|
- List<ArticleVideoAuditListVO> addList = articleAuditMapper.articleVideoAuditList(null,
|
|
|
- Arrays.asList(ArticleVideoAuditStatusEnum.WAITING.getCode()), null, null,
|
|
|
- null, Arrays.asList(poolEnum.getContentPool()), null,
|
|
|
- 0, needCount, poolLevelDesc);
|
|
|
+ List<ArticleVideoAuditListVO> addList = articleAuditMapper.articleVideoWatingAuditList(
|
|
|
+ Arrays.asList(ArticleVideoAuditStatusEnum.WAITING.getCode()),
|
|
|
+ Arrays.asList(poolEnum.getContentPool()), excludeContentIds, needCount);
|
|
|
if (CollectionUtils.isNotEmpty(addList)) {
|
|
|
for (ArticleVideoAuditListVO item : addList) {
|
|
|
redisTemplate.opsForZSet().add(auditQueueRedisKey, item.getContentId(), poolEnum.getWeight());
|
|
|
+ excludeContentIds.add(item.getContentId());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -480,9 +479,8 @@ public class ArticleVideoAuditService {
|
|
|
// 待发布内容不足添加
|
|
|
Long auditQueueSize = redisTemplate.opsForZSet().size(auditQueueRedisKey);
|
|
|
if (Objects.isNull(auditQueueSize) || auditQueueSize < 20) {
|
|
|
- List<ArticleVideoAuditListVO> list = articleAuditMapper.articleVideoAuditList(null,
|
|
|
- Arrays.asList(ArticleVideoAuditStatusEnum.WAITING.getCode()), null, null, null
|
|
|
- , null, null, 0, 40, poolLevelDesc);
|
|
|
+ List<ArticleVideoAuditListVO> list = articleAuditMapper.articleVideoWatingAuditList(
|
|
|
+ Arrays.asList(ArticleVideoAuditStatusEnum.WAITING.getCode()), null, excludeContentIds, 40);
|
|
|
if (CollectionUtils.isNotEmpty(list)) {
|
|
|
for (ArticleVideoAuditListVO item : list) {
|
|
|
ContentPoolEnum poolEnum = ContentPoolEnum.from(item.getFlowPoolLevel());
|