Przeglądaj źródła

Merge branch 'master' into wyp/0108-safeReduceV2

# Conflicts:
#	long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/mapper/aigc/AigcBaseMapper.java
#	long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/recall/RecallService.java
#	long-article-recommend-service/src/main/resources/mapper/aigc/AigcBaseMapper.xml
wangyunpeng 5 miesięcy temu
rodzic
commit
0210e2e285
36 zmienionych plików z 1243 dodań i 352 usunięć
  1. 1 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/common/enums/aigc/PublishContentStatusEnum.java
  2. 29 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/common/enums/longArticle/ArticleVideoAuditStatusEnum.java
  3. 7 44
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/mapper/aigc/AigcBaseMapper.java
  4. 57 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/mapper/aigc/PublishContentMapper.java
  5. 27 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/mapper/longArticle/ArticleAuditMapper.java
  6. 3 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/entity/longArticle/LongArticleAuditDelete.java
  7. 10 1
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/entity/longArticle/LongArticleCrawlerVideo.java
  8. 35 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/entity/longArticle/LongArticleTitleAudit.java
  9. 11 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/param/videoAudit/ArticleAuditParam.java
  10. 10 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/param/videoAudit/ArticleTitleUpdateParam.java
  11. 16 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/param/videoAudit/ArticleVideoAuditListParam.java
  12. 9 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/param/videoAudit/AuditFilterParam.java
  13. 12 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/param/videoAudit/VideoAuditParam.java
  14. 11 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/param/videoAudit/VideoTitleUpdateParam.java
  15. 30 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/vo/ArticleVideoAuditListVO.java
  16. 14 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/vo/VideoAuditExport.java
  17. 1 1
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/remote/WxAccessTokenRemoteService.java
  18. 12 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/repository/longArticle/ArticleReMatchRecordRepository.java
  19. 2 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/repository/longArticle/LongArticleAuditDeleteRepository.java
  20. 9 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/repository/longArticle/LongArticleCrawlerVideoRepository.java
  21. 21 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/repository/longArticle/LongArticleTitleAuditRepository.java
  22. 2 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/repository/longArticle/LongArticlesMatchVideoRepository.java
  23. 7 4
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/XxlJobService.java
  24. 80 25
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/ArticleAuditService.java
  25. 11 8
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/ArticleService.java
  26. 226 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/ArticleVideoAuditService.java
  27. 75 7
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/DataDashboardService.java
  28. 25 2
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/recall/RecallService.java
  29. 65 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/web/recommend/ArticleVideoAuditController.java
  30. 7 0
      long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/web/recommend/DataDashboardController.java
  31. 2 255
      long-article-recommend-service/src/main/resources/mapper/aigc/AigcBaseMapper.xml
  32. 253 0
      long-article-recommend-service/src/main/resources/mapper/aigc/PublishContentMapper.xml
  33. 140 0
      long-article-recommend-service/src/main/resources/mapper/longArticle/ArticleAuditMapper.xml
  34. 5 2
      long-article-recommend-service/src/test/java/com/tzld/longarticle/recommend/server/RecommendTest.java
  35. 14 2
      long-article-recommend-service/src/test/java/com/tzld/longarticle/recommend/server/WxApiTest.java
  36. 4 1
      long-article-recommend-service/src/test/java/com/tzld/longarticle/recommend/server/XxlJobTest.java

+ 1 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/common/enums/aigc/PublishContentStatusEnum.java

