Jelajahi Sumber

例外设置当天也同步操作计划,只是不发布

xueyiming 1 bulan lalu
induk
melakukan
a074b60cc1

+ 19 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/common/enums/SpecialNotSendEnum.java

@@ -0,0 +1,19 @@
+package com.tzld.piaoquan.longarticle.common.enums;
+
+import lombok.Getter;
+
+@Getter
+public enum SpecialNotSendEnum {
+
+    SEND(0, "发布"),
+    NOT_SEND(1, "不发布");
+
+    private final int statusCode;
+    private final String message;
+
+    SpecialNotSendEnum(int statusCode, String message) {
+        this.statusCode = statusCode;
+        this.message = message;
+    }
+
+}

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

@@ -57,6 +57,8 @@ public class PlanAccount {
 
     private Integer isSpecialSetting;
 
+    private Integer specialNotSend;
+
     private Integer isDelete;
 
     private Date createTime;
@@ -279,6 +281,14 @@ public class PlanAccount {
         this.isSpecialSetting = isSpecialSetting;
     }
 
+    public Integer getSpecialNotSend() {
+        return specialNotSend;
+    }
+
+    public void setSpecialNotSend(Integer specialNotSend) {
+        this.specialNotSend = specialNotSend;
+    }
+
     public Integer getIsDelete() {
         return isDelete;
     }
@@ -336,6 +346,7 @@ public class PlanAccount {
         sb.append(", sendCount=").append(sendCount);
         sb.append(", publishOpenFlag=").append(publishOpenFlag);
         sb.append(", isSpecialSetting=").append(isSpecialSetting);
+        sb.append(", specialNotSend=").append(specialNotSend);
         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/longarticle/PlanAccountExample.java

@@ -1856,6 +1856,66 @@ public class PlanAccountExample {
             return (Criteria) this;
         }
 
+        public Criteria andSpecialNotSendIsNull() {
+            addCriterion("special_not_send is null");
+            return (Criteria) this;
+        }
+
+        public Criteria andSpecialNotSendIsNotNull() {
+            addCriterion("special_not_send is not null");
+            return (Criteria) this;
+        }
+
+        public Criteria andSpecialNotSendEqualTo(Integer value) {
+            addCriterion("special_not_send =", value, "specialNotSend");
+            return (Criteria) this;
+        }
+
+        public Criteria andSpecialNotSendNotEqualTo(Integer value) {
+            addCriterion("special_not_send <>", value, "specialNotSend");
+            return (Criteria) this;
+        }
+
+        public Criteria andSpecialNotSendGreaterThan(Integer value) {
+            addCriterion("special_not_send >", value, "specialNotSend");
+            return (Criteria) this;
+        }
+
+        public Criteria andSpecialNotSendGreaterThanOrEqualTo(Integer value) {
+            addCriterion("special_not_send >=", value, "specialNotSend");
+            return (Criteria) this;
+        }
+
+        public Criteria andSpecialNotSendLessThan(Integer value) {
+            addCriterion("special_not_send <", value, "specialNotSend");
+            return (Criteria) this;
+        }
+
+        public Criteria andSpecialNotSendLessThanOrEqualTo(Integer value) {
+            addCriterion("special_not_send <=", value, "specialNotSend");
+            return (Criteria) this;
+        }
+
+        public Criteria andSpecialNotSendIn(List<Integer> values) {
+            addCriterion("special_not_send in", values, "specialNotSend");
+            return (Criteria) this;
+        }
+
+        public Criteria andSpecialNotSendNotIn(List<Integer> values) {
+            addCriterion("special_not_send not in", values, "specialNotSend");
+            return (Criteria) this;
+        }
+
+        public Criteria andSpecialNotSendBetween(Integer value1, Integer value2) {
+            addCriterion("special_not_send between", value1, value2, "specialNotSend");
+            return (Criteria) this;
+        }
+
+        public Criteria andSpecialNotSendNotBetween(Integer value1, Integer value2) {
+            addCriterion("special_not_send not between", value1, value2, "specialNotSend");
+            return (Criteria) this;
+        }
+
         public Criteria andIsDeleteIsNull() {
             addCriterion("is_delete is null");
             return (Criteria) this;

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

@@ -19,7 +19,7 @@ public interface PlanAccountService {
 
     List<PlanAccount> getMatchPlanAccount();
 
-    List<PlanAccount> getNormalPlanAccount();
+    List<PlanAccount> getSendNormalPlanAccount();
 
     List<PlanAccount> getNormalPlanAccount(String accountId);
 

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

@@ -173,9 +173,10 @@ public class CoreServiceImpl implements CoreService {
                     planAccount.setSortStrategy(sortStgMap.get(accountId));
                 }
                 planAccount.setPushType(longArticleSystemPlan.getPushType());
-                if (CollectionUtils.isEmpty(specialAccountIds) || !specialAccountIds.contains(planAccount.getAccountId())) {
-                    planAccountService.saveOrUpdatePlanAccount(planAccount);
+                if (!CollectionUtils.isEmpty(specialAccountIds) && specialAccountIds.contains(planAccount.getAccountId())) {
+                    planAccount.setSpecialNotSend(SpecialNotSendEnum.NOT_SEND.getStatusCode());
                 }
+                planAccountService.saveOrUpdatePlanAccount(planAccount);
             }
             if (CollectionUtils.isEmpty(accountIdSet)) {
                 continue;
@@ -209,7 +210,7 @@ public class CoreServiceImpl implements CoreService {
                 continue;
             }
             for (PlanAccount planAccount : planAccountList) {
-                planAccount.setPublishOpenFlag(0);
+                planAccount.setSpecialNotSend(SpecialNotSendEnum.NOT_SEND.getStatusCode());
                 planAccountService.saveOrUpdatePlanAccount(planAccount);
             }
         }
@@ -566,7 +567,7 @@ public class CoreServiceImpl implements CoreService {
                 }));
             }
             List<PlanAccount> planAccounts;
-            planAccounts = planAccountService.getNormalPlanAccount();
+            planAccounts = planAccountService.getSendNormalPlanAccount();
             if (CollectionUtils.isEmpty(planAccounts)) {
                 return;
             }

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

@@ -1,5 +1,6 @@
 package com.tzld.piaoquan.longarticle.service.local.impl;
 
+import com.tzld.piaoquan.longarticle.common.enums.SpecialNotSendEnum;
 import com.tzld.piaoquan.longarticle.dao.mapper.longarticle.PlanAccountMapper;
 import com.tzld.piaoquan.longarticle.dao.mapper.longarticle.PlanMapper;
 import com.tzld.piaoquan.longarticle.model.po.longarticle.Plan;
@@ -76,10 +77,11 @@ public class PlanAccountServiceImpl implements PlanAccountService {
         return planAccountMapper.selectByExample(example);
     }
 
-    public List<PlanAccount> getNormalPlanAccount() {
+    public List<PlanAccount> getSendNormalPlanAccount() {
         PlanAccountExample example = new PlanAccountExample();
         example.createCriteria().andCreateTimeGreaterThan(DateUtil.getThatDayDate())
-                .andStatusEqualTo(0).andIsDeleteEqualTo(0).andPublishOpenFlagEqualTo(1);
+                .andStatusEqualTo(0).andIsDeleteEqualTo(0).andPublishOpenFlagEqualTo(1)
+                .andSpecialNotSendEqualTo(SpecialNotSendEnum.SEND.getStatusCode());
         return planAccountMapper.selectByExample(example);
     }
 

+ 21 - 6
long-article-server/src/main/resources/mapper/longarticle/PlanAccountMapper.xml

@@ -29,6 +29,7 @@
     <result column="send_count" jdbcType="INTEGER" property="sendCount" />
     <result column="publish_open_flag" jdbcType="INTEGER" property="publishOpenFlag" />
     <result column="is_special_setting" jdbcType="INTEGER" property="isSpecialSetting" />
+    <result column="special_not_send" jdbcType="INTEGER" property="specialNotSend" />
     <result column="is_delete" jdbcType="INTEGER" property="isDelete" />
     <result column="create_time" jdbcType="TIMESTAMP" property="createTime" />
     <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" />
@@ -96,8 +97,8 @@
     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, exclude_content_index, `status`, match_status, 
-    retry_count, send_count, publish_open_flag, is_special_setting, is_delete, create_time, 
-    update_time
+    retry_count, send_count, publish_open_flag, is_special_setting, special_not_send, 
+    is_delete, create_time, update_time
   </sql>
   <select id="selectByExample" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.PlanAccountExample" resultMap="BaseResultMap">
     select
@@ -142,8 +143,8 @@
       mini_strategy, miniprogram_use_type, sort_strategy, 
       exclude_content_index, `status`, match_status, 
       retry_count, send_count, publish_open_flag, 
-      is_special_setting, is_delete, create_time, 
-      update_time)
+      is_special_setting, special_not_send, 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}, 
@@ -153,8 +154,8 @@
       #{miniStrategy,jdbcType=VARCHAR}, #{miniprogramUseType,jdbcType=INTEGER}, #{sortStrategy,jdbcType=VARCHAR}, 
       #{excludeContentIndex,jdbcType=VARCHAR}, #{status,jdbcType=INTEGER}, #{matchStatus,jdbcType=INTEGER}, 
       #{retryCount,jdbcType=INTEGER}, #{sendCount,jdbcType=INTEGER}, #{publishOpenFlag,jdbcType=INTEGER}, 
