Browse Source

增加账号开关

xueyiming 7 months ago
parent
commit
8a63096191

+ 11 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/po/PlanAccount.java

@@ -51,6 +51,8 @@ public class PlanAccount {
 
     private Integer sendCount;
 
+    private Integer publishOpenFlag;
+
     private Integer isDelete;
 
     private Date createTime;
@@ -249,6 +251,14 @@ public class PlanAccount {
         this.sendCount = sendCount;
     }
 
+    public Integer getPublishOpenFlag() {
+        return publishOpenFlag;
+    }
+
+    public void setPublishOpenFlag(Integer publishOpenFlag) {
+        this.publishOpenFlag = publishOpenFlag;
+    }
+
     public Integer getIsDelete() {
         return isDelete;
     }
@@ -303,6 +313,7 @@ public class PlanAccount {
         sb.append(", matchStatus=").append(matchStatus);
         sb.append(", retryCount=").append(retryCount);
         sb.append(", sendCount=").append(sendCount);
+        sb.append(", publishOpenFlag=").append(publishOpenFlag);
         sb.append(", isDelete=").append(isDelete);
         sb.append(", createTime=").append(createTime);
         sb.append(", updateTime=").append(updateTime);

+ 60 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/po/PlanAccountExample.java

@@ -1666,6 +1666,66 @@ public class PlanAccountExample {
             return (Criteria) this;
         }
 
+        public Criteria andPublishOpenFlagIsNull() {
+            addCriterion("publish_open_flag is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPublishOpenFlagIsNotNull() {
+            addCriterion("publish_open_flag is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andPublishOpenFlagEqualTo(Integer value) {
+            addCriterion("publish_open_flag =", value, "publishOpenFlag");
+            return (Criteria) this;
+        }
+
+        public Criteria andPublishOpenFlagNotEqualTo(Integer value) {
+            addCriterion("publish_open_flag <>", value, "publishOpenFlag");
+            return (Criteria) this;
+        }
+
+        public Criteria andPublishOpenFlagGreaterThan(Integer value) {
+            addCriterion("publish_open_flag >", value, "publishOpenFlag");
+            return (Criteria) this;
+        }
+
+        public Criteria andPublishOpenFlagGreaterThanOrEqualTo(Integer value) {
+            addCriterion("publish_open_flag >=", value, "publishOpenFlag");
+            return (Criteria) this;
+        }
+
+        public Criteria andPublishOpenFlagLessThan(Integer value) {
+            addCriterion("publish_open_flag <", value, "publishOpenFlag");
+            return (Criteria) this;
+        }
+
+        public Criteria andPublishOpenFlagLessThanOrEqualTo(Integer value) {
+            addCriterion("publish_open_flag <=", value, "publishOpenFlag");
+            return (Criteria) this;
+        }
+
+        public Criteria andPublishOpenFlagIn(List<Integer> values) {
+            addCriterion("publish_open_flag in", values, "publishOpenFlag");
+            return (Criteria) this;
+        }
+
+        public Criteria andPublishOpenFlagNotIn(List<Integer> values) {
+            addCriterion("publish_open_flag not in", values, "publishOpenFlag");
+            return (Criteria) this;
+        }
+
+        public Criteria andPublishOpenFlagBetween(Integer value1, Integer value2) {
+            addCriterion("publish_open_flag between", value1, value2, "publishOpenFlag");
+            return (Criteria) this;
+        }
+
+        public Criteria andPublishOpenFlagNotBetween(Integer value1, Integer value2) {
+            addCriterion("publish_open_flag not between", value1, value2, "publishOpenFlag");
+            return (Criteria) this;
+        }
+
         public Criteria andIsDeleteIsNull() {
             addCriterion("is_delete is null");
             return (Criteria) this;

+ 2 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/model/vo/LongArticleSystemPlanAccount.java

@@ -14,4 +14,6 @@ public class LongArticleSystemPlanAccount {
     private String name;
     //"公众号ID")
     private String ghId;
+    // 发布开关(0-关闭,1-打开)
+    private Integer publishOpenFlag;
 }

+ 1 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/CoreServiceImpl.java

@@ -123,6 +123,7 @@ public class CoreServiceImpl implements CoreService {
                 planAccount.setAccountId(accountId);
                 planAccount.setAccountName(account.getName());
                 planAccount.setGhId(account.getGhId());
+                planAccount.setPublishOpenFlag(account.getPublishOpenFlag());
                 planAccount.setPublishRate(longArticleSystemPlan.getPublishRate());
                 planAccount.setPublishDate(longArticleSystemPlan.getPublishDate());
                 planAccount.setPublishNum(longArticleSystemPlan.getPublishNum());

+ 1 - 1
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/impl/PlanAccountServiceImpl.java

@@ -63,7 +63,7 @@ public class PlanAccountServiceImpl implements PlanAccountService {
     public List<PlanAccount> getNormalPlanAccount() {
         PlanAccountExample example = new PlanAccountExample();
         example.createCriteria().andCreateTimeGreaterThan(DateUtil.getThatDayDate())
-                .andStatusEqualTo(0).andIsDeleteEqualTo(0);
+                .andStatusEqualTo(0).andIsDeleteEqualTo(0).andMiniprogramInsertFlagEqualTo(1);
         return planAccountMapper.selectByExample(example);
     }
 

+ 20 - 5
long-article-server/src/main/resources/mapper/PlanAccountMapper.xml

@@ -26,6 +26,7 @@
     <result column="match_status" jdbcType="INTEGER" property="matchStatus" />
     <result column="retry_count" jdbcType="INTEGER" property="retryCount" />
     <result column="send_count" jdbcType="INTEGER" property="sendCount" />
+    <result column="publish_open_flag" jdbcType="INTEGER" property="publishOpenFlag" />
     <result column="is_delete" jdbcType="INTEGER" property="isDelete" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
     <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
@@ -93,7 +94,7 @@
     publish_window_start, publish_window_end, publish_time_interval, publish_num, publish_pre_num, 
     publish_pre_min_num, publish_push_time, push_type, miniprogram_insert_flag, mini_strategy, 
     miniprogram_use_type, sort_strategy, `status`, match_status, retry_count, send_count, 
-    is_delete, create_time, update_time
+    publish_open_flag, is_delete, create_time, update_time
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.longarticle.model.po.PlanAccountExample" resultMap="BaseResultMap">
     select
@@ -137,8 +138,8 @@
       publish_push_time, push_type, miniprogram_insert_flag, 
       mini_strategy, miniprogram_use_type, sort_strategy, 
       `status`, match_status, retry_count, 
-      send_count, is_delete, create_time, 
-      update_time)
+      send_count, publish_open_flag, is_delete, 
+      create_time, update_time)
     values (#{id,jdbcType=BIGINT}, #{planId,jdbcType=VARCHAR}, #{planName,jdbcType=VARCHAR}, 
       #{accountId,jdbcType=VARCHAR}, #{accountName,jdbcType=VARCHAR}, #{ghId,jdbcType=VARCHAR}, 
       #{publishRate,jdbcType=INTEGER}, #{publishDate,jdbcType=VARCHAR}, #{publishWindowStart,jdbcType=VARCHAR}, 
@@ -147,8 +148,8 @@
       #{publishPushTime,jdbcType=VARCHAR}, #{pushType,jdbcType=INTEGER}, #{miniprogramInsertFlag,jdbcType=INTEGER}, 
       #{miniStrategy,jdbcType=VARCHAR}, #{miniprogramUseType,jdbcType=INTEGER}, #{sortStrategy,jdbcType=VARCHAR}, 
       #{status,jdbcType=INTEGER}, #{matchStatus,jdbcType=INTEGER}, #{retryCount,jdbcType=INTEGER}, 
-      #{sendCount,jdbcType=INTEGER}, #{isDelete,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, 
-      #{updateTime,jdbcType=TIMESTAMP})
+      #{sendCount,jdbcType=INTEGER}, #{publishOpenFlag,jdbcType=INTEGER}, #{isDelete,jdbcType=INTEGER}, 
+      #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.longarticle.model.po.PlanAccount">
     insert into long_articles_plan_account
@@ -225,6 +226,9 @@
       <if test="sendCount != null">
         send_count,
       </if>
+      <if test="publishOpenFlag != null">
+        publish_open_flag,
+      </if>
       <if test="isDelete != null">
         is_delete,
       </if>
@@ -308,6 +312,9 @@
       <if test="sendCount != null">
         #{sendCount,jdbcType=INTEGER},
       </if>
+      <if test="publishOpenFlag != null">
+        #{publishOpenFlag,jdbcType=INTEGER},
+      </if>
       <if test="isDelete != null">
         #{isDelete,jdbcType=INTEGER},
       </if>
@@ -400,6 +407,9 @@
       <if test="record.sendCount != null">
         send_count = #{record.sendCount,jdbcType=INTEGER},
       </if>
+      <if test="record.publishOpenFlag != null">
+        publish_open_flag = #{record.publishOpenFlag,jdbcType=INTEGER},
+      </if>
       <if test="record.isDelete != null">
         is_delete = #{record.isDelete,jdbcType=INTEGER},
       </if>
@@ -440,6 +450,7 @@
       match_status = #{record.matchStatus,jdbcType=INTEGER},
       retry_count = #{record.retryCount,jdbcType=INTEGER},
       send_count = #{record.sendCount,jdbcType=INTEGER},
+      publish_open_flag = #{record.publishOpenFlag,jdbcType=INTEGER},
       is_delete = #{record.isDelete,jdbcType=INTEGER},
       create_time = #{record.createTime,jdbcType=TIMESTAMP},
       update_time = #{record.updateTime,jdbcType=TIMESTAMP}
@@ -519,6 +530,9 @@
       <if test="sendCount != null">
         send_count = #{sendCount,jdbcType=INTEGER},
       </if>
+      <if test="publishOpenFlag != null">
+        publish_open_flag = #{publishOpenFlag,jdbcType=INTEGER},
+      </if>
       <if test="isDelete != null">
         is_delete = #{isDelete,jdbcType=INTEGER},
       </if>
@@ -556,6 +570,7 @@
       match_status = #{matchStatus,jdbcType=INTEGER},
       retry_count = #{retryCount,jdbcType=INTEGER},
       send_count = #{sendCount,jdbcType=INTEGER},
+      publish_open_flag = #{publishOpenFlag,jdbcType=INTEGER},
       is_delete = #{isDelete,jdbcType=INTEGER},
       create_time = #{createTime,jdbcType=TIMESTAMP},
       update_time = #{updateTime,jdbcType=TIMESTAMP}

+ 2 - 2
long-article-server/src/main/resources/mybatis-generator-config.xml

@@ -49,7 +49,7 @@
                              targetProject="/Users/shimeng/Desktop/project/long-article-manage/long-article-server/src/main/java">
             <property name="enableSubPackages" value="true"/>
         </javaClientGenerator>
-        <table tableName="long_articles_match_videos" domainObjectName="MatchVideo" alias="" />
+<!--        <table tableName="long_articles_match_videos" domainObjectName="MatchVideo" alias="" />-->
 <!--            <columnOverride column="response" javaType="java.lang.String" jdbcType="LONGVARCHAR" />-->
 <!--        </table>-->
 <!--        <table tableName="long_articles_text" domainObjectName="LongArticlesText" alias="">-->
@@ -60,7 +60,7 @@
 <!--            <columnOverride column="cover_url" javaType="java.lang.String" jdbcType="LONGVARCHAR" />-->
 <!--        </table>-->
 <!--        <table tableName="long_articles_root_source_id" domainObjectName="RootSource" alias=""/>-->
-<!--        <table tableName="long_articles_plan_account" domainObjectName="PlanAccount" alias=""/>-->
+        <table tableName="long_articles_plan_account" domainObjectName="PlanAccount" alias=""/>
 <!--            <table tableName="long_articles_plan" domainObjectName="Plan" alias=""/>-->
 
 <!--                <table tableName="long_articles_publish_content" domainObjectName="PublishContent" alias=""/>-->