소스 검색

Merge branch '20250425-wyp-gzhPlan' of Server/growth-manager into master

wangyunpeng 2 달 전
부모
커밋
3b3f9a0e91
36개의 변경된 파일890개의 추가작업 그리고 76개의 파일을 삭제
  1. 31 0
      api-module/src/main/java/com/tzld/piaoquan/api/common/enums/contentplatform/ContentPlatformGzhPlanTypeEnum.java
  2. 1 1
      api-module/src/main/java/com/tzld/piaoquan/api/common/enums/contentplatform/PublishStageEnum.java
  3. 54 0
      api-module/src/main/java/com/tzld/piaoquan/api/component/AigcApiService.java
  4. 3 2
      api-module/src/main/java/com/tzld/piaoquan/api/controller/contentplatform/ContentPlatformCooperateAccountController.java
  5. 9 2
      api-module/src/main/java/com/tzld/piaoquan/api/controller/contentplatform/ContentPlatformPlanController.java
  6. 3 1
      api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ext/ContentPlatformGzhAccountMapperExt.java
  7. 1 0
      api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ext/ContentPlatformPlanMapperExt.java
  8. 9 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/CooperateAccountListParam.java
  9. 3 1
      api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/CooperateAccountSaveParam.java
  10. 6 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/GzhPlanListParam.java
  11. 7 2
      api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/GzhPlanSaveParam.java
  12. 14 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/GzhPlanStagePublishStatusUpdateParam.java
  13. 32 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/GzhPlanVideoContentItemParam.java
  14. 11 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformGzhAccount.java
  15. 60 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformGzhAccountExample.java
  16. 33 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformGzhPlan.java
  17. 180 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformGzhPlanExample.java
  18. 11 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformGzhPlanVideo.java
  19. 70 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/po/contentplatform/ContentPlatformGzhPlanVideoExample.java
  20. 3 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/CooperateAccountItemVO.java
  21. 9 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/GzhPlanItemVO.java
  22. 3 0
      api-module/src/main/java/com/tzld/piaoquan/api/model/vo/contentplatform/GzhPlanVideoContentItemVO.java
  23. 7 0
      api-module/src/main/java/com/tzld/piaoquan/api/service/CgiReplyService.java
  24. 2 0
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/ContentPlatformAccountService.java
  25. 5 1
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/ContentPlatformCooperateAccountService.java
  26. 4 0
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/ContentPlatformPlanService.java
  27. 5 0
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformAccountServiceImpl.java
  28. 22 2
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformCooperateAccountServiceImpl.java
  29. 127 38
      api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/impl/ContentPlatformPlanServiceImpl.java
  30. 20 0
      api-module/src/main/java/com/tzld/piaoquan/api/service/impl/CgiReplyServiceImpl.java
  31. 2 1
      api-module/src/main/java/com/tzld/piaoquan/api/service/strategy/impl/ThirdPartyPushMessageStrategyV1.java
  32. 23 8
      api-module/src/main/resources/mapper/contentplatform/ContentPlatformGzhAccountMapper.xml
  33. 54 7
      api-module/src/main/resources/mapper/contentplatform/ContentPlatformGzhPlanMapper.xml
  34. 20 3
      api-module/src/main/resources/mapper/contentplatform/ContentPlatformGzhPlanVideoMapper.xml
  35. 25 1
      api-module/src/main/resources/mapper/contentplatform/ext/ContentPlatformGzhAccountMapperExt.xml
  36. 21 6
      api-module/src/main/resources/mapper/contentplatform/ext/ContentPlatformPlanMapperExt.xml

+ 31 - 0
api-module/src/main/java/com/tzld/piaoquan/api/common/enums/contentplatform/ContentPlatformGzhPlanTypeEnum.java

@@ -0,0 +1,31 @@
+package com.tzld.piaoquan.api.common.enums.contentplatform;
+
+import lombok.Getter;
+
+@Getter
+public enum ContentPlatformGzhPlanTypeEnum {
+    AUTO_REPLY(0, "自动回复"),
+    FWH_PUSH(1, "服务号推送"),
+
+    other(999, "其他");
+
+    // 0-自动回复、1-服务号推送
+    private final int val;
+    private final String description;
+
+    ContentPlatformGzhPlanTypeEnum(int val, String description) {
+        this.val = val;
+        this.description = description;
+    }
+
+    public static ContentPlatformGzhPlanTypeEnum from(int val) {
+        for (ContentPlatformGzhPlanTypeEnum typeEnum : ContentPlatformGzhPlanTypeEnum.values()) {
+            if (typeEnum.getVal() == val) {
+                return typeEnum;
+            }
+        }
+        return other;
+    }
+
+
+}

+ 1 - 1
api-module/src/main/java/com/tzld/piaoquan/api/common/enums/contentplatform/PublishStageEnum.java

@@ -5,7 +5,7 @@ import lombok.Getter;
 @Getter
 public enum PublishStageEnum {
     PLATFORM(0, "平台发布"),
-    USER(1, "用户发布"),
+    USER(1, "用户获取路径"),
 
     other(999, "其他");
 

+ 54 - 0
api-module/src/main/java/com/tzld/piaoquan/api/component/AigcApiService.java

@@ -196,6 +196,20 @@ public class AigcApiService {
         }
     }
 
+    public void changePublishPlanAccountStatus(String planId, String accountId, Integer status) {
+        String url = aigcApiHost + "/publish/plan/updatePlanAccountStatus";
+        JSONObject params = new JSONObject();
+        params.put("planId", planId);
+        params.put("accountId", accountId);
+        params.put("status", status);
+        try {
+            String post = httpPoolClient.post(url, getAigcPostParam(params));
+            JSONObject res = JSONObject.parseObject(post);
+        } catch (Exception e) {
+            log.error("changePublishPlanAccountStatus error", e);
+        }
+    }
+
     public void refreshGzhAutoReplyMsgData(String ghId) {
         String url = aigcApiHost + "/publish/api/refreshGzhAutoReplyMsgData?ghId=" + ghId;
         try {
@@ -231,4 +245,44 @@ public class AigcApiService {
             log.error("closeAccountMessagePublishPlan error", e);
         }
     }
+
+    public boolean checkContainMessagePlan(String publishAccountId) {
+        String url = aigcApiHost + "/publish/plan/list";
+        JSONObject params = JSONObject.parseObject("{\n" +
+                "    \"filterItems\": [\n" +
+                "        {\n" +
+                "            \"itemName\": \"planType\",\n" +
+                "            \"selectValues\": [\n" +
+                "                1\n" +
+                "            ]\n" +
+                "        },\n" +
+                "        {\n" +
+                "            \"itemName\": \"publishAccounts\",\n" +
+                "            \"selectValues\": [\n" +
+                "                \"" + publishAccountId + "\"\n" +
+                "            ]\n" +
+                "        },\n" +
+                "        {\n" +
+                "            \"itemName\": \"planStatus\",\n" +
+                "            \"selectValues\": [\n" +
+                "                1\n" +
+                "            ]\n" +
+                "        }\n" +
+                "    ],\n" +
+                "    \"listFieldFormula\": [],\n" +
+                "    \"pageNum\": 1,\n" +
+                "    \"pageSize\": 50,\n" +
+                "    \"channel\": 5,\n" +
+                "    \"contentModal\": 7\n" +
+                "}");
+        try {
+            String post = httpPoolClient.post(url, getAigcPostParam(params));
+            JSONObject res = JSONObject.parseObject(post);
+            Integer totalCount = res.getJSONObject("data").getInteger("totalCount");
+            return totalCount > 0;
+        } catch (Exception e) {
+            log.error("closeAccountMessagePublishPlan error", e);
+        }
+        return false;
+    }
 }

+ 3 - 2
api-module/src/main/java/com/tzld/piaoquan/api/controller/contentplatform/ContentPlatformCooperateAccountController.java

