Quellcode durchsuchen

修改例外设置查询

xueyiming vor 5 Monaten
Ursprung
Commit
0dd43055aa

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

@@ -824,19 +824,20 @@ public class CoreServiceImpl implements CoreService {
             }
 
         }
-        if (CollectionUtils.isEmpty(planIdSet)) {
-            return;
-        }
-        for (String planId : planIdSet) {
-            planAccountService.delPlan(planId);
+
+        if (!CollectionUtils.isEmpty(planIdSet)) {
+            for (String planId : planIdSet) {
+                planAccountService.delPlan(planId);
+            }
         }
 
         //例外设置处理
         setSpecialAccount(accountSpecialSettings, sendAccountSpecialSettings);
+
     }
 
-    private void setSpecialAccount(List<AccountSpecialSettings> accountSpecialSettings,
-                                   List<AccountSpecialSettings> sendAccountSpecialSettings) {
+    public void setSpecialAccount(List<AccountSpecialSettings> accountSpecialSettings,
+                                  List<AccountSpecialSettings> sendAccountSpecialSettings) {
 
         //当天计划不发送
         for (AccountSpecialSettings accountSpecialSetting : accountSpecialSettings) {
@@ -861,6 +862,7 @@ public class CoreServiceImpl implements CoreService {
                 Optional<PlanAccount> firstAccount = planAccountList.stream().min((a1, a2) -> -a1.getPublishNum().compareTo(a2.getPublishNum()));
                 PlanAccount targetPlanAccount = firstAccount.get();
                 updateAccountSetting(accountSpecialSetting, targetPlanAccount);
+                targetPlanAccount.setStatus(0);
                 targetPlanAccount.setIsSpecialSetting(1);
                 targetPlanAccount.setId(null);
                 planAccountService.saveOrUpdatePlanAccount(targetPlanAccount);
@@ -1263,7 +1265,7 @@ public class CoreServiceImpl implements CoreService {
                             continue;
                         }
                         List<VideoDetail> videoDetails = contentService.
-                                getPublishVideoDetail(matchVideo, PublicFlagEnum.NOT_PUBLIC.getStatusCode(),planAccount);
+                                getPublishVideoDetail(matchVideo, PublicFlagEnum.NOT_PUBLIC.getStatusCode(), planAccount);
                         log.info("publishContentId={}, videoDetails={}", publishContent.getId(), videoDetails);
                         if (CollectionUtils.isEmpty(videoDetails)) {
                             continue;