소스 검색

Merge branch 'dev-xym-update-match-video' of Server/long-article-manage into master

xueyiming 4 일 전
부모
커밋
87aa01bad1
27개의 변경된 파일1775개의 추가작업 그리고 121개의 파일을 삭제
  1. 16 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/common/constants/RedisConstant.java
  2. 49 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/common/enums/NewContentStatusEnum.java
  3. 23 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/common/enums/NewMatchResultStatusEnum.java
  4. 19 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/component/ThreadPools.java
  5. 30 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/dao/mapper/longarticle/NewMatchVideoMapper.java
  6. 112 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/job/NewMatchVideoJob.java
  7. 92 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/po/longarticle/NewMatchVideo.java
  8. 652 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/po/longarticle/NewMatchVideoExample.java
  9. 0 1
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/vo/ContentItemVO.java
  10. 15 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/vo/LongArticleMatchContent.java
  11. 19 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/vo/MatchContentItem.java
  12. 16 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/vo/MatchContentStatusParam.java
  13. 13 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/vo/MatchContentsParam.java
  14. 21 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/NewMatchVideoService.java
  15. 17 3
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/ContentServiceImpl.java
  16. 9 2
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/CoreServiceImpl.java
  17. 4 14
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/CrawlerVideoServiceImpl.java
  18. 1 1
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/MatchVideoServiceImpl.java
  19. 226 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/NewMatchVideoServiceImpl.java
  20. 6 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/remote/AigcService.java
  21. 2 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/remote/MatchService.java
  22. 66 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/remote/impl/AigcServiceImpl.java
  23. 20 0
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/remote/impl/MatchServiceImpl.java
  24. 1 2
      long-article-server/src/main/java/com/tzld/piaoquan/longarticle/utils/other/OSSUploader.java
  25. 99 96
      long-article-server/src/main/resources/mapper/longarticle/MatchVideoMapper.xml
  26. 246 0
      long-article-server/src/main/resources/mapper/longarticle/NewMatchVideoMapper.xml
  27. 1 2
      long-article-server/src/main/resources/mybatis-generator-config.xml

+ 16 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/common/constants/RedisConstant.java

@@ -3,4 +3,20 @@ package com.tzld.piaoquan.longarticle.common.constants;
 public interface RedisConstant {
 
     String REDIS_COOKIE_KEY = "redis_cookie_key";
+
+    String KIMI_LOCK_KEY = "kimi_lock_key_%s";
+
+    String CRAWLER_LOCK_KEY = "crawler_lock_key_%s";
+
+    String UPLOAD_CRAWLER_LOCK_KEY = "upload_crawler_lock_key_%s";
+
+    String CRAWLER_FAIL_COUNT_KEY = "crawler_count_key_%s";
+
+    String UPLOAD_CRAWLER_FAIL_COUNT_KEY = "upload_crawler_count_key_%s";
+
+    String KIMI_FAIL_COUNT_KEY = "kimi_count_key_%s";
+
+    String EXIST_RESULT_KEY = "exist_result_key_%s";
+
+    String SINGLE_VIDEO_LOCK_KEY = "single_video_lock_key_%s";
 }

+ 49 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/common/enums/NewContentStatusEnum.java

@@ -0,0 +1,49 @@
+package com.tzld.piaoquan.longarticle.common.enums;
+
+public enum NewContentStatusEnum {
+
+    DEFAULT(0, "初始状态"),
+    KIMI_SUCCESS(101, "kimi执行成功"),
+    CRAWLER_SUCCESS(102, "爬取视频成功"),
+    ELT_SUCCESS(103, "下载成功"),
+    KIMI_FAIL(201, "kimi执行失败"),
+    CRAWLER_FAIL(202, "爬取视频失败"),
+    ELT_FAIL(203, "下载失败");
+
+
+    private final int statusCode;
+    private final String message;
+
+    NewContentStatusEnum(int statusCode, String message) {
+        this.statusCode = statusCode;
+        this.message = message;
+    }
+
+    public int getStatusCode() {
+        return statusCode;
+    }
+
+    public String getMessage() {
+        return message;
+    }
+
+    // 判断是否为成功状态
+    public static boolean isSuccess(int contentStatus) {
+        return contentStatus == ELT_SUCCESS.statusCode;
+    }
+
+    public static boolean isFail(int contentStatus) {
+        return contentStatus == KIMI_FAIL.statusCode || contentStatus == CRAWLER_FAIL.statusCode
+                || contentStatus == ELT_FAIL.statusCode;
+    }
+
+    // 获取错误信息
+    public static String getErrorMessage(int contentStatus) {
+        for (NewContentStatusEnum status : NewContentStatusEnum.values()) {
+            if (status.statusCode == contentStatus) {
+                return status.message;
+            }
+        }
+        return null;
+    }
+}

+ 23 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/common/enums/NewMatchResultStatusEnum.java

@@ -0,0 +1,23 @@
+package com.tzld.piaoquan.longarticle.common.enums;
+
+public enum NewMatchResultStatusEnum {
+    SUCCESS(5, "匹配成功"),
+    FAIL(6, "匹配失败");
+
+    private final int statusCode;
+    private final String message;
+
+    NewMatchResultStatusEnum(int statusCode, String message) {
+        this.statusCode = statusCode;
+        this.message = message;
+    }
+
+    public int getStatusCode() {
+        return statusCode;
+    }
+
+    public String getMessage() {
+        return message;
+    }
+
+}

+ 19 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/component/ThreadPools.java

@@ -0,0 +1,19 @@
+package com.tzld.piaoquan.longarticle.component;
+
+import com.tzld.piaoquan.longarticle.model.po.longarticle.MatchVideo;
+
+import java.util.concurrent.ArrayBlockingQueue;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ThreadPoolExecutor;
+
+public class ThreadPools {
+
+    // 定义一个线程池,设置消费线程的数量
+    public static final ThreadPoolExecutor newMatchKimiVideoPoolExecutor = (ThreadPoolExecutor) Executors.newFixedThreadPool(5);
+
+    // 定义一个线程池,设置消费线程的数量
+    public static final ThreadPoolExecutor newMatchCrawlerVideoPoolExecutor = (ThreadPoolExecutor) Executors.newFixedThreadPool(20);
+
+    // 定义一个线程池,设置消费线程的数量
+    public static final ThreadPoolExecutor newUploadCrawlerVideoPoolExecutor = (ThreadPoolExecutor) Executors.newFixedThreadPool(40);
+}

+ 30 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/dao/mapper/longarticle/NewMatchVideoMapper.java

@@ -0,0 +1,30 @@
+package com.tzld.piaoquan.longarticle.dao.mapper.longarticle;
+
+import com.tzld.piaoquan.longarticle.model.po.longarticle.NewMatchVideo;
+import com.tzld.piaoquan.longarticle.model.po.longarticle.NewMatchVideoExample;
+import java.util.List;
+import org.apache.ibatis.annotations.Param;
+
+public interface NewMatchVideoMapper {
+    long countByExample(NewMatchVideoExample example);
+
+    int deleteByExample(NewMatchVideoExample example);
+
+    int deleteByPrimaryKey(Long id);
+
+    int insert(NewMatchVideo record);
+
+    int insertSelective(NewMatchVideo record);
+
+    List<NewMatchVideo> selectByExample(NewMatchVideoExample example);
+
+    NewMatchVideo selectByPrimaryKey(Long id);
+
+    int updateByExampleSelective(@Param("record") NewMatchVideo record, @Param("example") NewMatchVideoExample example);
+
+    int updateByExample(@Param("record") NewMatchVideo record, @Param("example") NewMatchVideoExample example);
+
+    int updateByPrimaryKeySelective(NewMatchVideo record);
+
+    int updateByPrimaryKey(NewMatchVideo record);
+}

+ 112 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/job/NewMatchVideoJob.java

