Bladeren bron

文章视频审核增加 生成计划优先级配置

wangyunpeng 1 week geleden
bovenliggende
commit
83ce5630e3

+ 1 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/mapper/longArticle/ArticleAuditMapper.java

@@ -31,6 +31,7 @@ public interface ArticleAuditMapper {
     List<ArticleVideoAuditListVO> articleVideoWatingAuditList(List<Integer> status,
                                                               List<String> flowPoolLevels,
                                                               List<String> excludeContentIds,
+                                                              List<String> producePlanIds,
                                                               Integer size);
 
 

+ 18 - 2
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/ArticleVideoAuditService.java

@@ -72,6 +72,9 @@ public class ArticleVideoAuditService {
     @ApolloJsonValue("${daily.article.audit.pool.count.config:{}}")
     private Map<String, Integer> dailyAuditPoolCount;
 
+    @ApolloJsonValue("${highPriorityProducePlan:[]}")
+    private List<String> highPriorityProducePlan;
+
     public Page<ArticleVideoAuditListVO> list(ArticleVideoAuditListParam param) {
         int offset = (param.getPageNum() - 1) * param.getPageSize();
         int count = articleAuditMapper.articleVideoAuditListCount(param.getContentId(), param.getStatus(),
@@ -475,6 +478,18 @@ public class ArticleVideoAuditService {
                 auditQueuePoolCountMap = auditQueueList.stream().collect(Collectors.groupingBy(item -> ContentPoolEnum.from(item.getFlowPoolLevel()).getContentPool()));
                 excludeContentIds.addAll(auditQueueIds);
             }
+            // 高优先级计划内容添加
+            if (CollectionUtils.isNotEmpty(highPriorityProducePlan)) {
+                List<ArticleVideoAuditListVO> addList = articleAuditMapper.articleVideoWatingAuditList(
+                        Arrays.asList(ArticleVideoAuditStatusEnum.WAITING.getCode()),
+                        null, excludeContentIds, highPriorityProducePlan, 100);
+                if (CollectionUtils.isNotEmpty(addList)) {
+                    for (ArticleVideoAuditListVO item : addList) {
+                        redisTemplate.opsForZSet().add(auditQueueRedisKey, item.getContentId(), 101);
+                        excludeContentIds.add(item.getContentId());
+                    }
+                }
+            }
             // 每日配置发送量不足添加
             for (Map.Entry<String, Integer> entry : dailyAuditPoolCount.entrySet()) {
                 ContentPoolEnum poolEnum = ContentPoolEnum.from(entry.getKey());
@@ -487,7 +502,7 @@ public class ArticleVideoAuditService {
                     if (needCount > 0) {
                         List<ArticleVideoAuditListVO> addList = articleAuditMapper.articleVideoWatingAuditList(
                                 Arrays.asList(ArticleVideoAuditStatusEnum.WAITING.getCode()),
-                                Arrays.asList(poolEnum.getContentPool()), excludeContentIds, needCount);
+                                Arrays.asList(poolEnum.getContentPool()), excludeContentIds, null, needCount);
                         if (CollectionUtils.isNotEmpty(addList)) {
                             for (ArticleVideoAuditListVO item : addList) {
                                 redisTemplate.opsForZSet().add(auditQueueRedisKey, item.getContentId(), poolEnum.getWeight());
@@ -501,7 +516,8 @@ public class ArticleVideoAuditService {
             Long auditQueueSize = redisTemplate.opsForZSet().size(auditQueueRedisKey);
             if (Objects.isNull(auditQueueSize) || auditQueueSize < 20) {
                 List<ArticleVideoAuditListVO> list = articleAuditMapper.articleVideoWatingAuditList(
-                        Arrays.asList(ArticleVideoAuditStatusEnum.WAITING.getCode()), null, excludeContentIds, 40);
+                        Arrays.asList(ArticleVideoAuditStatusEnum.WAITING.getCode()), null,
+                        excludeContentIds, null, 40);
                 if (CollectionUtils.isNotEmpty(list)) {
                     for (ArticleVideoAuditListVO item : list) {
                         ContentPoolEnum poolEnum = ContentPoolEnum.from(item.getFlowPoolLevel());

+ 12 - 8
long-article-recommend-service/src/main/resources/mapper/longArticle/ArticleAuditMapper.xml

@@ -245,31 +245,35 @@
 
     <select id="articleVideoWatingAuditList"
             resultType="com.tzld.longarticle.recommend.server.model.vo.ArticleVideoAuditListVO">
-        select lata.content_id, lata.status, lat.article_title as title, lat.kimi_title,
-        lata.audit_account, lata.audit_timestamp, lata.flow_pool_level
-        from long_articles_title_audit lata
-        left join long_articles_text lat on lata.content_id = lat.content_id
+        select content_id, status, audit_account, audit_timestamp, flow_pool_level
+        from long_articles_title_audit
         <where>
             <if test="status!= null and status.size() > 0">
-                and lata.status in
+                and status in
                 <foreach collection="status" item="item" separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
             <if test="flowPoolLevels!= null and flowPoolLevels.size() > 0">
-                and lata.flow_pool_level in
+                and flow_pool_level in
                 <foreach collection="flowPoolLevels" item="item" separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
             <if test="excludeContentIds!= null and excludeContentIds.size() > 0">
-                and lata.content_id not in
+                and content_id not in
                 <foreach collection="excludeContentIds" item="item" separator="," open="(" close=")">
                     #{item}
                 </foreach>
             </if>
+            <if test="producePlanIds!= null and producePlanIds.size() > 0">
+                and produce_plan_id in
+                <foreach collection="producePlanIds" item="item" separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
         </where>
-        order by lata.content_id desc
+        order by content_id desc
         limit #{size}
     </select>