@@ -15,6 +15,7 @@ public enum PublishContentStatusEnum {
     platformReview(6, "平台审核中"),
     platformReview(6, "平台审核中"),
     input_delete(7, "输入删除"),
     input_delete(7, "输入删除"),
     input_deprecated(8, "输入废弃"),
     input_deprecated(8, "输入废弃"),
+    gzh_article_deprecated(9, "公众号文章废弃"),
     other(999, "其他"),
     other(999, "其他"),
     ;
     ;
 
 

+ 29 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/common/enums/longArticle/ArticleVideoAuditStatusEnum.java

@@ -0,0 +1,29 @@
+package com.tzld.longarticle.recommend.server.common.enums.longArticle;
+
+import lombok.Getter;
+
+@Getter
+public enum ArticleVideoAuditStatusEnum {
+
+    WAITING(0, "待审核"),
+    PASS(1, "审核通过"),
+    REJECT(2, "审核不通过"),
+    ;
+
+    private final int code;
+    private final String msg;
+
+    ArticleVideoAuditStatusEnum(int code, String msg) {
+        this.code = code;
+        this.msg = msg;
+    }
+
+    public static ArticleVideoAuditStatusEnum getByCode(int code) {
+        for (ArticleVideoAuditStatusEnum statusEnum : ArticleVideoAuditStatusEnum.values()) {
+            if (statusEnum.getCode() == code) {
+                return statusEnum;
+            }
+        }
+        return null;
+    }
+}

+ 7 - 44
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/mapper/aigc/AigcBaseMapper.java

@@ -1,9 +1,12 @@
 package com.tzld.longarticle.recommend.server.mapper.aigc;
 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.param.MiniprogramTaskParam;
-import com.tzld.longarticle.recommend.server.model.param.PublishContentParam;
+import com.tzld.longarticle.recommend.server.model.dto.CrawlerContent;
+import com.tzld.longarticle.recommend.server.model.dto.ProduceContentDTO;
+import com.tzld.longarticle.recommend.server.model.dto.ProducePlanAuditCheckDTO;
+import com.tzld.longarticle.recommend.server.model.entity.aigc.CrawlerPlan;
+import com.tzld.longarticle.recommend.server.model.entity.aigc.CrawlerPlanResultRel;
+import com.tzld.longarticle.recommend.server.model.entity.aigc.ProducePlanExeRecord;
+import com.tzld.longarticle.recommend.server.model.entity.aigc.ProduceTaskAtom;
 import org.apache.ibatis.annotations.Mapper;
 import org.apache.ibatis.annotations.Mapper;
 
 
 import java.util.List;
 import java.util.List;
@@ -11,30 +14,10 @@ import java.util.List;
 @Mapper
 @Mapper
 public interface AigcBaseMapper {
 public interface AigcBaseMapper {
 
 
-    List<PublishContentDTO> getPublishContentByTitle(List<PublishContentParam> list);
-
-    List<PublishPlanMiniprogramTask> getMiniProgramTask(List<MiniprogramTaskParam> miniprogramTaskParamList);
-
     List<CrawlerPlanResultRel> getCrawlerPlanRelByChannelContentIds(List<String> channelContentIds);
     List<CrawlerPlanResultRel> getCrawlerPlanRelByChannelContentIds(List<String> channelContentIds);
 
 
     List<CrawlerPlan> getCrawlerPlanByPlanIds(List<String> planIds);
     List<CrawlerPlan> getCrawlerPlanByPlanIds(List<String> planIds);
 
 
-    List<NotPublishPlan> getNotPublishPlan(Long todayStart);
-
-    Integer getPublishPlanPushType(String planId);
-
-    List<PublishAccount> getPublishAccounts(String planId, Long todayStart);
-
-    List<ProduceContentDTO> getSourceProduceContentByTitles(List<String> titleList);
-
-    List<AccountTypeFansDTO> getAccountTypeFans();
-
-    List<PublishContentDTO> getHisPublishByTitles(List<String> titleList);
-
-    List<PublishContent> getNearestPublishContent(String publishAccountId, Long publishTimestamp, Integer size);
-
-    List<PublishContent> getLateNearestPublishContent(String publishAccountId, Long publishTimestamp);
-
     CrawlerContent getCrawlerContentByChannelContentId(String channelContentId);
     CrawlerContent getCrawlerContentByChannelContentId(String channelContentId);
 
 
     List<CrawlerContent> getCrawlerContentByChannelContentIdIn(List<String> channelContentIds);
     List<CrawlerContent> getCrawlerContentByChannelContentIdIn(List<String> channelContentIds);
@@ -43,32 +26,12 @@ public interface AigcBaseMapper {
 
 
     List<ProducePlanExeRecord> getAllByProducePlanId(List<String> producePlanIds);
     List<ProducePlanExeRecord> getAllByProducePlanId(List<String> producePlanIds);
 
 
-    List<PublishPlanAccountNotifyDTO> checkPublishPlanAccount();
-
-    List<PublishContentMiniprogramDTO> getPublishContentByTraceIdIn(List<String> traceIds);
-
-    List<PublishGzhPushContentRelDTO> getPushContentRelByPublishContentIdIn(List<String> publishContentIds);
-
-    List<PublishGzhPushDTO> getPushByPushIdIn(List<String> pushIds);
-
-    List<PublishGzhPushContentRelDTO> getGroupPushRelByPushIdIn(List<String> pushIds);
-
-    PublishContentDTO getPublishContentById(String publishContentId);
-
-    List<PublishContentDTO> getPublishContentByIdIn(List<String> publishContentIds);
-
-    List<PublishContentDTO> getPublishContentBySourceIdIn(List<String> sourceIds);
-
     List<CrawlerPlan> getColdCrawlerPlan(Long timeStart, Long timeEnd, List<String> planTags);
     List<CrawlerPlan> getColdCrawlerPlan(Long timeStart, Long timeEnd, List<String> planTags);
 
 
     List<ProducePlanAuditCheckDTO> getProducePlanAudit(Long timeStart, Long timeEnd, List<String> planIds);
     List<ProducePlanAuditCheckDTO> getProducePlanAudit(Long timeStart, Long timeEnd, List<String> planIds);
 
 
     List<ProducePlanAuditCheckDTO> getProducePlanProduce(Long timeStart, Long timeEnd, List<String> planIds);
     List<ProducePlanAuditCheckDTO> getProducePlanProduce(Long timeStart, Long timeEnd, List<String> planIds);
 
 
-    List<PublishAccountTypeDTO> getAccountTypeList(List<String> ghIds);
-
-    List<String> getOnlyMiniprogramArticle(Integer offset, Integer pageSize);
-
     List<ProduceTaskAtom> getProduceScoreGreaterThan(Long startTimeStamp, Long endTimeStamp);
     List<ProduceTaskAtom> getProduceScoreGreaterThan(Long startTimeStamp, Long endTimeStamp);
 
 
     void updatePublishContentSingleMiniProgram(List<String> publishContentIds);
     void updatePublishContentSingleMiniProgram(List<String> publishContentIds);

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

@@ -0,0 +1,57 @@
+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.param.MiniprogramTaskParam;
+import com.tzld.longarticle.recommend.server.model.param.PublishContentParam;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+@Mapper
+public interface PublishContentMapper {
+
+    List<PublishContentDTO> getPublishContentByTitle(List<PublishContentParam> list);
+
+    List<PublishPlanMiniprogramTask> getMiniProgramTask(List<MiniprogramTaskParam> miniprogramTaskParamList);
+
+    List<NotPublishPlan> getNotPublishPlan(Long todayStart);
+
+    Integer getPublishPlanPushType(String planId);
+
+    List<PublishAccount> getPublishAccounts(String planId, Long todayStart);
+
+    List<ProduceContentDTO> getSourceProduceContentByTitles(List<String> titleList);
+
+    List<AccountTypeFansDTO> getAccountTypeFans();
+
+    List<PublishContentDTO> getHisPublishByTitles(List<String> titleList);
+
+    List<PublishContent> getNearestPublishContent(String publishAccountId, Long publishTimestamp, Integer size);
+
+    List<PublishContent> getLateNearestPublishContent(String publishAccountId, Long publishTimestamp);
+
+    List<PublishPlanAccountNotifyDTO> checkPublishPlanAccount();
+
+    List<PublishContentMiniprogramDTO> getPublishContentByTraceIdIn(List<String> traceIds);
+
+    List<PublishGzhPushContentRelDTO> getPushContentRelByPublishContentIdIn(List<String> publishContentIds);
+
+    List<PublishGzhPushDTO> getPushByPushIdIn(List<String> pushIds);
+
+    List<PublishGzhPushContentRelDTO> getGroupPushRelByPushIdIn(List<String> pushIds);
+
+    PublishContentDTO getPublishContentById(String publishContentId);
+
+    List<PublishContentDTO> getPublishContentByIdIn(List<String> publishContentIds);
+
+    List<PublishContentDTO> getPublishContentBySourceIdIn(List<String> sourceIds);
+
+    List<PublishAccountTypeDTO> getAccountTypeList(List<String> ghIds);
+
+    List<String> getOnlyMiniprogramArticle(Integer offset, Integer pageSize);
+
+    void updatePublishContentSingleMiniProgram(List<String> publishContentIds);
+
+    void updatePublishContentStatus(String sourceId, Integer status, Integer oldStatus);
+}

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

@@ -0,0 +1,27 @@
+package com.tzld.longarticle.recommend.server.mapper.longArticle;
+
+import com.tzld.longarticle.recommend.server.model.param.videoAudit.ArticleTitleUpdateParam;
+import com.tzld.longarticle.recommend.server.model.param.videoAudit.VideoTitleUpdateParam;
+import com.tzld.longarticle.recommend.server.model.vo.ArticleVideoAuditListVO;
+import org.apache.ibatis.annotations.Mapper;
+
+import java.util.List;
+
+@Mapper
+public interface ArticleAuditMapper {
+
+    int articleVideoAuditListCount(List<String> contentId, List<Integer> status,
+                                   List<String> title, List<String> auditAccount);
+
+    List<ArticleVideoAuditListVO> articleVideoAuditList(List<String> contentId, List<Integer> status,
+                                                        List<String> title, List<String> auditAccount,
+                                                        int offset, Integer pageSize);
+
+    void updateCrawlerVideoIsIllegal(List<Integer> illegalVideoIds, Integer isIllegal);
+
+    List<String> searchFilterValueByItemName(String itemName, String searchKeyword);
+
+    void updateArticleTitle(ArticleTitleUpdateParam param, Long updateTime);
+
+    void updateVideoTitle(VideoTitleUpdateParam param, Long updateTime);
+}

+ 3 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/entity/longArticle/LongArticleAuditDelete.java

@@ -42,6 +42,9 @@ public class LongArticleAuditDelete {
     @Column(name = "fail_reason")
     @Column(name = "fail_reason")
     private String failReason;
     private String failReason;
 
 
+    @Column(name = "delete_all")
+    private Integer deleteAll;
+
     @Column(name = "create_timestamp")
     @Column(name = "create_timestamp")
     private Long createTimestamp;
     private Long createTimestamp;
 
 

+ 10 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/entity/longArticle/LongArticleCrawlerVideo.java

@@ -17,7 +17,7 @@ public class LongArticleCrawlerVideo {
     @Id
     @Id
     @GeneratedValue(strategy = GenerationType.IDENTITY)
     @GeneratedValue(strategy = GenerationType.IDENTITY)
     @Column(name = "id")
     @Column(name = "id")
-    private Integer id;
+    private Long id;
 
 
     @Column(name = "content_id")
     @Column(name = "content_id")
     private String contentId;
     private String contentId;
@@ -75,4 +75,13 @@ public class LongArticleCrawlerVideo {
 
 
     @Column(name = "is_illegal")
     @Column(name = "is_illegal")
     private Integer isIllegal;
     private Integer isIllegal;
+
+    @Column(name = "status")
+    private Integer status;
+
+    @Column(name = "audit_account")
+    private String auditAccount;
+
+    @Column(name = "audit_timestamp")
+    private Long auditTimestamp;
 }
 }

+ 35 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/entity/longArticle/LongArticleTitleAudit.java

@@ -0,0 +1,35 @@
+package com.tzld.longarticle.recommend.server.model.entity.longArticle;
+
+import lombok.AllArgsConstructor;
+import lombok.Data;
+import lombok.NoArgsConstructor;
+
+import javax.persistence.Column;
+import javax.persistence.Entity;
+import javax.persistence.Id;
+import javax.persistence.Table;
+
+@Data
+@AllArgsConstructor
+@NoArgsConstructor
+@Entity
+@Table(name = "long_articles_title_audit")
+public class LongArticleTitleAudit {
+
+    @Id
+    @Column(name = "content_id")
+    private String contentId;
+
+    @Column(name = "status")
+    private Integer status;
+
+    @Column(name = "create_timestamp")
+    private Long createTimestamp;
+
+    @Column(name = "audit_account")
+    private String auditAccount;
+
+    @Column(name = "audit_timestamp")
+    private Long auditTimestamp;
+
+}

+ 11 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/param/videoAudit/ArticleAuditParam.java

@@ -0,0 +1,11 @@
+package com.tzld.longarticle.recommend.server.model.param.videoAudit;
+
+import lombok.Data;
+
+@Data
+public class ArticleAuditParam {
+
+    private String contentId;
+    private Integer status;
+    private String auditAccount;
+}

+ 10 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/param/videoAudit/ArticleTitleUpdateParam.java

@@ -0,0 +1,10 @@
+package com.tzld.longarticle.recommend.server.model.param.videoAudit;
+
+import lombok.Data;
+
+@Data
+public class ArticleTitleUpdateParam {
+    private String contentId;
+    private String title;
+    private String updateAccount;
+}

+ 16 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/param/videoAudit/ArticleVideoAuditListParam.java

@@ -0,0 +1,16 @@
+package com.tzld.longarticle.recommend.server.model.param.videoAudit;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class ArticleVideoAuditListParam {
+    private List<String> contentId;
+    private List<String> title;
+    private List<Integer> status;
+    private List<String> auditAccount;
+
+    private Integer pageNum = 1;
+    private Integer pageSize = 50;
+}

+ 9 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/param/videoAudit/AuditFilterParam.java

@@ -0,0 +1,9 @@
+package com.tzld.longarticle.recommend.server.model.param.videoAudit;
+
+import lombok.Data;
+
+@Data
+public class AuditFilterParam {
+    private String itemName;
+    private String searchKeyword;
+}

+ 12 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/param/videoAudit/VideoAuditParam.java

@@ -0,0 +1,12 @@
+package com.tzld.longarticle.recommend.server.model.param.videoAudit;
+
+import lombok.Data;
+
+@Data
+public class VideoAuditParam {
+
+    private String contentId;
+    private Long videoId;
+    private Integer status;
+    private String auditAccount;
+}

+ 11 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/param/videoAudit/VideoTitleUpdateParam.java

@@ -0,0 +1,11 @@
+package com.tzld.longarticle.recommend.server.model.param.videoAudit;
+
+import lombok.Data;
+
+@Data
+public class VideoTitleUpdateParam {
+    private String contentId;
+    private Long videoId;
+    private String title;
+    private String updateAccount;
+}

+ 30 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/vo/ArticleVideoAuditListVO.java

@@ -0,0 +1,30 @@
+package com.tzld.longarticle.recommend.server.model.vo;
+
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class ArticleVideoAuditListVO {
+
+    private String contentId;
+    private String title;
+    private String kimiTitle;
+    private Integer videoCount;
+    private Integer waitingAuditVideoCount;
+    private Integer status;
+    private String auditAccount;
+    private Long auditTimestamp;
+    private List<VideoItem> videoList;
+
+    @Data
+    public static class VideoItem {
+        private Long videoId;
+        private String title;
+        private String videoUrl;
+        private String coverUrl;
+        private Integer status;
+        private String auditAccount;
+        private Long auditTimestamp;
+    }
+}

+ 14 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/model/vo/VideoAuditExport.java

@@ -0,0 +1,14 @@
+package com.tzld.longarticle.recommend.server.model.vo;
+
+import lombok.Data;
+
+@Data
+public class VideoAuditExport {
+
+    private String dateStr;
+    private Long articleAuditCount;
+    private Long articleAuditPassCount;
+    private Long videoAuditCount;
+    private Long videoAuditPassCount;
+
+}

+ 1 - 1
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/remote/WxAccessTokenRemoteService.java

@@ -50,7 +50,7 @@ public class WxAccessTokenRemoteService {
         return cache.getUnchecked(gzhId);
         return cache.getUnchecked(gzhId);
     }
     }
 
 
-    private String loadAccessToken(String gzhId) {
+    public String loadAccessToken(String gzhId) {
         try {
         try {
 
 
             URIBuilder uriBuilder = new URIBuilder("http://aigc-api.cybertogether.net/aigc/publish/account/getAccessTokenByGhId");
             URIBuilder uriBuilder = new URIBuilder("http://aigc-api.cybertogether.net/aigc/publish/account/getAccessTokenByGhId");

+ 12 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/repository/longArticle/ArticleReMatchRecordRepository.java

@@ -0,0 +1,12 @@
+package com.tzld.longarticle.recommend.server.repository.longArticle;
+
+import com.tzld.longarticle.recommend.server.model.entity.longArticle.ArticleReMatchRecord;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public interface ArticleReMatchRecordRepository extends JpaRepository<ArticleReMatchRecord, Integer> {
+    List<ArticleReMatchRecord> getByContentIdIn(List<String> contentIds);
+}

+ 2 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/repository/longArticle/LongArticleAuditDeleteRepository.java

@@ -11,4 +11,6 @@ public interface LongArticleAuditDeleteRepository extends JpaRepository<LongArti
     List<LongArticleAuditDelete> getByStatus(Integer status);
     List<LongArticleAuditDelete> getByStatus(Integer status);
 
 
     List<LongArticleAuditDelete> getByPublishContentIdIn(List<String> publishContentIds);
     List<LongArticleAuditDelete> getByPublishContentIdIn(List<String> publishContentIds);
+
+    List<LongArticleAuditDelete> getByGhIdAndMsgIdIn(String ghId, List<String> msgIds);
 }
 }

+ 9 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/repository/longArticle/LongArticleCrawlerVideoRepository.java

@@ -12,6 +12,15 @@ public interface LongArticleCrawlerVideoRepository extends JpaRepository<LongArt
 
 
     List<LongArticleCrawlerVideo> getByTraceIdIn(List<String> traceIds);
     List<LongArticleCrawlerVideo> getByTraceIdIn(List<String> traceIds);
 
 
+    List<LongArticleCrawlerVideo> getByContentIdIn(List<String> contentIds);
+
+    List<LongArticleCrawlerVideo> getByContentIdAndIsIllegal(String contentId, Integer isIllegal);
+
     List<LongArticleCrawlerVideo> getByVideoOssPath(String ossPath);
     List<LongArticleCrawlerVideo> getByVideoOssPath(String ossPath);
 
 
+    LongArticleCrawlerVideo getById(Long videoId);
+
+    long countByAuditTimestampBetween(Long start, Long end);
+
+    long countByStatusAndAuditTimestampBetween(Integer status, Long start, Long end);
 }
 }

+ 21 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/repository/longArticle/LongArticleTitleAuditRepository.java

@@ -0,0 +1,21 @@
+package com.tzld.longarticle.recommend.server.repository.longArticle;
+
+import com.tzld.longarticle.recommend.server.model.entity.longArticle.LongArticleTitleAudit;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+@Repository
+public interface LongArticleTitleAuditRepository extends JpaRepository<LongArticleTitleAudit, String> {
+
+    LongArticleTitleAudit getByContentId(String contentId);
+
+    List<LongArticleTitleAudit> getByStatus(Integer status);
+
+    long countByAuditTimestampBetween(Long start, Long end);
+
+    long countByStatusAndAuditTimestampBetween(Integer status, Long start, Long end);
+
+    List<LongArticleTitleAudit> getByContentIdIn(List<String> sourceIds);
+}

+ 2 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/repository/longArticle/LongArticlesMatchVideoRepository.java

@@ -14,4 +14,6 @@ public interface LongArticlesMatchVideoRepository extends JpaRepository<LongArti
     LongArticlesMatchVideo getByTraceId(String traceId);
     LongArticlesMatchVideo getByTraceId(String traceId);
 
 
     List<LongArticlesMatchVideo> getByContentIdIn(List<String> contentIds);
     List<LongArticlesMatchVideo> getByContentIdIn(List<String> contentIds);
+
+    List<LongArticlesMatchVideo> getByContentId(String contentId);
 }
 }

+ 7 - 4
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/XxlJobService.java

@@ -14,6 +14,7 @@ import com.tzld.longarticle.recommend.server.common.enums.recommend.AccountBusin
 import com.tzld.longarticle.recommend.server.common.enums.recommend.ContentPoolEnum;
 import com.tzld.longarticle.recommend.server.common.enums.recommend.ContentPoolEnum;
 import com.tzld.longarticle.recommend.server.common.enums.recommend.FeishuRobotIdEnum;
 import com.tzld.longarticle.recommend.server.common.enums.recommend.FeishuRobotIdEnum;
 import com.tzld.longarticle.recommend.server.mapper.aigc.AigcBaseMapper;
 import com.tzld.longarticle.recommend.server.mapper.aigc.AigcBaseMapper;
+import com.tzld.longarticle.recommend.server.mapper.aigc.PublishContentMapper;
 import com.tzld.longarticle.recommend.server.mapper.crawler.CrawlerBaseMapper;
 import com.tzld.longarticle.recommend.server.mapper.crawler.CrawlerBaseMapper;
 import com.tzld.longarticle.recommend.server.mapper.growth.NewPushMessageCallbackMapper;
 import com.tzld.longarticle.recommend.server.mapper.growth.NewPushMessageCallbackMapper;
 import com.tzld.longarticle.recommend.server.mapper.longArticle.LongArticleBaseMapper;
 import com.tzld.longarticle.recommend.server.mapper.longArticle.LongArticleBaseMapper;
@@ -71,6 +72,8 @@ public class XxlJobService {
     @Autowired
     @Autowired
     private AigcBaseMapper aigcBaseMapper;
     private AigcBaseMapper aigcBaseMapper;
     @Autowired
     @Autowired
+    private PublishContentMapper publishContentMapper;
+    @Autowired
     private CrawlerBaseMapper crawlerBaseMapper;
     private CrawlerBaseMapper crawlerBaseMapper;
     @Autowired
     @Autowired
     private LongArticleBaseMapper longArticleBaseMapper;
     private LongArticleBaseMapper longArticleBaseMapper;
@@ -117,7 +120,7 @@ public class XxlJobService {
     @XxlJob("checkPublishPlan")
     @XxlJob("checkPublishPlan")
     public ReturnT<String> checkPublishPlan(String param) {
     public ReturnT<String> checkPublishPlan(String param) {
         Long todayStart = DateUtils.getTodayStart();
         Long todayStart = DateUtils.getTodayStart();
-        List<NotPublishPlan> notPublishPlan = aigcBaseMapper.getNotPublishPlan(todayStart);
+        List<NotPublishPlan> notPublishPlan = publishContentMapper.getNotPublishPlan(todayStart);
         for (NotPublishPlan publishPlan : notPublishPlan) {
         for (NotPublishPlan publishPlan : notPublishPlan) {
             long now = System.currentTimeMillis();
             long now = System.currentTimeMillis();
             int nowHour = DateUtils.getHourByTimestamp(now / 1000);
             int nowHour = DateUtils.getHourByTimestamp(now / 1000);
@@ -155,7 +158,7 @@ public class XxlJobService {
 
 
     private void sendFeishuPublishPlanNotPushWarn(NotPublishPlan publishPlan) {
     private void sendFeishuPublishPlanNotPushWarn(NotPublishPlan publishPlan) {
         Long todayStart = DateUtils.getTodayStart();
         Long todayStart = DateUtils.getTodayStart();
-        List<PublishAccount> publishAccounts = aigcBaseMapper.getPublishAccounts(publishPlan.getPlanId(), todayStart);
+        List<PublishAccount> publishAccounts = publishContentMapper.getPublishAccounts(publishPlan.getPlanId(), todayStart);
         List<String> accountNames;
         List<String> accountNames;
         if (CollectionUtil.isNotEmpty(publishAccounts)) {
         if (CollectionUtil.isNotEmpty(publishAccounts)) {
             accountNames = publishAccounts.stream().map(PublishAccount::getName).collect(Collectors.toList());
             accountNames = publishAccounts.stream().map(PublishAccount::getName).collect(Collectors.toList());
@@ -196,7 +199,7 @@ public class XxlJobService {
 
 
     @XxlJob("checkPublishPlanAccount")
     @XxlJob("checkPublishPlanAccount")
     public ReturnT<String> checkPublishPlanAccount(String param) {
     public ReturnT<String> checkPublishPlanAccount(String param) {
-        List<PublishPlanAccountNotifyDTO> notifyAccounts = aigcBaseMapper.checkPublishPlanAccount();
+        List<PublishPlanAccountNotifyDTO> notifyAccounts = publishContentMapper.checkPublishPlanAccount();
         Map<String, List<PublishPlanAccountNotifyDTO>> notifyAccountMap = notifyAccounts.stream()
         Map<String, List<PublishPlanAccountNotifyDTO>> notifyAccountMap = notifyAccounts.stream()
                 .collect(Collectors.groupingBy(PublishPlanAccountNotifyDTO::getPlanId));
                 .collect(Collectors.groupingBy(PublishPlanAccountNotifyDTO::getPlanId));
         List<FeishuTableDTO.Column> columns = buildCheckPublishPlanAccountColumns();
         List<FeishuTableDTO.Column> columns = buildCheckPublishPlanAccountColumns();
@@ -540,7 +543,7 @@ public class XxlJobService {
             timeStamp = DateUtils.getStartOfDay(param, "yyyyMMdd");
             timeStamp = DateUtils.getStartOfDay(param, "yyyyMMdd");
         }
         }
         String dateStr = DateUtils.timestampToYMDStr(timeStamp, "yyyy-MM-dd");
         String dateStr = DateUtils.timestampToYMDStr(timeStamp, "yyyy-MM-dd");
-        List<AccountTypeFansDTO> accountList = aigcBaseMapper.getAccountTypeFans();
+        List<AccountTypeFansDTO> accountList = publishContentMapper.getAccountTypeFans();
         List<LongArticlesReadRate> readRateList = longArticlesReadRateRepository.findAll();
         List<LongArticlesReadRate> readRateList = longArticlesReadRateRepository.findAll();
         Map<String, Double> rateDict = readRateList.stream().collect(Collectors.toMap(o -> o.getGhId() + "_" + o.getPosition(),
         Map<String, Double> rateDict = readRateList.stream().collect(Collectors.toMap(o -> o.getGhId() + "_" + o.getPosition(),
                 LongArticlesReadRate::getReadRateAvg));
                 LongArticlesReadRate::getReadRateAvg));

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

@@ -19,6 +19,7 @@ import com.tzld.longarticle.recommend.server.common.enums.recommend.ArticleDelet
 import com.tzld.longarticle.recommend.server.common.enums.recommend.ArticleMatchContentStatusEnum;
 import com.tzld.longarticle.recommend.server.common.enums.recommend.ArticleMatchContentStatusEnum;
 import com.tzld.longarticle.recommend.server.common.enums.recommend.FeishuRobotIdEnum;
 import com.tzld.longarticle.recommend.server.common.enums.recommend.FeishuRobotIdEnum;
 import com.tzld.longarticle.recommend.server.mapper.aigc.AigcBaseMapper;
 import com.tzld.longarticle.recommend.server.mapper.aigc.AigcBaseMapper;
+import com.tzld.longarticle.recommend.server.mapper.aigc.PublishContentMapper;
 import com.tzld.longarticle.recommend.server.mapper.crawler.ArticleMapper;
 import com.tzld.longarticle.recommend.server.mapper.crawler.ArticleMapper;
 import com.tzld.longarticle.recommend.server.mapper.longArticle.LongArticleBaseMapper;
 import com.tzld.longarticle.recommend.server.mapper.longArticle.LongArticleBaseMapper;
 import com.tzld.longarticle.recommend.server.model.cgi.AlgFaceRecognizeResult;
 import com.tzld.longarticle.recommend.server.model.cgi.AlgFaceRecognizeResult;
@@ -81,6 +82,8 @@ public class ArticleAuditService {
     @Autowired
     @Autowired
     private AigcBaseMapper aigcBaseMapper;
     private AigcBaseMapper aigcBaseMapper;
     @Autowired
     @Autowired
+    private PublishContentMapper publishContentMapper;
+    @Autowired
     private PublishAccountRepository publishAccountRepository;
     private PublishAccountRepository publishAccountRepository;
     @Autowired
     @Autowired
     private ArticleRepository articleRepository;
     private ArticleRepository articleRepository;
@@ -347,7 +350,7 @@ public class ArticleAuditService {
         Map<String, LongArticlesMatchVideo> matchVideoMap = matchVideoList.stream()
         Map<String, LongArticlesMatchVideo> matchVideoMap = matchVideoList.stream()
                 .collect(Collectors.toMap(LongArticlesMatchVideo::getTraceId, Function.identity()));
                 .collect(Collectors.toMap(LongArticlesMatchVideo::getTraceId, Function.identity()));
         List<String> traceIds = matchVideoList.stream().map(LongArticlesMatchVideo::getTraceId).collect(Collectors.toList());
         List<String> traceIds = matchVideoList.stream().map(LongArticlesMatchVideo::getTraceId).collect(Collectors.toList());
-        List<PublishContentMiniprogramDTO> publishContentMiniprogramList = aigcBaseMapper.getPublishContentByTraceIdIn(traceIds);
+        List<PublishContentMiniprogramDTO> publishContentMiniprogramList = publishContentMapper.getPublishContentByTraceIdIn(traceIds);
         List<String> publishContentIds = publishContentMiniprogramList.stream()
         List<String> publishContentIds = publishContentMiniprogramList.stream()
                 .map(PublishContentMiniprogramDTO::getPublishContentId).collect(Collectors.toList());
                 .map(PublishContentMiniprogramDTO::getPublishContentId).collect(Collectors.toList());
         Map<String, String> PublishTraceIdMap = publishContentMiniprogramList.stream()
         Map<String, String> PublishTraceIdMap = publishContentMiniprogramList.stream()
@@ -400,7 +403,7 @@ public class ArticleAuditService {
         longArticleBaseMapper.batchInsertArticleReMatchRecord(reMatchRecordList);
         longArticleBaseMapper.batchInsertArticleReMatchRecord(reMatchRecordList);
     }
     }
 
 
-    private void buildArticleAuditDelete(List<String> publishContentIds) {
+    public void buildArticleAuditDelete(List<String> publishContentIds) {
         if (CollectionUtils.isEmpty(publishContentIds)) {
         if (CollectionUtils.isEmpty(publishContentIds)) {
             return;
             return;
         }
         }
@@ -411,7 +414,7 @@ public class ArticleAuditService {
         if (CollectionUtils.isEmpty(publishContentIds)) {
         if (CollectionUtils.isEmpty(publishContentIds)) {
             return;
             return;
         }
         }
-        List<PublishGzhPushContentRelDTO> pushContentRelList = aigcBaseMapper.getPushContentRelByPublishContentIdIn(publishContentIds);
+        List<PublishGzhPushContentRelDTO> pushContentRelList = publishContentMapper.getPushContentRelByPublishContentIdIn(publishContentIds);
         if (CollectionUtils.isEmpty(pushContentRelList)) {
         if (CollectionUtils.isEmpty(pushContentRelList)) {
             return;
             return;
         }
         }
@@ -420,7 +423,7 @@ public class ArticleAuditService {
                 .collect(Collectors.toMap(PublishGzhPushContentRelDTO::getPublishContentId,
                 .collect(Collectors.toMap(PublishGzhPushContentRelDTO::getPublishContentId,
                         PublishGzhPushContentRelDTO::getPushId,
                         PublishGzhPushContentRelDTO::getPushId,
                         (o1, o2) -> o2));
                         (o1, o2) -> o2));
-        List<PublishGzhPushDTO> pushList = aigcBaseMapper.getPushByPushIdIn(pushIds);
+        List<PublishGzhPushDTO> pushList = publishContentMapper.getPushByPushIdIn(pushIds);
         Map<String, PublishGzhPushDTO> pushDTOMap = pushList.stream()
         Map<String, PublishGzhPushDTO> pushDTOMap = pushList.stream()
                 .collect(Collectors.toMap(PublishGzhPushDTO::getPushId, Function.identity()));
                 .collect(Collectors.toMap(PublishGzhPushDTO::getPushId, Function.identity()));
         Map<String, String> pushIdMap = pushList.stream().filter(o -> StringUtils.hasText(o.getGroupPushMsgId()))
         Map<String, String> pushIdMap = pushList.stream().filter(o -> StringUtils.hasText(o.getGroupPushMsgId()))
@@ -432,10 +435,10 @@ public class ArticleAuditService {
         List<String> ghIds = publishAccountList.stream().map(PublishAccount::getGhId).collect(Collectors.toList());
         List<String> ghIds = publishAccountList.stream().map(PublishAccount::getGhId).collect(Collectors.toList());
         Map<String, String> publishAccountMap = publishAccountList.stream()
         Map<String, String> publishAccountMap = publishAccountList.stream()
                 .collect(Collectors.toMap(PublishAccount::getId, PublishAccount::getGhId));
                 .collect(Collectors.toMap(PublishAccount::getId, PublishAccount::getGhId));
-        List<PublishGzhPushContentRelDTO> groupPushRelList = aigcBaseMapper.getGroupPushRelByPushIdIn(pushIds);
+        List<PublishGzhPushContentRelDTO> groupPushRelList = publishContentMapper.getGroupPushRelByPushIdIn(pushIds);
         Map<String, List<PublishGzhPushContentRelDTO>> groupPushRelMap = groupPushRelList.stream()
         Map<String, List<PublishGzhPushContentRelDTO>> groupPushRelMap = groupPushRelList.stream()
                 .collect(Collectors.groupingBy(PublishGzhPushContentRelDTO::getPushId));
                 .collect(Collectors.groupingBy(PublishGzhPushContentRelDTO::getPushId));
-        List<PublishAccountTypeDTO> accountTypeList = aigcBaseMapper.getAccountTypeList(ghIds);
+        List<PublishAccountTypeDTO> accountTypeList = publishContentMapper.getAccountTypeList(ghIds);
         Map<String, PublishAccountTypeDTO> accountTypeMap = accountTypeList.stream()
         Map<String, PublishAccountTypeDTO> accountTypeMap = accountTypeList.stream()
                 .collect(Collectors.toMap(PublishAccountTypeDTO::getGhId, Function.identity()));
                 .collect(Collectors.toMap(PublishAccountTypeDTO::getGhId, Function.identity()));
         // 删除文章
         // 删除文章
@@ -505,7 +508,7 @@ public class ArticleAuditService {
     public ReturnT<String> articleVideoDelete(String param) {
     public ReturnT<String> articleVideoDelete(String param) {
         List<LongArticleAuditDelete> dealList = longArticleAuditDeleteRepository.getByStatus(ArticleDeleteStatusEnum.WAITING.getCode());
         List<LongArticleAuditDelete> dealList = longArticleAuditDeleteRepository.getByStatus(ArticleDeleteStatusEnum.WAITING.getCode());
         List<String> ghIds = dealList.stream().map(LongArticleAuditDelete::getGhId).collect(Collectors.toList());
         List<String> ghIds = dealList.stream().map(LongArticleAuditDelete::getGhId).collect(Collectors.toList());
-        List<PublishAccountTypeDTO> accountTypeList = aigcBaseMapper.getAccountTypeList(ghIds);
+        List<PublishAccountTypeDTO> accountTypeList = publishContentMapper.getAccountTypeList(ghIds);
         Map<String, PublishAccountTypeDTO> accountTypeMap = accountTypeList.stream()
         Map<String, PublishAccountTypeDTO> accountTypeMap = accountTypeList.stream()
                 .collect(Collectors.toMap(PublishAccountTypeDTO::getGhId, Function.identity()));
                 .collect(Collectors.toMap(PublishAccountTypeDTO::getGhId, Function.identity()));
         List<JSONObject> alarmList =  Collections.synchronizedList(new ArrayList<>());
         List<JSONObject> alarmList =  Collections.synchronizedList(new ArrayList<>());
@@ -521,25 +524,77 @@ public class ArticleAuditService {
                     // 获取token
                     // 获取token
                     String token = wxAccessTokenRemoteService.getAccessToken(entry.getKey());
                     String token = wxAccessTokenRemoteService.getAccessToken(entry.getKey());
                     List<LongArticleAuditDelete> list = entry.getValue();
                     List<LongArticleAuditDelete> list = entry.getValue();
-                    for (LongArticleAuditDelete delete : list) {
-                        try {
-                            if (Objects.equals(delete.getPushType(), PushTypeEnum.AUTO_GROUP_PUBLISH.getVal())) {
-                                // 删除文章
-                                RequestResult<String> result = wxArticleDeleteService.deleteArticle(token, delete.getMsgId(), delete.getIndex());
+                    Map<String, List<LongArticleAuditDelete>> msgIdMap = list.stream()
+                            .collect(Collectors.groupingBy(LongArticleAuditDelete::getMsgId));
+                    List<String> msgIds = new ArrayList<>(msgIdMap.keySet());
+                    List<LongArticleAuditDelete> accountAllDeleteList = longArticleAuditDeleteRepository.getByGhIdAndMsgIdIn(entry.getKey(), msgIds);
+                    Map<String, List<LongArticleAuditDelete>> accountAllDeleteMap = accountAllDeleteList.stream()
+                           .collect(Collectors.groupingBy(LongArticleAuditDelete::getMsgId));
+                    for (Map.Entry<String, List<LongArticleAuditDelete>> msgIdEntry : msgIdMap.entrySet()) {
+                        String msgId = msgIdEntry.getKey();
+                        List<LongArticleAuditDelete> msgIdList = msgIdEntry.getValue();
+                        Integer pushType = msgIdList.get(0).getPushType();
+                        List<LongArticleAuditDelete> msgIdDeleteList = accountAllDeleteMap.get(msgId);
+                        List<LongArticleAuditDelete> deleteAllCount = msgIdDeleteList.stream()
+                                .filter(o -> Objects.equals(o.getStatus(), ArticleDeleteStatusEnum.SUCCESS.getCode()))
+                                .filter(o -> o.getDeleteAll() == 1)
+                                .collect(Collectors.toList());
+                        int count = msgIdDeleteList.size();
+                        int status;
+                        String errMsg;
+                        // 执行过全部删除,则自动置为历史状态
+                        if (!deleteAllCount.isEmpty()) {
+                            LongArticleAuditDelete statusDelete = deleteAllCount.get(0);
+                            msgIdList.forEach(delete -> {
+                                delete.setStatus(statusDelete.getStatus());
+                                delete.setFailReason(statusDelete.getFailReason());
+                                delete.setFinishTimestamp(System.currentTimeMillis());
+                                longArticleAuditDeleteRepository.save(delete);
+                            });
+                            continue;
+                        }
+                        if (Objects.equals(pushType, PushTypeEnum.AUTO_GROUP_PUBLISH.getVal())) {
+                            // 删除文章
+                            if (count > 1) {
+                                RequestResult<String> result = wxArticleDeleteService.deleteArticle(token, msgId, 0);
                                 if (result.isSuccess()) {
                                 if (result.isSuccess()) {
-                                    delete.setStatus(ArticleDeleteStatusEnum.SUCCESS.getCode());
+                                    errMsg = null;
+                                    status = ArticleDeleteStatusEnum.SUCCESS.getCode();
                                 } else {
                                 } else {
-                                    delete.setStatus(ArticleDeleteStatusEnum.FAIL.getCode());
-                                    delete.setFailReason(result.getFailReason());
+                                    status = ArticleDeleteStatusEnum.FAIL.getCode();
+                                    errMsg = result.getFailReason();
                                 }
                                 }
+                                msgIdList.forEach(delete -> {
+                                    delete.setStatus(status);
+                                    delete.setFailReason(errMsg);
+                                    delete.setDeleteAll(1);
+                                    delete.setFinishTimestamp(System.currentTimeMillis());
+                                    longArticleAuditDeleteRepository.save(delete);
+                                });
                             } else {
                             } else {
+                                LongArticleAuditDelete delete = msgIdList.get(0);
+                                try {
+                                    RequestResult<String> result = wxArticleDeleteService.deleteArticle(token,
+                                            delete.getMsgId(), delete.getIndex());
+                                    if (result.isSuccess()) {
+                                        delete.setStatus(ArticleDeleteStatusEnum.SUCCESS.getCode());
+                                    } else {
+                                        delete.setStatus(ArticleDeleteStatusEnum.FAIL.getCode());
+                                        delete.setFailReason(result.getFailReason());
+                                    }
+                                    delete.setFinishTimestamp(System.currentTimeMillis());
+                                    longArticleAuditDeleteRepository.save(delete);
+                                } catch (Exception e) {
+                                    log.error("articleVideoDelete ghId:{} error", delete.getGhId(), e);
+                                }
+                            }
+                        } else {
+                            msgIdList.forEach(delete -> {
                                 deleteFailAlarmAdd(alarmList, delete.getPublishContentId(), "非自动群发", delete.getIndex());
                                 deleteFailAlarmAdd(alarmList, delete.getPublishContentId(), "非自动群发", delete.getIndex());
                                 delete.setStatus(ArticleDeleteStatusEnum.SUCCESS.getCode());
                                 delete.setStatus(ArticleDeleteStatusEnum.SUCCESS.getCode());
-                            }
-                            delete.setFinishTimestamp(System.currentTimeMillis());
-                            longArticleAuditDeleteRepository.save(delete);
-                        } catch (Exception e) {
-                            log.error("articleVideoDelete ghId:{} error", delete.getGhId(), e);
+                                delete.setFinishTimestamp(System.currentTimeMillis());
+                                longArticleAuditDeleteRepository.save(delete);
+                            });
                         }
                         }
                     }
                     }
                 } finally {
                 } finally {
@@ -561,7 +616,7 @@ public class ArticleAuditService {
         if (CollectionUtils.isEmpty(publishContentIds)) {
         if (CollectionUtils.isEmpty(publishContentIds)) {
             return;
             return;
         }
         }
-        List<PublishContentDTO> publishContents = aigcBaseMapper.getPublishContentByIdIn(publishContentIds);
+        List<PublishContentDTO> publishContents = publishContentMapper.getPublishContentByIdIn(publishContentIds);
         Map<String, PublishContentDTO> publishContentMap = publishContents.stream()
         Map<String, PublishContentDTO> publishContentMap = publishContents.stream()
                 .collect(Collectors.toMap(PublishContentDTO::getId, Function.identity()));
                 .collect(Collectors.toMap(PublishContentDTO::getId, Function.identity()));
         List<String> publishAccountIds = publishContents.stream().map(PublishContentDTO::getPublishAccountId)
         List<String> publishAccountIds = publishContents.stream().map(PublishContentDTO::getPublishAccountId)
@@ -641,7 +696,7 @@ public class ArticleAuditService {
         }).collect(Collectors.toList());
         }).collect(Collectors.toList());
         List<PublishContentDTO> publishContents = new ArrayList<>();
         List<PublishContentDTO> publishContents = new ArrayList<>();
         for (List<PublishContentParam> partitions : Lists.partition(publishContentParamList, 100)) {
         for (List<PublishContentParam> partitions : Lists.partition(publishContentParamList, 100)) {
-            publishContents.addAll(aigcBaseMapper.getPublishContentByTitle(partitions));
+            publishContents.addAll(publishContentMapper.getPublishContentByTitle(partitions));
         }
         }
         if (CollectionUtils.isEmpty(publishContents)) {
         if (CollectionUtils.isEmpty(publishContents)) {
             return;
             return;
@@ -657,7 +712,7 @@ public class ArticleAuditService {
         }
         }
         // 查找该生成内容下所有已发布内容
         // 查找该生成内容下所有已发布内容
         List<String> sourceIds = publishContents.stream().map(PublishContentDTO::getSourceId).distinct().collect(Collectors.toList());
         List<String> sourceIds = publishContents.stream().map(PublishContentDTO::getSourceId).distinct().collect(Collectors.toList());
-        publishContents = aigcBaseMapper.getPublishContentBySourceIdIn(sourceIds);
+        publishContents = publishContentMapper.getPublishContentBySourceIdIn(sourceIds);
 
 
         // 根据已发布文章查找推送id 并删除
         // 根据已发布文章查找推送id 并删除
         List<String> publishContentIds = publishContents.stream().map(PublishContentDTO::getId).collect(Collectors.toList());
         List<String> publishContentIds = publishContents.stream().map(PublishContentDTO::getId).collect(Collectors.toList());
@@ -693,7 +748,7 @@ public class ArticleAuditService {
             return;
             return;
         }
         }
         List<String> ghIds = list.stream().map(ArticleDeleteListVO::getGhId).distinct().collect(Collectors.toList());
         List<String> ghIds = list.stream().map(ArticleDeleteListVO::getGhId).distinct().collect(Collectors.toList());
-        List<PublishAccountTypeDTO> accountTypeList = aigcBaseMapper.getAccountTypeList(ghIds);
+        List<PublishAccountTypeDTO> accountTypeList = publishContentMapper.getAccountTypeList(ghIds);
         Map<String, PublishAccountTypeDTO> accountTypeMap = accountTypeList.stream()
         Map<String, PublishAccountTypeDTO> accountTypeMap = accountTypeList.stream()
                 .collect(Collectors.toMap(PublishAccountTypeDTO::getGhId, Function.identity()));
                 .collect(Collectors.toMap(PublishAccountTypeDTO::getGhId, Function.identity()));
 //        List<PublishAccount> publishAccountList = publishAccountRepository.getAllByGhIdIn(ghIds);
 //        List<PublishAccount> publishAccountList = publishAccountRepository.getAllByGhIdIn(ghIds);
@@ -774,7 +829,7 @@ public class ArticleAuditService {
         Integer pageSize = 100;
         Integer pageSize = 100;
         while (true) {
         while (true) {
             Integer offset = (pageNum - 1) * pageSize;
             Integer offset = (pageNum - 1) * pageSize;
-            List<String> publishContentIds = aigcBaseMapper.getOnlyMiniprogramArticle(offset, pageSize);
+            List<String> publishContentIds = publishContentMapper.getOnlyMiniprogramArticle(offset, pageSize);
             if (CollectionUtils.isEmpty(publishContentIds)) {
             if (CollectionUtils.isEmpty(publishContentIds)) {
                 break;
                 break;
             }
             }

+ 11 - 8
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/ArticleService.java

@@ -6,6 +6,7 @@ import com.tzld.longarticle.recommend.server.common.enums.StatusEnum;
 import com.tzld.longarticle.recommend.server.common.enums.aigc.PublishContentTypeEnum;
 import com.tzld.longarticle.recommend.server.common.enums.aigc.PublishContentTypeEnum;
 import com.tzld.longarticle.recommend.server.common.enums.recommend.ArticlePoolPromotionSourceStatusEnum;
 import com.tzld.longarticle.recommend.server.common.enums.recommend.ArticlePoolPromotionSourceStatusEnum;
 import com.tzld.longarticle.recommend.server.mapper.aigc.AigcBaseMapper;
 import com.tzld.longarticle.recommend.server.mapper.aigc.AigcBaseMapper;
+import com.tzld.longarticle.recommend.server.mapper.aigc.PublishContentMapper;
 import com.tzld.longarticle.recommend.server.mapper.crawler.ArticleMapper;
 import com.tzld.longarticle.recommend.server.mapper.crawler.ArticleMapper;
 import com.tzld.longarticle.recommend.server.mapper.crawler.CrawlerBaseMapper;
 import com.tzld.longarticle.recommend.server.mapper.crawler.CrawlerBaseMapper;
 import com.tzld.longarticle.recommend.server.mapper.longArticle.LongArticleBaseMapper;
 import com.tzld.longarticle.recommend.server.mapper.longArticle.LongArticleBaseMapper;
@@ -53,6 +54,8 @@ public class ArticleService {
     @Autowired
     @Autowired
     AigcBaseMapper aigcBaseMapper;
     AigcBaseMapper aigcBaseMapper;
     @Autowired
     @Autowired
+    PublishContentMapper publishContentMapper;
+    @Autowired
     CrawlerBaseMapper crawlerBaseMapper;
     CrawlerBaseMapper crawlerBaseMapper;
     @Autowired
     @Autowired
     ArticleMapper articleMapper;
     ArticleMapper articleMapper;
@@ -111,7 +114,7 @@ public class ArticleService {
         String title = article.getTitle();
         String title = article.getTitle();
         Long publishTimestamp = article.getPublishTimestamp() * 1000;
         Long publishTimestamp = article.getPublishTimestamp() * 1000;
         PublishAccount publishAccount = publishAccountRepository.getByGhId(ghId);
         PublishAccount publishAccount = publishAccountRepository.getByGhId(ghId);
-        List<PublishContent> publishContentList = aigcBaseMapper.getNearestPublishContent(publishAccount.getId(), publishTimestamp, 100);
+        List<PublishContent> publishContentList = publishContentMapper.getNearestPublishContent(publishAccount.getId(), publishTimestamp, 100);
         if (CollectionUtils.isEmpty(publishContentList)) {
         if (CollectionUtils.isEmpty(publishContentList)) {
             return;
             return;
         }
         }
@@ -123,7 +126,7 @@ public class ArticleService {
             publishContentId = publishContent.getId();
             publishContentId = publishContent.getId();
             channelContentId = publishContent.getCrawlerChannelContentId();
             channelContentId = publishContent.getCrawlerChannelContentId();
         } else {
         } else {
-            publishContentList = aigcBaseMapper.getLateNearestPublishContent(publishAccount.getId(), publishTimestamp);
+            publishContentList = publishContentMapper.getLateNearestPublishContent(publishAccount.getId(), publishTimestamp);
             publishContent = findPublishContent(publishContentList, article.getTitle(), publishTimestamp);
             publishContent = findPublishContent(publishContentList, article.getTitle(), publishTimestamp);
             if (Objects.nonNull(publishContent)) {
             if (Objects.nonNull(publishContent)) {
                 publishContentId = publishContent.getId();
                 publishContentId = publishContent.getId();
@@ -229,7 +232,7 @@ public class ArticleService {
         }
         }
         String title = crawlerContent.getTitle();
         String title = crawlerContent.getTitle();
         Long publishTimestamp = crawlerContent.getPublishTimestamp();
         Long publishTimestamp = crawlerContent.getPublishTimestamp();
-        List<PublishContent> publishContentList = aigcBaseMapper.getNearestPublishContent(publishAccount.getId(), publishTimestamp, 100);
+        List<PublishContent> publishContentList = publishContentMapper.getNearestPublishContent(publishAccount.getId(), publishTimestamp, 100);
         if (CollectionUtils.isEmpty(publishContentList)) {
         if (CollectionUtils.isEmpty(publishContentList)) {
             return result;
             return result;
         }
         }
@@ -242,7 +245,7 @@ public class ArticleService {
             result.setRootProduceContentId(publishContent.getSourceId());
             result.setRootProduceContentId(publishContent.getSourceId());
             channelContentId = publishContent.getCrawlerChannelContentId();
             channelContentId = publishContent.getCrawlerChannelContentId();
         } else {
         } else {
-            publishContentList = aigcBaseMapper.getLateNearestPublishContent(publishAccount.getId(), publishTimestamp);
+            publishContentList = publishContentMapper.getLateNearestPublishContent(publishAccount.getId(), publishTimestamp);
             publishContent = findPublishContent(publishContentList, title, publishTimestamp);
             publishContent = findPublishContent(publishContentList, title, publishTimestamp);
             if (Objects.nonNull(publishContent)) {
             if (Objects.nonNull(publishContent)) {
                 if (!StringUtils.hasText(sourcePublishContentId)) {
                 if (!StringUtils.hasText(sourcePublishContentId)) {
@@ -295,10 +298,10 @@ public class ArticleService {
                     continue;
                     continue;
                 }
                 }
                 long publishTimestamp = article.getPublishTimestamp() > 0 ? article.getPublishTimestamp() * 1000 : article.getUpdateTime() * 1000;
                 long publishTimestamp = article.getPublishTimestamp() > 0 ? article.getPublishTimestamp() * 1000 : article.getUpdateTime() * 1000;
-                List<PublishContent> publishContentList = aigcBaseMapper.getNearestPublishContent(publishAccount.getId(), publishTimestamp, 100);
+                List<PublishContent> publishContentList = publishContentMapper.getNearestPublishContent(publishAccount.getId(), publishTimestamp, 100);
                 PublishContent publishContent = findPublishContent(publishContentList, task.getTitle(), publishTimestamp);
                 PublishContent publishContent = findPublishContent(publishContentList, task.getTitle(), publishTimestamp);
                 if (Objects.isNull(publishContent)) {
                 if (Objects.isNull(publishContent)) {
-                    publishContentList = aigcBaseMapper.getLateNearestPublishContent(publishAccount.getId(), publishTimestamp);
+                    publishContentList = publishContentMapper.getLateNearestPublishContent(publishAccount.getId(), publishTimestamp);
                     publishContent = findPublishContent(publishContentList, task.getTitle(), publishTimestamp);
                     publishContent = findPublishContent(publishContentList, task.getTitle(), publishTimestamp);
                     if (Objects.isNull(publishContent)) {
                     if (Objects.isNull(publishContent)) {
                         task.setDeleted(StatusEnum.ONE.getCode());
                         task.setDeleted(StatusEnum.ONE.getCode());
@@ -354,12 +357,12 @@ public class ArticleService {
             return null;
             return null;
         }
         }
         long publishTimestamp = article.getPublishTimestamp() > 0 ? article.getPublishTimestamp() * 1000 : article.getUpdateTime() * 1000;
         long publishTimestamp = article.getPublishTimestamp() > 0 ? article.getPublishTimestamp() * 1000 : article.getUpdateTime() * 1000;
-        List<PublishContent> publishContentList = aigcBaseMapper.getNearestPublishContent(publishAccount.getId(), publishTimestamp, 100);
+        List<PublishContent> publishContentList = publishContentMapper.getNearestPublishContent(publishAccount.getId(), publishTimestamp, 100);
         PublishContent publishContent = findPublishContent(publishContentList, article.getTitle(), publishTimestamp);
         PublishContent publishContent = findPublishContent(publishContentList, article.getTitle(), publishTimestamp);
         if (Objects.nonNull(publishContent)) {
         if (Objects.nonNull(publishContent)) {
             return publishContent.getId();
             return publishContent.getId();
         } else {
         } else {
-            publishContentList = aigcBaseMapper.getLateNearestPublishContent(publishAccount.getId(), publishTimestamp);
+            publishContentList = publishContentMapper.getLateNearestPublishContent(publishAccount.getId(), publishTimestamp);
             publishContent = findPublishContent(publishContentList, article.getTitle(), publishTimestamp);
             publishContent = findPublishContent(publishContentList, article.getTitle(), publishTimestamp);
             if (Objects.nonNull(publishContent)) {
             if (Objects.nonNull(publishContent)) {
                 return publishContent.getId();
                 return publishContent.getId();

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

@@ -0,0 +1,226 @@
+package com.tzld.longarticle.recommend.server.service.recommend;
+
+import com.alibaba.fastjson.JSONArray;
+import com.tzld.longarticle.recommend.server.common.enums.aigc.PublishContentStatusEnum;
+import com.tzld.longarticle.recommend.server.common.enums.longArticle.ArticleVideoAuditStatusEnum;
+import com.tzld.longarticle.recommend.server.mapper.aigc.PublishContentMapper;
+import com.tzld.longarticle.recommend.server.mapper.longArticle.ArticleAuditMapper;
+import com.tzld.longarticle.recommend.server.model.dto.PublishContentMiniprogramDTO;
+import com.tzld.longarticle.recommend.server.model.entity.longArticle.ArticleReMatchRecord;
+import com.tzld.longarticle.recommend.server.model.entity.longArticle.LongArticleCrawlerVideo;
+import com.tzld.longarticle.recommend.server.model.entity.longArticle.LongArticleTitleAudit;
+import com.tzld.longarticle.recommend.server.model.entity.longArticle.LongArticlesMatchVideo;
+import com.tzld.longarticle.recommend.server.model.param.videoAudit.*;
+import com.tzld.longarticle.recommend.server.model.vo.ArticleVideoAuditListVO;
+import com.tzld.longarticle.recommend.server.repository.longArticle.*;
+import com.tzld.longarticle.recommend.server.util.page.Page;
+import com.xxl.job.core.biz.model.ReturnT;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections4.CollectionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
+
+import java.util.*;
+import java.util.stream.Collectors;
+
+@Service
+@Slf4j
+public class ArticleVideoAuditService {
+
+    @Autowired
+    private ArticleAuditMapper articleAuditMapper;
+    @Autowired
+    private PublishContentMapper publishContentMapper;
+    @Autowired
+    private ArticleReMatchRecordRepository articleReMatchRecordRepository;
+    @Autowired
+    private LongArticleCrawlerVideoRepository crawlerVideoRepository;
+    @Autowired
+    private LongArticleTitleAuditRepository titleAuditRepository;
+    @Autowired
+    private LongArticlesMatchVideoRepository articlesMatchVideoRepository;
+    @Autowired
+    private ArticleAuditService articleAuditService;
+
+    @Value("${cdnUrl:https://rescdn.piaoquantv.com/}")
+    private String cdnUrl;
+
+    public Page<ArticleVideoAuditListVO> list(ArticleVideoAuditListParam param) {
+        int offset = (param.getPageNum() - 1) * param.getPageSize();
+        int count = articleAuditMapper.articleVideoAuditListCount(param.getContentId(), param.getStatus(),
+                param.getTitle(), param.getAuditAccount());
+        List<ArticleVideoAuditListVO> list = articleAuditMapper.articleVideoAuditList(param.getContentId(),
+                param.getStatus(), param.getTitle(), param.getAuditAccount(), offset, param.getPageSize());
+        buildArticleVideoAuditListVO(list);
+        Page<ArticleVideoAuditListVO> page = new Page<>(param.getPageNum(), param.getPageSize());
+        page.setTotalSize(count);
+        page.setObjs(list);
+        return page;
+    }
+
+    private void buildArticleVideoAuditListVO(List<ArticleVideoAuditListVO> list) {
+        if (CollectionUtils.isEmpty(list)) {
+            return;
+        }
+        List<String> contentIds = list.stream().map(ArticleVideoAuditListVO::getContentId).collect(Collectors.toList());
+        List<LongArticleCrawlerVideo> videoList = crawlerVideoRepository.getByContentIdIn(contentIds);
+        Map<String, List<LongArticleCrawlerVideo>> videoMap = videoList.stream()
+                .filter(o -> o.getDownloadStatus() == 2)
+                .collect(Collectors.groupingBy(LongArticleCrawlerVideo::getContentId));
+        for (ArticleVideoAuditListVO item : list) {
+            List<LongArticleCrawlerVideo> videos = videoMap.get(item.getContentId());
+            if (CollectionUtils.isEmpty(videos)) {
+                continue;
+            }
+            List<ArticleVideoAuditListVO.VideoItem> videoItems = videos.stream().map(video -> {
+                ArticleVideoAuditListVO.VideoItem videoItem = new ArticleVideoAuditListVO.VideoItem();
+                videoItem.setVideoId(video.getId());
+                videoItem.setTitle(item.getKimiTitle());
+                videoItem.setVideoUrl(cdnUrl + video.getVideoOssPath());
+                if (StringUtils.hasText(video.getCoverOssPath())) {
+                    videoItem.setCoverUrl(cdnUrl + video.getCoverOssPath());
+                } else {
+                    videoItem.setCoverUrl(video.getCoverUrl());
+                }
+                videoItem.setStatus(video.getStatus());
+                videoItem.setAuditAccount(video.getAuditAccount());
+                videoItem.setAuditTimestamp(video.getAuditTimestamp());
+                return videoItem;
+            }).collect(Collectors.toList());
+            item.setVideoList(videoItems);
+            item.setVideoCount(videoItems.size());
+            item.setWaitingAuditVideoCount((int) videoItems.stream().filter(o -> o.getStatus() == 0).count());
+        }
+    }
+
+    public void auditArticle(ArticleAuditParam param) {
+        LongArticleTitleAudit titleAudit = titleAuditRepository.getByContentId(param.getContentId());
+        Long now = System.currentTimeMillis();
+        titleAudit.setStatus(param.getStatus());
+        titleAudit.setAuditAccount(param.getAuditAccount());
+        titleAudit.setAuditTimestamp(now);
+        titleAuditRepository.save(titleAudit);
+        if (param.getStatus() == 2) {
+            // 审核不通过
+            auditArticleReject(titleAudit);
+        } else {
+            // 审核通过
+            auditArticlePass(titleAudit);
+        }
+
+    }
+
+    private void auditArticlePass(LongArticleTitleAudit titleAudit) {
+        // publish_content
+        publishContentMapper.updatePublishContentStatus(titleAudit.getContentId(),
+                PublishContentStatusEnum.waiting_publish.getVal(),
+                PublishContentStatusEnum.gzh_article_deprecated.getVal());
+    }
+
+    private void auditArticleReject(LongArticleTitleAudit titleAudit) {
+        // reMatch 暂时取消
+//        List<LongArticleCrawlerVideo> videoList = crawlerVideoRepository.getByContentIdAndIsIllegal(titleAudit.getContentId(), 1);
+//        if (CollectionUtils.isNotEmpty(videoList)) {
+//            for (LongArticleCrawlerVideo video : videoList) {
+//                ArticleReMatchRecord reMatchRecord = new ArticleReMatchRecord();
+//                reMatchRecord.setContentId(titleAudit.getContentId());
+//                reMatchRecord.setOssPath(video.getVideoOssPath());
+//                reMatchRecord.setStatus(0);
+//                reMatchRecord.setCreateTimestamp(System.currentTimeMillis() / 1000);
+//                articleReMatchRecordRepository.save(reMatchRecord);
+//            }
+//        }
+        // publish_content
+        publishContentMapper.updatePublishContentStatus(titleAudit.getContentId(),
+                PublishContentStatusEnum.gzh_article_deprecated.getVal(),
+                PublishContentStatusEnum.waiting_publish.getVal());
+    }
+
+    public void auditVideo(VideoAuditParam param) {
+        LongArticleCrawlerVideo video = crawlerVideoRepository.getById(param.getVideoId());
+        Long now = System.currentTimeMillis();
+        video.setStatus(param.getStatus());
+        video.setAuditAccount(param.getAuditAccount());
+        video.setAuditTimestamp(now);
+        if (param.getStatus() == 2) {
+            video.setIsIllegal(1);
+            // 审核不通过
+            auditVideoReject(video);
+        } else {
+            video.setIsIllegal(0);
+        }
+        crawlerVideoRepository.save(video);
+    }
+
+    private void auditVideoReject(LongArticleCrawlerVideo video) {
+        // 已发布文章删除
+        List<LongArticlesMatchVideo> matchVideos = articlesMatchVideoRepository.getByContentId(video.getContentId());
+        List<String> traceIds = new ArrayList<>();
+        if (CollectionUtils.isNotEmpty(matchVideos)) {
+            for (LongArticlesMatchVideo matchVideo : matchVideos) {
+                // 发布位置为头条
+                List<String> results = JSONArray.parseArray(matchVideo.getResponse(), String.class);
+                if (CollectionUtils.isNotEmpty(results) && results.get(0).contains(video.getVideoOssPath())) {
+                    traceIds.add(matchVideo.getTraceId());
+                }
+            }
+        }
+        if (CollectionUtils.isEmpty(traceIds)) {
+            return;
+        }
+        List<PublishContentMiniprogramDTO> publishContents = publishContentMapper.getPublishContentByTraceIdIn(traceIds);
+        List<String> publishContentIds = publishContents.stream().map(PublishContentMiniprogramDTO::getPublishContentId)
+                .collect(Collectors.toList());
+        articleAuditService.buildArticleAuditDelete(publishContentIds);
+    }
+
+    public List<String> getFilterValue(AuditFilterParam param) {
+        return articleAuditMapper.searchFilterValueByItemName(param.getItemName(), param.getSearchKeyword());
+    }
+
+    @XxlJob("rematchVideoAudit")
+    public ReturnT<String> rematchVideoAudit(String param) {
+        List<LongArticleTitleAudit> rejectList = titleAuditRepository.getByStatus(ArticleVideoAuditStatusEnum.REJECT.getCode());
+        if (CollectionUtils.isEmpty(rejectList)) {
+            return ReturnT.SUCCESS;
+        }
+        List<String> contentIds = rejectList.stream().map(LongArticleTitleAudit::getContentId).collect(Collectors.toList());
+        List<ArticleReMatchRecord> reMatchRecordList = articleReMatchRecordRepository.getByContentIdIn(contentIds);
+        if (CollectionUtils.isEmpty(reMatchRecordList)) {
+            return ReturnT.SUCCESS;
+        }
+        Map<String, List<ArticleReMatchRecord>> reMatchRecordMap = reMatchRecordList.stream()
+                .collect(Collectors.groupingBy(ArticleReMatchRecord::getContentId));
+        for (LongArticleTitleAudit audit : rejectList) {
+            List<ArticleReMatchRecord> records = reMatchRecordMap.get(audit.getContentId());
+            if (CollectionUtils.isEmpty(records)) {
+                continue;
+            }
+            records = records.stream().filter(o -> Objects.isNull(o.getTraceId())).collect(Collectors.toList());
+            if (CollectionUtils.isEmpty(records)) {
+                continue;
+            }
+            List<ArticleReMatchRecord> failList = records.stream()
+                    .filter(o -> o.getStatus().equals(2) || o.getStatus().equals(0)).collect(Collectors.toList());
+            if (CollectionUtils.isNotEmpty(failList)) {
+                continue;
+            }
+            audit.setStatus(ArticleVideoAuditStatusEnum.WAITING.getCode());
+            titleAuditRepository.save(audit);
+        }
+        return ReturnT.SUCCESS;
+    }
+
+    public void updateArticleTitle(ArticleTitleUpdateParam param) {
+        long now = System.currentTimeMillis();
+        articleAuditMapper.updateArticleTitle(param, now);
+    }
+
+    public void updateVideoTitle(VideoTitleUpdateParam param) {
+        long now = System.currentTimeMillis();
+        articleAuditMapper.updateVideoTitle(param, now);
+    }
+}

+ 75 - 7
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/DataDashboardService.java

@@ -13,6 +13,7 @@ import com.tzld.longarticle.recommend.server.common.enums.recommend.ArticleTypeE
 import com.tzld.longarticle.recommend.server.common.enums.recommend.ContentPoolEnum;
 import com.tzld.longarticle.recommend.server.common.enums.recommend.ContentPoolEnum;
 import com.tzld.longarticle.recommend.server.common.enums.recommend.RankStrategyEnum;
 import com.tzld.longarticle.recommend.server.common.enums.recommend.RankStrategyEnum;
 import com.tzld.longarticle.recommend.server.mapper.aigc.AigcBaseMapper;
 import com.tzld.longarticle.recommend.server.mapper.aigc.AigcBaseMapper;
+import com.tzld.longarticle.recommend.server.mapper.aigc.PublishContentMapper;
 import com.tzld.longarticle.recommend.server.mapper.longArticle.LongArticleBaseMapper;
 import com.tzld.longarticle.recommend.server.mapper.longArticle.LongArticleBaseMapper;
 import com.tzld.longarticle.recommend.server.model.dto.ProduceContentDTO;
 import com.tzld.longarticle.recommend.server.model.dto.ProduceContentDTO;
 import com.tzld.longarticle.recommend.server.model.dto.ProducePlanAuditCheckDTO;
 import com.tzld.longarticle.recommend.server.model.dto.ProducePlanAuditCheckDTO;
@@ -34,9 +35,7 @@ import com.tzld.longarticle.recommend.server.repository.crawler.AccountAvgInfoRe
 import com.tzld.longarticle.recommend.server.repository.crawler.ArticleDetailInfoRepository;
 import com.tzld.longarticle.recommend.server.repository.crawler.ArticleDetailInfoRepository;
 import com.tzld.longarticle.recommend.server.repository.crawler.ArticleRepository;
 import com.tzld.longarticle.recommend.server.repository.crawler.ArticleRepository;
 import com.tzld.longarticle.recommend.server.repository.crawler.PublishSortLogRepository;
 import com.tzld.longarticle.recommend.server.repository.crawler.PublishSortLogRepository;
-import com.tzld.longarticle.recommend.server.repository.longArticle.ArticleCategoryRepository;
-import com.tzld.longarticle.recommend.server.repository.longArticle.ArticlePoolPromotionSourceRepository;
-import com.tzld.longarticle.recommend.server.repository.longArticle.DatastatScoreRepository;
+import com.tzld.longarticle.recommend.server.repository.longArticle.*;
 import com.tzld.longarticle.recommend.server.service.recommend.score.ScoreStrategy;
 import com.tzld.longarticle.recommend.server.service.recommend.score.ScoreStrategy;
 import com.tzld.longarticle.recommend.server.util.DateUtils;
 import com.tzld.longarticle.recommend.server.util.DateUtils;
 import com.tzld.longarticle.recommend.server.util.MapBuilder;
 import com.tzld.longarticle.recommend.server.util.MapBuilder;
@@ -75,6 +74,8 @@ public class DataDashboardService {
     @Autowired
     @Autowired
     private AigcBaseMapper aigcBaseMapper;
     private AigcBaseMapper aigcBaseMapper;
     @Autowired
     @Autowired
+    private PublishContentMapper publishContentMapper;
+    @Autowired
     private PublishAccountRepository publishAccountRepository;
     private PublishAccountRepository publishAccountRepository;
     @Autowired
     @Autowired
     private PublishContentLayOutRepository publishContentLayOutRepository;
     private PublishContentLayOutRepository publishContentLayOutRepository;
@@ -92,6 +93,10 @@ public class DataDashboardService {
     private ArticleCategoryRepository articleCategoryRepository;
     private ArticleCategoryRepository articleCategoryRepository;
     @Autowired
     @Autowired
     private ArticlePoolPromotionSourceRepository articlePoolPromotionSourceRepository;
     private ArticlePoolPromotionSourceRepository articlePoolPromotionSourceRepository;
+    @Autowired
+    private LongArticleTitleAuditRepository titleAuditRepository;
+    @Autowired
+    private LongArticleCrawlerVideoRepository crawlerVideoRepository;
 
 
     @ApolloJsonValue("${export.account.ghId:[]}")
     @ApolloJsonValue("${export.account.ghId:[]}")
     private static List<String> ghIdList;
     private static List<String> ghIdList;
@@ -222,7 +227,7 @@ public class DataDashboardService {
         }).filter(Objects::nonNull).collect(Collectors.toList());
         }).filter(Objects::nonNull).collect(Collectors.toList());
         List<PublishContentDTO> publishContents = new ArrayList<>();
         List<PublishContentDTO> publishContents = new ArrayList<>();
         for (List<PublishContentParam> partitions : Lists.partition(publishContentParamList, 100)) {
         for (List<PublishContentParam> partitions : Lists.partition(publishContentParamList, 100)) {
-            publishContents.addAll(aigcBaseMapper.getPublishContentByTitle(partitions));
+            publishContents.addAll(publishContentMapper.getPublishContentByTitle(partitions));
         }
         }
         log.info("newSortStrategyData publishContents finish");
         log.info("newSortStrategyData publishContents finish");
         Map<String, Map<String, Map<Long, PublishContentDTO>>> publishContentMap = publishContents.stream()
         Map<String, Map<String, Map<Long, PublishContentDTO>>> publishContentMap = publishContents.stream()
@@ -303,7 +308,7 @@ public class DataDashboardService {
         }
         }
         List<PublishPlanMiniprogramTask> miniprogramTaskList = new ArrayList<>();
         List<PublishPlanMiniprogramTask> miniprogramTaskList = new ArrayList<>();
         for (List<MiniprogramTaskParam> partitions : Lists.partition(miniprogramTaskParamList, 1000)) {
         for (List<MiniprogramTaskParam> partitions : Lists.partition(miniprogramTaskParamList, 1000)) {
-            miniprogramTaskList.addAll(aigcBaseMapper.getMiniProgramTask(partitions));
+            miniprogramTaskList.addAll(publishContentMapper.getMiniProgramTask(partitions));
         }
         }
         log.info("newSortStrategyData miniprogramTaskList finish");
         log.info("newSortStrategyData miniprogramTaskList finish");
         Map<String, List<PublishPlanMiniprogramTask>> miniprogramTaskMap = miniprogramTaskList.stream()
         Map<String, List<PublishPlanMiniprogramTask>> miniprogramTaskMap = miniprogramTaskList.stream()
@@ -671,7 +676,7 @@ public class DataDashboardService {
     private Map<String, ProducePlan> getTitleSourceProducePlanMap(List<String> titleList) {
     private Map<String, ProducePlan> getTitleSourceProducePlanMap(List<String> titleList) {
         List<ProduceContentDTO> sourceProduceContentList = new ArrayList<>();
         List<ProduceContentDTO> sourceProduceContentList = new ArrayList<>();
         for (List<String> partitions : Lists.partition(titleList, 1000)) {
         for (List<String> partitions : Lists.partition(titleList, 1000)) {
-            sourceProduceContentList.addAll(aigcBaseMapper.getSourceProduceContentByTitles(partitions));
+            sourceProduceContentList.addAll(publishContentMapper.getSourceProduceContentByTitles(partitions));
         }
         }
         Map<String, List<ProduceContentDTO>> sourceProduceContentMap = sourceProduceContentList.stream()
         Map<String, List<ProduceContentDTO>> sourceProduceContentMap = sourceProduceContentList.stream()
                 .collect(Collectors.groupingBy(ProduceContentDTO::getTitle));
                 .collect(Collectors.groupingBy(ProduceContentDTO::getTitle));
@@ -1606,7 +1611,7 @@ public class DataDashboardService {
         List<String> titleList = articleList.stream().map(Article::getTitle).distinct().collect(Collectors.toList());
         List<String> titleList = articleList.stream().map(Article::getTitle).distinct().collect(Collectors.toList());
         List<PublishContentDTO> hisPublishList = new ArrayList<>();
         List<PublishContentDTO> hisPublishList = new ArrayList<>();
         for (List<String> partitions : Lists.partition(new ArrayList<>(titleList), 100)) {
         for (List<String> partitions : Lists.partition(new ArrayList<>(titleList), 100)) {
-            hisPublishList.addAll(aigcBaseMapper.getHisPublishByTitles(partitions));
+            hisPublishList.addAll(publishContentMapper.getHisPublishByTitles(partitions));
         }
         }
         Map<String, List<PublishContentDTO>> hisPublishMap = hisPublishList.stream().collect(Collectors.groupingBy(PublishContentDTO::getTitle));
         Map<String, List<PublishContentDTO>> hisPublishMap = hisPublishList.stream().collect(Collectors.groupingBy(PublishContentDTO::getTitle));
         String ymd = DateUtils.timestampToYMDStr(minTimestamp - 86400 * 7, "yyyy-MM-dd");
         String ymd = DateUtils.timestampToYMDStr(minTimestamp - 86400 * 7, "yyyy-MM-dd");
@@ -1949,4 +1954,67 @@ public class DataDashboardService {
         return result;
         return result;
     }
     }
 
 
+    @XxlJob("videoAuditExport")
+    public ReturnT<String> videoAuditExportJob(String param) {
+        List<String> dateStrList = DateUtils.getBeforeDays(null, null, 1);
+        videoAuditExport(dateStrList);
+        return ReturnT.SUCCESS;
+    }
+
+    public void videoAuditExport(String dateStr) {
+        if (!StringUtils.hasText(dateStr)) {
+            dateStr = DateUtils.getBeforeDaysDateStr("yyyyMMdd", 1);
+        }
+        videoAuditExport(Collections.singletonList(dateStr));
+    }
+
+    public void videoAuditExport(List<String> dateStrList) {
+        List<VideoAuditExport> exportList = new ArrayList<>();
+        dateStrList = Lists.reverse(dateStrList);
+        for (String dateStr : dateStrList) {
+            exportList.add(buildVideoAuditExport(dateStr));
+        }
+        if (CollectionUtil.isEmpty(exportList)) {
+            return;
+        }
+        int rowNum = exportList.size();
+        List<List<Object>> rows = new ArrayList<>();
+        Field[] fields = VideoAuditExport.class.getDeclaredFields();
+        for (VideoAuditExport datum : exportList) {
+            List<Object> rowDatas = new ArrayList<>();
+            rows.add(rowDatas);
+
+            for (Field field : fields) {
+                field.setAccessible(true);
+                try {
+                    rowDatas.add(field.get(datum));
+                } catch (IllegalAccessException e) {
+                    log.error("获取值出错:{}", field.getName());
+                } catch (Exception e) {
+                    throw new RuntimeException(e.getMessage());
+                }
+            }
+        }
+
+        doSendFeishuSheet(dateStrList, dailyDetailSheetToken, "vddANt", rowNum, rows,
+                2, null, null);
+    }
+
+    private VideoAuditExport buildVideoAuditExport(String dateStr) {
+        VideoAuditExport result = new VideoAuditExport();
+        long timestamp = DateUtils.getStartOfDay(dateStr, "yyyyMMdd") * 1000;
+        long articleAuditCount = titleAuditRepository.countByAuditTimestampBetween(timestamp, timestamp + 86400000);
+        long articleAuditPassCount = titleAuditRepository.countByStatusAndAuditTimestampBetween(
+                ProduceContentAuditStatusEnum.pass.getVal(), timestamp, timestamp + 86400000);
+        long videoAuditCount = crawlerVideoRepository.countByAuditTimestampBetween(timestamp, timestamp + 86400000);
+        long videoAuditPassCount = crawlerVideoRepository.countByStatusAndAuditTimestampBetween(
+                ProduceContentAuditStatusEnum.pass.getVal(), timestamp, timestamp + 86400000);
+        result.setDateStr(dateStr);
+        result.setArticleAuditCount(articleAuditCount);
+        result.setArticleAuditPassCount(articleAuditPassCount);
+        result.setVideoAuditCount(videoAuditCount);
+        result.setVideoAuditPassCount(videoAuditPassCount);
+        return result;
+    }
+
 }
 }

+ 25 - 2
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/service/recommend/recall/RecallService.java

@@ -2,6 +2,7 @@ package com.tzld.longarticle.recommend.server.service.recommend.recall;
 
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
+import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
 import com.google.common.cache.Cache;
 import com.google.common.cache.Cache;
 import com.google.common.cache.CacheBuilder;
 import com.google.common.cache.CacheBuilder;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Lists;
@@ -10,6 +11,7 @@ import com.tzld.longarticle.recommend.server.common.ThreadPoolFactory;
 import com.tzld.longarticle.recommend.server.common.enums.LongArticleTextSimilarityStatusEnum;
 import com.tzld.longarticle.recommend.server.common.enums.LongArticleTextSimilarityStatusEnum;
 import com.tzld.longarticle.recommend.server.common.enums.StatusEnum;
 import com.tzld.longarticle.recommend.server.common.enums.StatusEnum;
 import com.tzld.longarticle.recommend.server.common.enums.aigc.PublishPlanInputSourceTypesEnum;
 import com.tzld.longarticle.recommend.server.common.enums.aigc.PublishPlanInputSourceTypesEnum;
+import com.tzld.longarticle.recommend.server.common.enums.longArticle.ArticleVideoAuditStatusEnum;
 import com.tzld.longarticle.recommend.server.common.enums.recommend.*;
 import com.tzld.longarticle.recommend.server.common.enums.recommend.*;
 import com.tzld.longarticle.recommend.server.mapper.aigc.AigcBaseMapper;
 import com.tzld.longarticle.recommend.server.mapper.aigc.AigcBaseMapper;
 import com.tzld.longarticle.recommend.server.mapper.crawler.ArticleMapper;
 import com.tzld.longarticle.recommend.server.mapper.crawler.ArticleMapper;
@@ -104,6 +106,8 @@ public class RecallService implements ApplicationContextAware {
     @Autowired
     @Autowired
     LongArticlesTextRepository longArticlesTextRepository;
     LongArticlesTextRepository longArticlesTextRepository;
     @Autowired
     @Autowired
+    LongArticleTitleAuditRepository titleAuditRepository;
+    @Autowired
     AigcBaseMapper aigcBaseMapper;
     AigcBaseMapper aigcBaseMapper;
 
 
     private final Map<String, RecallStrategy> strategyMap = new HashMap<>();
     private final Map<String, RecallStrategy> strategyMap = new HashMap<>();
@@ -116,6 +120,8 @@ public class RecallService implements ApplicationContextAware {
     private Boolean contentHisFeishuEnable;
     private Boolean contentHisFeishuEnable;
     @Value("${morning.noon.fission.rate:0.64}")
     @Value("${morning.noon.fission.rate:0.64}")
     private double morningNoonFissionRate;
     private double morningNoonFissionRate;
+    @ApolloJsonValue("${whiteAccountList:[]}")
+    private List<String> whiteAccountList;
 
 
 
 
     @PostConstruct
     @PostConstruct
@@ -185,8 +191,12 @@ public class RecallService implements ApplicationContextAware {
         List<Content> content = aigcWaitingPublishContentService.getAllContent(param);
         List<Content> content = aigcWaitingPublishContentService.getAllContent(param);
         long t2 = System.currentTimeMillis();
         long t2 = System.currentTimeMillis();
         CostMonitor.logCost("Recall", "GetAllContents", t2 - t1);
         CostMonitor.logCost("Recall", "GetAllContents", t2 - t1);
-        // 临时过滤文章视频不匹配content
-        filterNotMatchContent(content);
+        if (whiteAccountList.contains(param.getAccountName())) {
+            // 临时过滤文章视频不匹配content
+            filterNotMatchContent(content);
+            // 过滤仅保留审核通过content
+            filterAuditPassContent(content);
+        }
         if (CollectionUtils.isEmpty(content)) {
         if (CollectionUtils.isEmpty(content)) {
             FeishuMessageSender.sendWebHookMessage(FeishuRobotIdEnum.RECOMMEND.getRobotId(),
             FeishuMessageSender.sendWebHookMessage(FeishuRobotIdEnum.RECOMMEND.getRobotId(),
                     "内容召回失败\n"
                     "内容召回失败\n"
@@ -205,6 +215,19 @@ public class RecallService implements ApplicationContextAware {
         return content;
         return content;
     }
     }
 
 
+    private void filterAuditPassContent(List<Content> content) {
+        if (CollectionUtils.isEmpty(content)) {
+            return;
+        }
+        List<String> sourceIds = content.stream().map(Content::getSourceId).collect(Collectors.toList());
+        List<LongArticleTitleAudit> titleAuditList = titleAuditRepository.getByContentIdIn(sourceIds);
+        Map<String, Integer> titleAuditMap = titleAuditList.stream()
+                .collect(Collectors.toMap(LongArticleTitleAudit::getContentId, LongArticleTitleAudit::getStatus));
+        content.removeIf(o -> !Objects.equals(o.getSourceType(), PublishPlanInputSourceTypesEnum.longArticleVideoPoolSource.getVal())
+                && (Objects.isNull(titleAuditMap.get(o.getSourceId()))
+                || titleAuditMap.get(o.getSourceId()) != ArticleVideoAuditStatusEnum.PASS.getCode()));
+    }
+
     private void filterNotMatchContent(List<Content> content) {
     private void filterNotMatchContent(List<Content> content) {
         if (CollectionUtils.isEmpty(content)) {
         if (CollectionUtils.isEmpty(content)) {
             return;
             return;

+ 65 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/web/recommend/ArticleVideoAuditController.java

@@ -0,0 +1,65 @@
+package com.tzld.longarticle.recommend.server.web.recommend;
+
+import com.tzld.longarticle.recommend.server.common.response.CommonResponse;
+import com.tzld.longarticle.recommend.server.model.param.videoAudit.*;
+import com.tzld.longarticle.recommend.server.model.vo.ArticleVideoAuditListVO;
+import com.tzld.longarticle.recommend.server.service.recommend.ArticleVideoAuditService;
+import com.tzld.longarticle.recommend.server.util.page.Page;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+@RestController
+@RequestMapping("/articleVideoAudit")
+@Slf4j
+public class ArticleVideoAuditController {
+
+    @Autowired
+    ArticleVideoAuditService service;
+
+    @PostMapping("/list")
+    public CommonResponse<Page<ArticleVideoAuditListVO>> articleVideoAuditList(@RequestBody ArticleVideoAuditListParam param) {
+        return CommonResponse.success(service.list(param));
+    }
+
+    @PostMapping("/auditArticle")
+    public CommonResponse<Void> auditArticle(@RequestBody ArticleAuditParam param) {
+        service.auditArticle(param);
+        return CommonResponse.success();
+    }
+
+    @PostMapping("/auditVideo")
+    public CommonResponse<Void> auditVideo(@RequestBody VideoAuditParam param) {
+        service.auditVideo(param);
+        return CommonResponse.success();
+    }
+
+    @PostMapping("/getFilterValue")
+    public CommonResponse<List<String>> getFilterValue(@RequestBody AuditFilterParam param) {
+        return CommonResponse.success(service.getFilterValue(param));
+    }
+
+
+    @GetMapping("/rematchVideoAudit")
+    public CommonResponse<Void> rematchVideoAudit(String contentId) {
+        service.rematchVideoAudit(contentId);
+        return CommonResponse.success();
+    }
+
+
+    @PostMapping("/updateArticleTitle")
+    public CommonResponse<Void> updateArticleTitle(@RequestBody ArticleTitleUpdateParam param) {
+        service.updateArticleTitle(param);
+        return CommonResponse.success();
+    }
+
+
+    @PostMapping("/updateVideoTitle")
+    public CommonResponse<Void> updateVideoTitle(@RequestBody VideoTitleUpdateParam param) {
+        service.updateVideoTitle(param);
+        return CommonResponse.success();
+    }
+
+}

+ 7 - 0
long-article-recommend-service/src/main/java/com/tzld/longarticle/recommend/server/web/recommend/DataDashboardController.java

@@ -50,6 +50,13 @@ public class DataDashboardController {
         }).start();
         }).start();
     }
     }
 
 
+    @GetMapping("/export/videoAudit")
+    public void videoAuditExport(String dateStr) {
+        new Thread(() -> {
+            service.videoAuditExport(dateStr);
+        }).start();
+    }
+
     @GetMapping("/export/dailySafeScore")
     @GetMapping("/export/dailySafeScore")
     public void dailySafeScore(String dateStr) {
     public void dailySafeScore(String dateStr) {
         new Thread(() -> {
         new Thread(() -> {

+ 2 - 255
long-article-recommend-service/src/main/resources/mapper/aigc/AigcBaseMapper.xml

@@ -2,48 +2,6 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.tzld.longarticle.recommend.server.mapper.aigc.AigcBaseMapper">
 <mapper namespace="com.tzld.longarticle.recommend.server.mapper.aigc.AigcBaseMapper">
 
 
-    <select id="getPublishAccountByGhId"
-            resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.PublishAccount">
-        select * from publish_account where gh_id = #{ghId} limit 1
-    </select>
-
-    <select id="getPublishContentByTitle"
-            resultType="com.tzld.longarticle.recommend.server.model.dto.PublishContentDTO">
-        select content.id, content.plan_id, content.source_type, content.source_id, content.crawler_channel_content_id,
-               content.publish_account_id, content.publish_timestamp, output.output as title
-        from publish_content content
-        join publish_content_output output
-          on content.id = output.publish_content_id and output.content_type = 3 AND output.select_status = 1
-        where content.status = 2
-        and (content.publish_account_id, output.output) in
-        <foreach collection="list" item="item" open="(" close=")" separator=",">
-            (#{item.publishAccountId}, #{item.title})
-        </foreach>
-    </select>
-
-    <select id="getMiniProgramTask"
-            resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.PublishPlanMiniprogramTask">
-        select * from publish_plan_miniprogram_task where
-        <foreach collection="list" item="item" open="(" close=")" separator=" or ">
-            (plan_id = #{item.planId} and account_ids like CONCAT("%", #{item.accountId}, "%"))
-        </foreach>
-    </select>
-
-    <select id="getProduceContent"
-            resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.ProducePlanExeRecord">
-        select * from produce_plan_exe_record where plan_exe_id = #{id}
-    </select>
-
-    <select id="getProducePlan"
-            resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.ProducePlan">
-        select * from produce_plan where id = #{id}
-    </select>
-
-    <select id="getProducePlanInputSources"
-            resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.ProducePlanInputSource">
-        select * from produce_plan_input_source where plan_id = #{planId} and data_status = 1
-    </select>
-
     <select id="getCrawlerPlanRelByChannelContentIds"
     <select id="getCrawlerPlanRelByChannelContentIds"
             resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.CrawlerPlanResultRel">
             resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.CrawlerPlanResultRel">
         select * from crawler_plan_result_rel where channel_source_id in
         select * from crawler_plan_result_rel where channel_source_id in
@@ -60,115 +18,6 @@
         </foreach>
         </foreach>
     </select>
     </select>
 
 
-    <select id="getNotPublishPlan" resultType="com.tzld.longarticle.recommend.server.model.dto.NotPublishPlan">
-        SELECT
-            plan.id as planId,
-            plan.NAME as planName,
-            plan.error_msg as errorMsg,
-            stat.today_expect_publish_count as expectCount,
-            stat.today_publish_count as publishCount,
-            setting.publish_push_time as publishPushTime
-        FROM publish_plan plan
-        JOIN publish_plan_stat stat ON plan.id = stat.plan_id
-        JOIN publish_plan_setting setting ON plan.id = setting.plan_id
-        WHERE
-            stat.today_expect_publish_count > stat.today_publish_count
-          AND plan.plan_status = 1
-          AND setting.push_type = 2
-          and plan.create_timestamp &lt; #{todayStart}
-    </select>
-
-    <select id="getPublishPlanPushType" resultType="java.lang.Integer">
-        select push_type from publish_plan_setting where plan_id = #{planId}
-    </select>
-
-    <select id="getPublishAccounts"
-            resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.PublishAccount">
-        SELECT account.*
-        FROM publish_plan_account planAccount
-        join publish_account account on planAccount.account_id = account.id
-        left join publish_content content
-            on content.publish_account_id = planAccount.account_id
-           and content.plan_id = planAccount.plan_id
-           and content.publish_timestamp > #{todayStart}
-        WHERE planAccount.plan_id = #{planId} and content.id is null and planAccount.publish_open_flag = 1
-    </select>
-    <select id="getSourceProduceContentByTitles"
-            resultType="com.tzld.longarticle.recommend.server.model.dto.ProduceContentDTO">
-        select record.plan_exe_id as contentId,
-               output.output as title,
-               record.produce_timestamp as produceTimestamp,
-               record.plan_id as producePlanId
-        from produce_plan_exe_record record
-        join produce_plan_module_output output on record.plan_exe_id = output.plan_exe_id and output.produce_module_type = 3
-        join publish_content pc on pc.source_id = record.plan_exe_id and pc.status = 2 and pc.channel = 5
-        where output.output in
-        <foreach collection="titleList" item="item" open="(" close=")" separator=",">
-            #{item}
-        </foreach>
-    </select>
-
-    <select id="getAccountTypeFans"
-            resultType="com.tzld.longarticle.recommend.server.model.dto.AccountTypeFansDTO">
-        SELECT distinct t3.`name`,
-                        t3.gh_id,
-                        t3.follower_count,
-                        t6.account_source_name,
-                        t6.mode_type,
-                        t6.account_type,
-                        t6.`status`
-        FROM publish_plan t1
-        JOIN publish_plan_account t2 ON t1.id = t2.plan_id
-        JOIN publish_account t3 ON t2.account_id = t3.id
-        LEFT JOIN publish_account_wx_type t4 on t3.id = t4.account_id
-        LEFT JOIN wx_statistics_group_source_account t5 on t3.id = t5.account_id
-        LEFT JOIN wx_statistics_group_source t6 on t5.group_source_name = t6.account_source_name
-        WHERE t1.plan_status = 1
-          AND t3.channel = 5
-    </select>
-
-    <select id="getHisPublishByTitles"
-            resultType="com.tzld.longarticle.recommend.server.model.dto.PublishContentDTO">
-        select content.*, output.output as title
-        from publish_content content
-        join publish_content_output output
-        on content.id = output.publish_content_id and output.content_type = 3 AND output.select_status = 1
-        where content.status = 2
-          and output.output in
-        <foreach collection="titleList" item="item" open="(" close=")" separator=",">
-            #{item}
-        </foreach>
-    </select>
-
-    <select id="getNearestPublishContent"
-            resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.PublishContent">
-        select *
-        from publish_content
-        where publish_account_id = #{publishAccountId}
-          and channel = 5
-          and status = 2
-          <if test="publishTimestamp != null">
-            and publish_timestamp &lt;= (#{publishTimestamp} + 3600000)
-          </if>
-        order by publish_timestamp desc
-        <if test="size != null">
-            limit #{size}
-        </if>
-    </select>
-
-    <select id="getLateNearestPublishContent"
-            resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.PublishContent">
-        select *
-        from publish_content
-        where publish_account_id = #{publishAccountId}
-        and channel = 5
-        and status = 2
-        <if test="publishTimestamp != null">
-            and publish_timestamp > (#{publishTimestamp})
-        </if>
-        order by publish_timestamp
-    </select>
-
     <select id="getCrawlerContentByChannelContentId"
     <select id="getCrawlerContentByChannelContentId"
             resultType="com.tzld.longarticle.recommend.server.model.dto.CrawlerContent">
             resultType="com.tzld.longarticle.recommend.server.model.dto.CrawlerContent">
         select cc.channel_content_id, ca.wx_gh as ghId, cc.title, cc.publish_timestamp
         select cc.channel_content_id, ca.wx_gh as ghId, cc.title, cc.publish_timestamp
@@ -185,6 +34,7 @@
           on record.plan_exe_id = output.plan_exe_id and output.produce_module_type = 3
           on record.plan_exe_id = output.plan_exe_id and output.produce_module_type = 3
         where record.plan_id = #{planId} and record.status = 2 and audit_status = 1
         where record.plan_id = #{planId} and record.status = 2 and audit_status = 1
     </select>
     </select>
+
     <select id="getAllByProducePlanId"
     <select id="getAllByProducePlanId"
             resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.ProducePlanExeRecord">
             resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.ProducePlanExeRecord">
         select *
         select *
@@ -195,6 +45,7 @@
         </foreach>
         </foreach>
         and status = 2
         and status = 2
     </select>
     </select>
+
     <select id="getCrawlerContentByChannelContentIdIn"
     <select id="getCrawlerContentByChannelContentIdIn"
             resultType="com.tzld.longarticle.recommend.server.model.dto.CrawlerContent">
             resultType="com.tzld.longarticle.recommend.server.model.dto.CrawlerContent">
         select cc.channel_content_id, cprr.plan_id as crawlerPlanId, ca.wx_gh as ghId, cc.title, cc.publish_timestamp
         select cc.channel_content_id, cprr.plan_id as crawlerPlanId, ca.wx_gh as ghId, cc.title, cc.publish_timestamp
@@ -208,81 +59,6 @@
         </foreach>
         </foreach>
     </select>
     </select>
 
 
-    <select id="checkPublishPlanAccount" resultType="com.tzld.longarticle.recommend.server.model.dto.PublishPlanAccountNotifyDTO">
-        select ppa.plan_id, pp.name as planName, pa.name as accountName
-        from publish_plan_account ppa
-        join publish_account pa on ppa.account_id = pa.id
-        join publish_plan pp on ppa.plan_id = pp.id
-        where pp.plan_status = 1 and pp.channel = 5 and pp.content_modal = 3 and ppa.publish_open_flag = 0
-    </select>
-
-    <select id="getPublishContentByTraceIdIn"
-            resultType="com.tzld.longarticle.recommend.server.model.dto.PublishContentMiniprogramDTO">
-        select * from publish_content_miniprogram where trace_id in
-        <foreach collection="traceIds" item="item" open="(" close=")" separator=",">
-            #{item}
-        </foreach>
-    </select>
-
-    <select id="getPushContentRelByPublishContentIdIn"
-            resultType="com.tzld.longarticle.recommend.server.model.dto.PublishGzhPushContentRelDTO">
-        select pgpcr.*
-        from publish_gzh_push_content_rel pgpcr
-        join publish_gzh_push pgp on pgpcr.push_id = pgp.push_id
-        where pgpcr.publish_content_id in
-        <foreach collection="publishContentIds" item="item" open="(" close=")" separator=",">
-            #{item}
-        </foreach>
-    </select>
-
-    <select id="getPushByPushIdIn"
-            resultType="com.tzld.longarticle.recommend.server.model.dto.PublishGzhPushDTO">
-        select * from publish_gzh_push where push_id in
-        <foreach collection="pushIds" item="item" open="(" close=")" separator=",">
-            #{item}
-        </foreach>
-    </select>
-
-    <select id="getGroupPushRelByPushIdIn"
-            resultType="com.tzld.longarticle.recommend.server.model.dto.PublishGzhPushContentRelDTO">
-        select * from publish_gzh_push_content_rel where push_id in
-        <foreach collection="pushIds" item="item" open="(" close=")" separator=",">
-            #{item}
-        </foreach>
-        order by id
-    </select>
-
-    <select id="getPublishContentById"
-            resultType="com.tzld.longarticle.recommend.server.model.dto.PublishContentDTO">
-        select content.id, content.publish_timestamp, content.publish_account_id, output.output as title
-        from publish_content content
-         join publish_content_output output
-          on content.id = output.publish_content_id and output.content_type = 3 AND output.select_status = 1
-        where content.id = #{publishContentId}
-    </select>
-
-    <select id="getPublishContentByIdIn"
-            resultType="com.tzld.longarticle.recommend.server.model.dto.PublishContentDTO">
-        select content.id, content.publish_timestamp, content.publish_account_id, output.output as title
-        from publish_content content
-                 join publish_content_output output
-                      on content.id = output.publish_content_id and output.content_type = 3 AND output.select_status = 1
-        where content.id in
-        <foreach collection="publishContentIds" item="item" open="(" close=")" separator=",">
-            #{item}
-        </foreach>
-    </select>
-
-    <select id="getPublishContentBySourceIdIn"
-            resultType="com.tzld.longarticle.recommend.server.model.dto.PublishContentDTO">
-        select id, plan_id, source_type, source_id, crawler_channel_content_id, publish_account_id, publish_timestamp
-        from publish_content
-        where status = 2 and source_id in
-        <foreach collection="sourceIds" item="item" open="(" close=")" separator=",">
-            #{item}
-        </foreach>
-    </select>
-
     <select id="getColdCrawlerPlan"
     <select id="getColdCrawlerPlan"
             resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.CrawlerPlan">
             resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.CrawlerPlan">
         select *
         select *
@@ -322,35 +98,6 @@
         GROUP BY pper.plan_id
         GROUP BY pper.plan_id
     </select>
     </select>
 
 
-    <select id="getAccountTypeList"
-            resultType="com.tzld.longarticle.recommend.server.model.dto.PublishAccountTypeDTO">
-        SELECT DISTINCT t3.`name`, t3.gh_id, t3.follower_count, t6.account_source_name, t6.mode_type,
-                        t6.account_type, t6.`status`
-        FROM publish_plan t1
-        JOIN publish_plan_account t2 ON t1.id = t2.plan_id
-        JOIN publish_account t3 ON t2.account_id = t3.id
-        LEFT JOIN publish_account_wx_type t4 on t3.id = t4.account_id
-        LEFT JOIN wx_statistics_group_source_account t5 on t3.id = t5.account_id
-        LEFT JOIN wx_statistics_group_source t6 on t5.group_source_name = t6.account_source_name
-        WHERE t1.plan_status = 1
-          AND t3.channel = 5
-        <if test="ghIds != null and ghIds.size() > 0">
-            AND t3.gh_id in
-            <foreach collection="ghIds" item="item" open="(" close=")" separator=",">
-                #{item}
-            </foreach>
-        </if>
-        GROUP BY t3.id;
-    </select>
-
-    <select id="getOnlyMiniprogramArticle" resultType="java.lang.String">
-        select id
-        from publish_content
-        where gzh_only_miniprogram_flag = 1
-        order by id
-        limit #{offset}, #{pageSize}
-    </select>
-
     <select id="getProduceScoreGreaterThan"
     <select id="getProduceScoreGreaterThan"
             resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.ProduceTaskAtom">
             resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.ProduceTaskAtom">
         select atom.plan_exe_id, atom.input, atom.output, record.audit_timestamp as createTimestamp
         select atom.plan_exe_id, atom.input, atom.output, record.audit_timestamp as createTimestamp

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

@@ -0,0 +1,253 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.tzld.longarticle.recommend.server.mapper.aigc.PublishContentMapper">
+
+    <select id="getPublishContentByTitle"
+            resultType="com.tzld.longarticle.recommend.server.model.dto.PublishContentDTO">
+        select content.id, content.plan_id, content.source_type, content.source_id, content.crawler_channel_content_id,
+               content.publish_account_id, content.publish_timestamp, output.output as title
+        from publish_content content
+        join publish_content_output output
+          on content.id = output.publish_content_id and output.content_type = 3 AND output.select_status = 1
+        where content.status = 2
+        and (content.publish_account_id, output.output) in
+        <foreach collection="list" item="item" open="(" close=")" separator=",">
+            (#{item.publishAccountId}, #{item.title})
+        </foreach>
+    </select>
+
+    <select id="getMiniProgramTask"
+            resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.PublishPlanMiniprogramTask">
+        select * from publish_plan_miniprogram_task where
+        <foreach collection="list" item="item" open="(" close=")" separator=" or ">
+            (plan_id = #{item.planId} and account_ids like CONCAT("%", #{item.accountId}, "%"))
+        </foreach>
+    </select>
+
+    <select id="getNotPublishPlan" resultType="com.tzld.longarticle.recommend.server.model.dto.NotPublishPlan">
+        SELECT
+            plan.id as planId,
+            plan.NAME as planName,
+            plan.error_msg as errorMsg,
+            stat.today_expect_publish_count as expectCount,
+            stat.today_publish_count as publishCount,
+            setting.publish_push_time as publishPushTime
+        FROM publish_plan plan
+        JOIN publish_plan_stat stat ON plan.id = stat.plan_id
+        JOIN publish_plan_setting setting ON plan.id = setting.plan_id
+        WHERE
+            stat.today_expect_publish_count > stat.today_publish_count
+          AND plan.plan_status = 1
+          AND setting.push_type = 2
+          and plan.create_timestamp &lt; #{todayStart}
+    </select>
+
+    <select id="getPublishPlanPushType" resultType="java.lang.Integer">
+        select push_type from publish_plan_setting where plan_id = #{planId}
+    </select>
+
+    <select id="getPublishAccounts"
+            resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.PublishAccount">
+        SELECT account.*
+        FROM publish_plan_account planAccount
+        join publish_account account on planAccount.account_id = account.id
+        left join publish_content content
+            on content.publish_account_id = planAccount.account_id
+           and content.plan_id = planAccount.plan_id
+           and content.publish_timestamp > #{todayStart}
+        WHERE planAccount.plan_id = #{planId} and content.id is null and planAccount.publish_open_flag = 1
+    </select>
+    <select id="getSourceProduceContentByTitles"
+            resultType="com.tzld.longarticle.recommend.server.model.dto.ProduceContentDTO">
+        select record.plan_exe_id as contentId,
+               output.output as title,
+               record.produce_timestamp as produceTimestamp,
+               record.plan_id as producePlanId
+        from produce_plan_exe_record record
+        join produce_plan_module_output output on record.plan_exe_id = output.plan_exe_id and output.produce_module_type = 3
+        join publish_content pc on pc.source_id = record.plan_exe_id and pc.status = 2 and pc.channel = 5
+        where output.output in
+        <foreach collection="titleList" item="item" open="(" close=")" separator=",">
+            #{item}
+        </foreach>
+    </select>
+
+    <select id="getAccountTypeFans"
+            resultType="com.tzld.longarticle.recommend.server.model.dto.AccountTypeFansDTO">
+        SELECT distinct t3.`name`,
+                        t3.gh_id,
+                        t3.follower_count,
+                        t6.account_source_name,
+                        t6.mode_type,
+                        t6.account_type,
+                        t6.`status`
+        FROM publish_plan t1
+        JOIN publish_plan_account t2 ON t1.id = t2.plan_id
+        JOIN publish_account t3 ON t2.account_id = t3.id
+        LEFT JOIN publish_account_wx_type t4 on t3.id = t4.account_id
+        LEFT JOIN wx_statistics_group_source_account t5 on t3.id = t5.account_id
+        LEFT JOIN wx_statistics_group_source t6 on t5.group_source_name = t6.account_source_name
+        WHERE t1.plan_status = 1
+          AND t3.channel = 5
+    </select>
+
+    <select id="getHisPublishByTitles"
+            resultType="com.tzld.longarticle.recommend.server.model.dto.PublishContentDTO">
+        select content.*, output.output as title
+        from publish_content content
+        join publish_content_output output
+        on content.id = output.publish_content_id and output.content_type = 3 AND output.select_status = 1
+        where content.status = 2
+          and output.output in
+        <foreach collection="titleList" item="item" open="(" close=")" separator=",">
+            #{item}
+        </foreach>
+    </select>
+
+    <select id="getNearestPublishContent"
+            resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.PublishContent">
+        select *
+        from publish_content
+        where publish_account_id = #{publishAccountId}
+          and channel = 5
+          and status = 2
+          <if test="publishTimestamp != null">
+            and publish_timestamp &lt;= (#{publishTimestamp} + 3600000)
+          </if>
+        order by publish_timestamp desc
+        <if test="size != null">
+            limit #{size}
+        </if>
+    </select>
+
+    <select id="getLateNearestPublishContent"
+            resultType="com.tzld.longarticle.recommend.server.model.entity.aigc.PublishContent">
+        select *
+        from publish_content
+        where publish_account_id = #{publishAccountId}
+        and channel = 5
+        and status = 2
+        <if test="publishTimestamp != null">
+            and publish_timestamp > (#{publishTimestamp})
+        </if>
+        order by publish_timestamp
+    </select>
+
+    <select id="checkPublishPlanAccount" resultType="com.tzld.longarticle.recommend.server.model.dto.PublishPlanAccountNotifyDTO">
+        select ppa.plan_id, pp.name as planName, pa.name as accountName
+        from publish_plan_account ppa
+        join publish_account pa on ppa.account_id = pa.id
+        join publish_plan pp on ppa.plan_id = pp.id
+        where pp.plan_status = 1 and pp.channel = 5 and pp.content_modal = 3 and ppa.publish_open_flag = 0
+    </select>
+
+    <select id="getPublishContentByTraceIdIn"
+            resultType="com.tzld.longarticle.recommend.server.model.dto.PublishContentMiniprogramDTO">
+        select * from publish_content_miniprogram where trace_id in
+        <foreach collection="traceIds" item="item" open="(" close=")" separator=",">
+            #{item}
+        </foreach>
+    </select>
+
+    <select id="getPushContentRelByPublishContentIdIn"
+            resultType="com.tzld.longarticle.recommend.server.model.dto.PublishGzhPushContentRelDTO">
+        select pgpcr.*
+        from publish_gzh_push_content_rel pgpcr
+        join publish_gzh_push pgp on pgpcr.push_id = pgp.push_id
+        where pgpcr.publish_content_id in
+        <foreach collection="publishContentIds" item="item" open="(" close=")" separator=",">
+            #{item}
+        </foreach>
+    </select>
+
+    <select id="getPushByPushIdIn"
+            resultType="com.tzld.longarticle.recommend.server.model.dto.PublishGzhPushDTO">
+        select * from publish_gzh_push where push_id in
+        <foreach collection="pushIds" item="item" open="(" close=")" separator=",">
+            #{item}
+        </foreach>
+    </select>
+
+    <select id="getGroupPushRelByPushIdIn"
+            resultType="com.tzld.longarticle.recommend.server.model.dto.PublishGzhPushContentRelDTO">
+        select * from publish_gzh_push_content_rel where push_id in
+        <foreach collection="pushIds" item="item" open="(" close=")" separator=",">
+            #{item}
+        </foreach>
+        order by id
+    </select>
+
+    <select id="getPublishContentById"
+            resultType="com.tzld.longarticle.recommend.server.model.dto.PublishContentDTO">
+        select content.id, content.publish_timestamp, content.publish_account_id, output.output as title
+        from publish_content content
+         join publish_content_output output
+          on content.id = output.publish_content_id and output.content_type = 3 AND output.select_status = 1
+        where content.id = #{publishContentId}
+    </select>
+
+    <select id="getPublishContentByIdIn"
+            resultType="com.tzld.longarticle.recommend.server.model.dto.PublishContentDTO">
+        select content.id, content.publish_timestamp, content.publish_account_id, output.output as title
+        from publish_content content
+                 join publish_content_output output
+                      on content.id = output.publish_content_id and output.content_type = 3 AND output.select_status = 1
+        where content.id in
+        <foreach collection="publishContentIds" item="item" open="(" close=")" separator=",">
+            #{item}
+        </foreach>
+    </select>
+
+    <select id="getPublishContentBySourceIdIn"
+            resultType="com.tzld.longarticle.recommend.server.model.dto.PublishContentDTO">
+        select id, plan_id, source_type, source_id, crawler_channel_content_id, publish_account_id, publish_timestamp
+        from publish_content
+        where status = 2 and source_id in
+        <foreach collection="sourceIds" item="item" open="(" close=")" separator=",">
+            #{item}
+        </foreach>
+    </select>
+
+    <select id="getAccountTypeList"
+            resultType="com.tzld.longarticle.recommend.server.model.dto.PublishAccountTypeDTO">
+        SELECT DISTINCT t3.`name`, t3.gh_id, t3.follower_count, t6.account_source_name, t6.mode_type,
+                        t6.account_type, t6.`status`
+        FROM publish_plan t1
+        JOIN publish_plan_account t2 ON t1.id = t2.plan_id
+        JOIN publish_account t3 ON t2.account_id = t3.id
+        LEFT JOIN publish_account_wx_type t4 on t3.id = t4.account_id
+        LEFT JOIN wx_statistics_group_source_account t5 on t3.id = t5.account_id
+        LEFT JOIN wx_statistics_group_source t6 on t5.group_source_name = t6.account_source_name
+        WHERE t1.plan_status = 1
+          AND t3.channel = 5
+        <if test="ghIds != null and ghIds.size() > 0">
+            AND t3.gh_id in
+            <foreach collection="ghIds" item="item" open="(" close=")" separator=",">
+                #{item}
+            </foreach>
+        </if>
+        GROUP BY t3.id;
+    </select>
+
+    <select id="getOnlyMiniprogramArticle" resultType="java.lang.String">
+        select id
+        from publish_content
+        where gzh_only_miniprogram_flag = 1
+        order by id
+        limit #{offset}, #{pageSize}
+    </select>
+
+    <update id="updatePublishContentSingleMiniProgram">
+        update publish_content set gzh_only_miniprogram_flag = 1 where id in
+        <foreach collection="publishContentIds" item="item" open="(" close=")" separator=",">
+            #{item}
+        </foreach>
+    </update>
+    <update id="updatePublishContentStatus">
+        update publish_content
+        set status = #{status}
+        where source_id = #{sourceId}
+        and status = #{oldStatus}
+    </update>
+
+</mapper>

+ 140 - 0
long-article-recommend-service/src/main/resources/mapper/longArticle/ArticleAuditMapper.xml

@@ -0,0 +1,140 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.tzld.longarticle.recommend.server.mapper.longArticle.ArticleAuditMapper">
+
+    <select id="articleVideoAuditListCount" resultType="java.lang.Integer">
+        select count(long_articles_title_audit.content_id)
+        from long_articles_title_audit
+        left join long_articles_text on long_articles_title_audit.content_id = long_articles_text.content_id
+        <where>
+            <if test="status!= null and status.size() > 0">
+                and long_articles_title_audit.status in
+                <foreach collection="status" item="item" separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="contentId!= null and contentId.size() > 0">
+                and long_articles_title_audit.content_id in
+                <foreach collection="contentId" item="item" separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="title!= null and title.size() > 0">
+                and long_articles_text.article_title in
+                <foreach collection="title" item="item" separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="auditAccount!= null and auditAccount.size() > 0">
+                and long_articles_title_audit.audit_account in
+                <foreach collection="auditAccount" item="item" separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+        </where>
+    </select>
+
+    <select id="articleVideoAuditList"
+            resultType="com.tzld.longarticle.recommend.server.model.vo.ArticleVideoAuditListVO">
+        select long_articles_title_audit.content_id, long_articles_title_audit.status,
+        long_articles_text.article_title as title, long_articles_text.kimi_title,
+        long_articles_title_audit.audit_account, long_articles_title_audit.audit_timestamp
+        from long_articles_title_audit
+        left join long_articles_text on long_articles_title_audit.content_id = long_articles_text.content_id
+        <where>
+            <if test="status!= null and status.size() > 0">
+                and long_articles_title_audit.status in
+                <foreach collection="status" item="item" separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="contentId!= null and contentId.size() > 0">
+                and long_articles_title_audit.content_id in
+                <foreach collection="contentId" item="item" separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="title!= null and title.size() > 0">
+                and long_articles_text.article_title in
+                <foreach collection="title" item="item" separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+            <if test="auditAccount!= null and auditAccount.size() > 0">
+                and long_articles_title_audit.audit_account in
+                <foreach collection="auditAccount" item="item" separator="," open="(" close=")">
+                    #{item}
+                </foreach>
+            </if>
+        </where>
+        order by long_articles_title_audit.content_id desc
+        limit #{offset}, #{pageSize}
+    </select>
+
+    <update id="updateCrawlerVideoIsIllegal">
+        update long_articles_crawler_videos
+        set is_illegal = #{isIllegal}
+        where id in
+        <foreach collection="ids" item="id" open="(" close=")">
+            #{id}
+        </foreach>
+    </update>
+
+    <select id="searchFilterValueByItemName" resultType="java.lang.String">
+        <choose>
+            <when test="itemName == 'contentId'">
+                select content_id
+                from long_articles_title_audit
+                <where>
+                    <if test="searchKeyword != null and searchKeyword !=''">
+                        and content_id like concat('%', #{searchKeyword}, '%')
+                    </if>
+                </where>
+                order by create_timestamp desc
+                limit 100
+            </when>
+            <when test="itemName == 'auditAccount'">
+                select distinct audit_account
+                from long_articles_title_audit
+                <where>
+                    <if test="searchKeyword != null and searchKeyword !=''">
+                        and audit_account like concat('%', #{searchKeyword}, '%')
+                    </if>
+                </where>
+                order by create_timestamp desc
+                limit 100
+            </when>
+            <when test="itemName == 'title'">
+                select distinct long_articles_text.article_title
+                from long_articles_title_audit
+                left join long_articles_text on long_articles_title_audit.content_id = long_articles_text.content_id
+                <where>
+                    <if test="searchKeyword != null and searchKeyword !=''">
+                        and long_articles_text.article_title like concat('%', #{searchKeyword}, '%')
+                    </if>
+                </where>
+                order by long_articles_title_audit.create_timestamp desc
+                limit 100
+            </when>
+        </choose>
+    </select>
+
+    <update id="updateArticleTitle">
+        update long_articles_text
+        set old_article_title = article_title,
+            article_title = #{param.title},
+            article_title_update_account = #{param.updateAccount},
+            article_title_update_timestamp = #{updateTime}
+        where content_id = #{param.contentId}
+    </update>
+
+    <update id="updateVideoTitle">
+        update long_articles_text
+        set old_kimi_title = kimi_title,
+            kimi_title = #{param.title},
+            kimi_title_update_account = #{param.updateAccount},
+            kimi_title_update_timestamp = #{updateTime}
+        where content_id = #{param.contentId}
+    </update>
+
+</mapper>

+ 5 - 2
long-article-recommend-service/src/test/java/com/tzld/longarticle/recommend/server/RecommendTest.java

@@ -6,6 +6,7 @@ import com.alibaba.fastjson.JSONObject;
 import com.google.common.collect.Lists;
 import com.google.common.collect.Lists;
 import com.tzld.longarticle.recommend.server.common.enums.recommend.ArticleTypeEnum;
 import com.tzld.longarticle.recommend.server.common.enums.recommend.ArticleTypeEnum;
 import com.tzld.longarticle.recommend.server.mapper.aigc.AigcBaseMapper;
 import com.tzld.longarticle.recommend.server.mapper.aigc.AigcBaseMapper;
+import com.tzld.longarticle.recommend.server.mapper.aigc.PublishContentMapper;
 import com.tzld.longarticle.recommend.server.mapper.crawler.CrawlerBaseMapper;
 import com.tzld.longarticle.recommend.server.mapper.crawler.CrawlerBaseMapper;
 import com.tzld.longarticle.recommend.server.model.dto.PublishContentDTO;
 import com.tzld.longarticle.recommend.server.model.dto.PublishContentDTO;
 import com.tzld.longarticle.recommend.server.model.entity.aigc.PublishAccount;
 import com.tzld.longarticle.recommend.server.model.entity.aigc.PublishAccount;
@@ -65,6 +66,8 @@ public class RecommendTest {
     private PublishAccountRepository publishAccountRepository;
     private PublishAccountRepository publishAccountRepository;
     @Autowired
     @Autowired
     private AigcBaseMapper aigcBaseMapper;
     private AigcBaseMapper aigcBaseMapper;
+    @Autowired
+    private PublishContentMapper publishContentMapper;
 
 
 //    @Test
 //    @Test
 //    void recall() {
 //    void recall() {
@@ -852,11 +855,11 @@ public class RecommendTest {
         }).filter(Objects::nonNull).collect(Collectors.toList());
         }).filter(Objects::nonNull).collect(Collectors.toList());
         List<PublishContentDTO> publishContents = new ArrayList<>();
         List<PublishContentDTO> publishContents = new ArrayList<>();
         for (List<PublishContentParam> partitions : Lists.partition(publishContentParamList, 100)) {
         for (List<PublishContentParam> partitions : Lists.partition(publishContentParamList, 100)) {
-            publishContents.addAll(aigcBaseMapper.getPublishContentByTitle(partitions));
+            publishContents.addAll(publishContentMapper.getPublishContentByTitle(partitions));
         }
         }
         List<String> publishContentIds = publishContents.stream().map(PublishContentDTO::getId).collect(Collectors.toList());
         List<String> publishContentIds = publishContents.stream().map(PublishContentDTO::getId).collect(Collectors.toList());
         for (List<String> partition : Lists.partition(publishContentIds, 500)) {
         for (List<String> partition : Lists.partition(publishContentIds, 500)) {
-            aigcBaseMapper.updatePublishContentSingleMiniProgram(partition);
+            publishContentMapper.updatePublishContentSingleMiniProgram(partition);
         }
         }
     }
     }
 }
 }

+ 14 - 2
long-article-recommend-service/src/test/java/com/tzld/longarticle/recommend/server/WxApiTest.java

@@ -1,18 +1,22 @@
 package com.tzld.longarticle.recommend.server;
 package com.tzld.longarticle.recommend.server;
 
 
-import com.tzld.longarticle.recommend.server.mapper.aigc.AigcBaseMapper;
+import com.tzld.longarticle.recommend.server.mapper.aigc.PublishContentMapper;
 import com.tzld.longarticle.recommend.server.mapper.longArticle.LongArticleBaseMapper;
 import com.tzld.longarticle.recommend.server.mapper.longArticle.LongArticleBaseMapper;
 import com.tzld.longarticle.recommend.server.model.entity.aigc.PublishAccount;
 import com.tzld.longarticle.recommend.server.model.entity.aigc.PublishAccount;
 import com.tzld.longarticle.recommend.server.remote.WxAccessTokenRemoteService;
 import com.tzld.longarticle.recommend.server.remote.WxAccessTokenRemoteService;
 import com.tzld.longarticle.recommend.server.remote.WxArticleDeleteService;
 import com.tzld.longarticle.recommend.server.remote.WxArticleDeleteService;
 import com.tzld.longarticle.recommend.server.repository.aigc.PublishAccountRepository;
 import com.tzld.longarticle.recommend.server.repository.aigc.PublishAccountRepository;
+import com.tzld.longarticle.recommend.server.service.recommend.ArticleAuditService;
+import lombok.extern.slf4j.Slf4j;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.Test;
 import org.springframework.boot.test.context.SpringBootTest;
 import org.springframework.boot.test.context.SpringBootTest;
+import org.springframework.util.StringUtils;
 
 
 import javax.annotation.Resource;
 import javax.annotation.Resource;
 import java.util.List;
 import java.util.List;
 
 
 @SpringBootTest(classes = Application.class)
 @SpringBootTest(classes = Application.class)
+@Slf4j
 public class WxApiTest {
 public class WxApiTest {
 
 
     @Resource
     @Resource
@@ -23,13 +27,21 @@ public class WxApiTest {
     private WxAccessTokenRemoteService wxAccessTokenRemoteService;
     private WxAccessTokenRemoteService wxAccessTokenRemoteService;
     @Resource
     @Resource
     private WxArticleDeleteService wxArticleDeleteService;
     private WxArticleDeleteService wxArticleDeleteService;
+    @Resource
+    private PublishContentMapper publishContentMapper;
+    @Resource
+    private ArticleAuditService articleAuditService;
 
 
     @Test
     @Test
     public void clearQuotaTest() {
     public void clearQuotaTest() {
         List<String> ghIds = longArticleBaseMapper.getDisAuditDeleteGhid();
         List<String> ghIds = longArticleBaseMapper.getDisAuditDeleteGhid();
         List<PublishAccount> publishAccountList = publishAccountRepository.getAllByGhIdIn(ghIds);
         List<PublishAccount> publishAccountList = publishAccountRepository.getAllByGhIdIn(ghIds);
         for (PublishAccount publishAccount : publishAccountList) {
         for (PublishAccount publishAccount : publishAccountList) {
-            String token = wxAccessTokenRemoteService.getAccessToken(publishAccount.getGhId());
+            String token = wxAccessTokenRemoteService.loadAccessToken(publishAccount.getGhId());
+            if(StringUtils.isEmpty(token)) {
+                log.error("token is null ghId:{}", publishAccount.getGhId());
+                continue;
+            }
             wxArticleDeleteService.clearQuota(token, publishAccount.getAppId());
             wxArticleDeleteService.clearQuota(token, publishAccount.getAppId());
         }
         }
     }
     }

+ 4 - 1
long-article-recommend-service/src/test/java/com/tzld/longarticle/recommend/server/XxlJobTest.java

@@ -3,6 +3,7 @@ package com.tzld.longarticle.recommend.server;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
 import com.ctrip.framework.apollo.spring.annotation.ApolloJsonValue;
 import com.tzld.longarticle.recommend.server.mapper.aigc.AigcBaseMapper;
 import com.tzld.longarticle.recommend.server.mapper.aigc.AigcBaseMapper;
+import com.tzld.longarticle.recommend.server.mapper.aigc.PublishContentMapper;
 import com.tzld.longarticle.recommend.server.mapper.longArticle.ArticleCategoryMapper;
 import com.tzld.longarticle.recommend.server.mapper.longArticle.ArticleCategoryMapper;
 import com.tzld.longarticle.recommend.server.model.dto.CrawlerContent;
 import com.tzld.longarticle.recommend.server.model.dto.CrawlerContent;
 import com.tzld.longarticle.recommend.server.model.dto.ProduceContentDTO;
 import com.tzld.longarticle.recommend.server.model.dto.ProduceContentDTO;
@@ -30,6 +31,8 @@ public class XxlJobTest {
     @Resource
     @Resource
     private AigcBaseMapper aigcBaseMapper;
     private AigcBaseMapper aigcBaseMapper;
     @Resource
     @Resource
+    private PublishContentMapper publishContentMapper;
+    @Resource
     private ArticleCategoryMapper articleCategoryMapper;
     private ArticleCategoryMapper articleCategoryMapper;
     @Resource
     @Resource
     private ArticlePoolPromotionSourceRepository articlePoolPromotionSourceRepository;
     private ArticlePoolPromotionSourceRepository articlePoolPromotionSourceRepository;
@@ -101,7 +104,7 @@ public class XxlJobTest {
 
 
     @Test
     @Test
     public void getAccountTypeListTest() {
     public void getAccountTypeListTest() {
-        List<PublishAccountTypeDTO> accountTypeList = aigcBaseMapper.getAccountTypeList(null);
+        List<PublishAccountTypeDTO> accountTypeList = publishContentMapper.getAccountTypeList(null);
         System.out.println(JSONObject.toJSONString(accountTypeList));
         System.out.println(JSONObject.toJSONString(accountTypeList));
     }
     }
 }
 }