ソースを参照

待发布文章提前拉取

wangyunpeng 1 ヶ月 前
コミット
a64d9e5de3

+ 6 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/mapper/aigc/PublishContentMapper.java

@@ -1,7 +1,10 @@
 package com.tzld.longarticle.recommend.server.mapper.aigc;
 
 import com.tzld.longarticle.recommend.server.model.dto.*;
-import com.tzld.longarticle.recommend.server.model.entity.aigc.*;
+import com.tzld.longarticle.recommend.server.model.dto.aigc.PublishAccountRemarkDTO;
+import com.tzld.longarticle.recommend.server.model.entity.aigc.PublishAccount;
+import com.tzld.longarticle.recommend.server.model.entity.aigc.PublishContent;
+import com.tzld.longarticle.recommend.server.model.entity.aigc.PublishPlanMiniprogramTask;
 import com.tzld.longarticle.recommend.server.model.entity.longArticle.Account;
 import com.tzld.longarticle.recommend.server.model.param.MiniprogramTaskParam;
 import com.tzld.longarticle.recommend.server.model.param.PublishContentParam;
@@ -63,4 +66,6 @@ public interface PublishContentMapper {
     List<Account> getAccountByIds(List<String> accountIds);
 
     List<PublishPlanMiniprogramTask> getAccountMiniprogramTaskList(String id);
+
+    List<PublishAccountRemarkDTO> getPublishAccountRemarkList(List<String> accountIds);
 }

+ 18 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/dto/aigc/PublishAccountRemarkDTO.java

@@ -0,0 +1,18 @@
+package com.tzld.longarticle.recommend.server.model.dto.aigc;
+
+import lombok.Data;
+
+import java.util.Date;
+
+@Data
+public class PublishAccountRemarkDTO {
+
+    private Long id;
+
+    private String publishAccountId;
+
+    private String remark;
+
+    private Date createTime;
+
+}

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

@@ -26,6 +26,7 @@ import com.tzld.longarticle.recommend.server.mapper.longArticle.LongArticleBaseM
 import com.tzld.longarticle.recommend.server.model.cgi.AlgFaceRecognizeResult;
 import com.tzld.longarticle.recommend.server.model.cgi.PQVideoAuditResult;
 import com.tzld.longarticle.recommend.server.model.dto.*;
+import com.tzld.longarticle.recommend.server.model.dto.aigc.PublishAccountRemarkDTO;
 import com.tzld.longarticle.recommend.server.model.entity.aigc.PublishAccount;
 import com.tzld.longarticle.recommend.server.model.entity.aigc.PublishContent;
 import com.tzld.longarticle.recommend.server.model.entity.crawler.Article;
@@ -814,6 +815,9 @@ public class ArticleAuditService {
         List<PublishAccount> publishAccountList = publishAccountRepository.getByIdIn(publishAccountIds);
         Map<String, PublishAccount> publishAccountMap = publishAccountList.stream()
                 .collect(Collectors.toMap(PublishAccount::getId, Function.identity()));
+        List<PublishAccountRemarkDTO> publishAccountRemarkDTOList = publishContentMapper.getPublishAccountRemarkList(publishAccountIds);
+        Map<String, List<PublishAccountRemarkDTO>> publishAccountRemarkMap = publishAccountRemarkDTOList.stream()
+               .collect(Collectors.groupingBy(PublishAccountRemarkDTO::getPublishAccountId));
         List<PublishGzhPushContentRelDTO> groupPushRelList = publishContentMapper.getGroupPushRelByPushIdIn(pushIds);
         List<String> publishContentIds = groupPushRelList.stream().map(PublishGzhPushContentRelDTO::getPublishContentId)
                 .collect(Collectors.toList());
@@ -829,8 +833,18 @@ public class ArticleAuditService {
             if (notDeleteArticleAccountGhIds.contains(publishAccount.getGhId())) {
                 continue;
             }
-            if (StringUtils.hasText(publishAccount.getRemark()) && publishAccount.getRemark().contains("服务号")) {
-                continue;
+            List<PublishAccountRemarkDTO> remarkList = publishAccountRemarkMap.get(publishAccountId);
+            if (CollectionUtils.isNotEmpty(remarkList)) {
+                boolean isFwh = false;
+                for (PublishAccountRemarkDTO remark : remarkList) {
+                    if (remark.getRemark().contains("服务号")) {
+                        isFwh = true;
+                        break;
+                    }
+                }
+                if (isFwh) {
+                    continue;
+                }
             }
             List<PublishGzhPushContentRelDTO> relList = groupPushRelMap.get(push.getPushId()).stream()
                     .sorted(Comparator.comparing(PublishGzhPushContentRelDTO::getId)).collect(Collectors.toList());

+ 11 - 0
long-article-recommend-service/src/main/resources/mapper/aigc/PublishContentMapper.xml

@@ -303,4 +303,15 @@
           and ppmt.account_ids like CONCAT("%", #{accountId}, "%")
     </select>
 
+    <select id="getPublishAccountRemarkList"
+            resultType="com.tzld.longarticle.recommend.server.model.dto.aigc.PublishAccountRemarkDTO">
+        select *
+        from publish_account_remark
+        where publish_account_id in
+        <foreach collection="accountIds" item="item" open="(" close=")" separator=",">
+            #{item}
+        </foreach>
+
+    </select>
+
 </mapper>