ソースを参照

Merge branch 'dev-xym-update-special' of Server/long-article-manage into master

xueyiming 1 ヶ月 前
コミット
18f8b87297

+ 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;
+    }
+
+}

+ 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> getMatchPlanAccount();
 
 
-    List<PlanAccount> getNormalPlanAccount();
+    List<PlanAccount> getSendNormalPlanAccount();
 
 
     List<PlanAccount> getNormalPlanAccount(String accountId);
     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.setSortStrategy(sortStgMap.get(accountId));
                 }
                 }
                 planAccount.setPushType(longArticleSystemPlan.getPushType());
                 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)) {
             if (CollectionUtils.isEmpty(accountIdSet)) {
                 continue;
                 continue;
@@ -209,7 +210,7 @@ public class CoreServiceImpl implements CoreService {
                 continue;
                 continue;
             }
             }
             for (PlanAccount planAccount : planAccountList) {
             for (PlanAccount planAccount : planAccountList) {
-                planAccount.setPublishOpenFlag(0);
+                planAccount.setSpecialNotSend(SpecialNotSendEnum.NOT_SEND.getStatusCode());
                 planAccountService.saveOrUpdatePlanAccount(planAccount);
                 planAccountService.saveOrUpdatePlanAccount(planAccount);
             }
             }
         }
         }
@@ -566,7 +567,7 @@ public class CoreServiceImpl implements CoreService {
                 }));
                 }));
             }
             }
             List<PlanAccount> planAccounts;
             List<PlanAccount> planAccounts;
-            planAccounts = planAccountService.getNormalPlanAccount();
+            planAccounts = planAccountService.getSendNormalPlanAccount();
             if (CollectionUtils.isEmpty(planAccounts)) {
             if (CollectionUtils.isEmpty(planAccounts)) {
                 return;
                 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;
 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.PlanAccountMapper;
 import com.tzld.piaoquan.longarticle.dao.mapper.longarticle.PlanMapper;
 import com.tzld.piaoquan.longarticle.dao.mapper.longarticle.PlanMapper;
 import com.tzld.piaoquan.longarticle.model.po.longarticle.Plan;
 import com.tzld.piaoquan.longarticle.model.po.longarticle.Plan;
@@ -76,10 +77,11 @@ public class PlanAccountServiceImpl implements PlanAccountService {
         return planAccountMapper.selectByExample(example);
         return planAccountMapper.selectByExample(example);
     }
     }
 
 
-    public List<PlanAccount> getNormalPlanAccount() {
+    public List<PlanAccount> getSendNormalPlanAccount() {
         PlanAccountExample example = new PlanAccountExample();
         PlanAccountExample example = new PlanAccountExample();
         example.createCriteria().andCreateTimeGreaterThan(DateUtil.getThatDayDate())
         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);
         return planAccountMapper.selectByExample(example);
     }
     }