瀏覽代碼

增加不需要排序

xueyiming 7 月之前
父節點
當前提交
d7b5331322

+ 13 - 12
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/CoreServiceImpl.java

@@ -381,6 +381,19 @@ public class CoreServiceImpl implements CoreService {
             if (!flag) {
                 continue;
             }
+            //获取待排序数据
+            LongArticleSystemGetContentsParam waitingSortParam = new LongArticleSystemGetContentsParam();
+            waitingSortParam.setPlanId(planAccount.getPlanId());
+            waitingSortParam.setAccountId(planAccount.getAccountId());
+            waitingSortParam.setPageNum(1);
+            waitingSortParam.setPageSize(planAccount.getPublishPreNum());
+            LongArticleSystemContentVO longArticleSystemContentVO = aigcService.listWaitingSortContents(waitingSortParam);
+            if (longArticleSystemContentVO == null
+                    || longArticleSystemContentVO.getTotalCount() < planAccount.getPublishPreMinNum()
+                    || CollectionUtils.isEmpty(longArticleSystemContentVO.getContentItemList())
+                    || longArticleSystemContentVO.getContentItemList().size() < planAccount.getPublishPreMinNum()) {
+                continue;
+            }
             List<PublishArticleData> rankList;
             if (StringUtils.isNotEmpty(planAccount.getSortStrategy())) {
                 ArticleSortRequest articleSortRequest = new ArticleSortRequest();
@@ -421,18 +434,6 @@ public class CoreServiceImpl implements CoreService {
                 //排序结束
                 rankList = data.getRank_list();
             } else {
-                LongArticleSystemGetContentsParam param = new LongArticleSystemGetContentsParam();
-                param.setPlanId(planAccount.getPlanId());
-                param.setAccountId(planAccount.getAccountId());
-                param.setPageNum(1);
-                param.setPageSize(planAccount.getPublishPreNum());
-                LongArticleSystemContentVO longArticleSystemContentVO = aigcService.listWaitingSortContents(param);
-                if (longArticleSystemContentVO == null
-                        || longArticleSystemContentVO.getTotalCount() < planAccount.getPublishPreMinNum()
-                        || CollectionUtils.isEmpty(longArticleSystemContentVO.getContentItemList())
-                        || longArticleSystemContentVO.getContentItemList().size() < planAccount.getPublishPreMinNum()) {
-                    continue;
-                }
                 List<PublishArticleData> notSortList = new ArrayList<>();
                 for (ContentItemVO contentItemVO : longArticleSystemContentVO.getContentItemList()) {
                     PublishArticleData publishArticleData = new PublishArticleData();