Преглед на файлове

用户自定义标题、封面 上报

wangyunpeng преди 2 седмици
родител
ревизия
476361bf39

+ 2 - 0
api-module/src/main/java/com/tzld/piaoquan/api/common/enums/ExceptionEnum.java

@@ -62,6 +62,8 @@ public enum ExceptionEnum {
     PQ_ACCOUNT_NOT_BINDING(6006, "票圈账号未绑定"),
     VIDEO_CITED(6007, "视频已被引用,不能删除"),
     VIDEO_GET_FAILED(6008, "视频获取失败"),
+    VIDEO_MULTI_TITLE_SAVE_FAILED(6009, "视频多标题保存失败"),
+    VIDEO_MULTI_COVER_SAVE_FAILED(6010, "视频多封面保存失败"),
 
     // 自动回复
     CGI_REPLY_BUCKET_DATA_NOT_FOUND(10000, "自动回复数据不存在"),

+ 76 - 0
api-module/src/main/java/com/tzld/piaoquan/api/component/ManagerApiService.java

@@ -0,0 +1,76 @@
+package com.tzld.piaoquan.api.component;
+
+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.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.Objects;
+
+@Slf4j
+@Component
+public class ManagerApiService {
+
+    @Autowired
+    private HttpPoolClient httpPoolClient;
+
+    @Value("${manager.api.host:https://testadmin.piaoquantv.com/manager}")
+    private String managerApiHost;
+
+    public JSONObject videoMultiTitleSave(Long videoId, String title) {
+        String url = managerApiHost + "/video/multiTitleV2/saveNoAuth";
+        JSONObject res = null;
+        try {
+            JSONObject param = new JSONObject();
+            param.put("videoId", videoId);
+            param.put("title", title);
+            param.put("source", 1);
+            String post = httpPoolClient.post(url, param.toJSONString());
+            res = JSONObject.parseObject(post);
+        } catch (Exception e) {
+            log.error("ManagerApiService videoMultiTitleSave error, videoId={} title={}",
+                    videoId, title, e);
+        }
+        if (Objects.isNull(res)) {
+            throw new CommonException(ExceptionEnum.VIDEO_MULTI_TITLE_SAVE_FAILED);
+        }
+        if (res.getInteger("code") != 0) {
+            log.error("ManagerApiService videoMultiTitleSave error, videoId={} title={} res={}",
+                    videoId, title, res);
+            throw new CommonException(ExceptionEnum.VIDEO_MULTI_TITLE_SAVE_FAILED.getCode(),
+                    ExceptionEnum.VIDEO_MULTI_TITLE_SAVE_FAILED.getMsg() + "," + res.getString("msg"));
+        }
+        return res.getJSONObject("content");
+    }
+
+    public JSONObject videoMultiCoverSave(Long videoId, String coverUrl) {
+        String url = managerApiHost + "/video/multiCover/saveNoAuth";
+        JSONObject res = null;
+        try {
+            JSONObject param = new JSONObject();
+            param.put("videoId", videoId);
+            param.put("coverUrl", coverUrl);
+            param.put("source", 1);
+            String post = httpPoolClient.post(url, param.toJSONString());
+            res = JSONObject.parseObject(post);
+        } catch (Exception e) {
+            log.error("ManagerApiService videoMultiCoverSave error, videoId={} coverUrl={}",
+                    videoId, coverUrl, e);
+        }
+        if (Objects.isNull(res)) {
+            throw new CommonException(ExceptionEnum.VIDEO_MULTI_COVER_SAVE_FAILED);
+        }
+        if (res.getInteger("code") != 0) {
+            log.error("ManagerApiService videoMultiCoverSave error, videoId={} coverUrl={} res={}",
+                    videoId, coverUrl, res);
+            throw new CommonException(ExceptionEnum.VIDEO_MULTI_COVER_SAVE_FAILED.getCode(),
+                    ExceptionEnum.VIDEO_MULTI_COVER_SAVE_FAILED.getMsg() + "," + res.getString("msg"));
+        }
+        return res.getJSONObject("content");
+    }
+
+}

+ 0 - 3
api-module/src/main/java/com/tzld/piaoquan/api/job/wecom/thirdpart/WeComUserDetailJob.java

@@ -295,9 +295,6 @@ public class WeComUserDetailJob {
                     if (roomDetail.getMemberCount() >= memberMaxNums) {
                         roomDetail.setAddUserStatus(0);
                     }
-                    if (roomDetail.getMemberCount() >= sendMsgStatusNums && autoSendMsg) {
-                        roomDetail.setSendStatus(1);
-                    }
                 }
                 //roomMapper.updateByPrimaryKeySelective(roomDetail);
                 updateList.add(roomDetail);

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

@@ -9,10 +9,14 @@ public class ContentPlatformGzhPlanVideo {
 
     private String title;
 
+    private Long customTitleId;
+
     private String customTitle;
 
     private String cover;
 
+    private Long customCoverId;
+
     private String customCover;
 
     private Integer customCoverType;
@@ -21,6 +25,8 @@ public class ContentPlatformGzhPlanVideo {
 
     private String pageUrl;
 
+    private Integer status;
+
     private Long createAccountId;
 
     private Long createTimestamp;
@@ -57,6 +63,14 @@ public class ContentPlatformGzhPlanVideo {
         this.title = title;
     }
 
+    public Long getCustomTitleId() {
+        return customTitleId;
+    }
+
+    public void setCustomTitleId(Long customTitleId) {
+        this.customTitleId = customTitleId;
+    }
+
     public String getCustomTitle() {
         return customTitle;
     }
@@ -73,6 +87,14 @@ public class ContentPlatformGzhPlanVideo {
         this.cover = cover;
     }
 
+    public Long getCustomCoverId() {
+        return customCoverId;
+    }
+
+    public void setCustomCoverId(Long customCoverId) {
+        this.customCoverId = customCoverId;
+    }
+
     public String getCustomCover() {
         return customCover;
     }
@@ -105,6 +127,14 @@ public class ContentPlatformGzhPlanVideo {
         this.pageUrl = pageUrl;
     }
 
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
     public Long getCreateAccountId() {
         return createAccountId;
     }
@@ -131,12 +161,15 @@ public class ContentPlatformGzhPlanVideo {
         sb.append(", planId=").append(planId);
         sb.append(", videoId=").append(videoId);
         sb.append(", title=").append(title);
+        sb.append(", customTitleId=").append(customTitleId);
         sb.append(", customTitle=").append(customTitle);
         sb.append(", cover=").append(cover);
+        sb.append(", customCoverId=").append(customCoverId);
         sb.append(", customCover=").append(customCover);
         sb.append(", customCoverType=").append(customCoverType);
         sb.append(", video=").append(video);
         sb.append(", pageUrl=").append(pageUrl);
+        sb.append(", status=").append(status);
         sb.append(", createAccountId=").append(createAccountId);
         sb.append(", createTimestamp=").append(createTimestamp);
         sb.append("]");

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

@@ -365,6 +365,66 @@ public class ContentPlatformGzhPlanVideoExample {
             return (Criteria) this;
         }
 
+        public Criteria andCustomTitleIdIsNull() {
+            addCriterion("custom_title_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomTitleIdIsNotNull() {
+            addCriterion("custom_title_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomTitleIdEqualTo(Long value) {
+            addCriterion("custom_title_id =", value, "customTitleId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomTitleIdNotEqualTo(Long value) {
+            addCriterion("custom_title_id <>", value, "customTitleId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomTitleIdGreaterThan(Long value) {
+            addCriterion("custom_title_id >", value, "customTitleId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomTitleIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("custom_title_id >=", value, "customTitleId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomTitleIdLessThan(Long value) {
+            addCriterion("custom_title_id <", value, "customTitleId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomTitleIdLessThanOrEqualTo(Long value) {
+            addCriterion("custom_title_id <=", value, "customTitleId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomTitleIdIn(List<Long> values) {
+            addCriterion("custom_title_id in", values, "customTitleId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomTitleIdNotIn(List<Long> values) {
+            addCriterion("custom_title_id not in", values, "customTitleId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomTitleIdBetween(Long value1, Long value2) {
+            addCriterion("custom_title_id between", value1, value2, "customTitleId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomTitleIdNotBetween(Long value1, Long value2) {
+            addCriterion("custom_title_id not between", value1, value2, "customTitleId");
+            return (Criteria) this;
+        }
+
         public Criteria andCustomTitleIsNull() {
             addCriterion("custom_title is null");
             return (Criteria) this;
@@ -505,6 +565,66 @@ public class ContentPlatformGzhPlanVideoExample {
             return (Criteria) this;
         }
 
+        public Criteria andCustomCoverIdIsNull() {
+            addCriterion("custom_cover_id is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomCoverIdIsNotNull() {
+            addCriterion("custom_cover_id is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomCoverIdEqualTo(Long value) {
+            addCriterion("custom_cover_id =", value, "customCoverId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomCoverIdNotEqualTo(Long value) {
+            addCriterion("custom_cover_id <>", value, "customCoverId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomCoverIdGreaterThan(Long value) {
+            addCriterion("custom_cover_id >", value, "customCoverId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomCoverIdGreaterThanOrEqualTo(Long value) {
+            addCriterion("custom_cover_id >=", value, "customCoverId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomCoverIdLessThan(Long value) {
+            addCriterion("custom_cover_id <", value, "customCoverId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomCoverIdLessThanOrEqualTo(Long value) {
+            addCriterion("custom_cover_id <=", value, "customCoverId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomCoverIdIn(List<Long> values) {
+            addCriterion("custom_cover_id in", values, "customCoverId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomCoverIdNotIn(List<Long> values) {
+            addCriterion("custom_cover_id not in", values, "customCoverId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomCoverIdBetween(Long value1, Long value2) {
+            addCriterion("custom_cover_id between", value1, value2, "customCoverId");
+            return (Criteria) this;
+        }
+
+        public Criteria andCustomCoverIdNotBetween(Long value1, Long value2) {
+            addCriterion("custom_cover_id not between", value1, value2, "customCoverId");
+            return (Criteria) this;
+        }
+
         public Criteria andCustomCoverIsNull() {
             addCriterion("custom_cover is null");
             return (Criteria) this;
@@ -775,6 +895,66 @@ public class ContentPlatformGzhPlanVideoExample {
             return (Criteria) this;
         }
 
+        public Criteria andStatusIsNull() {
+            addCriterion("`status` is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusIsNotNull() {
+            addCriterion("`status` is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusEqualTo(Integer value) {
+            addCriterion("`status` =", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotEqualTo(Integer value) {
+            addCriterion("`status` <>", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusGreaterThan(Integer value) {
+            addCriterion("`status` >", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusGreaterThanOrEqualTo(Integer value) {
+            addCriterion("`status` >=", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusLessThan(Integer value) {
+            addCriterion("`status` <", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusLessThanOrEqualTo(Integer value) {
+            addCriterion("`status` <=", value, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusIn(List<Integer> values) {
+            addCriterion("`status` in", values, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotIn(List<Integer> values) {
+            addCriterion("`status` not in", values, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusBetween(Integer value1, Integer value2) {
+            addCriterion("`status` between", value1, value2, "status");
+            return (Criteria) this;
+        }
+
+        public Criteria andStatusNotBetween(Integer value1, Integer value2) {
+            addCriterion("`status` not between", value1, value2, "status");
+            return (Criteria) this;
+        }
+
         public Criteria andCreateAccountIdIsNull() {
             addCriterion("create_account_id is null");
             return (Criteria) this;

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

@@ -43,6 +43,8 @@ import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.util.StringUtils;
 
+import java.io.UnsupportedEncodingException;
+import java.net.URLEncoder;
 import java.util.*;
 import java.util.function.Function;
 import java.util.stream.Collectors;
@@ -91,6 +93,8 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
     private CgiReplyService cgiReplyService;
     @Autowired
     private TouLiuHttpClient touLiuHttpClient;
+    @Autowired
+    private ManagerApiService managerApiService;
 
 
     @Value("${vlog.share.appType:11}")
@@ -175,6 +179,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
                         }
                     }
                     videoItemVO.setShareCover(getShareCover(ContentPlatformPlanService.getVideoCover(video)));
+                    videoItemVO.setPageUrl(buildCustomPageUrl(videoItemVO, video));
                     videoVOList.add(videoItemVO);
                 }
                 planItemVO.setVideoList(videoVOList);
@@ -185,6 +190,22 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         return result;
     }
 
+    private String buildCustomPageUrl(GzhPlanVideoContentItemVO videoItemVO, ContentPlatformGzhPlanVideo video) {
+        String pageUrl = videoItemVO.getPageUrl();
+        try {
+            if (Objects.nonNull(video.getCustomTitleId()) && StringUtils.hasText(videoItemVO.getCustomTitle())) {
+                pageUrl += URLEncoder.encode("?shareTitleId=" + video.getCustomTitleId() + "?shareTitle=" + video.getTitle(), "UTF-8");
+            }
+            if (Objects.nonNull(video.getCustomCoverId()) && StringUtils.hasText(videoItemVO.getCustomCover())) {
+                pageUrl += URLEncoder.encode("?shareImageId=" + video.getCustomCoverId() + "?shareImageUrl=" + URLEncoder.encode(video.getCustomCover(), "UTF-8"), "UTF-8");
+            }
+            return pageUrl;
+        } catch (UnsupportedEncodingException e) {
+            log.error("buildCustomPageUrl error", e);
+        }
+        return videoItemVO.getPageUrl();
+    }
+
     @Override
     public List<ContentPlatformGzhPlanVideo> getGzhPlanVideoList(List<Long> planIds) {
         ContentPlatformGzhPlanVideoExample example = new ContentPlatformGzhPlanVideoExample();
@@ -299,7 +320,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
             // 更新gh_detail
             updateGhDetail(account, param.getSelectVideoType(), videoIds);
             // 更新cgi_reply_bucket_data
-            updateCgiReplyBucketData(account.getGhId(), param.getVideoList());
+            updateCgiReplyBucketData(account.getGhId());
         }
         // 保存视频内容
         saveGzhPlanVideo(param, videoIds, gzhPlan.getId(), account, loginAccount);
@@ -316,26 +337,8 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         }
     }
 
-    private void updateCgiReplyBucketData(String ghId, List<GzhPlanVideoContentItemParam> videoList) {
+    private void updateCgiReplyBucketData(String ghId) {
         cgiReplyBucketDataMapperExt.deleteBucketDataByGhId(ghId);
-//        for (GzhPlanVideoContentItemParam video : videoList) {
-//            if (!StringUtils.hasText(video.getCustomCover()) && !StringUtils.hasText(video.getCustomTitle())) {
-//                continue;
-//            }
-//            List<CgiReplyBucketData> dataList = cgiReplyService.getCgiReplyBucketDataListByVideoId(video.getVideoId());
-//            if (CollectionUtils.isEmpty(dataList)) {
-//                continue;
-//            }
-//            String existsCover = dataList.get(0).getCoverUrl();
-//            if (!existsCover.contains("?")) {
-//                continue;
-//            }
-//            String coverSuffix = existsCover.substring(existsCover.indexOf("?"));
-//            String cover = video.getCover().substring(0, existsCover.indexOf("?"));
-//            cgiReplyBucketDataMapperExt.updateBucketDataTitleCoverByGhId(ghId, video.getVideoId(),
-//                    StringUtils.hasText(video.getCustomTitle()) ? video.getCustomTitle() : video.getTitle(),
-//                    StringUtils.hasText(video.getCustomCover()) ? video.getCustomCover() : cover + coverSuffix);
-//        }
     }
 
     private void saveGzhPlanVideo(GzhPlanSaveParam param, List<Long> videoIds, Long planId,
@@ -359,9 +362,9 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
             if (existsVideoIds.contains(vo.getVideoId())) {
                 ContentPlatformGzhPlanVideo item = existsVideoMap.get(vo.getVideoId());
                 item.setTitle(vo.getTitle());
-                item.setCustomTitle(vo.getCustomTitle());
+                setCustomTitle(item, vo);
                 item.setCover(vo.getCover());
-                item.setCustomCover(vo.getCustomCover());
+                setCustomCover(item, vo);
                 item.setCustomCoverType(vo.getCustomCoverType());
                 gzhPlanVideoMapper.updateByPrimaryKey(item);
             } else {
@@ -369,9 +372,9 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
                 item.setPlanId(planId);
                 item.setVideoId(vo.getVideoId());
                 item.setTitle(vo.getTitle());
-                item.setCustomTitle(vo.getCustomTitle());
+                setCustomTitle(item, vo);
                 item.setCover(vo.getCover());
-                item.setCustomCover(vo.getCustomCover());
+                setCustomCover(item, vo);
                 item.setCustomCoverType(vo.getCustomCoverType());
                 item.setVideo(vo.getVideo());
                 if (param.getType() == ContentPlatformGzhPlanTypeEnum.FWH_PUSH.getVal()) {
@@ -397,6 +400,54 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         }
     }
 
+    private void setCustomTitle(ContentPlatformGzhPlanVideo item, GzhPlanVideoContentItemParam vo) {
+        if (StringUtils.hasText(vo.getCustomTitle())) {
+            List<ContentPlatformGzhPlanVideo> gzhPlanVideoList = gzhPlanVideoListByVideoTitle(vo.getVideoId());
+            if (CollectionUtils.isNotEmpty(gzhPlanVideoList)) {
+                for (ContentPlatformGzhPlanVideo gzhPlanVideo : gzhPlanVideoList) {
+                    if (gzhPlanVideo.getCustomTitle().equals(vo.getCustomTitle())) {
+                        item.setCustomTitleId(gzhPlanVideo.getCustomTitleId());
+                        break;
+                    }
+                }
+            } else {
+                JSONObject multiTitle = managerApiService.videoMultiTitleSave(vo.getVideoId(), vo.getCustomTitle());
+                item.setCustomTitleId(multiTitle.getLong("id"));
+            }
+            item.setCustomTitle(vo.getCustomTitle());
+        }
+    }
+
+    private List<ContentPlatformGzhPlanVideo> gzhPlanVideoListByVideoTitle(Long videoId) {
+        ContentPlatformGzhPlanVideoExample example = new ContentPlatformGzhPlanVideoExample();
+        example.createCriteria().andVideoIdEqualTo(videoId).andCustomTitleIdIsNotNull();
+        return gzhPlanVideoMapper.selectByExample(example);
+    }
+
+    private void setCustomCover(ContentPlatformGzhPlanVideo item, GzhPlanVideoContentItemParam vo) {
+        if (StringUtils.hasText(vo.getCustomCover())) {
+            List<ContentPlatformGzhPlanVideo> gzhPlanVideoList = gzhPlanVideoListByVideoCover(vo.getVideoId());
+            if (CollectionUtils.isNotEmpty(gzhPlanVideoList)) {
+                for (ContentPlatformGzhPlanVideo gzhPlanVideo : gzhPlanVideoList) {
+                    if (gzhPlanVideo.getCustomCover().equals(vo.getCustomCover())) {
+                        item.setCustomCoverId(gzhPlanVideo.getCustomCoverId());
+                        break;
+                    }
+                }
+            } else {
+                JSONObject multiCover = managerApiService.videoMultiCoverSave(vo.getVideoId(), vo.getCustomCover());
+                item.setCustomCoverId(multiCover.getLong("id"));
+            }
+            item.setCustomCover(vo.getCustomCover());
+        }
+    }
+
+    private List<ContentPlatformGzhPlanVideo> gzhPlanVideoListByVideoCover(Long videoId) {
+        ContentPlatformGzhPlanVideoExample example = new ContentPlatformGzhPlanVideoExample();
+        example.createCriteria().andVideoIdEqualTo(videoId).andCustomCoverIdIsNotNull();
+        return gzhPlanVideoMapper.selectByExample(example);
+    }
+
     private void saveChangeVideoLog(Long planId, List<Long> existsVideoIds, List<GzhPlanVideoContentItemParam> videoList) {
         List<Long> newVideoIds = videoList.stream().map(GzhPlanVideoContentItemParam::getVideoId).collect(Collectors.toList());
         boolean changed = false;
@@ -555,16 +606,16 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
                 type, Arrays.asList("sum", userChannel), videoIds);
         Map<Long, Double> typeVideoScoreMap = videoDataStatAggList.stream()
                 .filter(o -> channel.equals(o.getChannel()) && "normal".equals(o.getStrategy())).collect(Collectors.toMap(
-                ContentPlatformVideoDataStatAgg::getVideoId, ContentPlatformVideoDataStatAgg::getFissionRate));
+                        ContentPlatformVideoDataStatAgg::getVideoId, ContentPlatformVideoDataStatAgg::getFissionRate));
         Map<Long, Double> channelVideoScoreMap = videoDataStatAggList.stream()
                 .filter(o -> userChannel.equals(o.getChannel()) && "normal".equals(o.getStrategy())).collect(Collectors.toMap(
-                ContentPlatformVideoDataStatAgg::getVideoId, ContentPlatformVideoDataStatAgg::getFissionRate));
+                        ContentPlatformVideoDataStatAgg::getVideoId, ContentPlatformVideoDataStatAgg::getFissionRate));
         Map<Long, Double> recommendTypeVideoScoreMap = videoDataStatAggList.stream()
                 .filter(o -> channel.equals(o.getChannel()) && "recommend".equals(o.getStrategy())).collect(Collectors.toMap(
-                ContentPlatformVideoDataStatAgg::getVideoId, ContentPlatformVideoDataStatAgg::getFissionRate));
+                        ContentPlatformVideoDataStatAgg::getVideoId, ContentPlatformVideoDataStatAgg::getFissionRate));
         Map<Long, Double> recommendChannelVideoScoreMap = videoDataStatAggList.stream()
                 .filter(o -> userChannel.equals(o.getChannel()) && "recommend".equals(o.getStrategy())).collect(Collectors.toMap(
-                ContentPlatformVideoDataStatAgg::getVideoId, ContentPlatformVideoDataStatAgg::getFissionRate));
+                        ContentPlatformVideoDataStatAgg::getVideoId, ContentPlatformVideoDataStatAgg::getFissionRate));
         List<VideoContentItemVO> result = new ArrayList<>();
         for (ContentPlatformVideo video : videoList) {
             VideoContentItemVO item = new VideoContentItemVO();
@@ -591,9 +642,9 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
 
     @Override
     public List<ContentPlatformVideoDataStatAgg> getTypeChannelVideoDataStatAggList(String datastatDt,
-                                                                                     String type,
-                                                                                     List<String> channels,
-                                                                                     List<Long> videoIds) {
+                                                                                    String type,
+                                                                                    List<String> channels,
+                                                                                    List<Long> videoIds) {
         ContentPlatformVideoDataStatAggExample example = new ContentPlatformVideoDataStatAggExample();
         example.createCriteria().andVideoIdIn(videoIds).andDtEqualTo(datastatDt).andTypeEqualTo(type)
                 .andChannelIn(channels);

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

@@ -6,12 +6,15 @@
     <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="custom_title_id" jdbcType="BIGINT" property="customTitleId" />
     <result column="custom_title" jdbcType="VARCHAR" property="customTitle" />
     <result column="cover" jdbcType="VARCHAR" property="cover" />
+    <result column="custom_cover_id" jdbcType="BIGINT" property="customCoverId" />
     <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="page_url" jdbcType="VARCHAR" property="pageUrl" />
+    <result column="status" jdbcType="INTEGER" property="status" />
     <result column="create_account_id" jdbcType="BIGINT" property="createAccountId" />
     <result column="create_timestamp" jdbcType="BIGINT" property="createTimestamp" />
   </resultMap>
@@ -74,8 +77,8 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, plan_id, video_id, title, custom_title, cover, custom_cover, custom_cover_type, 
-    video, page_url, create_account_id, create_timestamp
+    id, plan_id, video_id, title, custom_title_id, custom_title, cover, custom_cover_id, 
+    custom_cover, custom_cover_type, video, page_url, `status`, create_account_id, create_timestamp
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlanVideoExample" resultMap="BaseResultMap">
     select
@@ -112,14 +115,16 @@
   </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, custom_title, cover, 
-      custom_cover, custom_cover_type, video, 
-      page_url, create_account_id, create_timestamp
+      title, custom_title_id, custom_title, 
+      cover, custom_cover_id, custom_cover, 
+      custom_cover_type, video, page_url, 
+      `status`, create_account_id, create_timestamp
       )
     values (#{id,jdbcType=BIGINT}, #{planId,jdbcType=BIGINT}, #{videoId,jdbcType=BIGINT}, 
-      #{title,jdbcType=VARCHAR}, #{customTitle,jdbcType=VARCHAR}, #{cover,jdbcType=VARCHAR}, 
-      #{customCover,jdbcType=VARCHAR}, #{customCoverType,jdbcType=INTEGER}, #{video,jdbcType=VARCHAR}, 
-      #{pageUrl,jdbcType=VARCHAR}, #{createAccountId,jdbcType=BIGINT}, #{createTimestamp,jdbcType=BIGINT}
+      #{title,jdbcType=VARCHAR}, #{customTitleId,jdbcType=BIGINT}, #{customTitle,jdbcType=VARCHAR}, 
+      #{cover,jdbcType=VARCHAR}, #{customCoverId,jdbcType=BIGINT}, #{customCover,jdbcType=VARCHAR}, 
+      #{customCoverType,jdbcType=INTEGER}, #{video,jdbcType=VARCHAR}, #{pageUrl,jdbcType=VARCHAR}, 
+      #{status,jdbcType=INTEGER}, #{createAccountId,jdbcType=BIGINT}, #{createTimestamp,jdbcType=BIGINT}
       )
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlanVideo">
@@ -137,12 +142,18 @@
       <if test="title != null">
         title,
       </if>
+      <if test="customTitleId != null">
+        custom_title_id,
+      </if>
       <if test="customTitle != null">
         custom_title,
       </if>
       <if test="cover != null">
         cover,
       </if>
+      <if test="customCoverId != null">
+        custom_cover_id,
+      </if>
       <if test="customCover != null">
         custom_cover,
       </if>
@@ -155,6 +166,9 @@
       <if test="pageUrl != null">
         page_url,
       </if>
+      <if test="status != null">
+        `status`,
+      </if>
       <if test="createAccountId != null">
         create_account_id,
       </if>
@@ -175,12 +189,18 @@
       <if test="title != null">
         #{title,jdbcType=VARCHAR},
       </if>
+      <if test="customTitleId != null">
+        #{customTitleId,jdbcType=BIGINT},
+      </if>
       <if test="customTitle != null">
         #{customTitle,jdbcType=VARCHAR},
       </if>
       <if test="cover != null">
         #{cover,jdbcType=VARCHAR},
       </if>
+      <if test="customCoverId != null">
+        #{customCoverId,jdbcType=BIGINT},
+      </if>
       <if test="customCover != null">
         #{customCover,jdbcType=VARCHAR},
       </if>
@@ -193,6 +213,9 @@
       <if test="pageUrl != null">
         #{pageUrl,jdbcType=VARCHAR},
       </if>
+      <if test="status != null">
+        #{status,jdbcType=INTEGER},
+      </if>
       <if test="createAccountId != null">
         #{createAccountId,jdbcType=BIGINT},
       </if>
@@ -222,12 +245,18 @@
       <if test="record.title != null">
         title = #{record.title,jdbcType=VARCHAR},
       </if>
+      <if test="record.customTitleId != null">
+        custom_title_id = #{record.customTitleId,jdbcType=BIGINT},
+      </if>
       <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.customCoverId != null">
+        custom_cover_id = #{record.customCoverId,jdbcType=BIGINT},
+      </if>
       <if test="record.customCover != null">
         custom_cover = #{record.customCover,jdbcType=VARCHAR},
       </if>
@@ -240,6 +269,9 @@
       <if test="record.pageUrl != null">
         page_url = #{record.pageUrl,jdbcType=VARCHAR},
       </if>
+      <if test="record.status != null">
+        `status` = #{record.status,jdbcType=INTEGER},
+      </if>
       <if test="record.createAccountId != null">
         create_account_id = #{record.createAccountId,jdbcType=BIGINT},
       </if>
@@ -257,12 +289,15 @@
       plan_id = #{record.planId,jdbcType=BIGINT},
       video_id = #{record.videoId,jdbcType=BIGINT},
       title = #{record.title,jdbcType=VARCHAR},
+      custom_title_id = #{record.customTitleId,jdbcType=BIGINT},
       custom_title = #{record.customTitle,jdbcType=VARCHAR},
       cover = #{record.cover,jdbcType=VARCHAR},
+      custom_cover_id = #{record.customCoverId,jdbcType=BIGINT},
       custom_cover = #{record.customCover,jdbcType=VARCHAR},
       custom_cover_type = #{record.customCoverType,jdbcType=INTEGER},
       video = #{record.video,jdbcType=VARCHAR},
       page_url = #{record.pageUrl,jdbcType=VARCHAR},
+      `status` = #{record.status,jdbcType=INTEGER},
       create_account_id = #{record.createAccountId,jdbcType=BIGINT},
       create_timestamp = #{record.createTimestamp,jdbcType=BIGINT}
     <if test="_parameter != null">
@@ -281,12 +316,18 @@
       <if test="title != null">
         title = #{title,jdbcType=VARCHAR},
       </if>
+      <if test="customTitleId != null">
+        custom_title_id = #{customTitleId,jdbcType=BIGINT},
+      </if>
       <if test="customTitle != null">
         custom_title = #{customTitle,jdbcType=VARCHAR},
       </if>
       <if test="cover != null">
         cover = #{cover,jdbcType=VARCHAR},
       </if>
+      <if test="customCoverId != null">
+        custom_cover_id = #{customCoverId,jdbcType=BIGINT},
+      </if>
       <if test="customCover != null">
         custom_cover = #{customCover,jdbcType=VARCHAR},
       </if>
@@ -299,6 +340,9 @@
       <if test="pageUrl != null">
         page_url = #{pageUrl,jdbcType=VARCHAR},
       </if>
+      <if test="status != null">
+        `status` = #{status,jdbcType=INTEGER},
+      </if>
       <if test="createAccountId != null">
         create_account_id = #{createAccountId,jdbcType=BIGINT},
       </if>
@@ -313,12 +357,15 @@
     set plan_id = #{planId,jdbcType=BIGINT},
       video_id = #{videoId,jdbcType=BIGINT},
       title = #{title,jdbcType=VARCHAR},
+      custom_title_id = #{customTitleId,jdbcType=BIGINT},
       custom_title = #{customTitle,jdbcType=VARCHAR},
       cover = #{cover,jdbcType=VARCHAR},
+      custom_cover_id = #{customCoverId,jdbcType=BIGINT},
       custom_cover = #{customCover,jdbcType=VARCHAR},
       custom_cover_type = #{customCoverType,jdbcType=INTEGER},
       video = #{video,jdbcType=VARCHAR},
       page_url = #{pageUrl,jdbcType=VARCHAR},
+      `status` = #{status,jdbcType=INTEGER},
       create_account_id = #{createAccountId,jdbcType=BIGINT},
       create_timestamp = #{createTimestamp,jdbcType=BIGINT}
     where id = #{id,jdbcType=BIGINT}

+ 1 - 0
api-module/src/main/resources/mapper/wecom/thirdpart/ext/ThirdPartWeComMapperExt.xml

@@ -232,6 +232,7 @@
                       on room.third_room_id = room_user.third_room_id
             where staff.third_staff_id = #{thirdStaffId}) room_user on staff_user.user_id = room_user.uin
         where staff.third_staff_id = #{thirdStaffId}
+          and staff_user.status not in (0, 8, 2049)
           and room_user.uin is null
     </select>