-      #{isSpecialSetting,jdbcType=INTEGER}, #{isDelete,jdbcType=INTEGER}, #{createTime,jdbcType=TIMESTAMP}, 
-      #{updateTime,jdbcType=TIMESTAMP})
+      #{isSpecialSetting,jdbcType=INTEGER}, #{specialNotSend,jdbcType=INTEGER}, #{isDelete,jdbcType=INTEGER}, 
+      #{createTime,jdbcType=TIMESTAMP}, #{updateTime,jdbcType=TIMESTAMP})
   </insert>
   <insert id="insertSelective" parameterType="com.tzld.piaoquan.longarticle.model.po.longarticle.PlanAccount">
     insert into long_articles_plan_account
@@ -240,6 +241,9 @@
       <if test="isSpecialSetting != null">
         is_special_setting,
       </if>
+      <if test="specialNotSend != null">
+        special_not_send,
+      </if>
       <if test="isDelete != null">
         is_delete,
       </if>
@@ -332,6 +336,9 @@
       <if test="isSpecialSetting != null">
         #{isSpecialSetting,jdbcType=INTEGER},
       </if>
+      <if test="specialNotSend != null">
+        #{specialNotSend,jdbcType=INTEGER},
+      </if>
       <if test="isDelete != null">
         #{isDelete,jdbcType=INTEGER},
       </if>
