Browse Source

公众号-自动回复

wangyunpeng 2 tháng trước cách đây
mục cha
commit
c5e7402d49
26 tập tin đã thay đổi với 1571 bổ sung76 xóa
  1. 30 0
      api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ContentPlatformVideoMapper.java
  2. 13 0
      api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ext/ContentPlatformPlanMapperExt.java
  3. 1 1
      api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/QwPlanSaveVideoParam.java
  4. 1 1
      api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/VideoContentCoverFrameParam.java
  5. 3 3
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformGzhPlanVideo.java
  6. 10 20
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformGzhPlanVideoExample.java
  7. 3 3
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformQwPlanVideo.java
  8. 10 20
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformQwPlanVideoExample.java
  9. 101 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformVideo.java
  10. 731 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformVideoExample.java
  11. 1 1
      api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/QwDatastatItemVO.java
  12. 1 1
      api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/VideoContentItemVO.java
  13. 78 2
      api-module/src/main/java/com/tzld/piaoquan/api/remote/AigcApiService.java
  14. 37 0
      api-module/src/main/java/com/tzld/piaoquan/api/remote/ManagerApiService.java
  15. 3 0
      api-module/src/main/java/com/tzld/piaoquan/api/service/GhDetailService.java
  16. 2 0
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/ContentPlatformCooperateAccountService.java
  17. 3 0
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/ContentPlatformPlanService.java
  18. 16 1
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformCooperateAccountServiceImpl.java
  19. 185 5
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformPlanServiceImpl.java
  20. 15 4
      api-module/src/main/java/com/tzld/piaoquan/api/service/impl/GhDetailServiceImpl.java
  21. 7 7
      api-module/src/main/resources/mapper/contentplatform/ContentPlatformGzhPlanVideoMapper.xml
  22. 7 7
      api-module/src/main/resources/mapper/contentplatform/ContentPlatformQwPlanVideoMapper.xml
  23. 261 0
      api-module/src/main/resources/mapper/contentplatform/ContentPlatformVideoMapper.xml
  24. 38 0
      api-module/src/main/resources/mapper/contentplatform/ext/ContentPlatformPlanMapperExt.xml
  25. 1 0
      api-module/src/main/resources/mybatis-api-contentPlatform-generator-config.xml
  26. 13 0
      common-module/src/main/java/com/tzld/piaoquan/growth/common/component/HttpPoolClient.java

+ 30 - 0
api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ContentPlatformVideoMapper.java

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

+ 13 - 0
api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ext/ContentPlatformPlanMapperExt.java

@@ -1,7 +1,9 @@
 package com.tzld.piaoquan.api.dao.mapper.contentplatform.ext;
 
 import com.tzld.piaoquan.api.model.param.contentplatform.GzhPlanListParam;
+import com.tzld.piaoquan.api.model.param.contentplatform.VideoContentListParam;
 import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlan;
+import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideo;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
@@ -20,4 +22,15 @@ public interface ContentPlatformPlanMapperExt {
     List<ContentPlatformGzhPlan> getGzhPlanExists(@Param("accountId") Long accountId,
                                                   @Param("scene") Integer scene,
                                                   @Param("id") Long id);
+
+    void insertGzhPlanReturnId(@Param("record") ContentPlatformGzhPlan gzhPlan);
+
+    String getVideoMaxDt();
+
+    int getVideoCount(@Param("param") VideoContentListParam param, @Param("dt") String dt);
+
+    List<ContentPlatformVideo> getVideoList(@Param("param") VideoContentListParam param,
+                                            @Param("dt") String dt,
+                                            @Param("offset") int offset,
+                                            @Param("pageSize") Integer pageSize);
 }

+ 1 - 1
api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/QwPlanSaveVideoParam.java

