瀏覽代碼

企微计划删除

wangyunpeng 2 月之前
父節點
當前提交
d04b39f5ef

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

@@ -34,6 +34,7 @@ public enum ExceptionEnum {
     GZH_SCENE_PLAN_EXISTS(3000, "公众号该类型计划已存在"),
     GZH_PLAN_NOT_EXISTS(3001, "公众号计划不存在"),
     GZH_PLAN_VIDEO_SIZE_EXCEED(3002, "计划视频数量超过限制"),
+    QW_PLAN_NOT_EXISTS(3003, "企微计划不存在"),
     ;
     private int code;
     private String msg;

+ 7 - 0
api-module/src/main/java/com/tzld/piaoquan/api/controller/contentplatform/ContentPlatformPlanController.java

@@ -76,6 +76,13 @@ public class ContentPlatformPlanController {
         return CommonResponse.success(planService.qwPlanSave(param));
     }
 
+    @ApiOperation(value = "企微计划 删除")
+    @PostMapping("/qw/delete")
+    public CommonResponse<Void> qwPlanDelete(@RequestBody IdParam<Long> param) {
+        planService.qwPlanDelete(param.getId());
+        return CommonResponse.success();
+    }
+
     @ApiOperation(value = "获取分享二维码")
     @GetMapping("/qw/getSharePic")
     public CommonResponse<String> getSharePic(@RequestParam String pageUrl) {

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

@@ -11,6 +11,8 @@ public class ContentPlatformQwPlan {
 
     private String rootSourceId;
 
+    private Integer status;
+
     private Long createAccountId;
 
     private Long createTimestamp;
@@ -57,6 +59,14 @@ public class ContentPlatformQwPlan {
         this.rootSourceId = rootSourceId;
     }
 
+    public Integer getStatus() {
+        return status;
+    }
+
+    public void setStatus(Integer status) {
+        this.status = status;
+    }
+
     public Long getCreateAccountId() {
         return createAccountId;
     }
@@ -92,6 +102,7 @@ public class ContentPlatformQwPlan {
         sb.append(", scene=").append(scene);
         sb.append(", pageUrl=").append(pageUrl);
         sb.append(", rootSourceId=").append(rootSourceId);
+        sb.append(", status=").append(status);
         sb.append(", createAccountId=").append(createAccountId);
         sb.append(", createTimestamp=").append(createTimestamp);
         sb.append(", updateTimestamp=").append(updateTimestamp);

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

@@ -435,6 +435,66 @@ public class ContentPlatformQwPlanExample {
             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;

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

@@ -59,4 +59,6 @@ public interface ContentPlatformPlanService {
     List<ContentPlatformGzhPlanVideo> getGzhPlanVideoList(List<Long> planIds);
 
     void gzhPlanDelete(Long id);
+
+    void qwPlanDelete(Long id);
 }

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

@@ -161,6 +161,17 @@ public class ContentPlatformPlanServiceImpl implements ContentPlatformPlanServic
         aigcApiService.closePublishPlan(plan.getExternalId());
     }
 
+    @Override
+    public void qwPlanDelete(Long id) {
+        ContentPlatformQwPlan plan = qwPlanMapper.selectByPrimaryKey(id);
+        if (Objects.isNull(plan)) {
+            throw new CommonException(ExceptionEnum.QW_PLAN_NOT_EXISTS);
+        }
+        plan.setStatus(0);
+        plan.setUpdateTimestamp(System.currentTimeMillis());
+        qwPlanMapper.updateByPrimaryKeySelective(plan);
+    }
+
     @Override
     public void gzhPlanSave(GzhPlanSaveParam param) {
         ContentPlatformAccount loginAccount = LoginUserContext.getUser();

+ 22 - 5
api-module/src/main/resources/mapper/contentplatform/ContentPlatformQwPlanMapper.xml

@@ -7,6 +7,7 @@
     <result column="scene" jdbcType="INTEGER" property="scene" />
     <result column="page_url" jdbcType="VARCHAR" property="pageUrl" />
     <result column="root_source_id" jdbcType="VARCHAR" property="rootSourceId" />
+    <result column="status" jdbcType="INTEGER" property="status" />
     <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" />
@@ -70,7 +71,7 @@
     </where>
   </sql>
   <sql id="Base_Column_List">
-    id, `type`, scene, page_url, root_source_id, create_account_id, create_timestamp, 
+    id, `type`, scene, page_url, root_source_id, `status`, create_account_id, create_timestamp, 
     update_timestamp
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformQwPlanExample" resultMap="BaseResultMap">
@@ -108,11 +109,13 @@
   </delete>
   <insert id="insert" parameterType="com.tzld.piaoquan.api.model.po.contentplatform.ContentPlatformQwPlan">
     insert into content_platform_qw_plan (id, `type`, scene, 
-      page_url, root_source_id, create_account_id, 
-      create_timestamp, update_timestamp)
+      page_url, root_source_id, `status`, 
+      create_account_id, create_timestamp, update_timestamp
+      )
     values (#{id,jdbcType=BIGINT}, #{type,jdbcType=INTEGER}, #{scene,jdbcType=INTEGER}, 
-      #{pageUrl,jdbcType=VARCHAR}, #{rootSourceId,jdbcType=VARCHAR}, #{createAccountId,jdbcType=BIGINT}, 
-      #{createTimestamp,jdbcType=BIGINT}, #{updateTimestamp,jdbcType=BIGINT})
+      #{pageUrl,jdbcType=VARCHAR}, #{rootSourceId,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.ContentPlatformQwPlan">
     insert into content_platform_qw_plan
@@ -132,6 +135,9 @@
       <if test="rootSourceId != null">
         root_source_id,
       </if>
+      <if test="status != null">
+        `status`,
+      </if>
       <if test="createAccountId != null">
         create_account_id,
       </if>
@@ -158,6 +164,9 @@
       <if test="rootSourceId != null">
         #{rootSourceId,jdbcType=VARCHAR},
       </if>
+      <if test="status != null">
+        #{status,jdbcType=INTEGER},
+      </if>
       <if test="createAccountId != null">
         #{createAccountId,jdbcType=BIGINT},
       </if>
@@ -193,6 +202,9 @@
       <if test="record.rootSourceId != null">
         root_source_id = #{record.rootSourceId,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>
@@ -214,6 +226,7 @@
       scene = #{record.scene,jdbcType=INTEGER},
       page_url = #{record.pageUrl,jdbcType=VARCHAR},
       root_source_id = #{record.rootSourceId,jdbcType=VARCHAR},
+      `status` = #{record.status,jdbcType=INTEGER},
       create_account_id = #{record.createAccountId,jdbcType=BIGINT},
       create_timestamp = #{record.createTimestamp,jdbcType=BIGINT},
       update_timestamp = #{record.updateTimestamp,jdbcType=BIGINT}
@@ -236,6 +249,9 @@
       <if test="rootSourceId != null">
         root_source_id = #{rootSourceId,jdbcType=VARCHAR},
       </if>
+      <if test="status != null">
+        `status` = #{status,jdbcType=INTEGER},
+      </if>
       <if test="createAccountId != null">
         create_account_id = #{createAccountId,jdbcType=BIGINT},
       </if>
@@ -254,6 +270,7 @@
       scene = #{scene,jdbcType=INTEGER},
       page_url = #{pageUrl,jdbcType=VARCHAR},
       root_source_id = #{rootSourceId,jdbcType=VARCHAR},
+      `status` = #{status,jdbcType=INTEGER},
       create_account_id = #{createAccountId,jdbcType=BIGINT},
       create_timestamp = #{createTimestamp,jdbcType=BIGINT},
       update_timestamp = #{updateTimestamp,jdbcType=BIGINT}

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

@@ -124,6 +124,7 @@
         from content_platform_qw_plan
         where create_account_id = #{createAccountId}
           and type = #{param.type}
+          and status = 1
         <if test="param.scene != null">
             and scene &lt; #{param.scene}
         </if>
@@ -139,6 +140,7 @@
         from content_platform_qw_plan
         where create_account_id = #{createAccountId}
         and type = #{param.type}
+        and status = 1
         <if test="param.scene != null">
             and scene &lt; #{param.scene}
         </if>