Browse Source

修改判断

xueyiming 4 weeks ago
parent
commit
d91cc5a9db

+ 3 - 1
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/ContentServiceImpl.java

@@ -206,10 +206,12 @@ public class ContentServiceImpl implements ContentService {
         }
         articleSortRequest.setPlanId(planAccount.getPlanId());
         articleSortRequest.setPushType(planAccount.getPushType());
+        int excludeContentSum = 0;
         if (StringUtils.isNotEmpty(planAccount.getExcludeContentIndex())) {
             List<Integer> excludeContentIndexList = JSONArray.parseArray(planAccount.getExcludeContentIndex(), Integer.class);
             if (!CollectionUtils.isEmpty(excludeContentIndexList)) {
                 articleSortRequest.setExcludeContentIndex(excludeContentIndexList);
+                excludeContentSum = excludeContentIndexList.size();
             }
         }
         log.info("articleSortRequest={}", JSONObject.toJSONString(articleSortRequest));
@@ -236,7 +238,7 @@ public class ContentServiceImpl implements ContentService {
             aigcService.filterSortContents(param);
         }
         if (CollectionUtils.isEmpty(articleSortResponse.getData().getRank_list())
-                || articleSortResponse.getData().getRank_list().size() < planAccount.getPublishPreMinNum()) {
+                || articleSortResponse.getData().getRank_list().size() < (planAccount.getPublishPreMinNum() - excludeContentSum)) {
             log.info("rank_list = {}", articleSortResponse.getData().getRank_list());
             String message = String.format("排序结果不足 planId=%s accountName=%s num=%s",
                     planAccount.getPlanId(), planAccount.getAccountName(), articleSortResponse.getData().getRank_list().size());