@@ -7,7 +7,7 @@ import lombok.Data;
 public class QwPlanSaveVideoParam {
 
     @ApiModelProperty(value = "id")
-    private String videoId;
+    private Long videoId;
 
     @ApiModelProperty(value = "标题")
     private String title;

+ 1 - 1
api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/VideoContentCoverFrameParam.java

@@ -7,6 +7,6 @@ import lombok.Data;
 public class VideoContentCoverFrameParam {
 
     @ApiModelProperty(value = "视频id")
-    private String videoId;
+    private Long videoId;
 
 }

+ 3 - 3
api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformGzhPlanVideo.java

@@ -5,7 +5,7 @@ public class ContentPlatformGzhPlanVideo {
 
     private Long planId;
 
-    private String videoId;
+    private Long videoId;
 
     private String title;
 
@@ -37,11 +37,11 @@ public class ContentPlatformGzhPlanVideo {
         this.planId = planId;
     }
 
-    public String getVideoId() {
+    public Long getVideoId() {
         return videoId;
     }
 
-    public void setVideoId(String videoId) {
+    public void setVideoId(Long videoId) {
         this.videoId = videoId;
     }
 

+ 10 - 20
api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformGzhPlanVideoExample.java

@@ -245,62 +245,52 @@ public class ContentPlatformGzhPlanVideoExample {
             return (Criteria) this;
         }
 
-        public Criteria andVideoIdEqualTo(String value) {
+        public Criteria andVideoIdEqualTo(Long value) {
             addCriterion("video_id =", value, "videoId");
             return (Criteria) this;
         }
 
-        public Criteria andVideoIdNotEqualTo(String value) {
+        public Criteria andVideoIdNotEqualTo(Long value) {
             addCriterion("video_id <>", value, "videoId");
             return (Criteria) this;
         }
 
-        public Criteria andVideoIdGreaterThan(String value) {
+        public Criteria andVideoIdGreaterThan(Long value) {
             addCriterion("video_id >", value, "videoId");
             return (Criteria) this;
         }
 
-        public Criteria andVideoIdGreaterThanOrEqualTo(String value) {
+        public Criteria andVideoIdGreaterThanOrEqualTo(Long value) {
             addCriterion("video_id >=", value, "videoId");
             return (Criteria) this;
         }
 
-        public Criteria andVideoIdLessThan(String value) {
+        public Criteria andVideoIdLessThan(Long value) {
             addCriterion("video_id <", value, "videoId");
             return (Criteria) this;
         }
 
-        public Criteria andVideoIdLessThanOrEqualTo(String value) {
+        public Criteria andVideoIdLessThanOrEqualTo(Long value) {
             addCriterion("video_id <=", value, "videoId");
             return (Criteria) this;
         }
 
-        public Criteria andVideoIdLike(String value) {
-            addCriterion("video_id like", value, "videoId");
-            return (Criteria) this;
-        }
-
-        public Criteria andVideoIdNotLike(String value) {
-            addCriterion("video_id not like", value, "videoId");
-            return (Criteria) this;
-        }
-
-        public Criteria andVideoIdIn(List<String> values) {
+        public Criteria andVideoIdIn(List<Long> values) {
             addCriterion("video_id in", values, "videoId");
             return (Criteria) this;
         }
 
-        public Criteria andVideoIdNotIn(List<String> values) {
+        public Criteria andVideoIdNotIn(List<Long> values) {
             addCriterion("video_id not in", values, "videoId");
             return (Criteria) this;
         }
 
-        public Criteria andVideoIdBetween(String value1, String value2) {
+        public Criteria andVideoIdBetween(Long value1, Long value2) {
             addCriterion("video_id between", value1, value2, "videoId");
             return (Criteria) this;
         }
 
-        public Criteria andVideoIdNotBetween(String value1, String value2) {
+        public Criteria andVideoIdNotBetween(Long value1, Long value2) {
             addCriterion("video_id not between", value1, value2, "videoId");
             return (Criteria) this;
         }

+ 3 - 3
api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformQwPlanVideo.java

@@ -5,7 +5,7 @@ public class ContentPlatformQwPlanVideo {
 
     private Long planId;
 
-    private String videoId;
+    private Long videoId;
 
     private String title;
 
@@ -33,11 +33,11 @@ public class ContentPlatformQwPlanVideo {
         this.planId = planId;
     }
 
-    public String getVideoId() {
+    public Long getVideoId() {
         return videoId;
     }
 
-    public void setVideoId(String videoId) {
+    public void setVideoId(Long videoId) {
         this.videoId = videoId;
     }
 

+ 10 - 20
api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformQwPlanVideoExample.java

@@ -245,62 +245,52 @@ public class ContentPlatformQwPlanVideoExample {
             return (Criteria) this;
         }
 
-        public Criteria andVideoIdEqualTo(String value) {
+        public Criteria andVideoIdEqualTo(Long value) {
             addCriterion("video_id =", value, "videoId");
             return (Criteria) this;
         }
 
-        public Criteria andVideoIdNotEqualTo(String value) {
+        public Criteria andVideoIdNotEqualTo(Long value) {
             addCriterion("video_id <>", value, "videoId");
             return (Criteria) this;
         }
 
-        public Criteria andVideoIdGreaterThan(String value) {
+        public Criteria andVideoIdGreaterThan(Long value) {
             addCriterion("video_id >", value, "videoId");
             return (Criteria) this;
         }
 
-        public Criteria andVideoIdGreaterThanOrEqualTo(String value) {
+        public Criteria andVideoIdGreaterThanOrEqualTo(Long value) {
             addCriterion("video_id >=", value, "videoId");
             return (Criteria) this;
         }
 
-        public Criteria andVideoIdLessThan(String value) {
+        public Criteria andVideoIdLessThan(Long value) {
             addCriterion("video_id <", value, "videoId");
             return (Criteria) this;
         }
 
-        public Criteria andVideoIdLessThanOrEqualTo(String value) {
+        public Criteria andVideoIdLessThanOrEqualTo(Long value) {
             addCriterion("video_id <=", value, "videoId");
             return (Criteria) this;
         }
 
-        public Criteria andVideoIdLike(String value) {
-            addCriterion("video_id like", value, "videoId");
-            return (Criteria) this;
-        }
-
-        public Criteria andVideoIdNotLike(String value) {
-            addCriterion("video_id not like", value, "videoId");
-            return (Criteria) this;
-        }
-
-        public Criteria andVideoIdIn(List<String> values) {
+        public Criteria andVideoIdIn(List<Long> values) {
             addCriterion("video_id in", values, "videoId");
             return (Criteria) this;
         }
 
-        public Criteria andVideoIdNotIn(List<String> values) {
+        public Criteria andVideoIdNotIn(List<Long> values) {
             addCriterion("video_id not in", values, "videoId");
             return (Criteria) this;
         }
 
-        public Criteria andVideoIdBetween(String value1, String value2) {
+        public Criteria andVideoIdBetween(Long value1, Long value2) {
             addCriterion("video_id between", value1, value2, "videoId");
             return (Criteria) this;
         }
 
-        public Criteria andVideoIdNotBetween(String value1, String value2) {
+        public Criteria andVideoIdNotBetween(Long value1, Long value2) {
             addCriterion("video_id not between", value1, value2, "videoId");
             return (Criteria) this;
         }

+ 101 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformVideo.java

@@ -0,0 +1,101 @@
+package com.tzld.piaoquan.api.model.po.contentplatform;
+
+public class ContentPlatformVideo {
+    private Long id;
+
+    private String dt;
+
+    private Long videoId;
+
+    private String category;
+
+    private String title;
+
+    private String video;
+
+    private Double score;
+
+    private Long createTimestamp;
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
+
+    public String getDt() {
+        return dt;
+    }
+
+    public void setDt(String dt) {
+        this.dt = dt;
+    }
+
+    public Long getVideoId() {
+        return videoId;
+    }
+
+    public void setVideoId(Long videoId) {
+        this.videoId = videoId;
+    }
+
+    public String getCategory() {
+        return category;
+    }
+
+    public void setCategory(String category) {
+        this.category = category;
+    }
+
+    public String getTitle() {
+        return title;
+    }
+
+    public void setTitle(String title) {
+        this.title = title;
+    }
+
+    public String getVideo() {
+        return video;
+    }
+
+    public void setVideo(String video) {
+        this.video = video;
+    }
+
+    public Double getScore() {
+        return score;
+    }
+
+    public void setScore(Double score) {
+        this.score = score;
+    }
+
+    public Long getCreateTimestamp() {
+        return createTimestamp;
+    }
+
+    public void setCreateTimestamp(Long createTimestamp) {
+        this.createTimestamp = createTimestamp;
+    }
+
+    @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(", dt=").append(dt);
+        sb.append(", videoId=").append(videoId);
+        sb.append(", category=").append(category);
+        sb.append(", title=").append(title);
+        sb.append(", video=").append(video);
+        sb.append(", score=").append(score);
+        sb.append(", createTimestamp=").append(createTimestamp);
+        sb.append("]");
+        return sb.toString();
+    }
+}

+ 731 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformVideoExample.java

@@ -0,0 +1,731 @@
+package com.tzld.piaoquan.api.model.po.contentplatform;
+
+import com.tzld.piaoquan.growth.common.utils.page.Page;
+import java.util.ArrayList;
+import java.util.List;
+
+public class ContentPlatformVideoExample {
+    protected String orderByClause;
+
+    protected boolean distinct;
+
+    protected List<Criteria> oredCriteria;
+
+    protected Page page;
+
+    public ContentPlatformVideoExample() {
+        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 andDtIsNull() {
+            addCriterion("dt is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtIsNotNull() {
+            addCriterion("dt is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtEqualTo(String value) {
+            addCriterion("dt =", value, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtNotEqualTo(String value) {
+            addCriterion("dt <>", value, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtGreaterThan(String value) {
+            addCriterion("dt >", value, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtGreaterThanOrEqualTo(String value) {
+            addCriterion("dt >=", value, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtLessThan(String value) {
+            addCriterion("dt <", value, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtLessThanOrEqualTo(String value) {
+            addCriterion("dt <=", value, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtLike(String value) {
+            addCriterion("dt like", value, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtNotLike(String value) {
+            addCriterion("dt not like", value, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtIn(List<String> values) {
+            addCriterion("dt in", values, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtNotIn(List<String> values) {
+            addCriterion("dt not in", values, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtBetween(String value1, String value2) {
+            addCriterion("dt between", value1, value2, "dt");
+            return (Criteria) this;
+        }
+
+        public Criteria andDtNotBetween(String value1, String value2) {
+            addCriterion("dt not between", value1, value2, "dt");
+            return (Criteria) this;
+        }
+
+        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 andCategoryIsNull() {
+            addCriterion("category is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCategoryIsNotNull() {
+            addCriterion("category is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCategoryEqualTo(String value) {
+            addCriterion("category =", value, "category");
+            return (Criteria) this;
+        }
+
+        public Criteria andCategoryNotEqualTo(String value) {
+            addCriterion("category <>", value, "category");
+            return (Criteria) this;
+        }
+
+        public Criteria andCategoryGreaterThan(String value) {
+            addCriterion("category >", value, "category");
+            return (Criteria) this;
+        }
+
+        public Criteria andCategoryGreaterThanOrEqualTo(String value) {
+            addCriterion("category >=", value, "category");
+            return (Criteria) this;
+        }
+
+        public Criteria andCategoryLessThan(String value) {
+            addCriterion("category <", value, "category");
+            return (Criteria) this;
+        }
+
+        public Criteria andCategoryLessThanOrEqualTo(String value) {
+            addCriterion("category <=", value, "category");
+            return (Criteria) this;
+        }
+
+        public Criteria andCategoryLike(String value) {
+            addCriterion("category like", value, "category");
+            return (Criteria) this;
+        }
+
+        public Criteria andCategoryNotLike(String value) {
+            addCriterion("category not like", value, "category");
+            return (Criteria) this;
+        }
+
+        public Criteria andCategoryIn(List<String> values) {
+            addCriterion("category in", values, "category");
+            return (Criteria) this;
+        }
+
+        public Criteria andCategoryNotIn(List<String> values) {
+            addCriterion("category not in", values, "category");
+            return (Criteria) this;
+        }
+
+        public Criteria andCategoryBetween(String value1, String value2) {
+            addCriterion("category between", value1, value2, "category");
+            return (Criteria) this;
+        }
+
+        public Criteria andCategoryNotBetween(String value1, String value2) {
+            addCriterion("category not between", value1, value2, "category");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleIsNull() {
+            addCriterion("title is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleIsNotNull() {
+            addCriterion("title is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleEqualTo(String value) {
+            addCriterion("title =", value, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleNotEqualTo(String value) {
+            addCriterion("title <>", value, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleGreaterThan(String value) {
+            addCriterion("title >", value, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleGreaterThanOrEqualTo(String value) {
+            addCriterion("title >=", value, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleLessThan(String value) {
+            addCriterion("title <", value, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleLessThanOrEqualTo(String value) {
+            addCriterion("title <=", value, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleLike(String value) {
+            addCriterion("title like", value, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleNotLike(String value) {
+            addCriterion("title not like", value, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleIn(List<String> values) {
+            addCriterion("title in", values, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleNotIn(List<String> values) {
+            addCriterion("title not in", values, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleBetween(String value1, String value2) {
+            addCriterion("title between", value1, value2, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andTitleNotBetween(String value1, String value2) {
+            addCriterion("title not between", value1, value2, "title");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIsNull() {
+            addCriterion("video is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIsNotNull() {
+            addCriterion("video is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoEqualTo(String value) {
+            addCriterion("video =", value, "video");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoNotEqualTo(String value) {
+            addCriterion("video <>", value, "video");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoGreaterThan(String value) {
+            addCriterion("video >", value, "video");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoGreaterThanOrEqualTo(String value) {
+            addCriterion("video >=", value, "video");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoLessThan(String value) {
+            addCriterion("video <", value, "video");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoLessThanOrEqualTo(String value) {
+            addCriterion("video <=", value, "video");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoLike(String value) {
+            addCriterion("video like", value, "video");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoNotLike(String value) {
+            addCriterion("video not like", value, "video");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoIn(List<String> values) {
+            addCriterion("video in", values, "video");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoNotIn(List<String> values) {
+            addCriterion("video not in", values, "video");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoBetween(String value1, String value2) {
+            addCriterion("video between", value1, value2, "video");
+            return (Criteria) this;
+        }
+
+        public Criteria andVideoNotBetween(String value1, String value2) {
+            addCriterion("video not between", value1, value2, "video");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreIsNull() {
+            addCriterion("score is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreIsNotNull() {
+            addCriterion("score is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreEqualTo(Double value) {
+            addCriterion("score =", value, "score");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreNotEqualTo(Double value) {
+            addCriterion("score <>", value, "score");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreGreaterThan(Double value) {
+            addCriterion("score >", value, "score");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreGreaterThanOrEqualTo(Double value) {
+            addCriterion("score >=", value, "score");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreLessThan(Double value) {
+            addCriterion("score <", value, "score");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreLessThanOrEqualTo(Double value) {
+            addCriterion("score <=", value, "score");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreIn(List<Double> values) {
+            addCriterion("score in", values, "score");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreNotIn(List<Double> values) {
+            addCriterion("score not in", values, "score");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreBetween(Double value1, Double value2) {
+            addCriterion("score between", value1, value2, "score");
+            return (Criteria) this;
+        }
+
+        public Criteria andScoreNotBetween(Double value1, Double value2) {
+            addCriterion("score not between", value1, value2, "score");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampIsNull() {
+            addCriterion("create_timestamp is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampIsNotNull() {
+            addCriterion("create_timestamp is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampEqualTo(Long value) {
+            addCriterion("create_timestamp =", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampNotEqualTo(Long value) {
+            addCriterion("create_timestamp <>", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampGreaterThan(Long value) {
+            addCriterion("create_timestamp >", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampGreaterThanOrEqualTo(Long value) {
+            addCriterion("create_timestamp >=", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampLessThan(Long value) {
+            addCriterion("create_timestamp <", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampLessThanOrEqualTo(Long value) {
+            addCriterion("create_timestamp <=", value, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampIn(List<Long> values) {
+            addCriterion("create_timestamp in", values, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampNotIn(List<Long> values) {
+            addCriterion("create_timestamp not in", values, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampBetween(Long value1, Long value2) {
+            addCriterion("create_timestamp between", value1, value2, "createTimestamp");
+            return (Criteria) this;
+        }
+
+        public Criteria andCreateTimestampNotBetween(Long value1, Long value2) {
+            addCriterion("create_timestamp not between", value1, value2, "createTimestamp");
+            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);
+        }
+    }
+}

+ 1 - 1
api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/QwDatastatItemVO.java

@@ -19,5 +19,5 @@ public class QwDatastatItemVO {
     private String title;
 
     @ApiModelProperty(value = "视频id")
-    private String videoId;
+    private Long videoId;
 }

+ 1 - 1
api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/VideoContentItemVO.java

@@ -7,7 +7,7 @@ import lombok.Data;
 public class VideoContentItemVO {
 
     @ApiModelProperty(value = "id")
-    private String videoId;
+    private Long videoId;
 
     @ApiModelProperty(value = "标题")
     private String title;

+ 78 - 2
api-module/src/main/java/com/tzld/piaoquan/api/remote/AigcApiService.java

@@ -1,8 +1,6 @@
 package com.tzld.piaoquan.api.remote;
 
-import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
-import com.tzld.piaoquan.api.model.bo.VideoDetail;
 import com.tzld.piaoquan.growth.common.component.HttpPoolClient;
 import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -90,4 +88,82 @@ public class AigcApiService {
         }
         return null;
     }
+
+    public String createPublishPlan(String publishAccountId, String name) {
+        String url = aigcApiHost + "/publish/plan/save";
+        JSONObject params = getPublishPlanAddParam(publishAccountId, name);
+        try {
+            String post = httpPoolClient.post(url, getAigcPostParam(params));
+            JSONObject res = JSONObject.parseObject(post);
+            JSONObject data = res.getJSONObject("data");
+            return data.getString("id");
+        } catch (Exception e) {
+            log.error("getVideoDetailRequest error", e);
+        }
+        return null;
+    }
+
+    private JSONObject getPublishPlanAddParam(String publishAccountId, String name) {
+        JSONObject params = JSONObject.parseObject("{\n" +
+                "    \"accountIds\": [\n" +
+                "        \"" + publishAccountId + "\"\n" +
+                "    ],\n" +
+                "    \"activeManualReview\": 0,\n" +
+                "    \"channel\": 5,\n" +
+                "    \"contentAllocationRules\": 0,\n" +
+                "    \"contentModal\": 7,\n" +
+                "    \"douyinPublishAccoutSetting\": [],\n" +
+                "    \"filterMatchMode\": 1,\n" +
+                "    \"name\": \" 自动回复-" + name + "\",\n" +
+                "    \"publishAccoutJson\": \"\",\n" +
+                "    \"publishBgmType\": 0,\n" +
+                "    \"publishDate\": \"\",\n" +
+                "    \"publishLocation\": [],\n" +
+                "    \"publishNum\": \"\",\n" +
+                "    \"publishPushTime\": \"\",\n" +
+                "    \"publishRate\": 0,\n" +
+                "    \"publishTimeInterval\": 240,\n" +
+                "    \"wxContentInsert\": [\n" +
+                "        {\n" +
+                "            \"accountId\": \"" + publishAccountId + "\",\n" +
+                "            \"name\": \"" + name + "\",\n" +
+                "            \"bottomInsertFlag\": 0,\n" +
+                "            \"topInsertFlag\": 0,\n" +
+                "            \"miniprogramInsertFlag\": 0,\n" +
+                "            \"gzhArticleSortFlag\": 0,\n" +
+                "            \"publishOpenFlag\": 1\n" +
+                "        }\n" +
+                "    ],\n" +
+                "    \"wxVideoPublishAccountSetting\": [],\n" +
+                "    \"scoreJudgeFlag\": 0,\n" +
+                "    \"scoreJudgeTasks\": [],\n" +
+                "    \"inputGroups\": [],\n" +
+                "    \"machineReviewMatchMode\": 1,\n" +
+                "    \"gzhOnlyMiniprogramFlag\": 0,\n" +
+                "    \"planType\": 1,\n" +
+                "    \"pushType\": 6,\n" +
+                "    \"inputFilters\": [],\n" +
+                "    \"inputSources\": [],\n" +
+                "    \"triggerEvent\": 1,\n" +
+                "    \"gzhTriggerSyncFrequency\": 1,\n" +
+                "    \"gzhTriggerSendContentType\": 1,\n" +
+                "    \"gzhAutoReplyDelayFlag\": 1,\n" +
+                "    \"gzhAutoReplyDelayMillisecond\": 500,\n" +
+                "    \"pushContentSortingRules\": 1\n" +
+                "}");
+        return params;
+    }
+
+    public void closePublishPlan(String externalId) {
+        String url = aigcApiHost + "/publish/plan/updatePlanStatus";
+        JSONObject params = new JSONObject();
+        params.put("id", externalId);
+        params.put("status", 0);
+        try {
+            String post = httpPoolClient.post(url, getAigcPostParam(params));
+            JSONObject res = JSONObject.parseObject(post);
+        } catch (Exception e) {
+            log.error("getVideoDetailRequest error", e);
+        }
+    }
 }

+ 37 - 0
api-module/src/main/java/com/tzld/piaoquan/api/remote/ManagerApiService.java

@@ -0,0 +1,37 @@
+package com.tzld.piaoquan.api.remote;
+
+import com.alibaba.fastjson.JSONObject;
+import com.tzld.piaoquan.growth.common.component.HttpPoolClient;
+import lombok.extern.slf4j.Slf4j;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
+import org.springframework.stereotype.Component;
+
+import java.util.List;
+
+@Slf4j
+@Component
+public class ManagerApiService {
+
+    @Autowired
+    private HttpPoolClient httpPoolClient;
+
+    @Value("${video.api.host:https://videotest.yishihui.com}")
+    private String videoApiHost;
+
+    @Value("${aigc.api.token:9ebfcb397e954c41986971f183eb1707}")
+    private String aigcApiToken;
+
+    public List<String> getCoverImagePaths(Long videoId) {
+        String url = videoApiHost + "/longvideoapi/video/getCoverImagePaths";
+        try {
+            String post = httpPoolClient.post(url, "id=" + videoId, "application/x-www-form-urlencoded;charset=UTF-8");
+            JSONObject res = JSONObject.parseObject(post);
+            JSONObject data = res.getJSONObject("data");
+            return data.getJSONArray("videoCoverImages").toJavaList(String.class);
+        } catch (Exception e) {
+            log.error("getVideoDetailRequest error", e);
+        }
+        return null;
+    }
+}

+ 3 - 0
api-module/src/main/java/com/tzld/piaoquan/api/service/GhDetailService.java

@@ -3,6 +3,7 @@ package com.tzld.piaoquan.api.service;
 
 import com.tzld.piaoquan.api.model.vo.GhDetailVo;
 import com.tzld.piaoquan.growth.common.common.base.CommonResponse;
+import com.tzld.piaoquan.growth.common.model.po.GhDetail;
 import com.tzld.piaoquan.growth.common.utils.page.Page;
 
 public interface GhDetailService {
@@ -14,4 +15,6 @@ public interface GhDetailService {
     CommonResponse<Void> updateDetail(GhDetailVo ghDetailVo);
 
     CommonResponse<Void> deleteDetail(Long id);
+
+    GhDetail getGhDetailByGhIdType(String ghId, Integer type);
 }

+ 2 - 0
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/ContentPlatformCooperateAccountService.java

@@ -28,4 +28,6 @@ public interface ContentPlatformCooperateAccountService {
     List<GzhAccountItem> getGzhAccountList();
 
     List<ContentPlatformGzhAccount> getAccountListByIds(List<Long> ids);
+
+    ContentPlatformGzhAccount getById(Long id);
 }

+ 3 - 0
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/ContentPlatformPlanService.java

@@ -1,6 +1,7 @@
 package com.tzld.piaoquan.api.service.contentplatform;
 
 import com.tzld.piaoquan.api.model.param.contentplatform.*;
+import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlan;
 import com.tzld.piaoquan.api.model.vo.contentplatform.GzhPlanItemVO;
 import com.tzld.piaoquan.api.model.vo.contentplatform.QwPlanItemVO;
 import com.tzld.piaoquan.api.model.vo.contentplatform.VideoContentItemVO;
@@ -20,4 +21,6 @@ public interface ContentPlatformPlanService {
     Page<QwPlanItemVO> qwPlanList(QwPlanListParam param);
 
     void qwPlanSave(QwPlanSaveParam param);
+
+    List<ContentPlatformGzhPlan> getGzhPlanListByCooperateAccountId(Long accountId);
 }

+ 16 - 1
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformCooperateAccountServiceImpl.java

@@ -12,12 +12,14 @@ import com.tzld.piaoquan.api.model.param.contentplatform.GzhAuthResultParam;
 import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformAccount;
 import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhAccount;
 import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhAccountExample;
+import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlan;
 import com.tzld.piaoquan.api.model.vo.contentplatform.CooperateAccountItemVO;
 import com.tzld.piaoquan.api.model.vo.contentplatform.GenerateQrcodeVO;
 import com.tzld.piaoquan.api.model.vo.contentplatform.GzhAccountItem;
 import com.tzld.piaoquan.api.model.vo.contentplatform.GzhAuthResultVO;
 import com.tzld.piaoquan.api.remote.AigcApiService;
 import com.tzld.piaoquan.api.service.contentplatform.ContentPlatformCooperateAccountService;
+import com.tzld.piaoquan.api.service.contentplatform.ContentPlatformPlanService;
 import com.tzld.piaoquan.growth.common.utils.RedisUtils;
 import com.tzld.piaoquan.growth.common.utils.page.Page;
 import org.apache.commons.collections4.CollectionUtils;
@@ -39,6 +41,8 @@ public class ContentPlatformCooperateAccountServiceImpl implements ContentPlatfo
     private ContentPlatformGzhAccountMapper gzhAccountMapper;
     @Autowired
     private ContentPlatformGzhAccountMapperExt gzhAccountMapperExt;
+    @Autowired
+    private ContentPlatformPlanService planService;
 
     @Autowired
     private RedisUtils redisUtils;
@@ -142,7 +146,13 @@ public class ContentPlatformCooperateAccountServiceImpl implements ContentPlatfo
         gzhAccount.setStatus(0);
         gzhAccount.setUpdateTimestamp(System.currentTimeMillis());
         gzhAccountMapper.updateByPrimaryKeySelective(gzhAccount);
-        // todo 调用aigc关闭发布计划
+        // 调用aigc关闭发布计划
+        List<ContentPlatformGzhPlan> planList = planService.getGzhPlanListByCooperateAccountId(id);
+        if (CollectionUtils.isNotEmpty(planList)) {
+            for (ContentPlatformGzhPlan plan : planList) {
+                aigcApiService.closePublishPlan(plan.getExternalId());
+            }
+        }
     }
 
     @Override
@@ -151,4 +161,9 @@ public class ContentPlatformCooperateAccountServiceImpl implements ContentPlatfo
         example.createCriteria().andIdIn(ids);
         return gzhAccountMapper.selectByExample(example);
     }
+
+    @Override
+    public ContentPlatformGzhAccount getById(Long id) {
+        return gzhAccountMapper.selectByPrimaryKey(id);
+    }
 }

+ 185 - 5
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformPlanServiceImpl.java

@@ -1,24 +1,41 @@
 package com.tzld.piaoquan.api.service.contentplatform.impl;
 
+import com.alibaba.fastjson.JSONObject;
+import com.tzld.piaoquan.api.common.enums.ExceptionEnum;
+import com.tzld.piaoquan.api.common.exception.CommonException;
 import com.tzld.piaoquan.api.dao.mapper.contentplatform.ContentPlatformGzhPlanMapper;
+import com.tzld.piaoquan.api.dao.mapper.contentplatform.ContentPlatformGzhPlanVideoMapper;
 import com.tzld.piaoquan.api.dao.mapper.contentplatform.ContentPlatformQwPlanMapper;
 import com.tzld.piaoquan.api.dao.mapper.contentplatform.ext.ContentPlatformPlanMapperExt;
 import com.tzld.piaoquan.api.model.config.LoginUserContext;
 import com.tzld.piaoquan.api.model.param.contentplatform.*;
-import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformAccount;
-import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlan;
+import com.tzld.piaoquan.api.model.po.contentplatform.*;
+import com.tzld.piaoquan.api.model.vo.GhDetailVo;
 import com.tzld.piaoquan.api.model.vo.contentplatform.GzhPlanItemVO;
 import com.tzld.piaoquan.api.model.vo.contentplatform.QwPlanItemVO;
 import com.tzld.piaoquan.api.model.vo.contentplatform.VideoContentItemVO;
+import com.tzld.piaoquan.api.remote.AigcApiService;
+import com.tzld.piaoquan.api.remote.ManagerApiService;
+import com.tzld.piaoquan.api.service.GhDetailService;
+import com.tzld.piaoquan.api.service.contentplatform.ContentPlatformCooperateAccountService;
 import com.tzld.piaoquan.api.service.contentplatform.ContentPlatformPlanService;
+import com.tzld.piaoquan.growth.common.common.enums.GhTypeEnum;
+import com.tzld.piaoquan.growth.common.common.enums.StrategyStatusEnum;
+import com.tzld.piaoquan.growth.common.model.po.GhDetail;
 import com.tzld.piaoquan.growth.common.utils.page.Page;
+import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.collections4.CollectionUtils;
+import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
+import java.util.Objects;
+import java.util.stream.Collectors;
 
+@Slf4j
 @Service
 public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanService {
 
@@ -27,7 +44,17 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
     @Autowired
     private ContentPlatformPlanMapperExt planMapperExt;
     @Autowired
+    private ContentPlatformGzhPlanVideoMapper gzhPlanVideoMapper;
+    @Autowired
     private ContentPlatformQwPlanMapper qwPlanMapper;
+    @Autowired
+    private ContentPlatformCooperateAccountService cooperateAccountService;
+    @Autowired
+    private GhDetailService ghDetailService;
+    @Autowired
+    private AigcApiService aigcApiService;
+    @Autowired
+    private ManagerApiService managerApiService;
 
     @Override
     public Page<GzhPlanItemVO> gzhPlanList(GzhPlanListParam param) {
@@ -50,30 +77,183 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         if (CollectionUtils.isEmpty(planList)) {
             return null;
         }
+        List<Long> accountIds = planList.stream().map(ContentPlatformGzhPlan::getAccountId).collect(Collectors.toList());
+        List<ContentPlatformGzhAccount> accountList = cooperateAccountService.getAccountListByIds(accountIds);
+        Map<Long, String> accountMap = accountList.stream().collect(Collectors.toMap(ContentPlatformGzhAccount::getId,
+                ContentPlatformGzhAccount::getName));
+        List<Long> planIds = planList.stream().map(ContentPlatformGzhPlan::getId).collect(Collectors.toList());
+        List<ContentPlatformGzhPlanVideo> videoList = getGzhPlanVideoList(planIds);
+        Map<Long, List<ContentPlatformGzhPlanVideo>> videoMap = videoList.stream()
+                .collect(Collectors.groupingBy(ContentPlatformGzhPlanVideo::getPlanId));
         List<GzhPlanItemVO> result = new ArrayList<>();
         for (ContentPlatformGzhPlan gzhPlan : planList) {
             GzhPlanItemVO planItemVO = new GzhPlanItemVO();
             planItemVO.setId(gzhPlan.getId());
-
+            planItemVO.setAccountId(gzhPlan.getAccountId());
+            planItemVO.setAccountName(accountMap.get(gzhPlan.getAccountId()));
+            planItemVO.setScene(gzhPlan.getScene());
+            planItemVO.setPublishStage(gzhPlan.getPublishStage());
+            List<ContentPlatformGzhPlanVideo> videoListByPlanId = videoMap.get(gzhPlan.getId());
+            if (CollectionUtils.isNotEmpty(videoListByPlanId)) {
+                planItemVO.setVideoCount(videoListByPlanId.size());
+                List<String> titleList = videoListByPlanId.stream().map(ContentPlatformGzhPlanVideo::getTitle)
+                        .collect(Collectors.toList());
+                planItemVO.setTitle(titleList);
+            }
             planItemVO.setCreateTimestamp(gzhPlan.getCreateTimestamp());
             result.add(planItemVO);
         }
         return result;
     }
 
+    private List<ContentPlatformGzhPlanVideo> getGzhPlanVideoList(List<Long> planIds) {
+        ContentPlatformGzhPlanVideoExample example = new ContentPlatformGzhPlanVideoExample();
+        example.createCriteria().andPlanIdIn(planIds);
+        return gzhPlanVideoMapper.selectByExample(example);
+    }
+
     @Override
     public void gzhPlanSave(GzhPlanSaveParam param) {
+        ContentPlatformAccount loginAccount = LoginUserContext.getUser();
+        List<ContentPlatformGzhPlan> planExistList = planMapperExt.getGzhPlanExists(param.getAccountId(), param.getScene(), param.getId());
+        if (CollectionUtils.isNotEmpty(planExistList)) {
+            throw new CommonException(ExceptionEnum.GZH_SCENE_PLAN_EXISTS);
+        }
+        if (param.getVideoList().size() > 3) {
+            throw new CommonException(ExceptionEnum.GZH_PLAN_VIDEO_SIZE_EXCEED);
+        }
+        ContentPlatformGzhAccount account = cooperateAccountService.getById(param.getAccountId());
+        Long now = System.currentTimeMillis();
+        ContentPlatformGzhPlan gzhPlan = new ContentPlatformGzhPlan();
+        gzhPlan.setAccountId(param.getAccountId());
+        gzhPlan.setScene(param.getScene());
+        gzhPlan.setPublishStage(param.getPublishStage());
+        gzhPlan.setUpdateTimestamp(now);
+        // 更新gh_detail
+        List<Long> videoIds = param.getVideoList().stream().map(VideoContentItemVO::getVideoId).collect(Collectors.toList());
+        updateGhDetail(account, videoIds);
+        // 调用aigc创建发布计划
+        String externalId = aigcApiService.createPublishPlan(account.getExternalId(), account.getName());
+        if (Objects.isNull(param.getId())) {
+            gzhPlan.setExternalId(externalId);
+            gzhPlan.setCreateAccountId(loginAccount.getId());
+            gzhPlan.setCreateTimestamp(now);
+            planMapperExt.insertGzhPlanReturnId(gzhPlan);
+        } else {
+            gzhPlan.setId(param.getId());
+            gzhPlanMapper.updateByPrimaryKeySelective(gzhPlan);
+        }
+        // 保存视频内容
+        saveGzhPlanVideo(param, videoIds, gzhPlan.getId(), loginAccount.getId());
+    }
+
+    private void saveGzhPlanVideo(GzhPlanSaveParam param, List<Long> videoIds, Long id, Long loginAccountId) {
+        List<ContentPlatformGzhPlanVideo> existsVideo = getGzhVideoByPlanId(id);
+        List<Long> existsVideoIds = existsVideo.stream().map(ContentPlatformGzhPlanVideo::getVideoId).collect(Collectors.toList());
+        Map<Long, ContentPlatformGzhPlanVideo> existsVideoMap = existsVideo.stream()
+               .collect(Collectors.toMap(ContentPlatformGzhPlanVideo::getVideoId, item -> item));
+        for (ContentPlatformGzhPlanVideo item : existsVideo) {
+            if (!videoIds.contains(item.getVideoId())) {
+                gzhPlanVideoMapper.deleteByPrimaryKey(item.getId());
+            }
+        }
+        for (VideoContentItemVO vo : param.getVideoList()) {
+            if (existsVideoIds.contains(vo.getVideoId())) {
+                ContentPlatformGzhPlanVideo item = existsVideoMap.get(vo.getVideoId());
+                item.setTitle(vo.getTitle());
+                item.setTitleIsUpdate(vo.getTitleIsEdit());
+                item.setCover(vo.getCover());
+                item.setCoverIsUpdate(vo.getCoverIsEdit());
+                gzhPlanVideoMapper.updateByPrimaryKeySelective(item);
+            } else {
+                ContentPlatformGzhPlanVideo item = new ContentPlatformGzhPlanVideo();
+                item.setPlanId(id);
+                item.setVideoId(vo.getVideoId());
+                item.setTitle(vo.getTitle());
+                item.setTitleIsUpdate(vo.getTitleIsEdit());
+                item.setCover(vo.getCover());
+                item.setCoverIsUpdate(vo.getCoverIsEdit());
+                item.setVideo(vo.getVideo());
+                item.setCreateAccountId(loginAccountId);
+                item.setCreateTimestamp(System.currentTimeMillis());
+                gzhPlanVideoMapper.insertSelective(item);
+            }
+        }
+    }
+
+    private List<ContentPlatformGzhPlanVideo> getGzhVideoByPlanId(Long planId) {
+        ContentPlatformGzhPlanVideoExample example = new ContentPlatformGzhPlanVideoExample();
+        example.createCriteria().andPlanIdEqualTo(planId);
+        return gzhPlanVideoMapper.selectByExample(example);
+    }
 
+    private void updateGhDetail(ContentPlatformGzhAccount account, List<Long> videoIds) {
+        GhDetail ghDetail = ghDetailService.getGhDetailByGhIdType(account.getGhId(), GhTypeEnum.THIRD_PARTY_GH.type);
+        GhDetailVo detailVo = new GhDetailVo();
+        if (Objects.nonNull(ghDetail)) {
+            ghDetail.setStrategyStatus(StrategyStatusEnum.DEFAULT.status);
+            ghDetail.setVideoIds(JSONObject.toJSONString(videoIds));
+            ghDetail.setAutoreplySendMinigramNum(videoIds.size());
+            ghDetail.setCategory1(account.getContentType());
+            BeanUtils.copyProperties(ghDetail, detailVo);
+            ghDetailService.updateDetail(detailVo);
+        } else {
+            ContentPlatformAccount loginUser = LoginUserContext.getUser();
+            detailVo.setAccountId(account.getGhId());
+            detailVo.setAccountName(account.getName());
+            detailVo.setType(GhTypeEnum.THIRD_PARTY_GH.type);
+            detailVo.setChannel(loginUser.getChannel());
+            detailVo.setCategory1(account.getContentType());
+            detailVo.setStrategyStatus(StrategyStatusEnum.DEFAULT.status);
+            detailVo.setVideoIds(videoIds);
+            detailVo.setAutoreplySendMinigramNum(videoIds.size());
+            ghDetailService.addGhDetail(detailVo);
+        }
+    }
+
+    @Override
+    public List<ContentPlatformGzhPlan> getGzhPlanListByCooperateAccountId(Long accountId) {
+        ContentPlatformGzhPlanExample example = new ContentPlatformGzhPlanExample();
+        example.createCriteria().andAccountIdEqualTo(accountId);
+        return gzhPlanMapper.selectByExample(example);
     }
 
     @Override
     public Page<VideoContentItemVO> getVideoContentList(VideoContentListParam param) {
-        return null;
+        Page<VideoContentItemVO> result = new Page<>(param.getPageNum(), param.getPageSize());
+        int offset = (param.getPageNum() - 1) * param.getPageSize();
+        String dt = planMapperExt.getVideoMaxDt();
+        int count = planMapperExt.getVideoCount(param, dt);
+        result.setTotalSize(count);
+        if (count == 0) {
+            return result;
+        }
+        List<ContentPlatformVideo> videoList = planMapperExt.getVideoList(param, dt, offset, param.getPageSize());
+        List<VideoContentItemVO> list = buildVideoContentItemVOList(videoList);
+        result.setObjs(list);
+        return result;
+    }
+
+    private List<VideoContentItemVO> buildVideoContentItemVOList(List<ContentPlatformVideo> videoList) {
+        if (CollectionUtils.isEmpty(videoList)) {
+            return null;
+        }
+        List<VideoContentItemVO> result = new ArrayList<>();
+        for (ContentPlatformVideo video : videoList) {
+            VideoContentItemVO item = new VideoContentItemVO();
+            item.setVideoId(video.getVideoId());
+            item.setTitle(video.getTitle());
+            item.setCover(video.getVideo());
+            item.setVideo(video.getVideo());
+            item.setScore(video.getScore());
+            result.add(item);
+        }
+        return result;
     }
 
     @Override
     public List<String> getVideoContentCoverFrameList(VideoContentCoverFrameParam param) {
-        return null;
+        return managerApiService.getCoverImagePaths(param.getVideoId());
     }
 
     @Override

+ 15 - 4
api-module/src/main/java/com/tzld/piaoquan/api/service/impl/GhDetailServiceImpl.java

@@ -2,14 +2,14 @@ package com.tzld.piaoquan.api.service.impl;
 
 import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
+import com.tzld.piaoquan.api.model.vo.GhDetailVo;
+import com.tzld.piaoquan.api.service.GhDetailService;
+import com.tzld.piaoquan.growth.common.common.base.CommonResponse;
 import com.tzld.piaoquan.growth.common.common.enums.GhTypeEnum;
 import com.tzld.piaoquan.growth.common.common.enums.StrategyStatusEnum;
 import com.tzld.piaoquan.growth.common.dao.mapper.GhDetailMapper;
 import com.tzld.piaoquan.growth.common.model.po.GhDetail;
 import com.tzld.piaoquan.growth.common.model.po.GhDetailExample;
-import com.tzld.piaoquan.api.model.vo.GhDetailVo;
-import com.tzld.piaoquan.api.service.GhDetailService;
-import com.tzld.piaoquan.growth.common.common.base.CommonResponse;
 import com.tzld.piaoquan.growth.common.utils.DateUtil;
 import com.tzld.piaoquan.growth.common.utils.page.Page;
 import lombok.extern.slf4j.Slf4j;
@@ -22,7 +22,6 @@ import org.springframework.util.CollectionUtils;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
-import java.util.Objects;
 
 @Slf4j
 @Service
@@ -217,4 +216,16 @@ public class GhDetailServiceImpl implements GhDetailService {
         return null;
     }
 
+    @Override
+    public GhDetail getGhDetailByGhIdType(String ghId, Integer type) {
+        GhDetailExample example = new GhDetailExample();
+        example.createCriteria().andGhIdEqualTo(ghId).andTypeEqualTo(type).andIsDeleteEqualTo(0);
+        List<GhDetail> ghDetails = ghDetailMapper.selectByExample(example);
+        if (!CollectionUtils.isEmpty(ghDetails)) {
+            return ghDetails.get(0);
+        }
+        return null;
+    }
+
+
 }

+ 7 - 7
api-module/src/main/resources/mapper/contentplatform/ContentPlatformGzhPlanVideoMapper.xml

@@ -4,7 +4,7 @@
   <resultMap id="BaseResultMap" type="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlanVideo">
     <id column="id" jdbcType="BIGINT" property="id" />
     <result column="plan_id" jdbcType="BIGINT" property="planId" />
-    <result column="video_id" jdbcType="VARCHAR" property="videoId" />
+    <result column="video_id" jdbcType="BIGINT" property="videoId" />
     <result column="title" jdbcType="VARCHAR" property="title" />
     <result column="title_is_update" jdbcType="INTEGER" property="titleIsUpdate" />
     <result column="cover" jdbcType="VARCHAR" property="cover" />
@@ -113,7 +113,7 @@
       title, title_is_update, cover, 
       cover_is_update, video, create_account_id, 
       create_timestamp)
-    values (#{id,jdbcType=BIGINT}, #{planId,jdbcType=BIGINT}, #{videoId,jdbcType=VARCHAR}, 
+    values (#{id,jdbcType=BIGINT}, #{planId,jdbcType=BIGINT}, #{videoId,jdbcType=BIGINT}, 
       #{title,jdbcType=VARCHAR}, #{titleIsUpdate,jdbcType=INTEGER}, #{cover,jdbcType=VARCHAR}, 
       #{coverIsUpdate,jdbcType=INTEGER}, #{video,jdbcType=VARCHAR}, #{createAccountId,jdbcType=BIGINT}, 
       #{createTimestamp,jdbcType=BIGINT})
@@ -160,7 +160,7 @@
         #{planId,jdbcType=BIGINT},
       </if>
       <if test="videoId != null">
-        #{videoId,jdbcType=VARCHAR},
+        #{videoId,jdbcType=BIGINT},
       </if>
       <if test="title != null">
         #{title,jdbcType=VARCHAR},
@@ -201,7 +201,7 @@
         plan_id = #{record.planId,jdbcType=BIGINT},
       </if>
       <if test="record.videoId != null">
-        video_id = #{record.videoId,jdbcType=VARCHAR},
+        video_id = #{record.videoId,jdbcType=BIGINT},
       </if>
       <if test="record.title != null">
         title = #{record.title,jdbcType=VARCHAR},
@@ -233,7 +233,7 @@
     update content_platform_gzh_plan_video
     set id = #{record.id,jdbcType=BIGINT},
       plan_id = #{record.planId,jdbcType=BIGINT},
-      video_id = #{record.videoId,jdbcType=VARCHAR},
+      video_id = #{record.videoId,jdbcType=BIGINT},
       title = #{record.title,jdbcType=VARCHAR},
       title_is_update = #{record.titleIsUpdate,jdbcType=INTEGER},
       cover = #{record.cover,jdbcType=VARCHAR},
@@ -252,7 +252,7 @@
         plan_id = #{planId,jdbcType=BIGINT},
       </if>
       <if test="videoId != null">
-        video_id = #{videoId,jdbcType=VARCHAR},
+        video_id = #{videoId,jdbcType=BIGINT},
       </if>
       <if test="title != null">
         title = #{title,jdbcType=VARCHAR},
@@ -281,7 +281,7 @@
   <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlanVideo">
     update content_platform_gzh_plan_video
     set plan_id = #{planId,jdbcType=BIGINT},
-      video_id = #{videoId,jdbcType=VARCHAR},
+      video_id = #{videoId,jdbcType=BIGINT},
       title = #{title,jdbcType=VARCHAR},
       title_is_update = #{titleIsUpdate,jdbcType=INTEGER},
       cover = #{cover,jdbcType=VARCHAR},

+ 7 - 7
api-module/src/main/resources/mapper/contentplatform/ContentPlatformQwPlanVideoMapper.xml

@@ -4,7 +4,7 @@
   <resultMap id="BaseResultMap" type="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformQwPlanVideo">
     <id column="id" jdbcType="BIGINT" property="id" />
     <result column="plan_id" jdbcType="BIGINT" property="planId" />
-    <result column="video_id" jdbcType="VARCHAR" property="videoId" />
+    <result column="video_id" jdbcType="BIGINT" property="videoId" />
     <result column="title" jdbcType="VARCHAR" property="title" />
     <result column="cover" jdbcType="VARCHAR" property="cover" />
     <result column="video" jdbcType="VARCHAR" property="video" />
@@ -109,7 +109,7 @@
     insert into content_platform_qw_plan_video (id, plan_id, video_id, 
       title, cover, video, 
       create_account_id, create_timestamp)
-    values (#{id,jdbcType=BIGINT}, #{planId,jdbcType=BIGINT}, #{videoId,jdbcType=VARCHAR}, 
+    values (#{id,jdbcType=BIGINT}, #{planId,jdbcType=BIGINT}, #{videoId,jdbcType=BIGINT}, 
       #{title,jdbcType=VARCHAR}, #{cover,jdbcType=VARCHAR}, #{video,jdbcType=VARCHAR}, 
       #{createAccountId,jdbcType=BIGINT}, #{createTimestamp,jdbcType=BIGINT})
   </insert>
@@ -149,7 +149,7 @@
         #{planId,jdbcType=BIGINT},
       </if>
       <if test="videoId != null">
-        #{videoId,jdbcType=VARCHAR},
+        #{videoId,jdbcType=BIGINT},
       </if>
       <if test="title != null">
         #{title,jdbcType=VARCHAR},
@@ -184,7 +184,7 @@
         plan_id = #{record.planId,jdbcType=BIGINT},
       </if>
       <if test="record.videoId != null">
-        video_id = #{record.videoId,jdbcType=VARCHAR},
+        video_id = #{record.videoId,jdbcType=BIGINT},
       </if>
       <if test="record.title != null">
         title = #{record.title,jdbcType=VARCHAR},
@@ -210,7 +210,7 @@
     update content_platform_qw_plan_video
     set id = #{record.id,jdbcType=BIGINT},
       plan_id = #{record.planId,jdbcType=BIGINT},
-      video_id = #{record.videoId,jdbcType=VARCHAR},
+      video_id = #{record.videoId,jdbcType=BIGINT},
       title = #{record.title,jdbcType=VARCHAR},
       cover = #{record.cover,jdbcType=VARCHAR},
       video = #{record.video,jdbcType=VARCHAR},
@@ -227,7 +227,7 @@
         plan_id = #{planId,jdbcType=BIGINT},
       </if>
       <if test="videoId != null">
-        video_id = #{videoId,jdbcType=VARCHAR},
+        video_id = #{videoId,jdbcType=BIGINT},
       </if>
       <if test="title != null">
         title = #{title,jdbcType=VARCHAR},
@@ -250,7 +250,7 @@
   <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformQwPlanVideo">
     update content_platform_qw_plan_video
     set plan_id = #{planId,jdbcType=BIGINT},
-      video_id = #{videoId,jdbcType=VARCHAR},
+      video_id = #{videoId,jdbcType=BIGINT},
       title = #{title,jdbcType=VARCHAR},
       cover = #{cover,jdbcType=VARCHAR},
       video = #{video,jdbcType=VARCHAR},

+ 261 - 0
api-module/src/main/resources/mapper/contentplatform/ContentPlatformVideoMapper.xml

@@ -0,0 +1,261 @@
+<?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.api.dao.mapper.contentplatform.ContentPlatformVideoMapper">
+  <resultMap id="BaseResultMap" type="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideo">
+    <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="dt" jdbcType="VARCHAR" property="dt" />
+    <result column="video_id" jdbcType="BIGINT" property="videoId" />
+    <result column="category" jdbcType="VARCHAR" property="category" />
+    <result column="title" jdbcType="VARCHAR" property="title" />
+    <result column="video" jdbcType="VARCHAR" property="video" />
+    <result column="score" jdbcType="DOUBLE" property="score" />
+    <result column="create_timestamp" jdbcType="BIGINT" property="createTimestamp" />
+  </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, dt, video_id, category, title, video, score, create_timestamp
+  </sql>
+  <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoExample" resultMap="BaseResultMap">
+    select
+    <if test="distinct">
+      distinct
+    </if>
+    <include refid="Base_Column_List" />
+    from content_platform_video
+    <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 content_platform_video
+    where id = #{id,jdbcType=BIGINT}
+  </select>
+  <delete id="deleteByPrimaryKey" parameterType="java.lang.Long">
+    delete from content_platform_video
+    where id = #{id,jdbcType=BIGINT}
+  </delete>
+  <delete id="deleteByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoExample">
+    delete from content_platform_video
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </delete>
+  <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideo">
+    insert into content_platform_video (id, dt, video_id, 
+      category, title, video, 
+      score, create_timestamp)
+    values (#{id,jdbcType=BIGINT}, #{dt,jdbcType=VARCHAR}, #{videoId,jdbcType=BIGINT}, 
+      #{category,jdbcType=VARCHAR}, #{title,jdbcType=VARCHAR}, #{video,jdbcType=VARCHAR}, 
+      #{score,jdbcType=DOUBLE}, #{createTimestamp,jdbcType=BIGINT})
+  </insert>
+  <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideo">
+    insert into content_platform_video
+    <trim prefix="(" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        id,
+      </if>
+      <if test="dt != null">
+        dt,
+      </if>
+      <if test="videoId != null">
+        video_id,
+      </if>
+      <if test="category != null">
+        category,
+      </if>
+      <if test="title != null">
+        title,
+      </if>
+      <if test="video != null">
+        video,
+      </if>
+      <if test="score != null">
+        score,
+      </if>
+      <if test="createTimestamp != null">
+        create_timestamp,
+      </if>
+    </trim>
+    <trim prefix="values (" suffix=")" suffixOverrides=",">
+      <if test="id != null">
+        #{id,jdbcType=BIGINT},
+      </if>
+      <if test="dt != null">
+        #{dt,jdbcType=VARCHAR},
+      </if>
+      <if test="videoId != null">
+        #{videoId,jdbcType=BIGINT},
+      </if>
+      <if test="category != null">
+        #{category,jdbcType=VARCHAR},
+      </if>
+      <if test="title != null">
+        #{title,jdbcType=VARCHAR},
+      </if>
+      <if test="video != null">
+        #{video,jdbcType=VARCHAR},
+      </if>
+      <if test="score != null">
+        #{score,jdbcType=DOUBLE},
+      </if>
+      <if test="createTimestamp != null">
+        #{createTimestamp,jdbcType=BIGINT},
+      </if>
+    </trim>
+  </insert>
+  <select id="countByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoExample" resultType="java.lang.Long">
+    select count(*) from content_platform_video
+    <if test="_parameter != null">
+      <include refid="Example_Where_Clause" />
+    </if>
+  </select>
+  <update id="updateByExampleSelective" parameterType="map">
+    update content_platform_video
+    <set>
+      <if test="record.id != null">
+        id = #{record.id,jdbcType=BIGINT},
+      </if>
+      <if test="record.dt != null">
+        dt = #{record.dt,jdbcType=VARCHAR},
+      </if>
+      <if test="record.videoId != null">
+        video_id = #{record.videoId,jdbcType=BIGINT},
+      </if>
+      <if test="record.category != null">
+        category = #{record.category,jdbcType=VARCHAR},
+      </if>
+      <if test="record.title != null">
+        title = #{record.title,jdbcType=VARCHAR},
+      </if>
+      <if test="record.video != null">
+        video = #{record.video,jdbcType=VARCHAR},
+      </if>
+      <if test="record.score != null">
+        score = #{record.score,jdbcType=DOUBLE},
+      </if>
+      <if test="record.createTimestamp != null">
+        create_timestamp = #{record.createTimestamp,jdbcType=BIGINT},
+      </if>
+    </set>
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByExample" parameterType="map">
+    update content_platform_video
+    set id = #{record.id,jdbcType=BIGINT},
+      dt = #{record.dt,jdbcType=VARCHAR},
+      video_id = #{record.videoId,jdbcType=BIGINT},
+      category = #{record.category,jdbcType=VARCHAR},
+      title = #{record.title,jdbcType=VARCHAR},
+      video = #{record.video,jdbcType=VARCHAR},
+      score = #{record.score,jdbcType=DOUBLE},
+      create_timestamp = #{record.createTimestamp,jdbcType=BIGINT}
+    <if test="_parameter != null">
+      <include refid="Update_By_Example_Where_Clause" />
+    </if>
+  </update>
+  <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideo">
+    update content_platform_video
+    <set>
+      <if test="dt != null">
+        dt = #{dt,jdbcType=VARCHAR},
+      </if>
+      <if test="videoId != null">
+        video_id = #{videoId,jdbcType=BIGINT},
+      </if>
+      <if test="category != null">
+        category = #{category,jdbcType=VARCHAR},
+      </if>
+      <if test="title != null">
+        title = #{title,jdbcType=VARCHAR},
+      </if>
+      <if test="video != null">
+        video = #{video,jdbcType=VARCHAR},
+      </if>
+      <if test="score != null">
+        score = #{score,jdbcType=DOUBLE},
+      </if>
+      <if test="createTimestamp != null">
+        create_timestamp = #{createTimestamp,jdbcType=BIGINT},
+      </if>
+    </set>
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+  <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideo">
+    update content_platform_video
+    set dt = #{dt,jdbcType=VARCHAR},
+      video_id = #{videoId,jdbcType=BIGINT},
+      category = #{category,jdbcType=VARCHAR},
+      title = #{title,jdbcType=VARCHAR},
+      video = #{video,jdbcType=VARCHAR},
+      score = #{score,jdbcType=DOUBLE},
+      create_timestamp = #{createTimestamp,jdbcType=BIGINT}
+    where id = #{id,jdbcType=BIGINT}
+  </update>
+</mapper>

+ 38 - 0
api-module/src/main/resources/mapper/contentplatform/ext/ContentPlatformPlanMapperExt.xml

@@ -2,6 +2,14 @@
 <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
 <mapper namespace="com.tzld.piaoquan.api.dao.mapper.contentplatform.ext.ContentPlatformPlanMapperExt">
 
+    <insert id="insertGzhPlanReturnId" useGeneratedKeys="true" keyProperty="id">
+        insert into content_platform_gzh_plan (publish_stage, account_id,
+                                               scene, external_id, create_account_id,
+                                               create_timestamp, update_timestamp)
+        values (#{record.publishStage}, #{record.accountId}, #{record.scene}, #{record.externalId},
+                #{record.createAccountId}, #{record.createTimestamp}, #{record.updateTimestamp})
+    </insert>
+
     <select id="getGzhPlanCount" resultType="java.lang.Integer">
         select count(*)
         from content_platform_gzh_plan
@@ -59,4 +67,34 @@
         limit 1
     </select>
 
+    <select id="getVideoMaxDt" resultType="java.lang.String">
+        select max(dt) from content_platform_video
+    </select>
+
+    <select id="getVideoCount" resultType="java.lang.Integer">
+        select count(1)
+        from content_platform_video
+        where dt = #{dt}
+        <if test="param.title!= null and param.title!= ''">
+            and title like concat('%', #{param.title}, '%')
+        </if>
+        <if test="param.category!= null and param.category!= ''">
+            and category = #{param.category}
+        </if>
+    </select>
+
+    <select id="getVideoList" resultType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideo">
+        select *
+        from content_platform_video
+        where dt = #{dt}
+        <if test="param.title!= null and param.title!= ''">
+            and title like concat('%', #{param.title}, '%')
+        </if>
+        <if test="param.category!= null and param.category!= ''">
+            and category = #{param.category}
+        </if>
+        order by video_id
+        limit #{offset}, #{pageSize}
+    </select>
+
 </mapper>

+ 1 - 0
api-module/src/main/resources/mybatis-api-contentPlatform-generator-config.xml

@@ -59,6 +59,7 @@
         <table tableName="content_platform_qw_plan" domainObjectName="ContentPlatformQwPlan" alias=""/>
         <table tableName="content_platform_qw_plan_video" domainObjectName="ContentPlatformQwPlanVideo" alias=""/>
         <table tableName="content_platform_verify_code" domainObjectName="ContentPlatformVerifyCode" alias=""/>
+        <table tableName="content_platform_video" domainObjectName="ContentPlatformVideo" alias=""/>
 
     </context>
 

+ 13 - 0
common-module/src/main/java/com/tzld/piaoquan/growth/common/component/HttpPoolClient.java

@@ -47,6 +47,19 @@ public class HttpPoolClient {
         return request(httpPost);
     }
 
+
+    public String post(String url, String json, String contentType) throws IOException {
+        HttpPost httpPost = new HttpPost(url);
+        if (StringUtils.isBlank(json)) {
+            return request(httpPost);
+        }
+        StringEntity entity = new StringEntity(json, StandardCharsets.UTF_8);
+        entity.setContentEncoding("UTF-8");
+        entity.setContentType(contentType);
+        httpPost.setEntity(entity);
+        return request(httpPost);
+    }
+
     public String post(String url, File file) throws IOException {
         HttpPost uploadFile = new HttpPost(url);
         MultipartEntityBuilder builder = MultipartEntityBuilder.create();