소스 검색

单小程序开发

xueyiming 4 달 전
부모
커밋
a774cb5bd0

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

@@ -0,0 +1,40 @@
+package com.tzld.piaoquan.longarticle.common.enums;
+
+import lombok.Getter;
+
+import java.util.Objects;
+
+@Getter
+public enum SourceTypesEnum {
+    producePlan(1, "生成计划"),
+    produceContent(2, "单个生成内容"),
+    crawlerPlan(3, "抓取计划"),
+    crawlerContent(4, "单个抓取内容"),
+    publishPlan(5, "发布计划"),
+    publishContent(6, "单个发布内容"),
+    pretreatPlan(7, "处理计划"),
+    pretreatContent(8, "单个处理内容"),
+    monitor_plan_query_contents(9, "监控计划查找输入源"),
+    template(10, "评论/私信模板"),
+    monitor_plan(11, "监控计划内容"),
+    longArticleVideoPoolSource(12, "长文视频池内容"),
+    other(999, ""),
+    ;
+
+    private final Integer val;
+    private final String description;
+
+    SourceTypesEnum(Integer val, String description) {
+        this.val = val;
+        this.description = description;
+    }
+
+    public static SourceTypesEnum from(Integer val) {
+        for (SourceTypesEnum typesEnum : SourceTypesEnum.values()) {
+            if (Objects.equals(typesEnum.val, val)) {
+                return typesEnum;
+            }
+        }
+        return null;
+    }
+}

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

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

+ 2 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/bo/MatchContent.java

@@ -20,4 +20,6 @@ public class MatchContent {
     private String title;
 
     private String flowPoolLevelTag;
+
+    private Integer sourceType;
 }

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

@@ -0,0 +1,79 @@
+package com.tzld.piaoquan.longarticle.model.po;
+
+public class OffVideo {
+    private Long videoId;
+
+    private Long publishTime;
+
+    private Integer videoStatus;
+
+    private String traceId;
+
+    private Long getOffTime;
+
+    private Integer checkStatus;
+
+    public Long getVideoId() {
+        return videoId;
+    }
+
+    public void setVideoId(Long videoId) {
+        this.videoId = videoId;
+    }
+
+    public Long getPublishTime() {
+        return publishTime;
+    }
+
+    public void setPublishTime(Long publishTime) {
+        this.publishTime = publishTime;
+    }
+
+    public Integer getVideoStatus() {
+        return videoStatus;
+    }
+
+    public void setVideoStatus(Integer videoStatus) {
+        this.videoStatus = videoStatus;
+    }
+
+    public String getTraceId() {
+        return traceId;
+    }
+
+    public void setTraceId(String traceId) {
+        this.traceId = traceId;
+    }
+
+    public Long getGetOffTime() {
+        return getOffTime;
+    }
+
+    public void setGetOffTime(Long getOffTime) {
+        this.getOffTime = getOffTime;
+    }
+
+    public Integer getCheckStatus() {
+        return checkStatus;
+    }
+
+    public void setCheckStatus(Integer checkStatus) {
+        this.checkStatus = checkStatus;
+    }
+
+    @Override
+    public String toString() {
+        StringBuilder sb = new StringBuilder();
+        sb.append(getClass().getSimpleName());
+        sb.append(" [");
+        sb.append("Hash = ").append(hashCode());
+        sb.append(", videoId=").append(videoId);
+        sb.append(", publishTime=").append(publishTime);
+        sb.append(", videoStatus=").append(videoStatus);
+        sb.append(", traceId=").append(traceId);
+        sb.append(", getOffTime=").append(getOffTime);
+        sb.append(", checkStatus=").append(checkStatus);
+        sb.append("]");
+        return sb.toString();
+    }
+}

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

