wangyunpeng 2 місяців тому
батько
коміт
2bbc41a677

+ 106 - 0
api-module/src/main/java/com/tzld/piaoquan/api/job/ContentPlatformDatastatJob.java

@@ -0,0 +1,106 @@
+package com.tzld.piaoquan.api.job;
+
+import com.aliyun.odps.data.Record;
+import com.tzld.piaoquan.api.dao.mapper.contentplatform.ContentPlatformVideoMapper;
+import com.tzld.piaoquan.api.dao.mapper.contentplatform.ext.ContentPlatformPlanMapperExt;
+import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideo;
+import com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformVideoExample;
+import com.tzld.piaoquan.growth.common.utils.DateUtil;
+import com.tzld.piaoquan.growth.common.utils.OdpsUtil;
+import com.xxl.job.core.biz.model.ReturnT;
+import com.xxl.job.core.handler.annotation.XxlJob;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.collections4.CollectionUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+import java.util.ArrayList;
+import java.util.List;
+
+@Slf4j
+@Component
+public class ContentPlatformDatastatJob {
+
+    @Autowired
+    private ContentPlatformPlanMapperExt planMapperExt;
+
+    @Autowired
+    private ContentPlatformVideoMapper videoMapper;
+
+    @XxlJob("syncContentPlatformGzhDatastatJob")
+    public ReturnT<String> syncContentPlatformGzhDatastatJob(String param) {
+        String dt = DateUtil.getBeforeDayDateString();
+        long videoCount = getVideoCount(dt);
+        if (videoCount > 0) {
+            return ReturnT.SUCCESS;
+        }
+        String sql = String.format("SELECT * FROM loghubods.wecom_cooperation_video_candidate_pool WHERE dt=%s;", dt);
+        List<Record> dataList = OdpsUtil.getOdpsData(sql);
+        Long now = System.currentTimeMillis();
+        if (CollectionUtils.isNotEmpty(dataList)) {
+            List<ContentPlatformVideo> saveList = new ArrayList<>();
+            for (Record record : dataList) {
+                ContentPlatformVideo item = new ContentPlatformVideo();
+                Long videoId = Long.parseLong((String) record.get(0));
+                String category = (String) record.get(1);
+                String title = (String) record.get(2);
+                String videoUrl = (String) record.get(3);
+                Double score = Double.parseDouble((String) record.get(4));
+                item.setDt(dt);
+                item.setVideoId(videoId);
+                item.setCategory(category);
+                item.setTitle(title);
+                item.setVideo(videoUrl);
+                item.setScore(score);
+                item.setCreateTimestamp(now);
+                saveList.add(item);
+            }
+            if (CollectionUtils.isNotEmpty(saveList)) {
+                planMapperExt.batchInsertContentPlatformVideo(saveList);
+            }
+        }
+        return ReturnT.SUCCESS;
+    }
+
+    private long getVideoCount(String dt) {
+        ContentPlatformVideoExample example = new ContentPlatformVideoExample();
+        example.createCriteria().andDtEqualTo(dt);
+        return videoMapper.countByExample(example);
+    }
+
+    @XxlJob("syncContentPlatformQwDatastatJob")
+    public ReturnT<String> syncContentPlatformQwDatastatJob(String param) {
+        String dt = DateUtil.getBeforeDayDateString();
+        long videoCount = getVideoCount(dt);
+        if (videoCount > 0) {
+            return ReturnT.SUCCESS;
+        }
+        String sql = String.format("SELECT * FROM loghubods.wecom_cooperation_video_candidate_pool WHERE dt=%s;", dt);
+        List<Record> dataList = OdpsUtil.getOdpsData(sql);
+        Long now = System.currentTimeMillis();
+        if (CollectionUtils.isNotEmpty(dataList)) {
+            List<ContentPlatformVideo> saveList = new ArrayList<>();
+            for (Record record : dataList) {
+                ContentPlatformVideo item = new ContentPlatformVideo();
+                Long videoId = Long.parseLong((String) record.get(0));
+                String category = (String) record.get(1);
+                String title = (String) record.get(2);
+                String videoUrl = (String) record.get(3);
+                Double score = Double.parseDouble((String) record.get(4));
+                item.setDt(dt);
+                item.setVideoId(videoId);
+                item.setCategory(category);
+                item.setTitle(title);
+                item.setVideo(videoUrl);
+                item.setScore(score);
+                item.setCreateTimestamp(now);
+                saveList.add(item);
+            }
+            if (CollectionUtils.isNotEmpty(saveList)) {
+                planMapperExt.batchInsertContentPlatformVideo(saveList);
+            }
+        }
+        return ReturnT.SUCCESS;
+    }
+
+}