@@ -0,0 +1,112 @@
+package com.tzld.piaoquan.longarticle.job;
+
+import com.tzld.piaoquan.longarticle.common.enums.NewContentStatusEnum;
+import com.tzld.piaoquan.longarticle.common.enums.NewMatchResultStatusEnum;
+import com.tzld.piaoquan.longarticle.dao.mapper.longarticle.NewMatchVideoMapper;
+import com.tzld.piaoquan.longarticle.model.dto.AuditContentRequest;
+import com.tzld.piaoquan.longarticle.model.po.longarticle.NewMatchVideo;
+import com.tzld.piaoquan.longarticle.model.po.longarticle.NewMatchVideoExample;
+import com.tzld.piaoquan.longarticle.model.vo.MatchContentItem;
+import com.tzld.piaoquan.longarticle.model.vo.MatchContentStatusParam;
+import com.tzld.piaoquan.longarticle.service.local.NewMatchVideoService;
+import com.tzld.piaoquan.longarticle.service.remote.AigcService;
+import com.tzld.piaoquan.longarticle.service.remote.MatchService;
+import com.tzld.piaoquan.longarticle.utils.LarkRobotUtil;
+import com.xxl.job.core.biz.model.ReturnT;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+import org.springframework.util.CollectionUtils;
+
+import java.util.List;
+
+@Slf4j
+@Component
+public class NewMatchVideoJob {
+
+    @Autowired
+    private NewMatchVideoService newMatchVideoService;
+
+    @Autowired
+    private AigcService aigcService;
+
+    @Autowired
+    private NewMatchVideoMapper newMatchVideoMapper;
+
+    @Autowired
+    private MatchService matchService;
+
+    @XxlJob("matchContentJob")
+    public ReturnT<String> matchContentJob(String param) {
+        List<MatchContentItem> matchContentItemList = aigcService.getMatchContentItemList();
+        if (CollectionUtils.isEmpty(matchContentItemList)) {
+            return ReturnT.SUCCESS;
+        }
+        for (MatchContentItem matchContentItem : matchContentItemList) {
+            NewMatchVideoExample example = new NewMatchVideoExample();
+            example.createCriteria().andContentIdEqualTo(matchContentItem.getProduceContentId());
+            List<NewMatchVideo> newMatchVideos = newMatchVideoMapper.selectByExample(example);
+            if (CollectionUtils.isEmpty(newMatchVideos)) {
+                newMatchVideoService.addMatchVideo(matchContentItem);
+            } else {
+                NewMatchVideo newMatchVideo = newMatchVideos.get(0);
+                if (NewContentStatusEnum.isSuccess(newMatchVideo.getContentStatus())) {
+                    MatchContentStatusParam matchContentStatusParam = new MatchContentStatusParam();
+                    matchContentStatusParam.setProduceContentId(newMatchVideo.getContentId());
+                    matchContentStatusParam.setStatus(NewMatchResultStatusEnum.SUCCESS.getStatusCode());
+                    boolean res = aigcService.updateMatchContentStatus(matchContentStatusParam);
+                    if (res) {
+                        AuditContentRequest auditContentRequest = new AuditContentRequest();
+                        auditContentRequest.setContentId(newMatchVideo.getContentId());
+                        auditContentRequest.setFlowPoolLevel(newMatchVideo.getFlowPoolLevel());
+                        matchService.addAudit(auditContentRequest);
+                    }
+
+                }
+                if (NewContentStatusEnum.isFail(newMatchVideo.getContentStatus())) {
+                    MatchContentStatusParam matchContentStatusParam = new MatchContentStatusParam();
+                    matchContentStatusParam.setProduceContentId(newMatchVideo.getContentId());
+                    matchContentStatusParam.setStatus(NewMatchResultStatusEnum.FAIL.getStatusCode());
+                    aigcService.updateMatchContentStatus(matchContentStatusParam);
+                }
+            }
+        }
+        return ReturnT.SUCCESS;
+    }
+
+    @XxlJob("newKimiContentJob")
+    public ReturnT<String> kimiContentJob(String param) {
+        try {
+            newMatchVideoService.kimiContent();
+        } catch (Exception e) {
+            LarkRobotUtil.sendMessage("kimiContentJob异常,请及时查看,@薛一鸣");
+            log.error("kimiContentJob error", e);
+        }
+        return ReturnT.SUCCESS;
+    }
+
+    @XxlJob("newMatchCrawlerVideoJob")
+    public ReturnT<String> matchCrawlerVideoJob(String param) {
+        try {
+            newMatchVideoService.matchCrawlerVideo();
+        } catch (Exception e) {
+            LarkRobotUtil.sendMessage("newMatchCrawlerVideoJob异常,请及时查看,@薛一鸣");
+            log.error("newMatchCrawlerVideoJob error", e);
+        }
+        return ReturnT.SUCCESS;
+    }
+
+    @XxlJob("newUploadCrawlerVideoJob")
+    public ReturnT<String> uploadCrawlerVideoJob(String param) {
+        try {
+            newMatchVideoService.uploadCrawlerVideo();
+        } catch (Exception e) {
+            LarkRobotUtil.sendMessage("newUploadCrawlerVideoJob异常,请及时查看,@薛一鸣");
+            log.error("newUploadCrawlerVideoJob error", e);
+        }
+        return ReturnT.SUCCESS;
+    }
+
+
+}

+ 92 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/po/longarticle/NewMatchVideo.java