@@ -0,0 +1,581 @@
+package com.tzld.piaoquan.longarticle.model.po;
+
+import com.tzld.piaoquan.longarticle.utils.page.Page;
+import java.util.ArrayList;
+import java.util.List;
+
+public class OffVideoExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    protected Page page;
+
+    public OffVideoExample() {
+        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 andVideoIdIsNull() {
+            addCriterion("video_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdIsNotNull() {
+            addCriterion("video_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdEqualTo(Long value) {
+            addCriterion("video_id =", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdNotEqualTo(Long value) {
+            addCriterion("video_id <>", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdGreaterThan(Long value) {
+            addCriterion("video_id >", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("video_id >=", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdLessThan(Long value) {
+            addCriterion("video_id <", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdLessThanOrEqualTo(Long value) {
+            addCriterion("video_id <=", value, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdIn(List<Long> values) {
+            addCriterion("video_id in", values, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdNotIn(List<Long> values) {
+            addCriterion("video_id not in", values, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdBetween(Long value1, Long value2) {
+            addCriterion("video_id between", value1, value2, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIdNotBetween(Long value1, Long value2) {
+            addCriterion("video_id not between", value1, value2, "videoId");
+            return (Criteria) this;
+        }
+
+        public Criteria andPublishTimeIsNull() {
+            addCriterion("publish_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPublishTimeIsNotNull() {
+            addCriterion("publish_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPublishTimeEqualTo(Long value) {
+            addCriterion("publish_time =", value, "publishTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andPublishTimeNotEqualTo(Long value) {
+            addCriterion("publish_time <>", value, "publishTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andPublishTimeGreaterThan(Long value) {
+            addCriterion("publish_time >", value, "publishTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andPublishTimeGreaterThanOrEqualTo(Long value) {
+            addCriterion("publish_time >=", value, "publishTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andPublishTimeLessThan(Long value) {
+            addCriterion("publish_time <", value, "publishTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andPublishTimeLessThanOrEqualTo(Long value) {
+            addCriterion("publish_time <=", value, "publishTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andPublishTimeIn(List<Long> values) {
+            addCriterion("publish_time in", values, "publishTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andPublishTimeNotIn(List<Long> values) {
+            addCriterion("publish_time not in", values, "publishTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andPublishTimeBetween(Long value1, Long value2) {
+            addCriterion("publish_time between", value1, value2, "publishTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andPublishTimeNotBetween(Long value1, Long value2) {
+            addCriterion("publish_time not between", value1, value2, "publishTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoStatusIsNull() {
+            addCriterion("video_status is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoStatusIsNotNull() {
+            addCriterion("video_status is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoStatusEqualTo(Integer value) {
+            addCriterion("video_status =", value, "videoStatus");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoStatusNotEqualTo(Integer value) {
+            addCriterion("video_status <>", value, "videoStatus");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoStatusGreaterThan(Integer value) {
+            addCriterion("video_status >", value, "videoStatus");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoStatusGreaterThanOrEqualTo(Integer value) {
+            addCriterion("video_status >=", value, "videoStatus");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoStatusLessThan(Integer value) {
+            addCriterion("video_status <", value, "videoStatus");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoStatusLessThanOrEqualTo(Integer value) {
+            addCriterion("video_status <=", value, "videoStatus");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoStatusIn(List<Integer> values) {
+            addCriterion("video_status in", values, "videoStatus");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoStatusNotIn(List<Integer> values) {
+            addCriterion("video_status not in", values, "videoStatus");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoStatusBetween(Integer value1, Integer value2) {
+            addCriterion("video_status between", value1, value2, "videoStatus");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoStatusNotBetween(Integer value1, Integer value2) {
+            addCriterion("video_status not between", value1, value2, "videoStatus");
+            return (Criteria) this;
+        }
+
+        public Criteria andTraceIdIsNull() {
+            addCriterion("trace_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTraceIdIsNotNull() {
+            addCriterion("trace_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTraceIdEqualTo(String value) {
+            addCriterion("trace_id =", value, "traceId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTraceIdNotEqualTo(String value) {
+            addCriterion("trace_id <>", value, "traceId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTraceIdGreaterThan(String value) {
+            addCriterion("trace_id >", value, "traceId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTraceIdGreaterThanOrEqualTo(String value) {
+            addCriterion("trace_id >=", value, "traceId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTraceIdLessThan(String value) {
+            addCriterion("trace_id <", value, "traceId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTraceIdLessThanOrEqualTo(String value) {
+            addCriterion("trace_id <=", value, "traceId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTraceIdLike(String value) {
+            addCriterion("trace_id like", value, "traceId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTraceIdNotLike(String value) {
+            addCriterion("trace_id not like", value, "traceId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTraceIdIn(List<String> values) {
+            addCriterion("trace_id in", values, "traceId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTraceIdNotIn(List<String> values) {
+            addCriterion("trace_id not in", values, "traceId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTraceIdBetween(String value1, String value2) {
+            addCriterion("trace_id between", value1, value2, "traceId");
+            return (Criteria) this;
+        }
+
+        public Criteria andTraceIdNotBetween(String value1, String value2) {
+            addCriterion("trace_id not between", value1, value2, "traceId");
+            return (Criteria) this;
+        }
+
+        public Criteria andGetOffTimeIsNull() {
+            addCriterion("get_off_time is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andGetOffTimeIsNotNull() {
+            addCriterion("get_off_time is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andGetOffTimeEqualTo(Long value) {
+            addCriterion("get_off_time =", value, "getOffTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andGetOffTimeNotEqualTo(Long value) {
+            addCriterion("get_off_time <>", value, "getOffTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andGetOffTimeGreaterThan(Long value) {
+            addCriterion("get_off_time >", value, "getOffTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andGetOffTimeGreaterThanOrEqualTo(Long value) {
+            addCriterion("get_off_time >=", value, "getOffTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andGetOffTimeLessThan(Long value) {
+            addCriterion("get_off_time <", value, "getOffTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andGetOffTimeLessThanOrEqualTo(Long value) {
+            addCriterion("get_off_time <=", value, "getOffTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andGetOffTimeIn(List<Long> values) {
+            addCriterion("get_off_time in", values, "getOffTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andGetOffTimeNotIn(List<Long> values) {
+            addCriterion("get_off_time not in", values, "getOffTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andGetOffTimeBetween(Long value1, Long value2) {
+            addCriterion("get_off_time between", value1, value2, "getOffTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andGetOffTimeNotBetween(Long value1, Long value2) {
+            addCriterion("get_off_time not between", value1, value2, "getOffTime");
+            return (Criteria) this;
+        }
+
+        public Criteria andCheckStatusIsNull() {
+            addCriterion("check_status is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCheckStatusIsNotNull() {
+            addCriterion("check_status is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCheckStatusEqualTo(Integer value) {
+            addCriterion("check_status =", value, "checkStatus");
+            return (Criteria) this;
+        }
+
+        public Criteria andCheckStatusNotEqualTo(Integer value) {
+            addCriterion("check_status <>", value, "checkStatus");
+            return (Criteria) this;
+        }
+
+        public Criteria andCheckStatusGreaterThan(Integer value) {
+            addCriterion("check_status >", value, "checkStatus");
+            return (Criteria) this;
+        }
+
+        public Criteria andCheckStatusGreaterThanOrEqualTo(Integer value) {
+            addCriterion("check_status >=", value, "checkStatus");
+            return (Criteria) this;
+        }
+
+        public Criteria andCheckStatusLessThan(Integer value) {
+            addCriterion("check_status <", value, "checkStatus");
+            return (Criteria) this;
+        }
+
+        public Criteria andCheckStatusLessThanOrEqualTo(Integer value) {
+            addCriterion("check_status <=", value, "checkStatus");
+            return (Criteria) this;
+        }
+
+        public Criteria andCheckStatusIn(List<Integer> values) {
+            addCriterion("check_status in", values, "checkStatus");
+            return (Criteria) this;
+        }
+
+        public Criteria andCheckStatusNotIn(List<Integer> values) {
+            addCriterion("check_status not in", values, "checkStatus");
+            return (Criteria) this;
+        }
+
+        public Criteria andCheckStatusBetween(Integer value1, Integer value2) {
+            addCriterion("check_status between", value1, value2, "checkStatus");
+            return (Criteria) this;
+        }
+
+        public Criteria andCheckStatusNotBetween(Integer value1, Integer value2) {
+            addCriterion("check_status not between", value1, value2, "checkStatus");
+            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);
+        }
+    }
+}

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

@@ -20,4 +20,6 @@ public class ContentItemVO {
     private String content;
     private String flowPoolLevelTag;
 
+    private Integer sourceType;
+
 }

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

@@ -139,6 +139,7 @@ public class ContentServiceImpl implements ContentService {
             publishArticleData.setSourceId(contentItemVO.getSourceId());
             publishArticleData.setTitle(contentItemVO.getTitle());
             publishArticleData.setContentPoolType(contentItemVO.getFlowPoolLevelTag());
+            publishArticleData.setSourceType(contentItemVO.getSourceType());
             waitSortList.add(publishArticleData);
         }
         return waitSortList;
@@ -222,6 +223,8 @@ public class ContentServiceImpl implements ContentService {
         videoDetail.setKimiTitle(singleVideoSource.getArticleTitle());
         videoDetail.setUid(singleVideoSource.getOutAccountId());
         videoDetail.setVideoOss(singleVideoSource.getVideoOssPath());
+        String traceId = "direct-" + UUID.randomUUID() + "-" + System.currentTimeMillis() / 1000;
+        videoDetail.setTraceId(traceId);
         return null;
     }
 

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

@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSON;
 import com.tzld.piaoquan.longarticle.common.constants.TimeConstant;
 import com.tzld.piaoquan.longarticle.common.enums.ContentStatusEnum;
 import com.tzld.piaoquan.longarticle.common.enums.PublishGzhPushTypeEnum;
+import com.tzld.piaoquan.longarticle.common.enums.SourceTypesEnum;
 import com.tzld.piaoquan.longarticle.dao.mapper.PlanAccountMapper;
 import com.tzld.piaoquan.longarticle.dao.mapper.PublishContentMapper;
 import com.tzld.piaoquan.longarticle.dao.mapper.PublishMiniprogramMapper;
@@ -210,6 +211,15 @@ public class CoreServiceImpl implements CoreService {
                             if (matchContent == null) {
                                 break; // 退出当前线程
                             }
+                            //只匹配小程序文章不做处理
+                            if (matchContent.getSourceType() != null &&
+                                    matchContent.getSourceType().equals(SourceTypesEnum.longArticleVideoPoolSource.getVal())) {
+                                MatchMiniprogramStatusParam statusParam = new MatchMiniprogramStatusParam();
+                                statusParam.setStatus(2);
+                                statusParam.setPublishContentId(matchContent.getPublishContentId());
+                                aigcService.updateMatchMiniprogramStatus(statusParam);
+                                continue;
+                            }
                             MatchVideo content = contentService.getContent(matchContent.getSourceId(), matchContent.getGhId(), 2);
                             if (content != null) {
                                 Integer contentStatus = content.getContentStatus();
@@ -272,6 +282,7 @@ public class CoreServiceImpl implements CoreService {
                     matchContent.setContent(contentItemVO.getContent());
                     matchContent.setTitle(contentItemVO.getTitle());
                     matchContent.setFlowPoolLevelTag(contentItemVO.getFlowPoolLevelTag());
+                    matchContent.setSourceType(contentItemVO.getSourceType());
                     try {
                         matchQueue.put(matchContent);
                     } catch (InterruptedException e) {
@@ -481,7 +492,8 @@ public class CoreServiceImpl implements CoreService {
             List<PublishMiniprogram> publishMiniprogramList = publicContentService.getPublishMiniprograms(publishContent);
             //不存在则重新生成
             if (CollectionUtils.isEmpty(publishMiniprogramList)) {
-                if (publishContent.getSourceType() != null && publishContent.getSourceType() == 12) {
+                if (publishContent.getSourceType() != null &&
+                        Objects.equals(publishContent.getSourceType(), SourceTypesEnum.longArticleVideoPoolSource.getVal())) {
                     List<VideoDetail> videoDetails = contentService.getOnlyMiniPublishVideoDetail(publishContent);
                     log.info("publishContentId={}, videoDetails={}", publishContent.getId(), videoDetails);
                     publishMiniprogramList = getPublishMiniprogramList(videoDetails, planAccount, publishContent);
@@ -647,11 +659,15 @@ public class CoreServiceImpl implements CoreService {
             if (updateStatus == 2) {
                 for (PublishContent publishContent : entry.getValue()) {
                     publicContentService.updatePublishContentStatus(updateStatus, publishContent.getId(), pushStatusVO.getErrorMsg());
-//                    if (StringUtils.isNotEmpty(publishContent.getTraceId())) {
-//                        videoService.miniProgramVideoOff(publishContent.getTraceId());
-//                    } else {
-//                        LarkRobotUtil.sendMessage("publishContent traceId is null publishContent id=" + publishContent.getId());
-//                    }
+                    if (Objects.equals(publishContent.getSourceType(), SourceTypesEnum.longArticleVideoPoolSource.getVal())) {
+                        List<PublishMiniprogram> publishMiniprogramList = publicContentService.getPublishMiniprograms(publishContent);
+                        if (CollectionUtils.isEmpty(publishMiniprogramList)) {
+                            continue;
+                        }
+                        for (PublishMiniprogram publishMiniprogram : publishMiniprogramList){
+                            videoService.addOffVideo(publishMiniprogram);
+                        }
+                    }
                 }
                 if (planAccount == null) {
                     continue;
@@ -682,28 +698,6 @@ public class CoreServiceImpl implements CoreService {
                     }
                 }
             }
-//            if (updateStatus == 0) {
-//                //查询创建时间   重试超过2h 直接设置失败
-//                long createTimestamp = entry.getValue().get(0).getCreateTime().getTime();
-//                long nowTimestamp = System.currentTimeMillis();
-//                if (nowTimestamp - createTimestamp > TimeConstant.MILLISECOND_HOUR * 2) {
-//                    if (StringUtils.isNotEmpty(pushStatusVO.getErrorMsg())) {
-//                        PublishContentExample publishContentExample = new PublishContentExample();
-//                        publishContentExample.createCriteria().andPushIdEqualTo(pushId);
-//                        PublishContent update = new PublishContent();
-//                        if (StringUtils.isNotEmpty(pushStatusVO.getErrorMsg())) {
-//                            update.setReason(pushStatusVO.getErrorMsg());
-//                        }
-//                        update.setStatus(3);
-//                        publishContentMapper.updateByExampleSelective(update, publishContentExample);
-//                        planAccountService.updateRetry(planAccount);
-//                        LarkRobotUtil.sendMessage("重试超过2h失败,pushId=", pushId);
-//                    } else {
-//                        long hour = (nowTimestamp - createTimestamp) / 1000 / 3600;
-//                        LarkRobotUtil.sendMessage("重试时间:" + hour + "pushId=", pushId);
-//                    }
-//                }
-//            }
             if (StringUtils.isNotEmpty(pushStatusVO.getErrorMsg()) && !pushStatusVO.getErrorMsg().contains("45028")) {
                 log.error("push error pushId={} msg={}", pushId, pushStatusVO.getErrorMsg());
                 String message = String.format("发布失败,请查看,pushId=%s 失败信息:%s 账号名称:%s 计划名称:%s",

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

@@ -1,10 +1,13 @@
 package com.tzld.piaoquan.longarticle.service.remote;
 
 import com.tzld.piaoquan.longarticle.model.bo.VideoDetail;
+import com.tzld.piaoquan.longarticle.model.po.PublishMiniprogram;
 
 public interface VideoService {
 
     VideoDetail publish(String ossPath, String uid, String title);
 
     void miniProgramVideoOff(String traceId);
+
+    void addOffVideo(PublishMiniprogram publishMiniprogram);
 }

+ 16 - 2
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/remote/impl/VideoServiceImpl.java

@@ -4,13 +4,17 @@ import cn.hutool.http.HttpRequest;
 import cn.hutool.http.HttpResponse;
 import cn.hutool.json.JSONObject;
 import cn.hutool.json.JSONUtil;
+import com.tzld.piaoquan.longarticle.dao.mapper.OffVideoMapper;
 import com.tzld.piaoquan.longarticle.model.bo.VideoDetail;
+import com.tzld.piaoquan.longarticle.model.po.OffVideo;
+import com.tzld.piaoquan.longarticle.model.po.PublishMiniprogram;
 import com.tzld.piaoquan.longarticle.service.remote.VideoService;
 import com.tzld.piaoquan.longarticle.utils.HttpClientUtil;
 import com.tzld.piaoquan.longarticle.utils.HttpPoolClientUtil;
 import com.tzld.piaoquan.longarticle.utils.LarkRobotUtil;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 import org.springframework.util.CollectionUtils;
 
@@ -24,11 +28,12 @@ import java.util.Objects;
 public class VideoServiceImpl implements VideoService {
 
     private static final HttpPoolClientUtil HTTP_POOL_CLIENT_UTIL_DEFAULT = HttpClientUtil.create(5000, 5000, 20, 100, 3, 3000);
-
-
     private static final String PUBLISH_URL = "https://vlogapi.piaoquantv.com/longvideoapi/crawler/video/send";
     private static final String VIDEO_DETAIL_URL = "https://longvideoapi.piaoquantv.com/longvideoapi/openapi/video/batchSelectVideoInfo";
 
+    @Autowired
+    private OffVideoMapper offVideoMapper;
+
     public VideoDetail publish(String ossPath, String uid, String title) {
         String videoId = publishToPQ(ossPath, uid, title);
         if (videoId == null) {
@@ -119,4 +124,13 @@ public class VideoServiceImpl implements VideoService {
             log.error("miniProgramVideoOff error {}", e.getMessage());
         }
     }
+
+    @Override
+    public void addOffVideo(PublishMiniprogram publishMiniprogram) {
+        OffVideo offVideo = new OffVideo();
+        offVideo.setVideoId(publishMiniprogram.getVideoId());
+        offVideo.setVideoStatus(1);
+        offVideo.setPublishTime(System.currentTimeMillis() / 1000);
+        offVideoMapper.insertSelective(offVideo);
+    }
 }

+ 231 - 0
long-article-server/src/main/resources/mapper/OffVideoMapper.xml

@@ -0,0 +1,231 @@
+<?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.OffVideoMapper">
+  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.longarticle.model.po.OffVideo">
+    <id column="video_id" jdbcType="BIGINT" property="videoId" />
+    <result column="publish_time" jdbcType="BIGINT" property="publishTime" />
+    <result column="video_status" jdbcType="INTEGER" property="videoStatus" />
+    <result column="trace_id" jdbcType="VARCHAR" property="traceId" />
+    <result column="get_off_time" jdbcType="BIGINT" property="getOffTime" />
+    <result column="check_status" jdbcType="INTEGER" property="checkStatus" />
+  </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">
+    video_id, publish_time, video_status, trace_id, get_off_time, check_status
+  </sql>
+  <select id="selectByExample" parameterType="com.tzld.piaoquan.longarticle.model.po.OffVideoExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from get_off_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 get_off_videos
+    where video_id = #{videoId,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from get_off_videos
+    where video_id = #{videoId,jdbcType=BIGINT}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.longarticle.model.po.OffVideoExample">
+    delete from get_off_videos
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.tzld.piaoquan.longarticle.model.po.OffVideo">
+    insert into get_off_videos (video_id, publish_time, video_status, 
+      trace_id, get_off_time, check_status
+      )
+    values (#{videoId,jdbcType=BIGINT}, #{publishTime,jdbcType=BIGINT}, #{videoStatus,jdbcType=INTEGER}, 
+      #{traceId,jdbcType=VARCHAR}, #{getOffTime,jdbcType=BIGINT}, #{checkStatus,jdbcType=INTEGER}
+      )
+  </insert>
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.longarticle.model.po.OffVideo">
+    insert into get_off_videos
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="videoId != null">
+        video_id,
+      </if>
+      <if test="publishTime != null">
+        publish_time,
+      </if>
+      <if test="videoStatus != null">
+        video_status,
+      </if>
+      <if test="traceId != null">
+        trace_id,
+      </if>
+      <if test="getOffTime != null">
+        get_off_time,
+      </if>
+      <if test="checkStatus != null">
+        check_status,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="videoId != null">
+        #{videoId,jdbcType=BIGINT},
+      </if>
+      <if test="publishTime != null">
+        #{publishTime,jdbcType=BIGINT},
+      </if>
+      <if test="videoStatus != null">
+        #{videoStatus,jdbcType=INTEGER},
+      </if>
+      <if test="traceId != null">
+        #{traceId,jdbcType=VARCHAR},
+      </if>
+      <if test="getOffTime != null">
+        #{getOffTime,jdbcType=BIGINT},
+      </if>
+      <if test="checkStatus != null">
+        #{checkStatus,jdbcType=INTEGER},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.tzld.piaoquan.longarticle.model.po.OffVideoExample" resultType="java.lang.Long">
+    select count(*) from get_off_videos
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update get_off_videos
+    <set>
+      <if test="record.videoId != null">
+        video_id = #{record.videoId,jdbcType=BIGINT},
+      </if>
+      <if test="record.publishTime != null">
+        publish_time = #{record.publishTime,jdbcType=BIGINT},
+      </if>
+      <if test="record.videoStatus != null">
+        video_status = #{record.videoStatus,jdbcType=INTEGER},
+      </if>
+      <if test="record.traceId != null">
+        trace_id = #{record.traceId,jdbcType=VARCHAR},
+      </if>
+      <if test="record.getOffTime != null">
+        get_off_time = #{record.getOffTime,jdbcType=BIGINT},
+      </if>
+      <if test="record.checkStatus != null">
+        check_status = #{record.checkStatus,jdbcType=INTEGER},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update get_off_videos
+    set video_id = #{record.videoId,jdbcType=BIGINT},
+      publish_time = #{record.publishTime,jdbcType=BIGINT},
+      video_status = #{record.videoStatus,jdbcType=INTEGER},
+      trace_id = #{record.traceId,jdbcType=VARCHAR},
+      get_off_time = #{record.getOffTime,jdbcType=BIGINT},
+      check_status = #{record.checkStatus,jdbcType=INTEGER}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.longarticle.model.po.OffVideo">
+    update get_off_videos
+    <set>
+      <if test="publishTime != null">
+        publish_time = #{publishTime,jdbcType=BIGINT},
+      </if>
+      <if test="videoStatus != null">
+        video_status = #{videoStatus,jdbcType=INTEGER},
+      </if>
+      <if test="traceId != null">
+        trace_id = #{traceId,jdbcType=VARCHAR},
+      </if>
+      <if test="getOffTime != null">
+        get_off_time = #{getOffTime,jdbcType=BIGINT},
+      </if>
+      <if test="checkStatus != null">
+        check_status = #{checkStatus,jdbcType=INTEGER},
+      </if>
+    </set>
+    where video_id = #{videoId,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.longarticle.model.po.OffVideo">
+    update get_off_videos
+    set publish_time = #{publishTime,jdbcType=BIGINT},
+      video_status = #{videoStatus,jdbcType=INTEGER},
+      trace_id = #{traceId,jdbcType=VARCHAR},
+      get_off_time = #{getOffTime,jdbcType=BIGINT},
+      check_status = #{checkStatus,jdbcType=INTEGER}
+    where video_id = #{videoId,jdbcType=BIGINT}
+  </update>
+</mapper>

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

@@ -63,8 +63,9 @@
 <!--        <table tableName="publish_single_video_source" domainObjectName="SingleVideoSource" alias=""/>-->
 <!--            <table tableName="long_articles_plan" domainObjectName="Plan" alias=""/>-->
 
-                <table tableName="long_articles_publish_content" domainObjectName="PublishContent" alias=""/>
+<!--                <table tableName="long_articles_publish_content" domainObjectName="PublishContent" alias=""/>-->
 <!--                <table tableName="long_articles_publish_miniprogram" domainObjectName="PublishMiniprogram" alias=""/>-->
+        <table tableName="get_off_videos" domainObjectName="OffVideo" alias=""/>
 
     </context>