+ 2 - 2
api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/GzhPlanSaveParam.java

@@ -1,6 +1,6 @@
 package com.tzld.piaoquan.api.model.param.contentplatform;
 
-import com.tzld.piaoquan.api.model.vo.contentplatform.VideoContentItemVO;
+import com.tzld.piaoquan.api.model.vo.contentplatform.GzhPlanVideoContentItemVO;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
@@ -22,5 +22,5 @@ public class GzhPlanSaveParam {
     private Integer publishStage;
 
     @ApiModelProperty(value = "视频列表")
-    private List<VideoContentItemVO> videoList;
+    private List<GzhPlanVideoContentItemVO> videoList;
 }

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

@@ -9,11 +9,13 @@ public class ContentPlatformGzhPlanVideo {
 
     private String title;
 
-    private Integer titleIsUpdate;
+    private String customTitle;
 
     private String cover;
 
-    private Integer coverIsUpdate;
+    private String customCover;
+
+    private Integer customCoverType;
 
     private String video;
 
@@ -53,12 +55,12 @@ public class ContentPlatformGzhPlanVideo {
         this.title = title;
     }
 
-    public Integer getTitleIsUpdate() {
-        return titleIsUpdate;
+    public String getCustomTitle() {
+        return customTitle;
     }
 
-    public void setTitleIsUpdate(Integer titleIsUpdate) {
-        this.titleIsUpdate = titleIsUpdate;
+    public void setCustomTitle(String customTitle) {
+        this.customTitle = customTitle;
     }
 
     public String getCover() {
@@ -69,12 +71,20 @@ public class ContentPlatformGzhPlanVideo {
         this.cover = cover;
     }
 
-    public Integer getCoverIsUpdate() {
-        return coverIsUpdate;
+    public String getCustomCover() {
+        return customCover;
+    }
+
+    public void setCustomCover(String customCover) {
+        this.customCover = customCover;
+    }
+
+    public Integer getCustomCoverType() {
+        return customCoverType;
     }
 
-    public void setCoverIsUpdate(Integer coverIsUpdate) {
-        this.coverIsUpdate = coverIsUpdate;
+    public void setCustomCoverType(Integer customCoverType) {
+        this.customCoverType = customCoverType;
     }
 
     public String getVideo() {
@@ -111,9 +121,10 @@ public class ContentPlatformGzhPlanVideo {
         sb.append(", planId=").append(planId);
         sb.append(", videoId=").append(videoId);
         sb.append(", title=").append(title);
-        sb.append(", titleIsUpdate=").append(titleIsUpdate);
+        sb.append(", customTitle=").append(customTitle);
         sb.append(", cover=").append(cover);
-        sb.append(", coverIsUpdate=").append(coverIsUpdate);
+        sb.append(", customCover=").append(customCover);
+        sb.append(", customCoverType=").append(customCoverType);
         sb.append(", video=").append(video);
         sb.append(", createAccountId=").append(createAccountId);
         sb.append(", createTimestamp=").append(createTimestamp);

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

@@ -365,63 +365,73 @@ public class ContentPlatformGzhPlanVideoExample {
             return (Criteria) this;
         }
 
-        public Criteria andTitleIsUpdateIsNull() {
-            addCriterion("title_is_update is null");
+        public Criteria andCustomTitleIsNull() {
+            addCriterion("custom_title is null");
             return (Criteria) this;
         }
 
-        public Criteria andTitleIsUpdateIsNotNull() {
-            addCriterion("title_is_update is not null");
+        public Criteria andCustomTitleIsNotNull() {
+            addCriterion("custom_title is not null");
             return (Criteria) this;
         }
 
-        public Criteria andTitleIsUpdateEqualTo(Integer value) {
-            addCriterion("title_is_update =", value, "titleIsUpdate");
+        public Criteria andCustomTitleEqualTo(String value) {
+            addCriterion("custom_title =", value, "customTitle");
             return (Criteria) this;
         }
 
-        public Criteria andTitleIsUpdateNotEqualTo(Integer value) {
-            addCriterion("title_is_update <>", value, "titleIsUpdate");
+        public Criteria andCustomTitleNotEqualTo(String value) {
+            addCriterion("custom_title <>", value, "customTitle");
             return (Criteria) this;
         }
 
-        public Criteria andTitleIsUpdateGreaterThan(Integer value) {
-            addCriterion("title_is_update >", value, "titleIsUpdate");
+        public Criteria andCustomTitleGreaterThan(String value) {
+            addCriterion("custom_title >", value, "customTitle");
             return (Criteria) this;
         }
 
-        public Criteria andTitleIsUpdateGreaterThanOrEqualTo(Integer value) {
-            addCriterion("title_is_update >=", value, "titleIsUpdate");
+        public Criteria andCustomTitleGreaterThanOrEqualTo(String value) {
+            addCriterion("custom_title >=", value, "customTitle");
             return (Criteria) this;
         }
 
-        public Criteria andTitleIsUpdateLessThan(Integer value) {
-            addCriterion("title_is_update <", value, "titleIsUpdate");
+        public Criteria andCustomTitleLessThan(String value) {
+            addCriterion("custom_title <", value, "customTitle");
             return (Criteria) this;
         }
 
-        public Criteria andTitleIsUpdateLessThanOrEqualTo(Integer value) {
-            addCriterion("title_is_update <=", value, "titleIsUpdate");
+        public Criteria andCustomTitleLessThanOrEqualTo(String value) {
+            addCriterion("custom_title <=", value, "customTitle");
             return (Criteria) this;
         }
 
-        public Criteria andTitleIsUpdateIn(List<Integer> values) {
-            addCriterion("title_is_update in", values, "titleIsUpdate");
+        public Criteria andCustomTitleLike(String value) {
+            addCriterion("custom_title like", value, "customTitle");
             return (Criteria) this;
         }
 
-        public Criteria andTitleIsUpdateNotIn(List<Integer> values) {
-            addCriterion("title_is_update not in", values, "titleIsUpdate");
+        public Criteria andCustomTitleNotLike(String value) {
+            addCriterion("custom_title not like", value, "customTitle");
             return (Criteria) this;
         }
 
-        public Criteria andTitleIsUpdateBetween(Integer value1, Integer value2) {
-            addCriterion("title_is_update between", value1, value2, "titleIsUpdate");
+        public Criteria andCustomTitleIn(List<String> values) {
+            addCriterion("custom_title in", values, "customTitle");
             return (Criteria) this;
         }
 
-        public Criteria andTitleIsUpdateNotBetween(Integer value1, Integer value2) {
-            addCriterion("title_is_update not between", value1, value2, "titleIsUpdate");
+        public Criteria andCustomTitleNotIn(List<String> values) {
+            addCriterion("custom_title not in", values, "customTitle");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomTitleBetween(String value1, String value2) {
+            addCriterion("custom_title between", value1, value2, "customTitle");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomTitleNotBetween(String value1, String value2) {
+            addCriterion("custom_title not between", value1, value2, "customTitle");
             return (Criteria) this;
         }
 
@@ -495,63 +505,133 @@ public class ContentPlatformGzhPlanVideoExample {
             return (Criteria) this;
         }
 
-        public Criteria andCoverIsUpdateIsNull() {
-            addCriterion("cover_is_update is null");
+        public Criteria andCustomCoverIsNull() {
+            addCriterion("custom_cover is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomCoverIsNotNull() {
+            addCriterion("custom_cover is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomCoverEqualTo(String value) {
+            addCriterion("custom_cover =", value, "customCover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomCoverNotEqualTo(String value) {
+            addCriterion("custom_cover <>", value, "customCover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomCoverGreaterThan(String value) {
+            addCriterion("custom_cover >", value, "customCover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomCoverGreaterThanOrEqualTo(String value) {
+            addCriterion("custom_cover >=", value, "customCover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomCoverLessThan(String value) {
+            addCriterion("custom_cover <", value, "customCover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomCoverLessThanOrEqualTo(String value) {
+            addCriterion("custom_cover <=", value, "customCover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomCoverLike(String value) {
+            addCriterion("custom_cover like", value, "customCover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomCoverNotLike(String value) {
+            addCriterion("custom_cover not like", value, "customCover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomCoverIn(List<String> values) {
+            addCriterion("custom_cover in", values, "customCover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomCoverNotIn(List<String> values) {
+            addCriterion("custom_cover not in", values, "customCover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomCoverBetween(String value1, String value2) {
+            addCriterion("custom_cover between", value1, value2, "customCover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomCoverNotBetween(String value1, String value2) {
+            addCriterion("custom_cover not between", value1, value2, "customCover");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomCoverTypeIsNull() {
+            addCriterion("custom_cover_type is null");
             return (Criteria) this;
         }
 
-        public Criteria andCoverIsUpdateIsNotNull() {
-            addCriterion("cover_is_update is not null");
+        public Criteria andCustomCoverTypeIsNotNull() {
+            addCriterion("custom_cover_type is not null");
             return (Criteria) this;
         }
 
-        public Criteria andCoverIsUpdateEqualTo(Integer value) {
-            addCriterion("cover_is_update =", value, "coverIsUpdate");
+        public Criteria andCustomCoverTypeEqualTo(Integer value) {
+            addCriterion("custom_cover_type =", value, "customCoverType");
             return (Criteria) this;
         }
 
-        public Criteria andCoverIsUpdateNotEqualTo(Integer value) {
-            addCriterion("cover_is_update <>", value, "coverIsUpdate");
+        public Criteria andCustomCoverTypeNotEqualTo(Integer value) {
+            addCriterion("custom_cover_type <>", value, "customCoverType");
             return (Criteria) this;
         }
 
-        public Criteria andCoverIsUpdateGreaterThan(Integer value) {
-            addCriterion("cover_is_update >", value, "coverIsUpdate");
+        public Criteria andCustomCoverTypeGreaterThan(Integer value) {
+            addCriterion("custom_cover_type >", value, "customCoverType");
             return (Criteria) this;
         }
 
-        public Criteria andCoverIsUpdateGreaterThanOrEqualTo(Integer value) {
-            addCriterion("cover_is_update >=", value, "coverIsUpdate");
+        public Criteria andCustomCoverTypeGreaterThanOrEqualTo(Integer value) {
+            addCriterion("custom_cover_type >=", value, "customCoverType");
             return (Criteria) this;
         }
 
-        public Criteria andCoverIsUpdateLessThan(Integer value) {
-            addCriterion("cover_is_update <", value, "coverIsUpdate");
+        public Criteria andCustomCoverTypeLessThan(Integer value) {
+            addCriterion("custom_cover_type <", value, "customCoverType");
             return (Criteria) this;
         }
 
-        public Criteria andCoverIsUpdateLessThanOrEqualTo(Integer value) {
-            addCriterion("cover_is_update <=", value, "coverIsUpdate");
+        public Criteria andCustomCoverTypeLessThanOrEqualTo(Integer value) {
+            addCriterion("custom_cover_type <=", value, "customCoverType");
             return (Criteria) this;
         }
 
-        public Criteria andCoverIsUpdateIn(List<Integer> values) {
-            addCriterion("cover_is_update in", values, "coverIsUpdate");
+        public Criteria andCustomCoverTypeIn(List<Integer> values) {
+            addCriterion("custom_cover_type in", values, "customCoverType");
             return (Criteria) this;
         }
 
-        public Criteria andCoverIsUpdateNotIn(List<Integer> values) {
-            addCriterion("cover_is_update not in", values, "coverIsUpdate");
+        public Criteria andCustomCoverTypeNotIn(List<Integer> values) {
+            addCriterion("custom_cover_type not in", values, "customCoverType");
             return (Criteria) this;
         }
 
-        public Criteria andCoverIsUpdateBetween(Integer value1, Integer value2) {
-            addCriterion("cover_is_update between", value1, value2, "coverIsUpdate");
+        public Criteria andCustomCoverTypeBetween(Integer value1, Integer value2) {
+            addCriterion("custom_cover_type between", value1, value2, "customCoverType");
             return (Criteria) this;
         }
 
-        public Criteria andCoverIsUpdateNotBetween(Integer value1, Integer value2) {
-            addCriterion("cover_is_update not between", value1, value2, "coverIsUpdate");
+        public Criteria andCustomCoverTypeNotBetween(Integer value1, Integer value2) {
+            addCriterion("custom_cover_type not between", value1, value2, "customCoverType");
             return (Criteria) this;
         }
 

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

@@ -24,7 +24,7 @@ public class GzhPlanItemVO {
     private Integer videoCount;
 
     @ApiModelProperty(value = "视频列表")
-    private List<VideoContentItemVO> videoList;
+    private List<GzhPlanVideoContentItemVO> videoList;
 
     @ApiModelProperty(value = "标题")
     private List<String> title;

+ 32 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/GzhPlanVideoContentItemVO.java

@@ -0,0 +1,32 @@
+package com.tzld.piaoquan.api.model.vo.contentplatform;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+public class GzhPlanVideoContentItemVO {
+
+    @ApiModelProperty(value = "id")
+    private Long videoId;
+
+    @ApiModelProperty(value = "标题")
+    private String title;
+
+    @ApiModelProperty(value = "自定义标题")
+    private String customTitle;
+
+    @ApiModelProperty(value = "封面")
+    private String cover;
+
+    @ApiModelProperty(value = "自定义封面")
+    private String customCover;
+
+    @ApiModelProperty(value = "自定义封面类型 1视频桢 2自己上传")
+    private Integer customCoverType;
+
+    @ApiModelProperty(value = "视频url")
+    private String video;
+
+    @ApiModelProperty(value = "传播效率")
+    private Double score;
+}

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

@@ -12,15 +12,9 @@ public class VideoContentItemVO {
     @ApiModelProperty(value = "标题")
     private String title;
 
-    @ApiModelProperty(value = "标题是否修改 0-未修改 1-已修改")
-    private Integer titleIsEdit;
-
     @ApiModelProperty(value = "封面")
     private String cover;
 
-    @ApiModelProperty(value = "封面是否修改 0-未修改 1-已修改")
-    private Integer coverIsEdit;
-
     @ApiModelProperty(value = "视频url")
     private String video;
 

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

@@ -10,6 +10,7 @@ import com.tzld.piaoquan.api.model.param.contentplatform.*;
 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.GzhPlanVideoContentItemVO;
 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;
@@ -33,6 +34,7 @@ import org.apache.commons.collections4.CollectionUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
+import org.springframework.util.StringUtils;
 
 import java.util.*;
 import java.util.function.Function;
@@ -112,14 +114,15 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
                 List<String> titleList = videoListByPlanId.stream().map(ContentPlatformGzhPlanVideo::getTitle)
                         .collect(Collectors.toList());
                 planItemVO.setTitle(titleList);
-                List<VideoContentItemVO> videoVOList = new ArrayList<>();
+                List<GzhPlanVideoContentItemVO> videoVOList = new ArrayList<>();
                 for (ContentPlatformGzhPlanVideo video : videoListByPlanId) {
-                    VideoContentItemVO videoItemVO = new VideoContentItemVO();
+                    GzhPlanVideoContentItemVO videoItemVO = new GzhPlanVideoContentItemVO();
                     videoItemVO.setVideoId(video.getVideoId());
                     videoItemVO.setTitle(video.getTitle());
-                    videoItemVO.setTitleIsEdit(video.getTitleIsUpdate());
+                    videoItemVO.setCustomTitle(video.getCustomTitle());
                     videoItemVO.setCover(video.getCover());
-                    videoItemVO.setCoverIsEdit(video.getCoverIsUpdate());
+                    videoItemVO.setCustomCover(video.getCustomCover());
+                    videoItemVO.setCustomCoverType(video.getCustomCoverType());
                     videoItemVO.setVideo(video.getVideo());
                     videoVOList.add(videoItemVO);
                 }
@@ -155,7 +158,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         gzhPlan.setPublishStage(param.getPublishStage());
         gzhPlan.setUpdateTimestamp(now);
         // 更新gh_detail
-        List<Long> videoIds = param.getVideoList().stream().map(VideoContentItemVO::getVideoId).collect(Collectors.toList());
+        List<Long> videoIds = param.getVideoList().stream().map(GzhPlanVideoContentItemVO::getVideoId).collect(Collectors.toList());
         updateGhDetail(account, videoIds);
         // 更新cgi_reply_bucket_data
         updateCgiReplyBucketData(account.getGhId(), param.getVideoList());
@@ -176,10 +179,9 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         aigcApiService.refreshGzhAutoReplyMsgData(account.getGhId());
     }
 
-    private void updateCgiReplyBucketData(String ghId, List<VideoContentItemVO> videoList) {
-        for (VideoContentItemVO video : videoList) {
-            if ((Objects.isNull(video.getTitleIsEdit()) || video.getTitleIsEdit() == 0)
-                    && (Objects.isNull(video.getCoverIsEdit()) || video.getCoverIsEdit() == 0)) {
+    private void updateCgiReplyBucketData(String ghId, List<GzhPlanVideoContentItemVO> videoList) {
+        for (GzhPlanVideoContentItemVO video : videoList) {
+            if (!StringUtils.hasText(video.getCustomCover()) && !StringUtils.hasText(video.getCustomTitle())) {
                 continue;
             }
             CgiReplyBucketDataExample example = new CgiReplyBucketDataExample();
@@ -192,7 +194,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
             String existsCover = dataList.get(0).getCoverUrl();
             String coverSuffix = existsCover.substring(existsCover.indexOf("/watermark"));
             cgiReplyBucketDataMapperExt.updateBucketDataTitleCoverByGhId(ghId, video.getVideoId(),
-                    video.getTitle(), video.getCover() + coverSuffix);
+                    video.getCustomTitle(), video.getCustomCover() + coverSuffix);
         }
     }
 
@@ -206,22 +208,24 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
                 gzhPlanVideoMapper.deleteByPrimaryKey(item.getId());
             }
         }
-        for (VideoContentItemVO vo : param.getVideoList()) {
+        for (GzhPlanVideoContentItemVO vo : param.getVideoList()) {
             if (existsVideoIds.contains(vo.getVideoId())) {
                 ContentPlatformGzhPlanVideo item = existsVideoMap.get(vo.getVideoId());
                 item.setTitle(vo.getTitle());
-                item.setTitleIsUpdate(vo.getTitleIsEdit());
+                item.setCustomTitle(vo.getCustomTitle());
                 item.setCover(vo.getCover());
-                item.setCoverIsUpdate(vo.getCoverIsEdit());
-                gzhPlanVideoMapper.updateByPrimaryKeySelective(item);
+                item.setCustomCover(vo.getCustomCover());
+                item.setCustomCoverType(vo.getCustomCoverType());
+                gzhPlanVideoMapper.updateByPrimaryKey(item);
             } else {
                 ContentPlatformGzhPlanVideo item = new ContentPlatformGzhPlanVideo();
                 item.setPlanId(id);
                 item.setVideoId(vo.getVideoId());
                 item.setTitle(vo.getTitle());
-                item.setTitleIsUpdate(vo.getTitleIsEdit());
+                item.setCustomTitle(vo.getCustomTitle());
                 item.setCover(vo.getCover());
-                item.setCoverIsUpdate(vo.getCoverIsEdit());
+                item.setCustomCover(vo.getCustomCover());
+                item.setCustomCoverType(vo.getCustomCoverType());
                 item.setVideo(vo.getVideo());
                 item.setCreateAccountId(loginAccountId);
                 item.setCreateTimestamp(System.currentTimeMillis());

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

@@ -6,9 +6,10 @@
     <result column="plan_id" jdbcType="BIGINT" property="planId" />
     <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="custom_title" jdbcType="VARCHAR" property="customTitle" />
     <result column="cover" jdbcType="VARCHAR" property="cover" />
-    <result column="cover_is_update" jdbcType="INTEGER" property="coverIsUpdate" />
+    <result column="custom_cover" jdbcType="VARCHAR" property="customCover" />
+    <result column="custom_cover_type" jdbcType="INTEGER" property="customCoverType" />
     <result column="video" jdbcType="VARCHAR" property="video" />
     <result column="create_account_id" jdbcType="BIGINT" property="createAccountId" />
     <result column="create_timestamp" jdbcType="BIGINT" property="createTimestamp" />
@@ -72,8 +73,8 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, plan_id, video_id, title, title_is_update, cover, cover_is_update, video, create_account_id, 
-    create_timestamp
+    id, plan_id, video_id, title, custom_title, cover, custom_cover, custom_cover_type, 
+    video, create_account_id, create_timestamp
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlanVideoExample" resultMap="BaseResultMap">
     select
@@ -110,13 +111,13 @@
   </delete>
   <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlanVideo">
     insert into content_platform_gzh_plan_video (id, plan_id, video_id, 
-      title, title_is_update, cover, 
-      cover_is_update, video, create_account_id, 
-      create_timestamp)
+      title, custom_title, cover, 
+      custom_cover, custom_cover_type, video, 
+      create_account_id, create_timestamp)
     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})
+      #{title,jdbcType=VARCHAR}, #{customTitle,jdbcType=VARCHAR}, #{cover,jdbcType=VARCHAR}, 
+      #{customCover,jdbcType=VARCHAR}, #{customCoverType,jdbcType=INTEGER}, #{video,jdbcType=VARCHAR}, 
+      #{createAccountId,jdbcType=BIGINT}, #{createTimestamp,jdbcType=BIGINT})
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlanVideo">
     insert into content_platform_gzh_plan_video
@@ -133,14 +134,17 @@
       <if test="title != null">
         title,
       </if>
-      <if test="titleIsUpdate != null">
-        title_is_update,
+      <if test="customTitle != null">
+        custom_title,
       </if>
       <if test="cover != null">
         cover,
       </if>
-      <if test="coverIsUpdate != null">
-        cover_is_update,
+      <if test="customCover != null">
+        custom_cover,
+      </if>
+      <if test="customCoverType != null">
+        custom_cover_type,
       </if>
       <if test="video != null">
         video,
@@ -165,14 +169,17 @@
       <if test="title != null">
         #{title,jdbcType=VARCHAR},
       </if>
-      <if test="titleIsUpdate != null">
-        #{titleIsUpdate,jdbcType=INTEGER},
+      <if test="customTitle != null">
+        #{customTitle,jdbcType=VARCHAR},
       </if>
       <if test="cover != null">
         #{cover,jdbcType=VARCHAR},
       </if>
-      <if test="coverIsUpdate != null">
-        #{coverIsUpdate,jdbcType=INTEGER},
+      <if test="customCover != null">
+        #{customCover,jdbcType=VARCHAR},
+      </if>
+      <if test="customCoverType != null">
+        #{customCoverType,jdbcType=INTEGER},
       </if>
       <if test="video != null">
         #{video,jdbcType=VARCHAR},
@@ -206,14 +213,17 @@
       <if test="record.title != null">
         title = #{record.title,jdbcType=VARCHAR},
       </if>
-      <if test="record.titleIsUpdate != null">
-        title_is_update = #{record.titleIsUpdate,jdbcType=INTEGER},
+      <if test="record.customTitle != null">
+        custom_title = #{record.customTitle,jdbcType=VARCHAR},
       </if>
       <if test="record.cover != null">
         cover = #{record.cover,jdbcType=VARCHAR},
       </if>
-      <if test="record.coverIsUpdate != null">
-        cover_is_update = #{record.coverIsUpdate,jdbcType=INTEGER},
+      <if test="record.customCover != null">
+        custom_cover = #{record.customCover,jdbcType=VARCHAR},
+      </if>
+      <if test="record.customCoverType != null">
+        custom_cover_type = #{record.customCoverType,jdbcType=INTEGER},
       </if>
       <if test="record.video != null">
         video = #{record.video,jdbcType=VARCHAR},
@@ -235,9 +245,10 @@
       plan_id = #{record.planId,jdbcType=BIGINT},
       video_id = #{record.videoId,jdbcType=BIGINT},
       title = #{record.title,jdbcType=VARCHAR},
-      title_is_update = #{record.titleIsUpdate,jdbcType=INTEGER},
+      custom_title = #{record.customTitle,jdbcType=VARCHAR},
       cover = #{record.cover,jdbcType=VARCHAR},
-      cover_is_update = #{record.coverIsUpdate,jdbcType=INTEGER},
+      custom_cover = #{record.customCover,jdbcType=VARCHAR},
+      custom_cover_type = #{record.customCoverType,jdbcType=INTEGER},
       video = #{record.video,jdbcType=VARCHAR},
       create_account_id = #{record.createAccountId,jdbcType=BIGINT},
       create_timestamp = #{record.createTimestamp,jdbcType=BIGINT}
@@ -257,14 +268,17 @@
       <if test="title != null">
         title = #{title,jdbcType=VARCHAR},
       </if>
-      <if test="titleIsUpdate != null">
-        title_is_update = #{titleIsUpdate,jdbcType=INTEGER},
+      <if test="customTitle != null">
+        custom_title = #{customTitle,jdbcType=VARCHAR},
       </if>
       <if test="cover != null">
         cover = #{cover,jdbcType=VARCHAR},
       </if>
-      <if test="coverIsUpdate != null">
-        cover_is_update = #{coverIsUpdate,jdbcType=INTEGER},
+      <if test="customCover != null">
+        custom_cover = #{customCover,jdbcType=VARCHAR},
+      </if>
+      <if test="customCoverType != null">
+        custom_cover_type = #{customCoverType,jdbcType=INTEGER},
       </if>
       <if test="video != null">
         video = #{video,jdbcType=VARCHAR},
@@ -283,9 +297,10 @@
     set plan_id = #{planId,jdbcType=BIGINT},
       video_id = #{videoId,jdbcType=BIGINT},
       title = #{title,jdbcType=VARCHAR},
-      title_is_update = #{titleIsUpdate,jdbcType=INTEGER},
+      custom_title = #{customTitle,jdbcType=VARCHAR},
       cover = #{cover,jdbcType=VARCHAR},
-      cover_is_update = #{coverIsUpdate,jdbcType=INTEGER},
+      custom_cover = #{customCover,jdbcType=VARCHAR},
+      custom_cover_type = #{customCoverType,jdbcType=INTEGER},
       video = #{video,jdbcType=VARCHAR},
       create_account_id = #{createAccountId,jdbcType=BIGINT},
       create_timestamp = #{createTimestamp,jdbcType=BIGINT}