@@ -0,0 +1,92 @@
+package com.tzld.piaoquan.longarticle.model.po.longarticle;
+
+import java.util.Date;
+
+public class NewMatchVideo {
+    private Long id;
+
+    private String contentId;
+
+    private String flowPoolLevel;
+
+    private Integer contentStatus;
+
+    private Integer retryCount;
+
+    private Date createTime;
+
+    private Date updateTime;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getContentId() {
+        return contentId;
+    }
+
+    public void setContentId(String contentId) {
+        this.contentId = contentId;
+    }
+
+    public String getFlowPoolLevel() {
+        return flowPoolLevel;
+    }
+
+    public void setFlowPoolLevel(String flowPoolLevel) {
+        this.flowPoolLevel = flowPoolLevel;
+    }
+
+    public Integer getContentStatus() {
+        return contentStatus;
+    }
+
+    public void setContentStatus(Integer contentStatus) {
+        this.contentStatus = contentStatus;
+    }
+
+    public Integer getRetryCount() {
+        return retryCount;
+    }
+
+    public void setRetryCount(Integer retryCount) {
+        this.retryCount = retryCount;
+    }
+
+    public Date getCreateTime() {
+        return createTime;
+    }
+
+    public void setCreateTime(Date createTime) {
+        this.createTime = createTime;
+    }
+
+    public Date getUpdateTime() {
+        return updateTime;
+    }
+
+    public void setUpdateTime(Date updateTime) {
+        this.updateTime = updateTime;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", id=").append(id);
+        sb.append(", contentId=").append(contentId);
+        sb.append(", flowPoolLevel=").append(flowPoolLevel);
+        sb.append(", contentStatus=").append(contentStatus);
+        sb.append(", retryCount=").append(retryCount);
+        sb.append(", createTime=").append(createTime);
+        sb.append(", updateTime=").append(updateTime);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 652 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/po/longarticle/NewMatchVideoExample.java

@@ -0,0 +1,652 @@
+package com.tzld.piaoquan.longarticle.model.po.longarticle;
+
+import com.tzld.piaoquan.longarticle.utils.page.Page;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
+public class NewMatchVideoExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    protected Page page;
+
+    public NewMatchVideoExample() {
+        oredCriteria = new ArrayList<Criteria>();
+    }
+
+    public void setOrderByClause(String orderByClause) {
+        this.orderByClause = orderByClause;
+    }
+
+    public String getOrderByClause() {
+        return orderByClause;
+    }
+
+    public void setDistinct(boolean distinct) {
+        this.distinct = distinct;
+    }
+
+    public boolean isDistinct() {
+        return distinct;
+    }
+
+    public List<Criteria> getOredCriteria() {
+        return oredCriteria;
+    }
+
+    public void or(Criteria criteria) {
+        oredCriteria.add(criteria);
+    }
+
+    public Criteria or() {
+        Criteria criteria = createCriteriaInternal();
+        oredCriteria.add(criteria);
+        return criteria;
+    }
+
+    public Criteria createCriteria() {
+        Criteria criteria = createCriteriaInternal();
+        if (oredCriteria.size() == 0) {
+            oredCriteria.add(criteria);
+        }
+        return criteria;
+    }
+
+    protected Criteria createCriteriaInternal() {
+        Criteria criteria = new Criteria();
+        return criteria;
+    }
+
+    public void clear() {
+        oredCriteria.clear();
+        orderByClause = null;
+        distinct = false;
+    }
+
+    public void setPage(Page page) {
+        this.page=page;
+    }
+
+    public Page getPage() {
+        return page;
+    }
+
+    protected abstract static class GeneratedCriteria {
+        protected List<Criterion> criteria;
+
+        protected GeneratedCriteria() {
+            super();
+            criteria = new ArrayList<Criterion>();
+        }
+
+        public boolean isValid() {
+            return criteria.size() > 0;
+        }
+
+        public List<Criterion> getAllCriteria() {
+            return criteria;
+        }
+
+        public List<Criterion> getCriteria() {
+            return criteria;
+        }
+
+        protected void addCriterion(String condition) {
+            if (condition == null) {
+                throw new RuntimeException("Value for condition cannot be null");
+            }
+            criteria.add(new Criterion(condition));
+        }
+
+        protected void addCriterion(String condition, Object value, String property) {
+            if (value == null) {
+                throw new RuntimeException("Value for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value));
+        }
+
+        protected void addCriterion(String condition, Object value1, Object value2, String property) {
+            if (value1 == null || value2 == null) {
+                throw new RuntimeException("Between values for " + property + " cannot be null");
+            }
+            criteria.add(new Criterion(condition, value1, value2));
+        }
+
+        public Criteria andIdIsNull() {
+            addCriterion("id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIsNotNull() {
+            addCriterion("id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdEqualTo(Long value) {
+            addCriterion("id =", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotEqualTo(Long value) {
+            addCriterion("id <>", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThan(Long value) {
+            addCriterion("id >", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("id >=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThan(Long value) {
+            addCriterion("id <", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdLessThanOrEqualTo(Long value) {
+            addCriterion("id <=", value, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdIn(List<Long> values) {
+            addCriterion("id in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotIn(List<Long> values) {
+            addCriterion("id not in", values, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdBetween(Long value1, Long value2) {
+            addCriterion("id between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andIdNotBetween(Long value1, Long value2) {
+            addCriterion("id not between", value1, value2, "id");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentIdIsNull() {
+            addCriterion("content_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentIdIsNotNull() {
+            addCriterion("content_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentIdEqualTo(String value) {
+            addCriterion("content_id =", value, "contentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentIdNotEqualTo(String value) {
+            addCriterion("content_id <>", value, "contentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentIdGreaterThan(String value) {
+            addCriterion("content_id >", value, "contentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentIdGreaterThanOrEqualTo(String value) {
+            addCriterion("content_id >=", value, "contentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentIdLessThan(String value) {
+            addCriterion("content_id <", value, "contentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentIdLessThanOrEqualTo(String value) {
+            addCriterion("content_id <=", value, "contentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentIdLike(String value) {
+            addCriterion("content_id like", value, "contentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentIdNotLike(String value) {
+            addCriterion("content_id not like", value, "contentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentIdIn(List<String> values) {
+            addCriterion("content_id in", values, "contentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentIdNotIn(List<String> values) {
+            addCriterion("content_id not in", values, "contentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentIdBetween(String value1, String value2) {
+            addCriterion("content_id between", value1, value2, "contentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentIdNotBetween(String value1, String value2) {
+            addCriterion("content_id not between", value1, value2, "contentId");
+            return (Criteria) this;
+        }
+
+        public Criteria andFlowPoolLevelIsNull() {
+            addCriterion("flow_pool_level is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andFlowPoolLevelIsNotNull() {
+            addCriterion("flow_pool_level is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andFlowPoolLevelEqualTo(String value) {
+            addCriterion("flow_pool_level =", value, "flowPoolLevel");
+            return (Criteria) this;
+        }
+
+        public Criteria andFlowPoolLevelNotEqualTo(String value) {
+            addCriterion("flow_pool_level <>", value, "flowPoolLevel");
+            return (Criteria) this;
+        }
+
+        public Criteria andFlowPoolLevelGreaterThan(String value) {
+            addCriterion("flow_pool_level >", value, "flowPoolLevel");
+            return (Criteria) this;
+        }
+
+        public Criteria andFlowPoolLevelGreaterThanOrEqualTo(String value) {
+            addCriterion("flow_pool_level >=", value, "flowPoolLevel");
+            return (Criteria) this;
+        }
+
+        public Criteria andFlowPoolLevelLessThan(String value) {
+            addCriterion("flow_pool_level <", value, "flowPoolLevel");
+            return (Criteria) this;
+        }
+
+        public Criteria andFlowPoolLevelLessThanOrEqualTo(String value) {
+            addCriterion("flow_pool_level <=", value, "flowPoolLevel");
+            return (Criteria) this;
+        }
+
+        public Criteria andFlowPoolLevelLike(String value) {
+            addCriterion("flow_pool_level like", value, "flowPoolLevel");
+            return (Criteria) this;
+        }
+
+        public Criteria andFlowPoolLevelNotLike(String value) {
+            addCriterion("flow_pool_level not like", value, "flowPoolLevel");
+            return (Criteria) this;
+        }
+
+        public Criteria andFlowPoolLevelIn(List<String> values) {
+            addCriterion("flow_pool_level in", values, "flowPoolLevel");
+            return (Criteria) this;
+        }
+
+        public Criteria andFlowPoolLevelNotIn(List<String> values) {
+            addCriterion("flow_pool_level not in", values, "flowPoolLevel");
+            return (Criteria) this;
+        }
+
+        public Criteria andFlowPoolLevelBetween(String value1, String value2) {
+            addCriterion("flow_pool_level between", value1, value2, "flowPoolLevel");
+            return (Criteria) this;
+        }
+
+        public Criteria andFlowPoolLevelNotBetween(String value1, String value2) {
+            addCriterion("flow_pool_level not between", value1, value2, "flowPoolLevel");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentStatusIsNull() {
+            addCriterion("content_status is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentStatusIsNotNull() {
+            addCriterion("content_status is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentStatusEqualTo(Integer value) {
+            addCriterion("content_status =", value, "contentStatus");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentStatusNotEqualTo(Integer value) {
+            addCriterion("content_status <>", value, "contentStatus");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentStatusGreaterThan(Integer value) {
+            addCriterion("content_status >", value, "contentStatus");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentStatusGreaterThanOrEqualTo(Integer value) {
+            addCriterion("content_status >=", value, "contentStatus");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentStatusLessThan(Integer value) {
+            addCriterion("content_status <", value, "contentStatus");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentStatusLessThanOrEqualTo(Integer value) {
+            addCriterion("content_status <=", value, "contentStatus");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentStatusIn(List<Integer> values) {
+            addCriterion("content_status in", values, "contentStatus");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentStatusNotIn(List<Integer> values) {
+            addCriterion("content_status not in", values, "contentStatus");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentStatusBetween(Integer value1, Integer value2) {
+            addCriterion("content_status between", value1, value2, "contentStatus");
+            return (Criteria) this;
+        }
+
+        public Criteria andContentStatusNotBetween(Integer value1, Integer value2) {
+            addCriterion("content_status not between", value1, value2, "contentStatus");
+            return (Criteria) this;
+        }
+
+        public Criteria andRetryCountIsNull() {
+            addCriterion("retry_count is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andRetryCountIsNotNull() {
+            addCriterion("retry_count is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andRetryCountEqualTo(Integer value) {
+            addCriterion("retry_count =", value, "retryCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andRetryCountNotEqualTo(Integer value) {
+            addCriterion("retry_count <>", value, "retryCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andRetryCountGreaterThan(Integer value) {
+            addCriterion("retry_count >", value, "retryCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andRetryCountGreaterThanOrEqualTo(Integer value) {
+            addCriterion("retry_count >=", value, "retryCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andRetryCountLessThan(Integer value) {
+            addCriterion("retry_count <", value, "retryCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andRetryCountLessThanOrEqualTo(Integer value) {
+            addCriterion("retry_count <=", value, "retryCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andRetryCountIn(List<Integer> values) {
+            addCriterion("retry_count in", values, "retryCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andRetryCountNotIn(List<Integer> values) {
+            addCriterion("retry_count not in", values, "retryCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andRetryCountBetween(Integer value1, Integer value2) {
+            addCriterion("retry_count between", value1, value2, "retryCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andRetryCountNotBetween(Integer value1, Integer value2) {
+            addCriterion("retry_count not between", value1, value2, "retryCount");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNull() {
+            addCriterion("create_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIsNotNull() {
+            addCriterion("create_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeEqualTo(Date value) {
+            addCriterion("create_time =", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotEqualTo(Date value) {
+            addCriterion("create_time <>", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThan(Date value) {
+            addCriterion("create_time >", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("create_time >=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThan(Date value) {
+            addCriterion("create_time <", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeLessThanOrEqualTo(Date value) {
+            addCriterion("create_time <=", value, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeIn(List<Date> values) {
+            addCriterion("create_time in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotIn(List<Date> values) {
+            addCriterion("create_time not in", values, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeBetween(Date value1, Date value2) {
+            addCriterion("create_time between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimeNotBetween(Date value1, Date value2) {
+            addCriterion("create_time not between", value1, value2, "createTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeIsNull() {
+            addCriterion("update_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeIsNotNull() {
+            addCriterion("update_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeEqualTo(Date value) {
+            addCriterion("update_time =", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeNotEqualTo(Date value) {
+            addCriterion("update_time <>", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeGreaterThan(Date value) {
+            addCriterion("update_time >", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeGreaterThanOrEqualTo(Date value) {
+            addCriterion("update_time >=", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeLessThan(Date value) {
+            addCriterion("update_time <", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeLessThanOrEqualTo(Date value) {
+            addCriterion("update_time <=", value, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeIn(List<Date> values) {
+            addCriterion("update_time in", values, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeNotIn(List<Date> values) {
+            addCriterion("update_time not in", values, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeBetween(Date value1, Date value2) {
+            addCriterion("update_time between", value1, value2, "updateTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andUpdateTimeNotBetween(Date value1, Date value2) {
+            addCriterion("update_time not between", value1, value2, "updateTime");
+            return (Criteria) this;
+        }
+    }
+
+    public static class Criteria extends GeneratedCriteria {
+
+        protected Criteria() {
+            super();
+        }
+    }
+
+    public static class Criterion {
+        private String condition;
+
+        private Object value;
+
+        private Object secondValue;
+
+        private boolean noValue;
+
+        private boolean singleValue;
+
+        private boolean betweenValue;
+
+        private boolean listValue;
+
+        private String typeHandler;
+
+        public String getCondition() {
+            return condition;
+        }
+
+        public Object getValue() {
+            return value;
+        }
+
+        public Object getSecondValue() {
+            return secondValue;
+        }
+
+        public boolean isNoValue() {
+            return noValue;
+        }
+
+        public boolean isSingleValue() {
+            return singleValue;
+        }
+
+        public boolean isBetweenValue() {
+            return betweenValue;
+        }
+
+        public boolean isListValue() {
+            return listValue;
+        }
+
+        public String getTypeHandler() {
+            return typeHandler;
+        }
+
+        protected Criterion(String condition) {
+            super();
+            this.condition = condition;
+            this.typeHandler = null;
+            this.noValue = true;
+        }
+
+        protected Criterion(String condition, Object value, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.typeHandler = typeHandler;
+            if (value instanceof List<?>) {
+                this.listValue = true;
+            } else {
+                this.singleValue = true;
+            }
+        }
+
+        protected Criterion(String condition, Object value) {
+            this(condition, value, null);
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue, String typeHandler) {
+            super();
+            this.condition = condition;
+            this.value = value;
+            this.secondValue = secondValue;
+            this.typeHandler = typeHandler;
+            this.betweenValue = true;
+        }
+
+        protected Criterion(String condition, Object value, Object secondValue) {
+            this(condition, value, secondValue, null);
+        }
+    }
+}

+ 0 - 1
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/vo/ContentItemVO.java

@@ -7,7 +7,6 @@ import lombok.experimental.Accessors;
 
 @Getter
 @Setter
-@Accessors(chain = true)
 @ToString
 public class ContentItemVO {
     //"发布内容ID")

+ 15 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/vo/LongArticleMatchContent.java

@@ -0,0 +1,15 @@
+package com.tzld.piaoquan.longarticle.model.vo;
+
+import lombok.Data;
+import lombok.ToString;
+
+import java.util.List;
+
+@Data
+@ToString
+public class LongArticleMatchContent {
+
+    private Long totalCount;
+
+    private List<MatchContentItem> contentItemList;
+}

+ 19 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/vo/MatchContentItem.java

@@ -0,0 +1,19 @@
+package com.tzld.piaoquan.longarticle.model.vo;
+
+import lombok.Data;
+import lombok.ToString;
+
+@Data
+@ToString
+public class MatchContentItem {
+
+    private String channelContentId;
+
+    private String content;
+
+    private String flowPoolLevelTag;
+
+    private String produceContentId;
+
+    private String title;
+}

+ 16 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/vo/MatchContentStatusParam.java

@@ -0,0 +1,16 @@
+package com.tzld.piaoquan.longarticle.model.vo;
+
+import lombok.Getter;
+import lombok.Setter;
+
+@Getter
+@Setter
+public class MatchContentStatusParam {
+
+    //发布内容ID
+    private String produceContentId;
+    //小程序匹配状态(2-匹配成功,3-匹配失败)
+    private Integer status;
+    //匹配失败原因
+    private String errorMsg;
+}

+ 13 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/vo/MatchContentsParam.java

@@ -0,0 +1,13 @@
+package com.tzld.piaoquan.longarticle.model.vo;
+
+import lombok.Data;
+import lombok.ToString;
+
+@Data
+@ToString
+public class MatchContentsParam {
+
+    private Integer pageNum;
+
+    private Integer pageSize;
+}

+ 21 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/NewMatchVideoService.java

@@ -0,0 +1,21 @@
+package com.tzld.piaoquan.longarticle.service.local;
+
+import com.tzld.piaoquan.longarticle.common.enums.NewContentStatusEnum;
+import com.tzld.piaoquan.longarticle.model.bo.MatchContent;
+import com.tzld.piaoquan.longarticle.model.po.longarticle.NewMatchVideo;
+import com.tzld.piaoquan.longarticle.model.vo.MatchContentItem;
+
+import java.util.List;
+
+import static com.tzld.piaoquan.longarticle.component.ThreadPools.*;
+
+public interface NewMatchVideoService {
+
+    void addMatchVideo(MatchContentItem matchContentItem);
+
+    void kimiContent() throws InterruptedException;
+
+    void matchCrawlerVideo() throws InterruptedException;
+
+    void uploadCrawlerVideo() throws InterruptedException;
+}

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

@@ -19,6 +19,7 @@ import com.tzld.piaoquan.longarticle.model.vo.*;
 import com.tzld.piaoquan.longarticle.service.local.ContentService;
 import com.tzld.piaoquan.longarticle.service.local.KimiService;
 import com.tzld.piaoquan.longarticle.service.remote.AigcService;
+import com.tzld.piaoquan.longarticle.service.remote.MatchService;
 import com.tzld.piaoquan.longarticle.service.remote.SortService;
 import com.tzld.piaoquan.longarticle.service.remote.VideoService;
 import com.tzld.piaoquan.longarticle.utils.DateUtil;
@@ -95,6 +96,9 @@ public class ContentServiceImpl implements ContentService {
     @Autowired
     private ContentPlatformVideoMapper contentPlatformVideoMapper;
 
+    @Autowired
+    private MatchService matchService;
+
     public void addMatchContent(MatchVideo matchVideo, String publishContentId) {
         PublishMatchContent publishMatchContent = new PublishMatchContent();
         publishMatchContent.setTraceId(matchVideo.getTraceId());
@@ -122,10 +126,19 @@ public class ContentServiceImpl implements ContentService {
                 .andPublishFlagIn(Arrays.asList(1, 2));
         matchVideoExample.setOrderByClause("publish_flag desc");
         List<MatchVideo> matchVideos = matchVideoMapper.selectByExample(matchVideoExample);
-        if (CollectionUtils.isEmpty(matchVideos)) {
-            return null;
+        if (!CollectionUtils.isEmpty(matchVideos)) {
+            return matchVideos.get(0);
         }
-        return matchVideos.get(0);
+        MatchVideo newMatchVideo = matchVideos.get(0);
+        newMatchVideo.setTraceId(String.format("search-%s-%s", UUID.randomUUID(), System.currentTimeMillis() / 1000));
+        newMatchVideo.setContentId(publishContent.getSourceId());
+        newMatchVideo.setFlowPoolLevel(publishContent.getContentPoolType());
+        newMatchVideo.setGhId(planAccount.getGhId());
+        newMatchVideo.setAccountName(planAccount.getAccountName());
+        newMatchVideo.setContentStatus(ContentStatusEnum.SUCCESS_3.getStatusCode());
+        newMatchVideo.setPublishFlag(PublicFlagEnum.NOT_PUBLIC.getStatusCode());
+        matchVideoMapper.insertSelective(newMatchVideo);
+        return newMatchVideo;
     }
 
     public void updateMatchContent(PublishContent publishContent,
@@ -260,6 +273,7 @@ public class ContentServiceImpl implements ContentService {
             statusParam.setErrorMsg("小程序为空");
             aigcService.updateMatchMiniprogramStatus(statusParam);
             log.info("文章获取小程序为空 matchVideo={} planAccount={}", matchVideo, planAccount);
+            matchService.notHasMiniVideos(publishContent.getSourceId());
             return new ArrayList<>();
         }
         List<VideoDetail> videoDetails = publishVideo(contentMiniVideos, matchVideo, publishContent);

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

@@ -10,6 +10,7 @@ import com.tzld.piaoquan.longarticle.dao.mapper.crawler.FwhDailyPublishDetailMap
 import com.tzld.piaoquan.longarticle.dao.mapper.longarticle.*;
 import com.tzld.piaoquan.longarticle.model.bo.MatchContent;
 import com.tzld.piaoquan.longarticle.model.bo.VideoDetail;
+import com.tzld.piaoquan.longarticle.model.dto.AuditContentRequest;
 import com.tzld.piaoquan.longarticle.model.dto.MiniprogramCardRequest;
 import com.tzld.piaoquan.longarticle.model.dto.PublishArticleData;
 import com.tzld.piaoquan.longarticle.model.po.crawler.ArticleUseGroup;
@@ -388,8 +389,14 @@ public class CoreServiceImpl implements CoreService {
                                         MatchMiniprogramStatusParam statusParam = new MatchMiniprogramStatusParam();
                                         statusParam.setStatus(MatchResultStatusEnum.SUCCESS.getStatusCode());
                                         statusParam.setPublishContentId(matchContent.getPublishContentId());
-                                        aigcService.updateMatchMiniprogramStatus(statusParam);
-                                        contentService.addMatchContent(matchVideo, matchContent.getPublishContentId());
+                                        boolean res = aigcService.updateMatchMiniprogramStatus(statusParam);
+                                        if (res) {
+                                            contentService.addMatchContent(matchVideo, matchContent.getPublishContentId());
+                                            AuditContentRequest auditContentRequest = new AuditContentRequest();
+                                            auditContentRequest.setContentId(matchContent.getSourceId());
+                                            auditContentRequest.setFlowPoolLevel(matchContent.getFlowPoolLevelTag());
+                                            matchService.addAudit(auditContentRequest);
+                                        }
                                         continue;
                                     }
                                     if (ContentStatusEnum.isFail(matchVideo1.getContentStatus())) {

+ 4 - 14
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/CrawlerVideoServiceImpl.java

@@ -109,22 +109,12 @@ public class CrawlerVideoServiceImpl {
     }
 
 
-    public boolean uploadCrawlerVideo(MatchVideo matchVideo) {
-        if (existUploadCrawlerVideo(matchVideo.getContentId())) {
+    public boolean uploadCrawlerVideo(String contentId, String flowPoolLeve) {
+        if (existUploadCrawlerVideo(contentId)) {
             return true;
         }
-        boolean pushRes = pushOss(matchVideo.getContentId());
-        log.info("uploadCrawlerVideo pushRes={} contentId={}", pushRes, matchVideo.getContentId());
-        if (pushRes) {
-            AuditContentRequest auditContentRequest = new AuditContentRequest();
-            auditContentRequest.setContentId(matchVideo.getContentId());
-            auditContentRequest.setFlowPoolLevel(matchVideo.getFlowPoolLevel());
-            boolean addAudit = matchService.addAudit(auditContentRequest);
-            if (!addAudit) {
-                LarkRobotUtil.sendMessage("添加审核文章失败 contentId=" + matchVideo.getContentId() +
-                        " flowPoolLevel=" + matchVideo.getFlowPoolLevel());
-            }
-        }
+        boolean pushRes = pushOss(contentId);
+        log.info("uploadCrawlerVideo pushRes={} contentId={}", pushRes, contentId);
         return pushRes;
     }
 

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

@@ -557,7 +557,7 @@ public class MatchVideoServiceImpl {
             String lockValue = UUID.randomUUID().toString();
             boolean lock = redisLock.tryLock(lockKey, lockValue, 20, TimeUnit.MINUTES);
             if (lock) {
-                boolean res = crawlerVideoService.uploadCrawlerVideo(matchVideo);
+                boolean res = crawlerVideoService.uploadCrawlerVideo(matchVideo.getContentId(), matchVideo.getFlowPoolLevel());
                 if (res) {
                     successMatchVideo(matchVideo);
                     log.info("uploadCrawlerVideo success contentId={}", matchVideo.getContentId());

+ 226 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/NewMatchVideoServiceImpl.java

@@ -0,0 +1,226 @@
+package com.tzld.piaoquan.longarticle.service.local.impl;
+
+import com.tzld.piaoquan.longarticle.common.enums.NewContentStatusEnum;
+import com.tzld.piaoquan.longarticle.dao.mapper.aigc.ProducePlanExeRecordMapper;
+import com.tzld.piaoquan.longarticle.dao.mapper.longarticle.LongArticlesTextMapper;
+import com.tzld.piaoquan.longarticle.dao.mapper.longarticle.NewMatchVideoMapper;
+import com.tzld.piaoquan.longarticle.dao.mapper.longarticle.PromotionSourceMapper;
+import com.tzld.piaoquan.longarticle.model.bo.MatchContent;
+import com.tzld.piaoquan.longarticle.model.po.aigc.ProducePlanExeRecord;
+import com.tzld.piaoquan.longarticle.model.po.aigc.ProducePlanExeRecordExample;
+import com.tzld.piaoquan.longarticle.model.po.longarticle.*;
+import com.tzld.piaoquan.longarticle.model.vo.MatchContentItem;
+import com.tzld.piaoquan.longarticle.service.local.KimiService;
+import com.tzld.piaoquan.longarticle.service.local.NewMatchVideoService;
+import com.tzld.piaoquan.longarticle.service.remote.AigcService;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.util.CollectionUtils;
+
+import java.util.List;
+import java.util.concurrent.CountDownLatch;
+import java.util.concurrent.ExecutorService;
+import java.util.function.Consumer;
+
+import static com.tzld.piaoquan.longarticle.component.ThreadPools.*;
+
+@Slf4j
+@Service
+public class NewMatchVideoServiceImpl implements NewMatchVideoService {
+
+    @Autowired
+    KimiService kimiService;
+
+    @Autowired
+    private CrawlerVideoServiceImpl crawlerVideoService;
+
+    @Autowired
+    private ProducePlanExeRecordMapper producePlanExeRecordMapper;
+
+    @Autowired
+    private PromotionSourceMapper promotionSourceMapper;
+
+    @Autowired
+    private NewMatchVideoMapper newMatchVideoMapper;
+
+    @Autowired
+    private LongArticlesTextMapper longArticlesTextMapper;
+
+    @Autowired
+    private AigcService aigcService;
+
+
+    @Transactional
+    @Override
+    public void addMatchVideo(MatchContentItem matchContentItem) {
+        NewMatchVideoExample example = new NewMatchVideoExample();
+        example.createCriteria().andContentIdEqualTo(matchContentItem.getProduceContentId());
+        long l = newMatchVideoMapper.countByExample(example);
+        if (l > 0) {
+            return;
+        }
+        NewMatchVideo newMatchVideo = new NewMatchVideo();
+        newMatchVideo.setContentId(matchContentItem.getProduceContentId());
+        newMatchVideo.setFlowPoolLevel(matchContentItem.getFlowPoolLevelTag());
+        newMatchVideo.setContentStatus(NewContentStatusEnum.DEFAULT.getStatusCode());
+        newMatchVideoMapper.insertSelective(newMatchVideo);
+        LongArticlesTextExample longArticlesTextExample = new LongArticlesTextExample();
+        longArticlesTextExample.createCriteria().andContentIdEqualTo(matchContentItem.getProduceContentId());
+        long l1 = longArticlesTextMapper.countByExample(longArticlesTextExample);
+        if (l1 == 0) {
+            LongArticlesText longArticlesText = new LongArticlesText();
+            longArticlesText.setArticleTitle(matchContentItem.getTitle());
+            longArticlesText.setArticleText(matchContentItem.getContent());
+            longArticlesText.setContentId(matchContentItem.getProduceContentId());
+            longArticlesText.setKimiStatus(0);
+            longArticlesTextMapper.insertSelective(longArticlesText);
+        }
+    }
+
+
+    // 抽取公共的查询逻辑
+    private List<NewMatchVideo> queryMatchVideosByStatus(NewContentStatusEnum status) {
+        NewMatchVideoExample example = new NewMatchVideoExample();
+        example.createCriteria().andContentStatusEqualTo(status.getStatusCode());
+        return newMatchVideoMapper.selectByExample(example);
+    }
+
+    // 抽取公共的并行处理逻辑
+    private void processVideosInParallel(List<NewMatchVideo> videos,
+                                         Consumer<NewMatchVideo> processor,
+                                         ExecutorService executor) throws InterruptedException {
+        if (CollectionUtils.isEmpty(videos)) {
+            return;
+        }
+
+        CountDownLatch countDownLatch = new CountDownLatch(videos.size());
+        for (NewMatchVideo video : videos) {
+            executor.execute(() -> {
+                try {
+                    processor.accept(video);
+                } finally {
+                    countDownLatch.countDown();
+                }
+            });
+        }
+
+        countDownLatch.await();
+    }
+
+    // 抽取公共的状态更新逻辑
+    private void updateVideoStatus(NewMatchVideo video, boolean success,
+                                   NewContentStatusEnum successStatus,
+                                   NewContentStatusEnum failStatus) {
+        int retryCount = video.getRetryCount();
+        int newStatus;
+
+        if (success) {
+            newStatus = successStatus.getStatusCode();
+            retryCount = 0;
+        } else {
+            retryCount++;
+            newStatus = (retryCount > 3)
+                    ? failStatus.getStatusCode()
+                    : video.getContentStatus();
+        }
+
+        video.setContentStatus(newStatus);
+        video.setRetryCount(retryCount);
+
+        try {
+            newMatchVideoMapper.updateByPrimaryKeySelective(video);
+        } catch (Exception e) {
+            log.error("Failed to update video status for ID: {}", video.getContentId(), e);
+        }
+    }
+
+    @Override
+    public void kimiContent() throws InterruptedException {
+        List<NewMatchVideo> videos = queryMatchVideosByStatus(NewContentStatusEnum.DEFAULT);
+        processVideosInParallel(videos,
+                this::processKimiMatchContent,
+                newMatchKimiVideoPoolExecutor);
+    }
+
+    @Override
+    public void matchCrawlerVideo() throws InterruptedException {
+        List<NewMatchVideo> videos = queryMatchVideosByStatus(NewContentStatusEnum.KIMI_SUCCESS);
+        processVideosInParallel(videos,
+                this::processCrawlerMatchContent,
+                newMatchCrawlerVideoPoolExecutor);
+    }
+
+    @Override
+    public void uploadCrawlerVideo() throws InterruptedException {
+        List<NewMatchVideo> videos = queryMatchVideosByStatus(NewContentStatusEnum.CRAWLER_SUCCESS);
+        processVideosInParallel(videos,
+                this::processUploadCrawlerVideo,
+                newUploadCrawlerVideoPoolExecutor);
+    }
+
+    private void processKimiMatchContent(NewMatchVideo newMatchVideo) {
+        boolean updateSuccess = false;
+        try {
+            updateSuccess = kimiService.updateKimiContent(newMatchVideo.getContentId());
+        } catch (Exception e) {
+            log.error("Failed to update Kimi content for ID: {}", newMatchVideo.getContentId(), e);
+        }
+
+        updateVideoStatus(newMatchVideo, updateSuccess,
+                NewContentStatusEnum.KIMI_SUCCESS,
+                NewContentStatusEnum.KIMI_FAIL);
+    }
+
+    public void processCrawlerMatchContent(NewMatchVideo newMatchVideo) {
+        boolean updateSuccess = false;
+        try {
+            LongArticlesText kimiText = kimiService.getKimiText(newMatchVideo.getContentId());
+            String rootContentId = getRootContentId(newMatchVideo.getContentId());
+            updateSuccess = crawlerVideoService.addCrawlerVideo(newMatchVideo.getContentId(), rootContentId, kimiText);
+        } catch (Exception e) {
+            log.error("Failed to crawler match video content for ID: {}", newMatchVideo.getContentId(), e);
+        }
+
+        updateVideoStatus(newMatchVideo, updateSuccess,
+                NewContentStatusEnum.CRAWLER_SUCCESS,
+                NewContentStatusEnum.CRAWLER_FAIL);
+    }
+
+    private void processUploadCrawlerVideo(NewMatchVideo newMatchVideo) {
+        boolean updateSuccess = false;
+        try {
+            updateSuccess = crawlerVideoService.uploadCrawlerVideo(newMatchVideo.getContentId(), newMatchVideo.getFlowPoolLevel());
+        } catch (Exception e) {
+            log.error("Failed to upload crawler video content for ID: {}", newMatchVideo.getContentId(), e);
+        }
+
+        updateVideoStatus(newMatchVideo, updateSuccess,
+                NewContentStatusEnum.ELT_SUCCESS,
+                NewContentStatusEnum.ELT_FAIL);
+
+    }
+
+    private String getRootContentId(String contentId) {
+        ProducePlanExeRecordExample example = new ProducePlanExeRecordExample();
+        example.createCriteria().andPlanExeIdEqualTo(contentId);
+        List<ProducePlanExeRecord> producePlanExeRecords = producePlanExeRecordMapper.selectByExample(example);
+        if (!CollectionUtils.isEmpty(producePlanExeRecords)) {
+            String channelContentId = producePlanExeRecords.get(0).getChannelContentId();
+            if (channelContentId == null) {
+                return null;
+            }
+            PromotionSourceExample promotionSourceExample = new PromotionSourceExample();
+            promotionSourceExample.createCriteria().andChannelContentIdEqualTo(channelContentId);
+            List<PromotionSource> promotionSources = promotionSourceMapper.selectByExample(promotionSourceExample);
+            if (CollectionUtils.isEmpty(promotionSources)) {
+                return null;
+            }
+            return promotionSources.get(0).getRootProduceContentId();
+        }
+        return null;
+    }
+
+
+}

+ 6 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/remote/AigcService.java

@@ -30,4 +30,10 @@ public interface AigcService {
     List<PushRecordVO> getTodayPushRecords(PushRecordParam param);
 
     List<SpecialSettingVO> getSpecialSetting();
+
+    List<MatchContentItem> getMatchContentItemList();
+
+    LongArticleMatchContent listWaitingMatchContents(MatchContentsParam param);
+
+    boolean updateMatchContentStatus(MatchContentStatusParam param);
 }

+ 2 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/remote/MatchService.java

@@ -8,4 +8,6 @@ public interface MatchService {
     Integer matchMiniprogramVideo(MiniprogramCardRequest request);
 
     boolean addAudit(AuditContentRequest request);
+
+    boolean notHasMiniVideos(String sourceId);
 }

+ 66 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/remote/impl/AigcServiceImpl.java

@@ -13,6 +13,7 @@ import org.apache.commons.lang3.StringUtils;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 
+import java.util.ArrayList;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -247,4 +248,69 @@ public class AigcServiceImpl implements AigcService {
         return null;
     }
 
+    //分页获取待匹配内容列表
+    @Override
+    public List<MatchContentItem> getMatchContentItemList() {
+        List<MatchContentItem> resultList = new ArrayList<>();
+        MatchContentsParam param = new MatchContentsParam();
+        param.setPageSize(500); // 固定页大小
+
+        // 首次请求必须设置pageNum=1
+        param.setPageNum(1);
+        LongArticleMatchContent currentPage = listWaitingMatchContents(param);
+        if (currentPage == null || CollectionUtils.isEmpty(currentPage.getContentItemList())) {
+            return resultList; // 返回空列表
+        }
+
+        resultList.addAll(currentPage.getContentItemList());
+        long totalCount = currentPage.getTotalCount();
+        int totalPages = (int) Math.ceil((double) totalCount / param.getPageSize());
+
+        // 从第2页开始循环获取
+        for (int pageNum = 2; pageNum <= totalPages; pageNum++) {
+            param.setPageNum(pageNum);
+            currentPage = listWaitingMatchContents(param);
+
+            if (currentPage != null && !CollectionUtils.isEmpty(currentPage.getContentItemList())) {
+                resultList.addAll(currentPage.getContentItemList());
+            } else {
+                log.warn("分页获取数据异常: pageNum={}, totalCount={}", pageNum, totalCount);
+            }
+        }
+        return resultList;
+    }
+
+    @Override
+    public LongArticleMatchContent listWaitingMatchContents(MatchContentsParam param) {
+        String apiUrl = "http://aigc-api.cybertogether.net/aigc/produce/longArticleSystem/listWaitingMatchMiniprogramContents";
+        try {
+            String res = HTTP_POOL_CLIENT_UTIL_DEFAULT.post(apiUrl, JSON.toJSONString(param));
+            JSONObject jsonObject = JSON.parseObject(res);
+            Integer code = jsonObject.getInteger("code");
+            if (code == 0) {
+                return jsonObject.getJSONObject("data").toJavaObject(LongArticleMatchContent.class);
+            }
+        } catch (Exception e) {
+            log.error("listWaitingMatchContents error", e);
+        }
+        return null;
+    }
+
+    @Override
+    //更新匹配小程序状态
+    public boolean updateMatchContentStatus(MatchContentStatusParam param) {
+        String apiUrl = "http://aigc-api.cybertogether.net/aigc/produce/longArticleSystem/updateMatchMiniprogramStatus";
+        try {
+            String res = HTTP_POOL_CLIENT_UTIL_DEFAULT.post(apiUrl, JSON.toJSONString(param));
+            JSONObject jsonObject = JSON.parseObject(res);
+            Integer code = jsonObject.getInteger("code");
+            if (code == 0) {
+                return true;
+            }
+        } catch (Exception e) {
+            log.error("updateMatchContentStatus error", e);
+        }
+        return false;
+    }
+
 }

+ 20 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/remote/impl/MatchServiceImpl.java

@@ -46,6 +46,7 @@ public class MatchServiceImpl implements MatchService {
         return MatchRequestStatusEnum.HAS_EXCEPTION.getStatusCode();
     }
 
+    @Override
     public boolean addAudit(AuditContentRequest request) {
         String apiUrl = "http://101.37.174.139:80/articleVideoAudit/addAudit";
         int retry = 0;
@@ -66,4 +67,23 @@ public class MatchServiceImpl implements MatchService {
         }
         return false;
     }
+
+    public boolean notHasMiniVideos(String sourceId) {
+        String apiUrl = "http://101.37.174.139:80/articleVideoAudit/updateContentStatusBySourceId?sourceId=" + sourceId;
+        int retry = 0;
+        while (retry < 3) {
+            try {
+                String res = HTTP_POOL_CLIENT_UTIL_DEFAULT.get(apiUrl);
+                JSONObject jsonObject = JSON.parseObject(res);
+                Integer code = jsonObject.getInteger("code");
+                if (code == 0) {
+                    return true;
+                }
+            } catch (Exception e) {
+                log.error("notHasMiniVideos error", e);
+            }
+            retry++;
+        }
+        return false;
+    }
 }

+ 1 - 2
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/utils/other/OSSUploader.java

@@ -17,8 +17,7 @@ public class OSSUploader {
     private static final String BUCKET_NAME = "art-pubbucket"; // 存储空间名称
 
     public static String uploadToOSS(String localVideoPath, String downloadType) {
-        String ossVideoKey = String.format("we_com/%s/%s", downloadType, UUID.randomUUID().toString());
-
+        String ossVideoKey = String.format("long_articles/%s/%s", downloadType, UUID.randomUUID().toString());
         // 创建 OSSClient 实例
         OSS ossClient = new OSSClientBuilder().build(ENDPOINT, ACCESS_KEY_ID, ACCESS_KEY_SECRET);
 

+ 99 - 96
long-article-server/src/main/resources/mapper/longarticle/MatchVideoMapper.xml

@@ -154,102 +154,105 @@
       #{processTimes,jdbcType=INTEGER}, #{publishFlag,jdbcType=INTEGER}, #{response,jdbcType=LONGVARCHAR}
       )
   </insert>
-  <insert id="insertSelective" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.MatchVideo">
-    insert into long_articles_match_videos
-    <trim prefix="(" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        id,
-      </if>
-      <if test="traceId != null">
-        trace_id,
-      </if>
-      <if test="contentId != null">
-        content_id,
-      </if>
-      <if test="flowPoolLevel != null">
-        flow_pool_level,
-      </if>
-      <if test="ghId != null">
-        gh_id,
-      </if>
-      <if test="accountName != null">
-        account_name,
-      </if>
-      <if test="videoPoolTraceId != null">
-        video_pool_trace_id,
-      </if>
-      <if test="contentStatus != null">
-        content_status,
-      </if>
-      <if test="contentStatusUpdateTime != null">
-        content_status_update_time,
-      </if>
-      <if test="successStatus != null">
-        success_status,
-      </if>
-      <if test="requestTimestamp != null">
-        request_timestamp,
-      </if>
-      <if test="updateTime != null">
-        update_time,
-      </if>
-      <if test="processTimes != null">
-        process_times,
-      </if>
-      <if test="publishFlag != null">
-        publish_flag,
-      </if>
-      <if test="response != null">
-        response,
-      </if>
-    </trim>
-    <trim prefix="values (" suffix=")" suffixOverrides=",">
-      <if test="id != null">
-        #{id,jdbcType=INTEGER},
-      </if>
-      <if test="traceId != null">
-        #{traceId,jdbcType=VARCHAR},
-      </if>
-      <if test="contentId != null">
-        #{contentId,jdbcType=VARCHAR},
-      </if>
-      <if test="flowPoolLevel != null">
-        #{flowPoolLevel,jdbcType=VARCHAR},
-      </if>
-      <if test="ghId != null">
-        #{ghId,jdbcType=VARCHAR},
-      </if>
-      <if test="accountName != null">
-        #{accountName,jdbcType=VARCHAR},
-      </if>
-      <if test="videoPoolTraceId != null">
-        #{videoPoolTraceId,jdbcType=VARCHAR},
-      </if>
-      <if test="contentStatus != null">
-        #{contentStatus,jdbcType=INTEGER},
-      </if>
-      <if test="contentStatusUpdateTime != null">
-        #{contentStatusUpdateTime,jdbcType=INTEGER},
-      </if>
-      <if test="successStatus != null">
-        #{successStatus,jdbcType=INTEGER},
-      </if>
-      <if test="requestTimestamp != null">
-        #{requestTimestamp,jdbcType=INTEGER},
-      </if>
-      <if test="updateTime != null">
-        #{updateTime,jdbcType=TIMESTAMP},
-      </if>
-      <if test="processTimes != null">
-        #{processTimes,jdbcType=INTEGER},
-      </if>
-      <if test="publishFlag != null">
-        #{publishFlag,jdbcType=INTEGER},
-      </if>
-      <if test="response != null">
-        #{response,jdbcType=LONGVARCHAR},
-      </if>
-    </trim>
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.MatchVideo"  useGeneratedKeys="true" keyProperty="id">
+      insert into long_articles_match_videos
+      <trim prefix="(" suffix=")" suffixOverrides=",">
+          <if test="id != null">
+              id,
+          </if>
+          <if test="traceId != null">
+              trace_id,
+          </if>
+          <if test="contentId != null">
+              content_id,
+          </if>
+          <if test="flowPoolLevel != null">
+              flow_pool_level,
+          </if>
+          <if test="ghId != null">
+              gh_id,
+          </if>
+          <if test="accountName != null">
+              account_name,
+          </if>
+          <if test="videoPoolTraceId != null">
+              video_pool_trace_id,
+          </if>
+          <if test="contentStatus != null">
+              content_status,
+          </if>
+          <if test="contentStatusUpdateTime != null">
+              content_status_update_time,
+          </if>
+          <if test="successStatus != null">
+              success_status,
+          </if>
+          <if test="requestTimestamp != null">
+              request_timestamp,
+          </if>
+          <if test="updateTime != null">
+              update_time,
+          </if>
+          <if test="processTimes != null">
+              process_times,
+          </if>
+          <if test="publishFlag != null">
+              publish_flag,
+          </if>
+          <if test="response != null">
+              response,
+          </if>
+      </trim>
+      <trim prefix="values (" suffix=")" suffixOverrides=",">
+          <if test="id != null">
+              #{id,jdbcType=INTEGER},
+          </if>
+          <if test="traceId != null">
+              #{traceId,jdbcType=VARCHAR},
+          </if>
+          <if test="contentId != null">
+              #{contentId,jdbcType=VARCHAR},
+          </if>
+          <if test="flowPoolLevel != null">
+              #{flowPoolLevel,jdbcType=VARCHAR},
+          </if>
+          <if test="ghId != null">
+              #{ghId,jdbcType=VARCHAR},
+          </if>
+          <if test="accountName != null">
+              #{accountName,jdbcType=VARCHAR},
+          </if>
+          <if test="videoPoolTraceId != null">
+              #{videoPoolTraceId,jdbcType=VARCHAR},
+          </if>
+          <if test="contentStatus != null">
+              #{contentStatus,jdbcType=INTEGER},
+          </if>
+          <if test="contentStatusUpdateTime != null">
+              #{contentStatusUpdateTime,jdbcType=INTEGER},
+          </if>
+          <if test="successStatus != null">
+              #{successStatus,jdbcType=INTEGER},
+          </if>
+          <if test="requestTimestamp != null">
+              #{requestTimestamp,jdbcType=INTEGER},
+          </if>
+          <if test="updateTime != null">
+              #{updateTime,jdbcType=TIMESTAMP},
+          </if>
+          <if test="processTimes != null">
+              #{processTimes,jdbcType=INTEGER},
+          </if>
+          <if test="publishFlag != null">
+              #{publishFlag,jdbcType=INTEGER},
+          </if>
+          <if test="response != null">
+              #{response,jdbcType=LONGVARCHAR},
+          </if>
+      </trim>
+      <selectKey resultType="java.lang.Long" order="AFTER" keyProperty="id">
+          select LAST_INSERT_ID()
+      </selectKey>
   </insert>
   <select id="countByExample" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.MatchVideoExample" resultType="java.lang.Long">
     select count(*) from long_articles_match_videos

+ 246 - 0
long-article-server/src/main/resources/mapper/longarticle/NewMatchVideoMapper.xml

@@ -0,0 +1,246 @@
+<?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.piaoquan.longarticle.dao.mapper.longarticle.NewMatchVideoMapper">
+  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.longarticle.model.po.longarticle.NewMatchVideo">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="content_id" jdbcType="VARCHAR" property="contentId" />
+    <result column="flow_pool_level" jdbcType="VARCHAR" property="flowPoolLevel" />
+    <result column="content_status" jdbcType="INTEGER" property="contentStatus" />
+    <result column="retry_count" jdbcType="INTEGER" property="retryCount" />
+    <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
+    <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
+  </resultMap>
+  <sql id="Example_Where_Clause">
+    <where>
+      <foreach collection="oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Update_By_Example_Where_Clause">
+    <where>
+      <foreach collection="example.oredCriteria" item="criteria" separator="or">
+        <if test="criteria.valid">
+          <trim prefix="(" prefixOverrides="and" suffix=")">
+            <foreach collection="criteria.criteria" item="criterion">
+              <choose>
+                <when test="criterion.noValue">
+                  and ${criterion.condition}
+                </when>
+                <when test="criterion.singleValue">
+                  and ${criterion.condition} #{criterion.value}
+                </when>
+                <when test="criterion.betweenValue">
+                  and ${criterion.condition} #{criterion.value} and #{criterion.secondValue}
+                </when>
+                <when test="criterion.listValue">
+                  and ${criterion.condition}
+                  <foreach close=")" collection="criterion.value" item="listItem" open="(" separator=",">
+                    #{listItem}
+                  </foreach>
+                </when>
+              </choose>
+            </foreach>
+          </trim>
+        </if>
+      </foreach>
+    </where>
+  </sql>
+  <sql id="Base_Column_List">
+    id, content_id, flow_pool_level, content_status, retry_count, create_time, update_time
+  </sql>
+  <select id="selectByExample" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.NewMatchVideoExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from long_articles_new_match_videos
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+    <if test="orderByClause != null">
+      order by ${orderByClause}
+    </if>
+    <if test="page != null">
+      limit #{page.offset} , #{page.pageSize}
+    </if>
+  </select>
+  <select id="selectByPrimaryKey" parameterType="java.lang.Long" resultMap="BaseResultMap">
+    select 
+    <include refid="Base_Column_List" />
+    from long_articles_new_match_videos
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from long_articles_new_match_videos
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.NewMatchVideoExample">
+    delete from long_articles_new_match_videos
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.NewMatchVideo">
+    insert into long_articles_new_match_videos (id, content_id, flow_pool_level, 
+      content_status, retry_count, create_time, 
+      update_time)
+    values (#{id,jdbcType=BIGINT}, #{contentId,jdbcType=VARCHAR}, #{flowPoolLevel,jdbcType=VARCHAR}, 
+      #{contentStatus,jdbcType=INTEGER}, #{retryCount,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, 
+      #{updateTime,jdbcType=TIMESTAMP})
+  </insert>
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.NewMatchVideo">
+    insert into long_articles_new_match_videos
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="contentId != null">
+        content_id,
+      </if>
+      <if test="flowPoolLevel != null">
+        flow_pool_level,
+      </if>
+      <if test="contentStatus != null">
+        content_status,
+      </if>
+      <if test="retryCount != null">
+        retry_count,
+      </if>
+      <if test="createTime != null">
+        create_time,
+      </if>
+      <if test="updateTime != null">
+        update_time,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=BIGINT},
+      </if>
+      <if test="contentId != null">
+        #{contentId,jdbcType=VARCHAR},
+      </if>
+      <if test="flowPoolLevel != null">
+        #{flowPoolLevel,jdbcType=VARCHAR},
+      </if>
+      <if test="contentStatus != null">
+        #{contentStatus,jdbcType=INTEGER},
+      </if>
+      <if test="retryCount != null">
+        #{retryCount,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.NewMatchVideoExample" resultType="java.lang.Long">
+    select count(*) from long_articles_new_match_videos
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update long_articles_new_match_videos
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=BIGINT},
+      </if>
+      <if test="record.contentId != null">
+        content_id = #{record.contentId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.flowPoolLevel != null">
+        flow_pool_level = #{record.flowPoolLevel,jdbcType=VARCHAR},
+      </if>
+      <if test="record.contentStatus != null">
+        content_status = #{record.contentStatus,jdbcType=INTEGER},
+      </if>
+      <if test="record.retryCount != null">
+        retry_count = #{record.retryCount,jdbcType=INTEGER},
+      </if>
+      <if test="record.createTime != null">
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="record.updateTime != null">
+        update_time = #{record.updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update long_articles_new_match_videos
+    set id = #{record.id,jdbcType=BIGINT},
+      content_id = #{record.contentId,jdbcType=VARCHAR},
+      flow_pool_level = #{record.flowPoolLevel,jdbcType=VARCHAR},
+      content_status = #{record.contentStatus,jdbcType=INTEGER},
+      retry_count = #{record.retryCount,jdbcType=INTEGER},
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
+      update_time = #{record.updateTime,jdbcType=TIMESTAMP}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.NewMatchVideo">
+    update long_articles_new_match_videos
+    <set>
+      <if test="contentId != null">
+        content_id = #{contentId,jdbcType=VARCHAR},
+      </if>
+      <if test="flowPoolLevel != null">
+        flow_pool_level = #{flowPoolLevel,jdbcType=VARCHAR},
+      </if>
+      <if test="contentStatus != null">
+        content_status = #{contentStatus,jdbcType=INTEGER},
+      </if>
+      <if test="retryCount != null">
+        retry_count = #{retryCount,jdbcType=INTEGER},
+      </if>
+      <if test="createTime != null">
+        create_time = #{createTime,jdbcType=TIMESTAMP},
+      </if>
+      <if test="updateTime != null">
+        update_time = #{updateTime,jdbcType=TIMESTAMP},
+      </if>
+    </set>
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.NewMatchVideo">
+    update long_articles_new_match_videos
+    set content_id = #{contentId,jdbcType=VARCHAR},
+      flow_pool_level = #{flowPoolLevel,jdbcType=VARCHAR},
+      content_status = #{contentStatus,jdbcType=INTEGER},
+      retry_count = #{retryCount,jdbcType=INTEGER},
+      create_time = #{createTime,jdbcType=TIMESTAMP},
+      update_time = #{updateTime,jdbcType=TIMESTAMP}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+</mapper>

+ 1 - 2
long-article-server/src/main/resources/mybatis-generator-config.xml

@@ -66,8 +66,7 @@
 <!--        <table tableName="long_articles_plan_account" domainObjectName="PlanAccount" alias=""/>-->
         <!--            <table tableName="long_articles_plan" domainObjectName="Plan" alias=""/>-->
 <!--        <table tableName="long_articles_publish_content" domainObjectName="PublishContent" alias=""/>-->
-        <table tableName="long_articles_group_send_result" domainObjectName="GroupSendResult" alias=""/>
-        <table tableName="long_articles_group_send_open_id" domainObjectName="GroupSendOpenId" alias=""/>
+        <table tableName="long_articles_new_match_videos" domainObjectName="NewMatchVideo" alias=""/>
 
 <!--        <table tableName="video_keywords_map" domainObjectName="VideoKeywordsMap" alias=""/>-->