@@ -433,6 +440,9 @@
       <if test="record.isSpecialSetting != null">
         is_special_setting = #{record.isSpecialSetting,jdbcType=INTEGER},
       </if>
+      <if test="record.specialNotSend != null">
+        special_not_send = #{record.specialNotSend,jdbcType=INTEGER},
+      </if>
       <if test="record.isDelete != null">
         is_delete = #{record.isDelete,jdbcType=INTEGER},
       </if>
@@ -476,6 +486,7 @@
       send_count = #{record.sendCount,jdbcType=INTEGER},
       publish_open_flag = #{record.publishOpenFlag,jdbcType=INTEGER},
       is_special_setting = #{record.isSpecialSetting,jdbcType=INTEGER},
+      special_not_send = #{record.specialNotSend,jdbcType=INTEGER},
       is_delete = #{record.isDelete,jdbcType=INTEGER},
       create_time = #{record.createTime,jdbcType=TIMESTAMP},
       update_time = #{record.updateTime,jdbcType=TIMESTAMP}
@@ -564,6 +575,9 @@
       <if test="isSpecialSetting != null">
         is_special_setting = #{isSpecialSetting,jdbcType=INTEGER},
       </if>
+      <if test="specialNotSend != null">
+        special_not_send = #{specialNotSend,jdbcType=INTEGER},
+      </if>
       <if test="isDelete != null">
         is_delete = #{isDelete,jdbcType=INTEGER},
       </if>
@@ -604,6 +618,7 @@
       send_count = #{sendCount,jdbcType=INTEGER},
       publish_open_flag = #{publishOpenFlag,jdbcType=INTEGER},
       is_special_setting = #{isSpecialSetting,jdbcType=INTEGER},
+      special_not_send = #{specialNotSend,jdbcType=INTEGER},
       is_delete = #{isDelete,jdbcType=INTEGER},
       create_time = #{createTime,jdbcType=TIMESTAMP},
       update_time = #{updateTime,jdbcType=TIMESTAMP}

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

@@ -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="video_end_screen_transformation_task" domainObjectName="VideoEndScreen" 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=""/>-->