@@ -58,8 +58,9 @@ public class ContentPlatformCooperateAccountController {
 
     @ApiOperation(value = "公众号下拉框")
     @GetMapping("/gzh/accountList")
-    public CommonResponse<List<GzhAccountItem>> getGzhAccountList() {
-        return CommonResponse.success(cooperateAccountService.getGzhAccountList());
+    public CommonResponse<List<GzhAccountItem>> getGzhAccountList(@RequestParam(required = false) Integer accountType,
+                                                                  @RequestParam(required = false) String name) {
+        return CommonResponse.success(cooperateAccountService.getGzhAccountList(accountType, name));
     }
 
     @ApiOperation(value = "公众号删除")

+ 9 - 2
api-module/src/main/java/com/tzld/piaoquan/api/controller/contentplatform/ContentPlatformPlanController.java

@@ -47,6 +47,13 @@ public class ContentPlatformPlanController {
         return CommonResponse.success();
     }
 
+    @ApiOperation(value = "公众号计划 平台发布开关修改")
+    @PostMapping("/gzh/updateStagePublishStatus")
+    public CommonResponse<Void> gzhUpdateStagePublishStatus(@RequestBody GzhPlanStagePublishStatusUpdateParam param) {
+        planService.gzhUpdateStagePublishStatus(param.getId(), param.getStagePublishStatus());
+        return CommonResponse.success();
+    }
+
     @ApiOperation(value = "发布内容视频列表")
     @PostMapping("/videoContentList")
     public CommonResponse<Page<VideoContentItemVO>> getVideoContentList(@RequestBody VideoContentListParam param) {
@@ -90,7 +97,7 @@ public class ContentPlatformPlanController {
         return CommonResponse.success(planService.getSharePic(pageUrl));
     }
 
-    @ApiOperation(value = "同步最近14日top1000视频")
+    @ApiOperation(value = "同步最近14日top1000视频", hidden = true)
     @JwtIgnore
     @PostMapping("/syncContentPlatformVideoJob")
     public CommonResponse<Void> syncContentPlatformVideoJob(@RequestBody QwPlanSaveParam param) {
@@ -98,7 +105,7 @@ public class ContentPlatformPlanController {
         return CommonResponse.success();
     }
 
-    @ApiOperation(value = "检查视频状态")
+    @ApiOperation(value = "检查视频状态", hidden = true)
     @JwtIgnore
     @PostMapping("/checkContentPlatformVideoStatusJob")
     public CommonResponse<Void> checkContentPlatformVideoStatusJob(@RequestBody QwPlanSaveParam param) {

+ 3 - 1
api-module/src/main/java/com/tzld/piaoquan/api/dao/mapper/contentplatform/ext/ContentPlatformGzhAccountMapperExt.java

@@ -20,5 +20,7 @@ public interface ContentPlatformGzhAccountMapperExt {
                                                             @Param("offset") int offset,
                                                             @Param("pageSize") Integer pageSize);
 
-    List<GzhAccountItem> getGzhAccountList(@Param("createAccountId") Long createAccountId);
+    List<GzhAccountItem> getGzhAccountList(@Param("createAccountId") Long createAccountId,
+                                           @Param("accountType") Integer accountType,
+                                           @Param("name") String name);
 }

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

@@ -20,6 +20,7 @@ public interface ContentPlatformPlanMapperExt {
                                                 @Param("pageSize") Integer pageSize);
 
     List<ContentPlatformGzhPlan> getGzhPlanExists(@Param("accountId") Long accountId,
+                                                  @Param("type") Integer type,
                                                   @Param("scene") Integer scene,
                                                   @Param("id") Long id);
 

+ 9 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/CooperateAccountListParam.java

@@ -9,4 +9,13 @@ import lombok.Data;
 public class CooperateAccountListParam extends PageParam {
 
 
+    @ApiModelProperty(value = "公众号名称")
+    private String name;
+
+    @ApiModelProperty(value = "ghId")
+    private String ghId;
+
+    @ApiModelProperty(value = "账号类型 0-公众号 1-服务号")
+    private Integer type;
+
 }

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

@@ -1,6 +1,5 @@
 package com.tzld.piaoquan.api.model.param.contentplatform;
 
-import com.tzld.piaoquan.api.model.param.PageParam;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
@@ -17,6 +16,9 @@ public class CooperateAccountSaveParam {
     @ApiModelProperty(value = "ghId")
     private String ghId;
 
+    @ApiModelProperty(value = "账号类型 0-公众号 1-服务号")
+    private Integer type;
+
     @ApiModelProperty(value = "内容类别")
     private String contentType;
 

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

@@ -13,9 +13,15 @@ public class GzhPlanListParam extends PageParam {
     @ApiModelProperty(value = "标题")
     private String title;
 
+    @ApiModelProperty(value = "发布计划类型 0-自动回复、1-服务号推送")
+    private Integer type;
+
     @ApiModelProperty(value = "发布方:0-平台发布 1-用户发布")
     private Integer publishStage;
 
+    @ApiModelProperty(value = "视频选取方式 0-手动选取 1-自动选取")
+    private Integer selectVideoType;
+
     @ApiModelProperty(value = "创建时间开始")
     private Long createTimestampStart;
 

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

@@ -1,6 +1,5 @@
 package com.tzld.piaoquan.api.model.param.contentplatform;
 
-import com.tzld.piaoquan.api.model.vo.contentplatform.GzhPlanVideoContentItemVO;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
@@ -15,12 +14,18 @@ public class GzhPlanSaveParam {
     @ApiModelProperty(value = "公众号id")
     private Long accountId;
 
+    @ApiModelProperty(value = "发布计划类型 0-自动回复、1-服务号推送")
+    private Integer type;
+
     @ApiModelProperty(value = "发布场景 0-关注回复")
     private Integer scene;
 
     @ApiModelProperty(value = "发布方:0-平台发布 1-用户发布")
     private Integer publishStage;
 
+    @ApiModelProperty(value = "视频选取方式 0-手动选取 1-自动选取")
+    private Integer selectVideoType;
+
     @ApiModelProperty(value = "视频列表")
-    private List<GzhPlanVideoContentItemVO> videoList;
+    private List<GzhPlanVideoContentItemParam> videoList;
 }

+ 14 - 0
api-module/src/main/java/com/tzld/piaoquan/api/model/param/contentplatform/GzhPlanStagePublishStatusUpdateParam.java

@@ -0,0 +1,14 @@
+package com.tzld.piaoquan.api.model.param.contentplatform;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+public class GzhPlanStagePublishStatusUpdateParam {
+
+    @ApiModelProperty(value = "id")
+    private Long id;
+
+    @ApiModelProperty(value = "平台发布开关 0-关闭 1-开启")
+    private Integer stagePublishStatus;
+}

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

@@ -0,0 +1,32 @@
+package com.tzld.piaoquan.api.model.param.contentplatform;
+
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+public class GzhPlanVideoContentItemParam {
+
+    @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;
+}

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

@@ -9,6 +9,8 @@ public class ContentPlatformGzhAccount {
 
     private String externalId;
 
+    private Integer type;
+
     private String contentType;
 
     private Integer status;
@@ -51,6 +53,14 @@ public class ContentPlatformGzhAccount {
         this.externalId = externalId;
     }
 
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
     public String getContentType() {
         return contentType;
     }
@@ -101,6 +111,7 @@ public class ContentPlatformGzhAccount {
         sb.append(", name=").append(name);
         sb.append(", ghId=").append(ghId);
         sb.append(", externalId=").append(externalId);
+        sb.append(", type=").append(type);
         sb.append(", contentType=").append(contentType);
         sb.append(", status=").append(status);
         sb.append(", createAccountId=").append(createAccountId);

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

@@ -385,6 +385,66 @@ public class ContentPlatformGzhAccountExample {
             return (Criteria) this;
         }
 
+        public Criteria andTypeIsNull() {
+            addCriterion("`type` is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeIsNotNull() {
+            addCriterion("`type` is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeEqualTo(Integer value) {
+            addCriterion("`type` =", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeNotEqualTo(Integer value) {
+            addCriterion("`type` <>", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeGreaterThan(Integer value) {
+            addCriterion("`type` >", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeGreaterThanOrEqualTo(Integer value) {
+            addCriterion("`type` >=", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeLessThan(Integer value) {
+            addCriterion("`type` <", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeLessThanOrEqualTo(Integer value) {
+            addCriterion("`type` <=", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeIn(List<Integer> values) {
+            addCriterion("`type` in", values, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeNotIn(List<Integer> values) {
+            addCriterion("`type` not in", values, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeBetween(Integer value1, Integer value2) {
+            addCriterion("`type` between", value1, value2, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeNotBetween(Integer value1, Integer value2) {
+            addCriterion("`type` not between", value1, value2, "type");
+            return (Criteria) this;
+        }
+
         public Criteria andContentTypeIsNull() {
             addCriterion("content_type is null");
             return (Criteria) this;

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

@@ -3,6 +3,8 @@ package com.tzld.piaoquan.api.model.po.contentplatform;
 public class ContentPlatformGzhPlan {
     private Long id;
 
+    private Integer type;
+
     private Integer publishStage;
 
     private Long accountId;
@@ -11,8 +13,12 @@ public class ContentPlatformGzhPlan {
 
     private String externalId;
 
+    private Integer selectVideoType;
+
     private Integer status;
 
+    private Integer stagePublishStatus;
+
     private Long createAccountId;
 
     private Long createTimestamp;
@@ -27,6 +33,14 @@ public class ContentPlatformGzhPlan {
         this.id = id;
     }
 
+    public Integer getType() {
+        return type;
+    }
+
+    public void setType(Integer type) {
+        this.type = type;
+    }
+
     public Integer getPublishStage() {
         return publishStage;
     }
@@ -59,6 +73,14 @@ public class ContentPlatformGzhPlan {
         this.externalId = externalId;
     }
 
+    public Integer getSelectVideoType() {
+        return selectVideoType;
+    }
+
+    public void setSelectVideoType(Integer selectVideoType) {
+        this.selectVideoType = selectVideoType;
+    }
+
     public Integer getStatus() {
         return status;
     }
@@ -67,6 +89,14 @@ public class ContentPlatformGzhPlan {
         this.status = status;
     }
 
+    public Integer getStagePublishStatus() {
+        return stagePublishStatus;
+    }
+
+    public void setStagePublishStatus(Integer stagePublishStatus) {
+        this.stagePublishStatus = stagePublishStatus;
+    }
+
     public Long getCreateAccountId() {
         return createAccountId;
     }
@@ -98,11 +128,14 @@ public class ContentPlatformGzhPlan {
         sb.append(" [");
         sb.append("Hash = ").append(hashCode());
         sb.append(", id=").append(id);
+        sb.append(", type=").append(type);
         sb.append(", publishStage=").append(publishStage);
         sb.append(", accountId=").append(accountId);
         sb.append(", scene=").append(scene);
         sb.append(", externalId=").append(externalId);
+        sb.append(", selectVideoType=").append(selectVideoType);
         sb.append(", status=").append(status);
+        sb.append(", stagePublishStatus=").append(stagePublishStatus);
         sb.append(", createAccountId=").append(createAccountId);
         sb.append(", createTimestamp=").append(createTimestamp);
         sb.append(", updateTimestamp=").append(updateTimestamp);

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

@@ -175,6 +175,66 @@ public class ContentPlatformGzhPlanExample {
             return (Criteria) this;
         }
 
+        public Criteria andTypeIsNull() {
+            addCriterion("`type` is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeIsNotNull() {
+            addCriterion("`type` is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeEqualTo(Integer value) {
+            addCriterion("`type` =", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeNotEqualTo(Integer value) {
+            addCriterion("`type` <>", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeGreaterThan(Integer value) {
+            addCriterion("`type` >", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeGreaterThanOrEqualTo(Integer value) {
+            addCriterion("`type` >=", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeLessThan(Integer value) {
+            addCriterion("`type` <", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeLessThanOrEqualTo(Integer value) {
+            addCriterion("`type` <=", value, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeIn(List<Integer> values) {
+            addCriterion("`type` in", values, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeNotIn(List<Integer> values) {
+            addCriterion("`type` not in", values, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeBetween(Integer value1, Integer value2) {
+            addCriterion("`type` between", value1, value2, "type");
+            return (Criteria) this;
+        }
+
+        public Criteria andTypeNotBetween(Integer value1, Integer value2) {
+            addCriterion("`type` not between", value1, value2, "type");
+            return (Criteria) this;
+        }
+
         public Criteria andPublishStageIsNull() {
             addCriterion("publish_stage is null");
             return (Criteria) this;
@@ -425,6 +485,66 @@ public class ContentPlatformGzhPlanExample {
             return (Criteria) this;
         }
 
+        public Criteria andSelectVideoTypeIsNull() {
+            addCriterion("select_video_type is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andSelectVideoTypeIsNotNull() {
+            addCriterion("select_video_type is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andSelectVideoTypeEqualTo(Integer value) {
+            addCriterion("select_video_type =", value, "selectVideoType");
+            return (Criteria) this;
+        }
+
+        public Criteria andSelectVideoTypeNotEqualTo(Integer value) {
+            addCriterion("select_video_type <>", value, "selectVideoType");
+            return (Criteria) this;
+        }
+
+        public Criteria andSelectVideoTypeGreaterThan(Integer value) {
+            addCriterion("select_video_type >", value, "selectVideoType");
+            return (Criteria) this;
+        }
+
+        public Criteria andSelectVideoTypeGreaterThanOrEqualTo(Integer value) {
+            addCriterion("select_video_type >=", value, "selectVideoType");
+            return (Criteria) this;
+        }
+
+        public Criteria andSelectVideoTypeLessThan(Integer value) {
+            addCriterion("select_video_type <", value, "selectVideoType");
+            return (Criteria) this;
+        }
+
+        public Criteria andSelectVideoTypeLessThanOrEqualTo(Integer value) {
+            addCriterion("select_video_type <=", value, "selectVideoType");
+            return (Criteria) this;
+        }
+
+        public Criteria andSelectVideoTypeIn(List<Integer> values) {
+            addCriterion("select_video_type in", values, "selectVideoType");
+            return (Criteria) this;
+        }
+
+        public Criteria andSelectVideoTypeNotIn(List<Integer> values) {
+            addCriterion("select_video_type not in", values, "selectVideoType");
+            return (Criteria) this;
+        }
+
+        public Criteria andSelectVideoTypeBetween(Integer value1, Integer value2) {
+            addCriterion("select_video_type between", value1, value2, "selectVideoType");
+            return (Criteria) this;
+        }
+
+        public Criteria andSelectVideoTypeNotBetween(Integer value1, Integer value2) {
+            addCriterion("select_video_type not between", value1, value2, "selectVideoType");
+            return (Criteria) this;
+        }
+
         public Criteria andStatusIsNull() {
             addCriterion("`status` is null");
             return (Criteria) this;
@@ -485,6 +605,66 @@ public class ContentPlatformGzhPlanExample {
             return (Criteria) this;
         }
 
+        public Criteria andStagePublishStatusIsNull() {
+            addCriterion("stage_publish_status is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStagePublishStatusIsNotNull() {
+            addCriterion("stage_publish_status is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andStagePublishStatusEqualTo(Integer value) {
+            addCriterion("stage_publish_status =", value, "stagePublishStatus");
+            return (Criteria) this;
+        }
+
+        public Criteria andStagePublishStatusNotEqualTo(Integer value) {
+            addCriterion("stage_publish_status <>", value, "stagePublishStatus");
+            return (Criteria) this;
+        }
+
+        public Criteria andStagePublishStatusGreaterThan(Integer value) {
+            addCriterion("stage_publish_status >", value, "stagePublishStatus");
+            return (Criteria) this;
+        }
+
+        public Criteria andStagePublishStatusGreaterThanOrEqualTo(Integer value) {
+            addCriterion("stage_publish_status >=", value, "stagePublishStatus");
+            return (Criteria) this;
+        }
+
+        public Criteria andStagePublishStatusLessThan(Integer value) {
+            addCriterion("stage_publish_status <", value, "stagePublishStatus");
+            return (Criteria) this;
+        }
+
+        public Criteria andStagePublishStatusLessThanOrEqualTo(Integer value) {
+            addCriterion("stage_publish_status <=", value, "stagePublishStatus");
+            return (Criteria) this;
+        }
+
+        public Criteria andStagePublishStatusIn(List<Integer> values) {
+            addCriterion("stage_publish_status in", values, "stagePublishStatus");
+            return (Criteria) this;
+        }
+
+        public Criteria andStagePublishStatusNotIn(List<Integer> values) {
+            addCriterion("stage_publish_status not in", values, "stagePublishStatus");
+            return (Criteria) this;
+        }
+
+        public Criteria andStagePublishStatusBetween(Integer value1, Integer value2) {
+            addCriterion("stage_publish_status between", value1, value2, "stagePublishStatus");
+            return (Criteria) this;
+        }
+
+        public Criteria andStagePublishStatusNotBetween(Integer value1, Integer value2) {
+            addCriterion("stage_publish_status not between", value1, value2, "stagePublishStatus");
+            return (Criteria) this;
+        }
+
         public Criteria andCreateAccountIdIsNull() {
             addCriterion("create_account_id is null");
             return (Criteria) this;

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

@@ -19,6 +19,8 @@ public class ContentPlatformGzhPlanVideo {
 
     private String video;
 
+    private String pageUrl;
+
     private Long createAccountId;
 
     private Long createTimestamp;
@@ -95,6 +97,14 @@ public class ContentPlatformGzhPlanVideo {
         this.video = video;
     }
 
+    public String getPageUrl() {
+        return pageUrl;
+    }
+
+    public void setPageUrl(String pageUrl) {
+        this.pageUrl = pageUrl;
+    }
+
     public Long getCreateAccountId() {
         return createAccountId;
     }
@@ -126,6 +136,7 @@ public class ContentPlatformGzhPlanVideo {
         sb.append(", customCover=").append(customCover);
         sb.append(", customCoverType=").append(customCoverType);
         sb.append(", video=").append(video);
+        sb.append(", pageUrl=").append(pageUrl);
         sb.append(", createAccountId=").append(createAccountId);
         sb.append(", createTimestamp=").append(createTimestamp);
         sb.append("]");

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

@@ -705,6 +705,76 @@ public class ContentPlatformGzhPlanVideoExample {
             return (Criteria) this;
         }
 
+        public Criteria andPageUrlIsNull() {
+            addCriterion("page_url is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPageUrlIsNotNull() {
+            addCriterion("page_url is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPageUrlEqualTo(String value) {
+            addCriterion("page_url =", value, "pageUrl");
+            return (Criteria) this;
+        }
+
+        public Criteria andPageUrlNotEqualTo(String value) {
+            addCriterion("page_url <>", value, "pageUrl");
+            return (Criteria) this;
+        }
+
+        public Criteria andPageUrlGreaterThan(String value) {
+            addCriterion("page_url >", value, "pageUrl");
+            return (Criteria) this;
+        }
+
+        public Criteria andPageUrlGreaterThanOrEqualTo(String value) {
+            addCriterion("page_url >=", value, "pageUrl");
+            return (Criteria) this;
+        }
+
+        public Criteria andPageUrlLessThan(String value) {
+            addCriterion("page_url <", value, "pageUrl");
+            return (Criteria) this;
+        }
+
+        public Criteria andPageUrlLessThanOrEqualTo(String value) {
+            addCriterion("page_url <=", value, "pageUrl");
+            return (Criteria) this;
+        }
+
+        public Criteria andPageUrlLike(String value) {
+            addCriterion("page_url like", value, "pageUrl");
+            return (Criteria) this;
+        }
+
+        public Criteria andPageUrlNotLike(String value) {
+            addCriterion("page_url not like", value, "pageUrl");
+            return (Criteria) this;
+        }
+
+        public Criteria andPageUrlIn(List<String> values) {
+            addCriterion("page_url in", values, "pageUrl");
+            return (Criteria) this;
+        }
+
+        public Criteria andPageUrlNotIn(List<String> values) {
+            addCriterion("page_url not in", values, "pageUrl");
+            return (Criteria) this;
+        }
+
+        public Criteria andPageUrlBetween(String value1, String value2) {
+            addCriterion("page_url between", value1, value2, "pageUrl");
+            return (Criteria) this;
+        }
+
+        public Criteria andPageUrlNotBetween(String value1, String value2) {
+            addCriterion("page_url not between", value1, value2, "pageUrl");
+            return (Criteria) this;
+        }
+
         public Criteria andCreateAccountIdIsNull() {
             addCriterion("create_account_id is null");
             return (Criteria) this;

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

@@ -15,6 +15,9 @@ public class CooperateAccountItemVO {
     @ApiModelProperty(value = "ghId")
     private String ghId;
 
+    @ApiModelProperty(value = "账号类型 0-公众号 1-服务号")
+    private Integer type;
+
     @ApiModelProperty(value = "内容类别")
     private String contentType;
 

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

@@ -17,6 +17,9 @@ public class GzhPlanItemVO {
     @ApiModelProperty(value = "公众号名称")
     private String accountName;
 
+    @ApiModelProperty(value = "发布计划类型 0-自动回复、1-服务号推送")
+    private Integer type;
+
     @ApiModelProperty(value = "发布场景 0-关注回复")
     private Integer scene;
 
@@ -34,4 +37,10 @@ public class GzhPlanItemVO {
 
     @ApiModelProperty(value = "发布方:0-平台发布 1-用户发布")
     private Integer publishStage;
+
+    @ApiModelProperty(value = "视频选取方式 0-手动选取 1-自动选取")
+    private Integer selectVideoType;
+
+    @ApiModelProperty(value = "平台发布开关 0-关闭 1-开启")
+    private Integer stagePublishStatus;
 }

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

@@ -29,4 +29,7 @@ public class GzhPlanVideoContentItemVO {
 
     @ApiModelProperty(value = "传播效率")
     private Double score;
+
+    @ApiModelProperty(value = "推送链接")
+    private String pageUrl;
 }

+ 7 - 0
api-module/src/main/java/com/tzld/piaoquan/api/service/CgiReplyService.java

@@ -2,8 +2,15 @@ package com.tzld.piaoquan.api.service;
 
 import com.tzld.piaoquan.api.model.bo.BucketDataParam;
 import com.tzld.piaoquan.api.model.bo.ReplyBucketData;
+import com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketData;
+
+import java.util.List;
 
 public interface CgiReplyService {
     ReplyBucketData getRgiReplyData(BucketDataParam bucketDataParam);
 
+    List<CgiReplyBucketData> getCgiReplyBucketDataListByGhIds(List<String> ghIds, String strategy);
+
+    List<CgiReplyBucketData> getCgiReplyBucketDataListByVideoId(Long videoId);
+
 }

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

@@ -22,4 +22,6 @@ public interface ContentPlatformAccountService {
     List<ContentPlatformAccount> getAccountListByChannels(List<String> channels);
 
     ContentPlatformAccount getAccountByChannel(String channel);
+
+    ContentPlatformAccount getAccountById(Long id);
 }

+ 5 - 1
api-module/src/main/java/com/tzld/piaoquan/api/service/contentplatform/ContentPlatformCooperateAccountService.java

@@ -25,7 +25,7 @@ public interface ContentPlatformCooperateAccountService {
 
     void gzhDelete(Long id);
 
-    List<GzhAccountItem> getGzhAccountList();
+    List<GzhAccountItem> getGzhAccountList(Integer accountType, String name);
 
     List<ContentPlatformGzhAccount> getAccountListByIds(List<Long> ids);
 
@@ -34,4 +34,8 @@ public interface ContentPlatformCooperateAccountService {
     List<ContentPlatformGzhAccount> getCooperateAccountListByGhIds(Long loginAccountId, List<String> ghIds);
 
     void gzhImport(List<String> channels);
+
+    ContentPlatformGzhAccount getGzhAccount(String ghId);
+
+    List<ContentPlatformGzhAccount> getAccountListByCreatorId(Long creatorId);
 }

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

@@ -67,4 +67,8 @@ public interface ContentPlatformPlanService {
     void gzhPlanImport(List<String> channels);
 
     void qwPlanImport(List<String> channels);
+
+    void gzhUpdateStagePublishStatus(Long id, Integer stagePublishStatus);
+
+    String getGzhChannel(String ghId);
 }

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

@@ -245,4 +245,9 @@ public class ContentPlatformAccountServiceImpl implements ContentPlatformAccount
         }
         return null;
     }
+
+    @Override
+    public ContentPlatformAccount getAccountById(Long id) {
+        return accountMapper.selectByPrimaryKey(id);
+    }
 }

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

@@ -78,6 +78,7 @@ public class ContentPlatformCooperateAccountServiceImpl implements ContentPlatfo
             accountVO.setId(account.getId());
             accountVO.setName(account.getName());
             accountVO.setGhId(account.getGhId());
+            accountVO.setType(account.getType());
             accountVO.setContentType(account.getContentType());
             accountVO.setCreateTimestamp(account.getCreateTimestamp());
             result.add(accountVO);
@@ -108,6 +109,7 @@ public class ContentPlatformCooperateAccountServiceImpl implements ContentPlatfo
             if (StringUtils.hasText(externalId)) {
                 account.setExternalId(externalId);
             }
+            account.setType(param.getType());
             account.setCreateAccountId(loginAccount.getId());
             account.setCreateTimestamp(now);
             gzhAccountMapper.insertSelective(account);
@@ -153,9 +155,9 @@ public class ContentPlatformCooperateAccountServiceImpl implements ContentPlatfo
     }
 
     @Override
-    public List<GzhAccountItem> getGzhAccountList() {
+    public List<GzhAccountItem> getGzhAccountList(Integer accountType, String name) {
         ContentPlatformAccount loginAccount = LoginUserContext.getUser();
-        return gzhAccountMapperExt.getGzhAccountList(loginAccount.getId());
+        return gzhAccountMapperExt.getGzhAccountList(loginAccount.getId(), accountType, name);
     }
 
     @Override
@@ -235,4 +237,22 @@ public class ContentPlatformCooperateAccountServiceImpl implements ContentPlatfo
             }
         }
     }
+
+    @Override
+    public ContentPlatformGzhAccount getGzhAccount(String ghId) {
+        ContentPlatformGzhAccountExample example = new ContentPlatformGzhAccountExample();
+        example.createCriteria().andGhIdEqualTo(ghId).andStatusEqualTo(1);
+        List<ContentPlatformGzhAccount> accountList = gzhAccountMapper.selectByExample(example);
+        if (CollectionUtils.isNotEmpty(accountList)) {
+            return accountList.get(0);
+        }
+        return null;
+    }
+
+    @Override
+    public List<ContentPlatformGzhAccount> getAccountListByCreatorId(Long creatorId) {
+        ContentPlatformGzhAccountExample example = new ContentPlatformGzhAccountExample();
+        example.createCriteria().andCreateAccountIdEqualTo(creatorId).andStatusEqualTo(1);
+        return gzhAccountMapper.selectByExample(example);
+    }
 }

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

@@ -3,16 +3,16 @@ package com.tzld.piaoquan.api.service.contentplatform.impl;
 import com.alibaba.fastjson.JSONObject;
 import com.google.common.collect.Lists;
 import com.tzld.piaoquan.api.common.enums.ExceptionEnum;
+import com.tzld.piaoquan.api.common.enums.contentplatform.ContentPlatformGzhPlanTypeEnum;
 import com.tzld.piaoquan.api.common.enums.contentplatform.PublishStageEnum;
 import com.tzld.piaoquan.api.common.enums.contentplatform.QwPlanTypeEnum;
 import com.tzld.piaoquan.api.common.exception.CommonException;
-import com.tzld.piaoquan.api.component.AdApiService;
-import com.tzld.piaoquan.api.component.AigcApiService;
-import com.tzld.piaoquan.api.component.ManagerApiService;
-import com.tzld.piaoquan.api.component.VlogApiService;
+import com.tzld.piaoquan.api.component.*;
 import com.tzld.piaoquan.api.dao.mapper.contentplatform.*;
 import com.tzld.piaoquan.api.dao.mapper.contentplatform.ext.ContentPlatformPlanMapperExt;
 import com.tzld.piaoquan.api.model.bo.AdPutFlowRecordTencent;
+import com.tzld.piaoquan.api.model.bo.BucketDataParam;
+import com.tzld.piaoquan.api.model.bo.SmallPageUrlDetail;
 import com.tzld.piaoquan.api.model.config.LoginUserContext;
 import com.tzld.piaoquan.api.model.param.contentplatform.*;
 import com.tzld.piaoquan.api.model.po.contentplatform.*;
@@ -21,17 +21,16 @@ 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.service.CgiReplyService;
 import com.tzld.piaoquan.api.service.GhDetailService;
 import com.tzld.piaoquan.api.service.contentplatform.ContentPlatformAccountService;
 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.dao.mapper.CgiReplyBucketDataMapper;
 import com.tzld.piaoquan.growth.common.dao.mapper.ext.CgiReplyBucketDataMapperExt;
 import com.tzld.piaoquan.growth.common.model.bo.VideoDetail;
 import com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketData;
-import com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketDataExample;
 import com.tzld.piaoquan.growth.common.model.po.GhDetail;
 import com.tzld.piaoquan.growth.common.service.MessageAttachmentService;
 import com.tzld.piaoquan.growth.common.utils.MessageUtil;
@@ -63,8 +62,6 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
     @Autowired
     private ContentPlatformQwPlanVideoMapper qwPlanVideoMapper;
     @Autowired
-    private CgiReplyBucketDataMapper cgiReplyBucketDataMapper;
-    @Autowired
     private CgiReplyBucketDataMapperExt cgiReplyBucketDataMapperExt;
     @Autowired
     private ContentPlatformVideoMapper contentPlatformVideoMapper;
@@ -84,6 +81,11 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
     private ContentPlatformAccountService accountService;
     @Autowired
     private AdApiService adApiService;
+    @Autowired
+    private CgiReplyService cgiReplyService;
+    @Autowired
+    private TouLiuHttpClient touLiuHttpClient;
+
 
     @Value("${vlog.share.appType:11}")
     private String shareAppType;
@@ -91,6 +93,9 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
     @Value("${video.min.score:0.6}")
     private Double videoMinScore;
 
+    @Value("${small_page_url}")
+    private String GET_SMALL_PAGE_URL;
+
     @Override
     public Page<GzhPlanItemVO> gzhPlanList(GzhPlanListParam param) {
         ContentPlatformAccount loginAccount = LoginUserContext.getUser();
@@ -114,20 +119,30 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         }
         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));
+        Map<Long, ContentPlatformGzhAccount> accountMap = accountList.stream().collect(Collectors.toMap(ContentPlatformGzhAccount::getId,
+                Function.identity()));
         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<String> ghIds = accountList.stream().map(ContentPlatformGzhAccount::getGhId).collect(Collectors.toList());
+        List<CgiReplyBucketData> bucketDataList = cgiReplyService.getCgiReplyBucketDataListByGhIds(ghIds, "manual");
+        Map<String, Map<Long, CgiReplyBucketData>> bucketDataMap = bucketDataList.stream()
+                .collect(Collectors.groupingBy(CgiReplyBucketData::getGhId,
+                        Collectors.toMap(CgiReplyBucketData::getMiniVideoId, Function.identity())));
         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()));
+            ContentPlatformGzhAccount gzhAccount = accountMap.get(gzhPlan.getAccountId());
+            if (Objects.nonNull(gzhAccount)) {
+                planItemVO.setAccountName(gzhAccount.getName());
+            }
+            planItemVO.setType(gzhPlan.getType());
             planItemVO.setScene(gzhPlan.getScene());
             planItemVO.setPublishStage(gzhPlan.getPublishStage());
+            planItemVO.setSelectVideoType(gzhPlan.getSelectVideoType());
             List<ContentPlatformGzhPlanVideo> videoListByPlanId = videoMap.get(gzhPlan.getId());
             if (CollectionUtils.isNotEmpty(videoListByPlanId)) {
                 planItemVO.setVideoCount(videoListByPlanId.size());
@@ -135,6 +150,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
                         .collect(Collectors.toList());
                 planItemVO.setTitle(titleList);
                 List<GzhPlanVideoContentItemVO> videoVOList = new ArrayList<>();
+                Map<Long, CgiReplyBucketData> bucketDataMapByGhId = bucketDataMap.get(gzhAccount.getGhId());
                 for (ContentPlatformGzhPlanVideo video : videoListByPlanId) {
                     GzhPlanVideoContentItemVO videoItemVO = new GzhPlanVideoContentItemVO();
                     videoItemVO.setVideoId(video.getVideoId());
@@ -144,6 +160,13 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
                     videoItemVO.setCustomCover(video.getCustomCover());
                     videoItemVO.setCustomCoverType(video.getCustomCoverType());
                     videoItemVO.setVideo(video.getVideo());
+                    videoItemVO.setPageUrl(video.getPageUrl());
+                    if (Objects.nonNull(bucketDataMapByGhId)) {
+                        CgiReplyBucketData bucketData = bucketDataMapByGhId.get(video.getVideoId());
+                        if (Objects.nonNull(bucketData)) {
+                            videoItemVO.setPageUrl(bucketData.getMiniPagePath());
+                        }
+                    }
                     videoVOList.add(videoItemVO);
                 }
                 planItemVO.setVideoList(videoVOList);
@@ -176,6 +199,25 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         }
     }
 
+
+    @Override
+    public void gzhUpdateStagePublishStatus(Long id, Integer stagePublishStatus) {
+        ContentPlatformGzhPlan plan = gzhPlanMapper.selectByPrimaryKey(id);
+        if (Objects.isNull(plan)) {
+            throw new CommonException(ExceptionEnum.GZH_PLAN_NOT_EXISTS);
+        }
+        if (!Objects.equals(LoginUserContext.getUser().getId(), plan.getCreateAccountId())) {
+            throw new CommonException(ExceptionEnum.PARAM_ERROR);
+        }
+        plan.setStagePublishStatus(stagePublishStatus);
+        plan.setUpdateTimestamp(System.currentTimeMillis());
+        gzhPlanMapper.updateByPrimaryKeySelective(plan);
+        ContentPlatformGzhAccount gzhAccount = cooperateAccountService.getById(plan.getAccountId());
+        if (StringUtils.hasText(plan.getExternalId()) && StringUtils.hasText(gzhAccount.getExternalId())) {
+            aigcApiService.changePublishPlanAccountStatus(plan.getExternalId(), gzhAccount.getExternalId(), stagePublishStatus);
+        }
+    }
+
     @Override
     public void qwPlanDelete(Long id) {
         ContentPlatformQwPlan plan = qwPlanMapper.selectByPrimaryKey(id);
@@ -190,8 +232,9 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
     @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)) {
+        List<ContentPlatformGzhPlan> planExistList = planMapperExt.getGzhPlanExists(param.getAccountId(),
+                param.getType(), param.getScene(), param.getId());
+        if (CollectionUtils.isNotEmpty(planExistList) && param.getType() != ContentPlatformGzhPlanTypeEnum.FWH_PUSH.getVal()) {
             throw new CommonException(ExceptionEnum.GZH_SCENE_PLAN_EXISTS);
         }
         if (param.getVideoList().size() > 3) {
@@ -207,18 +250,23 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         Long now = System.currentTimeMillis();
         ContentPlatformGzhPlan gzhPlan = new ContentPlatformGzhPlan();
         gzhPlan.setAccountId(param.getAccountId());
+        gzhPlan.setType(param.getType());
         gzhPlan.setScene(param.getScene());
         gzhPlan.setPublishStage(param.getPublishStage());
+        gzhPlan.setSelectVideoType(param.getSelectVideoType());
         gzhPlan.setUpdateTimestamp(now);
-        // 更新gh_detail
-        List<Long> videoIds = param.getVideoList().stream().map(GzhPlanVideoContentItemVO::getVideoId).collect(Collectors.toList());
-        updateGhDetail(account, videoIds);
-        // 更新cgi_reply_bucket_data
-        updateCgiReplyBucketData(account.getGhId(), param.getVideoList());
+        List<Long> videoIds = param.getVideoList().stream().map(GzhPlanVideoContentItemParam::getVideoId).collect(Collectors.toList());
+        if (param.getType() == ContentPlatformGzhPlanTypeEnum.AUTO_REPLY.getVal()) {
+            // 更新gh_detail
+            updateGhDetail(account, param.getSelectVideoType(), videoIds);
+            // 更新cgi_reply_bucket_data
+            updateCgiReplyBucketData(account.getGhId(), param.getVideoList());
+        }
         if (Objects.isNull(param.getId())) {
             // 调用aigc创建发布计划
             if (PublishStageEnum.PLATFORM.getVal() == param.getPublishStage()) {
                 String externalId = aigcApiService.createPublishPlan(account.getExternalId(), account.getName(), loginAccount.getChannel());
+                gzhPlan.setStagePublishStatus(1);
                 gzhPlan.setExternalId(externalId);
             }
             gzhPlan.setCreateAccountId(loginAccount.getId());
@@ -228,13 +276,16 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
             ContentPlatformGzhPlan oldPlan = gzhPlanMapper.selectByPrimaryKey(param.getId());
             if (PublishStageEnum.USER.getVal() == param.getPublishStage()) {
                 if (StringUtils.hasText(oldPlan.getExternalId())) {
+                    gzhPlan.setStagePublishStatus(0);
                     aigcApiService.changePublishPlanStatus(oldPlan.getExternalId(), 0);
                 }
             } else {
                 if (StringUtils.hasText(oldPlan.getExternalId())) {
+                    gzhPlan.setStagePublishStatus(1);
                     aigcApiService.changePublishPlanStatus(oldPlan.getExternalId(), 1);
                 } else {
                     String externalId = aigcApiService.createPublishPlan(account.getExternalId(), account.getName(), loginAccount.getChannel());
+                    gzhPlan.setStagePublishStatus(1);
                     gzhPlan.setExternalId(externalId);
                 }
             }
@@ -242,20 +293,25 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
             gzhPlanMapper.updateByPrimaryKeySelective(gzhPlan);
         }
         // 保存视频内容
-        saveGzhPlanVideo(param, videoIds, gzhPlan.getId(), loginAccount.getId());
+        saveGzhPlanVideo(param, videoIds, gzhPlan.getId(), account, loginAccount);
         // 调用aigc重新拉取视频
-        aigcApiService.refreshGzhAutoReplyMsgData(account.getGhId());
+        if (param.getType() == ContentPlatformGzhPlanTypeEnum.AUTO_REPLY.getVal()) {
+            if (PublishStageEnum.PLATFORM.getVal() == param.getPublishStage()) {
+                aigcApiService.refreshGzhAutoReplyMsgData(account.getGhId());
+            } else {
+                BucketDataParam bucketDataParam = new BucketDataParam();
+                bucketDataParam.setGhId(account.getGhId());
+                cgiReplyService.getRgiReplyData(bucketDataParam);
+            }
+        }
     }
 
-    private void updateCgiReplyBucketData(String ghId, List<GzhPlanVideoContentItemVO> videoList) {
-        for (GzhPlanVideoContentItemVO video : videoList) {
+    private void updateCgiReplyBucketData(String ghId, List<GzhPlanVideoContentItemParam> videoList) {
+        for (GzhPlanVideoContentItemParam video : videoList) {
             if (!StringUtils.hasText(video.getCustomCover()) && !StringUtils.hasText(video.getCustomTitle())) {
                 continue;
             }
-            CgiReplyBucketDataExample example = new CgiReplyBucketDataExample();
-            example.createCriteria().andGhIdEqualTo(ghId).andMiniVideoIdEqualTo(video.getVideoId())
-                    .andIsDeleteEqualTo(0);
-            List<CgiReplyBucketData> dataList = cgiReplyBucketDataMapper.selectByExample(example);
+            List<CgiReplyBucketData> dataList = cgiReplyService.getCgiReplyBucketDataListByVideoId(video.getVideoId());
             if (CollectionUtils.isEmpty(dataList)) {
                 continue;
             }
@@ -266,7 +322,8 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         }
     }
 
-    private void saveGzhPlanVideo(GzhPlanSaveParam param, List<Long> videoIds, Long id, Long loginAccountId) {
+    private void saveGzhPlanVideo(GzhPlanSaveParam param, List<Long> videoIds, Long id,
+                                  ContentPlatformGzhAccount account, ContentPlatformAccount loginAccount) {
         List<ContentPlatformGzhPlanVideo> existsVideo = getGzhVideoByPlanId(id);
         List<Long> existsVideoIds = existsVideo.stream().map(ContentPlatformGzhPlanVideo::getVideoId).collect(Collectors.toList());
         Map<Long, ContentPlatformGzhPlanVideo> existsVideoMap = existsVideo.stream()
@@ -276,7 +333,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
                 gzhPlanVideoMapper.deleteByPrimaryKey(item.getId());
             }
         }
-        for (GzhPlanVideoContentItemVO vo : param.getVideoList()) {
+        for (GzhPlanVideoContentItemParam vo : param.getVideoList()) {
             if (existsVideoIds.contains(vo.getVideoId())) {
                 ContentPlatformGzhPlanVideo item = existsVideoMap.get(vo.getVideoId());
                 item.setTitle(vo.getTitle());
@@ -295,7 +352,14 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
                 item.setCustomCover(vo.getCustomCover());
                 item.setCustomCoverType(vo.getCustomCoverType());
                 item.setVideo(vo.getVideo());
-                item.setCreateAccountId(loginAccountId);
+                if (param.getType() == ContentPlatformGzhPlanTypeEnum.FWH_PUSH.getVal()) {
+                    String response = touLiuHttpClient.sendAdFlowAddRequest(GET_SMALL_PAGE_URL, String.valueOf(vo.getVideoId()), "fwhdyy",
+                            loginAccount.getChannel(), "自动", "公众号", "文章插小程序", "文字和小程序", account.getGhId());
+                    JSONObject json = JSONObject.parseObject(response);
+                    SmallPageUrlDetail smallPageUrlDetail = json.getJSONObject("data").toJavaObject(SmallPageUrlDetail.class);
+                    item.setPageUrl(smallPageUrlDetail.getUrl());
+                }
+                item.setCreateAccountId(loginAccount.getId());
                 item.setCreateTimestamp(System.currentTimeMillis());
                 gzhPlanVideoMapper.insertSelective(item);
             }
@@ -308,13 +372,14 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         return gzhPlanVideoMapper.selectByExample(example);
     }
 
-    private void updateGhDetail(ContentPlatformGzhAccount account, List<Long> videoIds) {
+    private void updateGhDetail(ContentPlatformGzhAccount account, Integer selectVideoType, List<Long> videoIds) {
         GhDetail ghDetail = ghDetailService.getGhDetailByGhIdType(account.getGhId(), GhTypeEnum.THIRD_PARTY_GH.type);
         GhDetailVo detailVo = new GhDetailVo();
+        Integer strategyStatus = selectVideoType == 0 ? StrategyStatusEnum.DEFAULT.status : StrategyStatusEnum.STRATEGY.status;
         if (Objects.nonNull(ghDetail)) {
             BeanUtils.copyProperties(ghDetail, detailVo);
             detailVo.setVideoIds(videoIds);
-            detailVo.setStrategyStatus(StrategyStatusEnum.DEFAULT.status);
+            detailVo.setStrategyStatus(strategyStatus);
             detailVo.setAutoreplySendMinigramNum(videoIds.size());
             detailVo.setCategory1(account.getContentType());
             ghDetailService.updateDetail(detailVo);
@@ -325,7 +390,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
             detailVo.setType(GhTypeEnum.THIRD_PARTY_GH.type);
             detailVo.setChannel(loginUser.getChannel());
             detailVo.setCategory1(account.getContentType());
-            detailVo.setStrategyStatus(StrategyStatusEnum.DEFAULT.status);
+            detailVo.setStrategyStatus(strategyStatus);
             detailVo.setVideoIds(videoIds);
             detailVo.setAutoreplySendMinigramNum(videoIds.size());
             ghDetailService.addGhDetail(detailVo);
@@ -529,6 +594,22 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         return qwPlanVideoMapper.selectByExample(example);
     }
 
+    @Override
+    public String getGzhChannel(String ghId) {
+        ContentPlatformGzhAccount gzhAccount = cooperateAccountService.getGzhAccount(ghId);
+        if (Objects.nonNull(gzhAccount)) {
+            ContentPlatformAccount account = accountService.getAccountById(gzhAccount.getCreateAccountId());
+            ContentPlatformGzhPlanExample example = new ContentPlatformGzhPlanExample();
+            example.createCriteria().andCreateAccountIdEqualTo(account.getId()).andAccountIdEqualTo(gzhAccount.getId())
+                    .andStatusEqualTo(1).andTypeEqualTo(ContentPlatformGzhPlanTypeEnum.FWH_PUSH.getVal());
+            List<ContentPlatformGzhPlan> list = gzhPlanMapper.selectByExample(example);
+            if (CollectionUtils.isNotEmpty(list)) {
+                return account.getChannel();
+            }
+        }
+        return null;
+    }
+
     @Override
     public void gzhPlanImport(List<String> channels) {
         List<ContentPlatformAccount> accountList = accountService.getAccountListByChannels(channels);
@@ -536,7 +617,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
             Long now = System.currentTimeMillis();
             List<GhDetail> ghDetailList = ghDetailService.getByChannel(account.getChannel());
             ghDetailList = ghDetailList.stream()
-                    .filter(o -> Objects.equals(o.getStrategyStatus(), StrategyStatusEnum.DEFAULT.status))
+                    .filter(o -> Objects.equals(o.getStrategyStatus(), StrategyStatusEnum.STRATEGY.status))
                     .collect(Collectors.toList());
             if (CollectionUtils.isEmpty(ghDetailList)) {
                 continue;
@@ -544,7 +625,7 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
             List<String> ghIds = ghDetailList.stream().map(GhDetail::getGhId).collect(Collectors.toList());
             List<ContentPlatformGzhAccount> gzhAccountList = cooperateAccountService.getCooperateAccountListByGhIds(account.getId(), ghIds);
             List<ContentPlatformGzhPlan> existsPlanList = getGzhPlanListByCreateAccountId(account.getId());
-            List<Long> existsAccountIds = existsPlanList.stream().map(ContentPlatformGzhPlan::getAccountId).collect(Collectors.toList());
+            List<Long> existsAccountIds = existsPlanList.stream().map(ContentPlatformGzhPlan::getAccountId).distinct().collect(Collectors.toList());
             Map<String, ContentPlatformGzhAccount> gzhAccountMap = gzhAccountList.stream()
                     .collect(Collectors.toMap(ContentPlatformGzhAccount::getGhId, Function.identity()));
             for (GhDetail ghDetail : ghDetailList) {
@@ -554,18 +635,26 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
                     continue;
                 }
                 gzhPlan.setAccountId(gzhAccount.getId());
+                gzhPlan.setType(ContentPlatformGzhPlanTypeEnum.AUTO_REPLY.getVal());
                 gzhPlan.setScene(0);
+                gzhPlan.setSelectVideoType(ghDetail.getStrategyStatus());
                 gzhPlan.setPublishStage(PublishStageEnum.USER.getVal());
                 if (StringUtils.hasText(gzhAccount.getExternalId())) {
-                    aigcApiService.closeAccountMessagePublishPlan(gzhAccount.getExternalId());
-                    gzhPlan.setPublishStage(PublishStageEnum.PLATFORM.getVal());
-                    String externalId = aigcApiService.createPublishPlan(gzhAccount.getExternalId(), gzhAccount.getName(), account.getChannel());
-                    gzhPlan.setExternalId(externalId);
+                    if (aigcApiService.checkContainMessagePlan(gzhAccount.getExternalId())) {
+                        aigcApiService.closeAccountMessagePublishPlan(gzhAccount.getExternalId());
+                        gzhPlan.setPublishStage(PublishStageEnum.PLATFORM.getVal());
+                        String externalId = aigcApiService.createPublishPlan(gzhAccount.getExternalId(), gzhAccount.getName(), account.getChannel());
+                        gzhPlan.setExternalId(externalId);
+                        gzhPlan.setStagePublishStatus(1);
+                    }
                 }
                 gzhPlan.setCreateAccountId(account.getId());
                 gzhPlan.setCreateTimestamp(now);
                 gzhPlan.setUpdateTimestamp(now);
                 planMapperExt.insertGzhPlanReturnId(gzhPlan);
+                if (!StringUtils.hasText(ghDetail.getVideoIds())) {
+                    continue;
+                }
                 List<Long> videoIds = JSONObject.parseArray(ghDetail.getVideoIds(), Long.class);
                 Map<Long, VideoDetail> videoMap = messageAttachmentService.getVideoDetail(new HashSet<>(videoIds));
                 for (Map.Entry<Long, VideoDetail> entry : videoMap.entrySet()) {

+ 20 - 0
api-module/src/main/java/com/tzld/piaoquan/api/service/impl/CgiReplyServiceImpl.java

@@ -3,9 +3,12 @@ package com.tzld.piaoquan.api.service.impl;
 import com.alibaba.fastjson.JSONArray;
 import com.tzld.piaoquan.growth.common.common.enums.GhTypeEnum;
 import com.tzld.piaoquan.api.common.enums.ReplyStrategyServiceEnum;
+import com.tzld.piaoquan.growth.common.dao.mapper.CgiReplyBucketDataMapper;
 import com.tzld.piaoquan.growth.common.dao.mapper.GhDetailMapper;
 import com.tzld.piaoquan.api.model.bo.BucketDataParam;
 import com.tzld.piaoquan.api.model.bo.ReplyBucketData;
+import com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketData;
+import com.tzld.piaoquan.growth.common.model.po.CgiReplyBucketDataExample;
 import com.tzld.piaoquan.growth.common.model.po.GhDetail;
 import com.tzld.piaoquan.growth.common.model.po.GhDetailExample;
 import com.tzld.piaoquan.api.service.CgiReplyService;
@@ -33,6 +36,9 @@ public class CgiReplyServiceImpl implements CgiReplyService {
     @Autowired
     private GhDetailMapper ghDetailMapper;
 
+    @Autowired
+    private CgiReplyBucketDataMapper cgiReplyBucketDataMapper;
+
     @PostConstruct
     public void init() {
         strategyServiceMap = applicationContext.getBeansOfType(ReplyStrategyService.class);
@@ -86,4 +92,18 @@ public class CgiReplyServiceImpl implements CgiReplyService {
         // 无执行策略 不会走到这里
         return null;
     }
+
+    @Override
+    public List<CgiReplyBucketData> getCgiReplyBucketDataListByGhIds(List<String> ghIds, String strategy) {
+        CgiReplyBucketDataExample example = new CgiReplyBucketDataExample();
+        example.createCriteria().andGhIdIn(ghIds).andStrategyEqualTo(strategy).andIsDeleteEqualTo(0);
+        return cgiReplyBucketDataMapper.selectByExample(example);
+    }
+
+    @Override
+    public List<CgiReplyBucketData> getCgiReplyBucketDataListByVideoId(Long videoId) {
+        CgiReplyBucketDataExample example = new CgiReplyBucketDataExample();
+        example.createCriteria().andMiniVideoIdEqualTo(videoId).andIsDeleteEqualTo(0);
+        return cgiReplyBucketDataMapper.selectByExample(example);
+    }
 }

+ 2 - 1
api-module/src/main/java/com/tzld/piaoquan/api/service/strategy/impl/ThirdPartyPushMessageStrategyV1.java

@@ -248,7 +248,8 @@ public class ThirdPartyPushMessageStrategyV1 implements ReplyStrategyService {
                 }
                 Map<Long, VideoDetail> videoDetailMap = touLiuHttpClient.getVideoDetailRequest(bucketDataParam.getVideos());
                 List<ContentPlatformGzhPlanVideo> gzhPlanVideoList = contentPlatformPlanService.getGzhPlanVideoListByCooperateAccountId(bucketDataParam.getGhId());
-                Map<Long, ContentPlatformGzhPlanVideo> gzhPlanVideoMap = gzhPlanVideoList.stream().collect(Collectors.toMap(ContentPlatformGzhPlanVideo::getVideoId, x -> x));
+                Map<Long, ContentPlatformGzhPlanVideo> gzhPlanVideoMap = gzhPlanVideoList.stream()
+                        .collect(Collectors.toMap(ContentPlatformGzhPlanVideo::getVideoId, x -> x, (a, b) -> b));
                 for (int i = 0; i < bucketDataParam.getVideos().size(); i++) {
                     int sort = i + 1;
                     Long videoId = bucketDataParam.getVideos().get(i);

+ 23 - 8
api-module/src/main/resources/mapper/contentplatform/ContentPlatformGzhAccountMapper.xml

@@ -6,6 +6,7 @@
     <result column="name" jdbcType="VARCHAR" property="name" />
     <result column="gh_id" jdbcType="VARCHAR" property="ghId" />
     <result column="external_id" jdbcType="VARCHAR" property="externalId" />
+    <result column="type" jdbcType="INTEGER" property="type" />
     <result column="content_type" jdbcType="VARCHAR" property="contentType" />
     <result column="status" jdbcType="INTEGER" property="status" />
     <result column="create_account_id" jdbcType="BIGINT" property="createAccountId" />
@@ -71,8 +72,8 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, `name`, gh_id, external_id, content_type, `status`, create_account_id, create_timestamp, 
-    update_timestamp
+    id, `name`, gh_id, external_id, `type`, content_type, `status`, create_account_id, 
+    create_timestamp, update_timestamp
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhAccountExample" resultMap="BaseResultMap">
     select
@@ -109,13 +110,13 @@
   </delete>
   <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhAccount">
     insert into content_platform_gzh_account (id, `name`, gh_id, 
-      external_id, content_type, `status`, 
-      create_account_id, create_timestamp, update_timestamp
-      )
+      external_id, `type`, content_type, 
+      `status`, create_account_id, create_timestamp, 
+      update_timestamp)
     values (#{id,jdbcType=BIGINT}, #{name,jdbcType=VARCHAR}, #{ghId,jdbcType=VARCHAR}, 
-      #{externalId,jdbcType=VARCHAR}, #{contentType,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, 
-      #{createAccountId,jdbcType=BIGINT}, #{createTimestamp,jdbcType=BIGINT}, #{updateTimestamp,jdbcType=BIGINT}
-      )
+      #{externalId,jdbcType=VARCHAR}, #{type,jdbcType=INTEGER}, #{contentType,jdbcType=VARCHAR}, 
+      #{status,jdbcType=INTEGER}, #{createAccountId,jdbcType=BIGINT}, #{createTimestamp,jdbcType=BIGINT}, 
+      #{updateTimestamp,jdbcType=BIGINT})
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhAccount">
     insert into content_platform_gzh_account
@@ -132,6 +133,9 @@
       <if test="externalId != null">
         external_id,
       </if>
+      <if test="type != null">
+        `type`,
+      </if>
       <if test="contentType != null">
         content_type,
       </if>
@@ -161,6 +165,9 @@
       <if test="externalId != null">
         #{externalId,jdbcType=VARCHAR},
       </if>
+      <if test="type != null">
+        #{type,jdbcType=INTEGER},
+      </if>
       <if test="contentType != null">
         #{contentType,jdbcType=VARCHAR},
       </if>
@@ -199,6 +206,9 @@
       <if test="record.externalId != null">
         external_id = #{record.externalId,jdbcType=VARCHAR},
       </if>
+      <if test="record.type != null">
+        `type` = #{record.type,jdbcType=INTEGER},
+      </if>
       <if test="record.contentType != null">
         content_type = #{record.contentType,jdbcType=VARCHAR},
       </if>
@@ -225,6 +235,7 @@
       `name` = #{record.name,jdbcType=VARCHAR},
       gh_id = #{record.ghId,jdbcType=VARCHAR},
       external_id = #{record.externalId,jdbcType=VARCHAR},
+      `type` = #{record.type,jdbcType=INTEGER},
       content_type = #{record.contentType,jdbcType=VARCHAR},
       `status` = #{record.status,jdbcType=INTEGER},
       create_account_id = #{record.createAccountId,jdbcType=BIGINT},
@@ -246,6 +257,9 @@
       <if test="externalId != null">
         external_id = #{externalId,jdbcType=VARCHAR},
       </if>
+      <if test="type != null">
+        `type` = #{type,jdbcType=INTEGER},
+      </if>
       <if test="contentType != null">
         content_type = #{contentType,jdbcType=VARCHAR},
       </if>
@@ -269,6 +283,7 @@
     set `name` = #{name,jdbcType=VARCHAR},
       gh_id = #{ghId,jdbcType=VARCHAR},
       external_id = #{externalId,jdbcType=VARCHAR},
+      `type` = #{type,jdbcType=INTEGER},
       content_type = #{contentType,jdbcType=VARCHAR},
       `status` = #{status,jdbcType=INTEGER},
       create_account_id = #{createAccountId,jdbcType=BIGINT},

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

@@ -3,11 +3,14 @@
 <mapper namespace="com.tzld.piaoquan.api.dao.mapper.contentplatform.ContentPlatformGzhPlanMapper">
   <resultMap id="BaseResultMap" type="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlan">
     <id column="id" jdbcType="BIGINT" property="id" />
+    <result column="type" jdbcType="INTEGER" property="type" />
     <result column="publish_stage" jdbcType="INTEGER" property="publishStage" />
     <result column="account_id" jdbcType="BIGINT" property="accountId" />
     <result column="scene" jdbcType="INTEGER" property="scene" />
     <result column="external_id" jdbcType="VARCHAR" property="externalId" />
+    <result column="select_video_type" jdbcType="INTEGER" property="selectVideoType" />
     <result column="status" jdbcType="INTEGER" property="status" />
+    <result column="stage_publish_status" jdbcType="INTEGER" property="stagePublishStatus" />
     <result column="create_account_id" jdbcType="BIGINT" property="createAccountId" />
     <result column="create_timestamp" jdbcType="BIGINT" property="createTimestamp" />
     <result column="update_timestamp" jdbcType="BIGINT" property="updateTimestamp" />
@@ -71,8 +74,8 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, publish_stage, account_id, scene, external_id, `status`, create_account_id, create_timestamp, 
-    update_timestamp
+    id, `type`, publish_stage, account_id, scene, external_id, select_video_type, `status`, 
+    stage_publish_status, create_account_id, create_timestamp, update_timestamp
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlanExample" resultMap="BaseResultMap">
     select
@@ -108,12 +111,14 @@
     </if>
   </delete>
   <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlan">
-    insert into content_platform_gzh_plan (id, publish_stage, account_id, 
-      scene, external_id, `status`, 
+    insert into content_platform_gzh_plan (id, `type`, publish_stage, 
+      account_id, scene, external_id, 
+      select_video_type, `status`, stage_publish_status, 
       create_account_id, create_timestamp, update_timestamp
       )
-    values (#{id,jdbcType=BIGINT}, #{publishStage,jdbcType=INTEGER}, #{accountId,jdbcType=BIGINT}, 
-      #{scene,jdbcType=INTEGER}, #{externalId,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, 
+    values (#{id,jdbcType=BIGINT}, #{type,jdbcType=INTEGER}, #{publishStage,jdbcType=INTEGER}, 
+      #{accountId,jdbcType=BIGINT}, #{scene,jdbcType=INTEGER}, #{externalId,jdbcType=VARCHAR}, 
+      #{selectVideoType,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{stagePublishStatus,jdbcType=INTEGER}, 
       #{createAccountId,jdbcType=BIGINT}, #{createTimestamp,jdbcType=BIGINT}, #{updateTimestamp,jdbcType=BIGINT}
       )
   </insert>
@@ -123,6 +128,9 @@
       <if test="id != null">
         id,
       </if>
+      <if test="type != null">
+        `type`,
+      </if>
       <if test="publishStage != null">
         publish_stage,
       </if>
@@ -135,9 +143,15 @@
       <if test="externalId != null">
         external_id,
       </if>
+      <if test="selectVideoType != null">
+        select_video_type,
+      </if>
       <if test="status != null">
         `status`,
       </if>
+      <if test="stagePublishStatus != null">
+        stage_publish_status,
+      </if>
       <if test="createAccountId != null">
         create_account_id,
       </if>
@@ -152,6 +166,9 @@
       <if test="id != null">
         #{id,jdbcType=BIGINT},
       </if>
+      <if test="type != null">
+        #{type,jdbcType=INTEGER},
+      </if>
       <if test="publishStage != null">
         #{publishStage,jdbcType=INTEGER},
       </if>
@@ -164,9 +181,15 @@
       <if test="externalId != null">
         #{externalId,jdbcType=VARCHAR},
       </if>
+      <if test="selectVideoType != null">
+        #{selectVideoType,jdbcType=INTEGER},
+      </if>
       <if test="status != null">
         #{status,jdbcType=INTEGER},
       </if>
+      <if test="stagePublishStatus != null">
+        #{stagePublishStatus,jdbcType=INTEGER},
+      </if>
       <if test="createAccountId != null">
         #{createAccountId,jdbcType=BIGINT},
       </if>
@@ -190,6 +213,9 @@
       <if test="record.id != null">
         id = #{record.id,jdbcType=BIGINT},
       </if>
+      <if test="record.type != null">
+        `type` = #{record.type,jdbcType=INTEGER},
+      </if>
       <if test="record.publishStage != null">
         publish_stage = #{record.publishStage,jdbcType=INTEGER},
       </if>
@@ -202,9 +228,15 @@
       <if test="record.externalId != null">
         external_id = #{record.externalId,jdbcType=VARCHAR},
       </if>
+      <if test="record.selectVideoType != null">
+        select_video_type = #{record.selectVideoType,jdbcType=INTEGER},
+      </if>
       <if test="record.status != null">
         `status` = #{record.status,jdbcType=INTEGER},
       </if>
+      <if test="record.stagePublishStatus != null">
+        stage_publish_status = #{record.stagePublishStatus,jdbcType=INTEGER},
+      </if>
       <if test="record.createAccountId != null">
         create_account_id = #{record.createAccountId,jdbcType=BIGINT},
       </if>
@@ -222,11 +254,14 @@
   <update id="updateByExample" parameterType="map">
     update content_platform_gzh_plan
     set id = #{record.id,jdbcType=BIGINT},
+      `type` = #{record.type,jdbcType=INTEGER},
       publish_stage = #{record.publishStage,jdbcType=INTEGER},
       account_id = #{record.accountId,jdbcType=BIGINT},
       scene = #{record.scene,jdbcType=INTEGER},
       external_id = #{record.externalId,jdbcType=VARCHAR},
+      select_video_type = #{record.selectVideoType,jdbcType=INTEGER},
       `status` = #{record.status,jdbcType=INTEGER},
+      stage_publish_status = #{record.stagePublishStatus,jdbcType=INTEGER},
       create_account_id = #{record.createAccountId,jdbcType=BIGINT},
       create_timestamp = #{record.createTimestamp,jdbcType=BIGINT},
       update_timestamp = #{record.updateTimestamp,jdbcType=BIGINT}
@@ -237,6 +272,9 @@
   <update id="updateByPrimaryKeySelective" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlan">
     update content_platform_gzh_plan
     <set>
+      <if test="type != null">
+        `type` = #{type,jdbcType=INTEGER},
+      </if>
       <if test="publishStage != null">
         publish_stage = #{publishStage,jdbcType=INTEGER},
       </if>
@@ -249,9 +287,15 @@
       <if test="externalId != null">
         external_id = #{externalId,jdbcType=VARCHAR},
       </if>
+      <if test="selectVideoType != null">
+        select_video_type = #{selectVideoType,jdbcType=INTEGER},
+      </if>
       <if test="status != null">
         `status` = #{status,jdbcType=INTEGER},
       </if>
+      <if test="stagePublishStatus != null">
+        stage_publish_status = #{stagePublishStatus,jdbcType=INTEGER},
+      </if>
       <if test="createAccountId != null">
         create_account_id = #{createAccountId,jdbcType=BIGINT},
       </if>
@@ -266,11 +310,14 @@
   </update>
   <update id="updateByPrimaryKey" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlan">
     update content_platform_gzh_plan
-    set publish_stage = #{publishStage,jdbcType=INTEGER},
+    set `type` = #{type,jdbcType=INTEGER},
+      publish_stage = #{publishStage,jdbcType=INTEGER},
       account_id = #{accountId,jdbcType=BIGINT},
       scene = #{scene,jdbcType=INTEGER},
       external_id = #{externalId,jdbcType=VARCHAR},
+      select_video_type = #{selectVideoType,jdbcType=INTEGER},
       `status` = #{status,jdbcType=INTEGER},
+      stage_publish_status = #{stagePublishStatus,jdbcType=INTEGER},
       create_account_id = #{createAccountId,jdbcType=BIGINT},
       create_timestamp = #{createTimestamp,jdbcType=BIGINT},
       update_timestamp = #{updateTimestamp,jdbcType=BIGINT}

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

@@ -11,6 +11,7 @@
     <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="create_account_id" jdbcType="BIGINT" property="createAccountId" />
     <result column="create_timestamp" jdbcType="BIGINT" property="createTimestamp" />
   </resultMap>
@@ -74,7 +75,7 @@
   </sql>
   <sql id="Base_Column_List">
     id, plan_id, video_id, title, custom_title, cover, custom_cover, custom_cover_type, 
-    video, create_account_id, create_timestamp
+    video, page_url, create_account_id, create_timestamp
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformGzhPlanVideoExample" resultMap="BaseResultMap">
     select
@@ -113,11 +114,13 @@
     insert into content_platform_gzh_plan_video (id, plan_id, video_id, 
       title, custom_title, cover, 
       custom_cover, custom_cover_type, video, 
-      create_account_id, create_timestamp)
+      page_url, 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}, 
-      #{createAccountId,jdbcType=BIGINT}, #{createTimestamp,jdbcType=BIGINT})
+      #{pageUrl,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
@@ -149,6 +152,9 @@
       <if test="video != null">
         video,
       </if>
+      <if test="pageUrl != null">
+        page_url,
+      </if>
       <if test="createAccountId != null">
         create_account_id,
       </if>
@@ -184,6 +190,9 @@
       <if test="video != null">
         #{video,jdbcType=VARCHAR},
       </if>
+      <if test="pageUrl != null">
+        #{pageUrl,jdbcType=VARCHAR},
+      </if>
       <if test="createAccountId != null">
         #{createAccountId,jdbcType=BIGINT},
       </if>
@@ -228,6 +237,9 @@
       <if test="record.video != null">
         video = #{record.video,jdbcType=VARCHAR},
       </if>
+      <if test="record.pageUrl != null">
+        page_url = #{record.pageUrl,jdbcType=VARCHAR},
+      </if>
       <if test="record.createAccountId != null">
         create_account_id = #{record.createAccountId,jdbcType=BIGINT},
       </if>
@@ -250,6 +262,7 @@
       custom_cover = #{record.customCover,jdbcType=VARCHAR},
       custom_cover_type = #{record.customCoverType,jdbcType=INTEGER},
       video = #{record.video,jdbcType=VARCHAR},
+      page_url = #{record.pageUrl,jdbcType=VARCHAR},
       create_account_id = #{record.createAccountId,jdbcType=BIGINT},
       create_timestamp = #{record.createTimestamp,jdbcType=BIGINT}
     <if test="_parameter != null">
@@ -283,6 +296,9 @@
       <if test="video != null">
         video = #{video,jdbcType=VARCHAR},
       </if>
+      <if test="pageUrl != null">
+        page_url = #{pageUrl,jdbcType=VARCHAR},
+      </if>
       <if test="createAccountId != null">
         create_account_id = #{createAccountId,jdbcType=BIGINT},
       </if>
@@ -302,6 +318,7 @@
       custom_cover = #{customCover,jdbcType=VARCHAR},
       custom_cover_type = #{customCoverType,jdbcType=INTEGER},
       video = #{video,jdbcType=VARCHAR},
+      page_url = #{pageUrl,jdbcType=VARCHAR},
       create_account_id = #{createAccountId,jdbcType=BIGINT},
       create_timestamp = #{createTimestamp,jdbcType=BIGINT}
     where id = #{id,jdbcType=BIGINT}

+ 25 - 1
api-module/src/main/resources/mapper/contentplatform/ext/ContentPlatformGzhAccountMapperExt.xml

@@ -17,6 +17,15 @@
     from content_platform_gzh_account
     where create_account_id = #{createAccountId}
     and status = 1
+    <if test="param.name!= null and param.name!= ''">
+      and name like concat('%', #{param.name}, '%')
+    </if>
+    <if test="param.ghId!= null and param.ghId!= ''">
+      and gh_id = #{param.ghId}
+    </if>
+    <if test="param.type!= null">
+      and type = #{param.type}
+    </if>
   </select>
 
   <select id="getCooperateAccountList"
@@ -25,6 +34,15 @@
     from content_platform_gzh_account
     where create_account_id = #{createAccountId}
       and status = 1
+    <if test="param.name!= null and param.name!= ''">
+      and name like concat('%', #{param.name}, '%')
+    </if>
+    <if test="param.ghId!= null and param.ghId!= ''">
+      and gh_id = #{param.ghId}
+    </if>
+    <if test="param.type!= null">
+      and type = #{param.type}
+    </if>
     order by create_timestamp desc
     limit #{offset}, #{pageSize}
   </select>
@@ -33,7 +51,13 @@
     select id, name
     from content_platform_gzh_account
     where create_account_id = #{createAccountId}
-      and status = 1
+    and status = 1
+    <if test="name != null and name != ''">
+      and name like concat('%', #{name}, '%')
+    </if>
+    <if test="accountType!= null">
+      and type = #{accountType}
+    </if>
     order by create_timestamp desc
   </select>
 

+ 21 - 6
api-module/src/main/resources/mapper/contentplatform/ext/ContentPlatformPlanMapperExt.xml

@@ -3,23 +3,30 @@
 <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 into content_platform_gzh_plan (`type`, publish_stage, account_id, scene, external_id,
+                                               select_video_type, stage_publish_status,
+                                               create_account_id, create_timestamp, update_timestamp)
+        values (#{record.type}, #{record.publishStage}, #{record.accountId}, #{record.scene}, #{record.externalId},
+                #{record.selectVideoType}, #{record.stagePublishStatus}, #{record.createAccountId},
+                #{record.createTimestamp}, #{record.updateTimestamp})
     </insert>
 
     <select id="getGzhPlanCount" resultType="java.lang.Integer">
         select count(*)
         from content_platform_gzh_plan
         where create_account_id = #{createAccountId} and status = 1
+        <if test="param.type != null">
+            and type = #{param.type}
+        </if>
         <if test="param.accountId != null">
             and account_id = #{param.accountId}
         </if>
         <if test="param.publishStage != null">
             and publish_stage = #{param.publishStage}
         </if>
+        <if test="param.selectVideoType != null">
+            and select_video_type = #{param.selectVideoType}
+        </if>
         <if test="param.createTimestampStart != null">
             and create_timestamp > #{param.createTimestampStart}
         </if>
@@ -39,12 +46,18 @@
         select *
         from content_platform_gzh_plan
         where create_account_id = #{createAccountId} and status = 1
+        <if test="param.type != null">
+            and type = #{param.type}
+        </if>
         <if test="param.accountId != null">
             and account_id = #{param.accountId}
         </if>
         <if test="param.publishStage != null">
             and publish_stage = #{param.publishStage}
         </if>
+        <if test="param.selectVideoType != null">
+            and select_video_type = #{param.selectVideoType}
+        </if>
         <if test="param.createTimestampStart != null">
             and create_timestamp > #{param.createTimestampStart}
         </if>
@@ -66,7 +79,9 @@
         select *
         from content_platform_gzh_plan
         where account_id = #{accountId}
-        and scene = #{scene} and status = 1
+          and scene = #{scene}
+          and type = #{type}
+          and status = 1
         <if test="id != null">
             and id != #{id}
         </if>