|
@@ -124,17 +124,31 @@ public class ArticleVideoAuditService {
|
|
|
return list(param);
|
|
|
}
|
|
|
Page<ArticleVideoAuditListVO> result = new Page<>();
|
|
|
+ Long now = System.currentTimeMillis();
|
|
|
+ String redisKey = "article-pool-audit-next-list";
|
|
|
+ Map<Object, Object> entries = redisTemplate.opsForHash().entries(redisKey);
|
|
|
+ List<String> excludeContentIds = new ArrayList<>();
|
|
|
+ entries.forEach((k, v) -> {
|
|
|
+ long timestamp = Long.parseLong((String) v);
|
|
|
+ if (now > timestamp) {
|
|
|
+ redisTemplate.opsForHash().delete(redisKey, k);
|
|
|
+ } else {
|
|
|
+ excludeContentIds.add((String) k);
|
|
|
+ }
|
|
|
+ });
|
|
|
// 根据配置判断当日是否审核完成 并 选择内容池返回
|
|
|
ArticleVideoAuditListVO item = null;
|
|
|
List<String> excludePoolLevel = new ArrayList<>();
|
|
|
String poolLevel = getAuditPoolLevel(excludePoolLevel);
|
|
|
if (Objects.isNull(poolLevel)) {
|
|
|
item = articleAuditMapper.articleVideoAuditNext(param.getContentId(),
|
|
|
- param.getStatus(), param.getTitle(), param.getAuditAccount(), param.getSourceProducePlan(), poolLevel);
|
|
|
+ param.getStatus(), param.getTitle(), param.getAuditAccount(), param.getSourceProducePlan(),
|
|
|
+ poolLevel, excludeContentIds);
|
|
|
} else {
|
|
|
do {
|
|
|
item = articleAuditMapper.articleVideoAuditNext(param.getContentId(),
|
|
|
- param.getStatus(), param.getTitle(), param.getAuditAccount(), param.getSourceProducePlan(), poolLevel);
|
|
|
+ param.getStatus(), param.getTitle(), param.getAuditAccount(), param.getSourceProducePlan(),
|
|
|
+ poolLevel, excludeContentIds);
|
|
|
if (Objects.nonNull(item)) {
|
|
|
break;
|
|
|
}
|
|
@@ -145,6 +159,7 @@ public class ArticleVideoAuditService {
|
|
|
if (Objects.isNull(item)) {
|
|
|
return result;
|
|
|
}
|
|
|
+ redisTemplate.opsForHash().put(redisKey, item.getContentId(), String.valueOf(now + 600000));
|
|
|
List<ArticleVideoAuditListVO> list = Collections.singletonList(item);
|
|
|
buildArticleVideoAuditListVO(list);
|
|
|
result.setObjs(list);
|