|
@@ -96,10 +96,6 @@ public class VideoPoolAuditService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public Page<VideoPoolAuditListVO> next(VideoPoolAuditListParam param) {
|
|
public Page<VideoPoolAuditListVO> next(VideoPoolAuditListParam param) {
|
|
|
- if (Objects.nonNull(param.getFlowPoolLevel())) {
|
|
|
|
|
- param.setPageSize(1);
|
|
|
|
|
- return list(param);
|
|
|
|
|
- }
|
|
|
|
|
Page<VideoPoolAuditListVO> result = new Page<>();
|
|
Page<VideoPoolAuditListVO> result = new Page<>();
|
|
|
String lockKey = "video-pool-audit-lock";
|
|
String lockKey = "video-pool-audit-lock";
|
|
|
String requestId = UUID.randomUUID().toString();
|
|
String requestId = UUID.randomUUID().toString();
|
|
@@ -276,18 +272,21 @@ public class VideoPoolAuditService {
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ List<String> excludeContentIds = new ArrayList<>();
|
|
|
List<String> nextList = redisTemplate.opsForList().range(nextListRedisKey, 0, -1);
|
|
List<String> nextList = redisTemplate.opsForList().range(nextListRedisKey, 0, -1);
|
|
|
Map<String, List<PublishSingleVideoSource>> nextListPoolCountMap = new HashMap<>();
|
|
Map<String, List<PublishSingleVideoSource>> nextListPoolCountMap = new HashMap<>();
|
|
|
if (CollectionUtils.isNotEmpty(nextList)) {
|
|
if (CollectionUtils.isNotEmpty(nextList)) {
|
|
|
List<String> nextListIds = nextList.stream().map(item -> JSONObject.parseObject(item).getString("id")).collect(Collectors.toList());
|
|
List<String> nextListIds = nextList.stream().map(item -> JSONObject.parseObject(item).getString("id")).collect(Collectors.toList());
|
|
|
List<PublishSingleVideoSource> auditQueueList = videoSourceRepository.getByContentTraceIdIn(new ArrayList<>(nextListIds));
|
|
List<PublishSingleVideoSource> auditQueueList = videoSourceRepository.getByContentTraceIdIn(new ArrayList<>(nextListIds));
|
|
|
nextListPoolCountMap = auditQueueList.stream().collect(Collectors.groupingBy(item -> ContentPoolEnum.from(item.getFlowPoolLevel()).getContentPool()));
|
|
nextListPoolCountMap = auditQueueList.stream().collect(Collectors.groupingBy(item -> ContentPoolEnum.from(item.getFlowPoolLevel()).getContentPool()));
|
|
|
|
|
+ excludeContentIds.addAll(nextListIds);
|
|
|
}
|
|
}
|
|
|
Set<String> auditQueueIds = redisTemplate.opsForZSet().rangeByScore(auditQueueRedisKey, 0, 100);
|
|
Set<String> auditQueueIds = redisTemplate.opsForZSet().rangeByScore(auditQueueRedisKey, 0, 100);
|
|
|
Map<String, List<PublishSingleVideoSource>> auditQueuePoolCountMap = new HashMap<>();
|
|
Map<String, List<PublishSingleVideoSource>> auditQueuePoolCountMap = new HashMap<>();
|
|
|
if (CollectionUtils.isNotEmpty(auditQueueIds)) {
|
|
if (CollectionUtils.isNotEmpty(auditQueueIds)) {
|
|
|
List<PublishSingleVideoSource> auditQueueList = videoSourceRepository.getByContentTraceIdIn(new ArrayList<>(auditQueueIds));
|
|
List<PublishSingleVideoSource> auditQueueList = videoSourceRepository.getByContentTraceIdIn(new ArrayList<>(auditQueueIds));
|
|
|
auditQueuePoolCountMap = auditQueueList.stream().collect(Collectors.groupingBy(item -> ContentPoolEnum.from(item.getFlowPoolLevel()).getContentPool()));
|
|
auditQueuePoolCountMap = auditQueueList.stream().collect(Collectors.groupingBy(item -> ContentPoolEnum.from(item.getFlowPoolLevel()).getContentPool()));
|
|
|
|
|
+ excludeContentIds.addAll(auditQueueIds);
|
|
|
}
|
|
}
|
|
|
// 每日配置发送量不足添加
|
|
// 每日配置发送量不足添加
|
|
|
for (Map.Entry<String, Integer> entry : dailyAuditPoolCount.entrySet()) {
|
|
for (Map.Entry<String, Integer> entry : dailyAuditPoolCount.entrySet()) {
|
|
@@ -299,12 +298,13 @@ public class VideoPoolAuditService {
|
|
|
List<PublishSingleVideoSource> nextListPool = nextListPoolCountMap.getOrDefault(poolEnum.getContentPool(), new ArrayList<>());
|
|
List<PublishSingleVideoSource> nextListPool = nextListPoolCountMap.getOrDefault(poolEnum.getContentPool(), new ArrayList<>());
|
|
|
int needCount = entry.getValue() - (totalCount + auditQueueList.size() + nextListPool.size());
|
|
int needCount = entry.getValue() - (totalCount + auditQueueList.size() + nextListPool.size());
|
|
|
if (needCount > 0) {
|
|
if (needCount > 0) {
|
|
|
- List<PublishSingleVideoSource> addList = videoPoolAuditMapper.articleVideoAuditList(null,
|
|
|
|
|
- Arrays.asList(ArticleVideoAuditStatusEnum.WAITING.getCode()), null, null,
|
|
|
|
|
- Arrays.asList(poolEnum.getValue()), null, 0, needCount, poolLevelDesc);
|
|
|
|
|
|
|
+ List<PublishSingleVideoSource> addList = videoPoolAuditMapper.articleVideoWatingAuditList(
|
|
|
|
|
+ Arrays.asList(ArticleVideoAuditStatusEnum.WAITING.getCode()),
|
|
|
|
|
+ Arrays.asList(poolEnum.getValue()), excludeContentIds, needCount);
|
|
|
if (CollectionUtils.isNotEmpty(addList)) {
|
|
if (CollectionUtils.isNotEmpty(addList)) {
|
|
|
for (PublishSingleVideoSource item : addList) {
|
|
for (PublishSingleVideoSource item : addList) {
|
|
|
redisTemplate.opsForZSet().add(auditQueueRedisKey, item.getContentTraceId(), poolEnum.getWeight());
|
|
redisTemplate.opsForZSet().add(auditQueueRedisKey, item.getContentTraceId(), poolEnum.getWeight());
|
|
|
|
|
+ excludeContentIds.add(item.getContentTraceId());
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -313,9 +313,8 @@ public class VideoPoolAuditService {
|
|
|
// 待发布内容不足添加
|
|
// 待发布内容不足添加
|
|
|
Long auditQueueSize = redisTemplate.opsForZSet().size(auditQueueRedisKey);
|
|
Long auditQueueSize = redisTemplate.opsForZSet().size(auditQueueRedisKey);
|
|
|
if (Objects.isNull(auditQueueSize) || auditQueueSize < 20) {
|
|
if (Objects.isNull(auditQueueSize) || auditQueueSize < 20) {
|
|
|
- List<PublishSingleVideoSource> list = videoPoolAuditMapper.articleVideoAuditList(null,
|
|
|
|
|
- Arrays.asList(ArticleVideoAuditStatusEnum.WAITING.getCode()), null, null, null
|
|
|
|
|
- , null, 0, 40, poolLevelDesc);
|
|
|
|
|
|
|
+ List<PublishSingleVideoSource> list = videoPoolAuditMapper.articleVideoWatingAuditList(
|
|
|
|
|
+ Arrays.asList(ArticleVideoAuditStatusEnum.WAITING.getCode()), null, excludeContentIds, 40);
|
|
|
if (CollectionUtils.isNotEmpty(list)) {
|
|
if (CollectionUtils.isNotEmpty(list)) {
|
|
|
for (PublishSingleVideoSource item : list) {
|
|
for (PublishSingleVideoSource item : list) {
|
|
|
ContentPoolEnum poolEnum = ContentPoolEnum.from(item.getFlowPoolLevel());
|
|
ContentPoolEnum poolEnum = ContentPoolEnum.from(item.getFlowPoolLevel());
|