Browse Source

例外设置修改

xueyiming 5 tháng trước cách đây
mục cha
commit
cc0cf68d24

+ 2 - 0
long-article-server/src/main/java/com/tzld/piaoquan/longarticle/service/local/AccountService.java

@@ -11,4 +11,6 @@ public interface AccountService {
     List<AccountSpecialSettings> getSendAccountSpecialSettings();
 
     void saveOrUpdateAccountSpecialSettings(AccountSpecialSettings accountSpecialSettings);
+
+    boolean isSendSpecialSettings(String accountId);
 }

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

@@ -25,14 +25,14 @@ public class AccountServiceImpl implements AccountService {
     public List<AccountSpecialSettings> getAccountSpecialSettings() {
         String dateString = DateUtil.getThatDayDateString();
         AccountSpecialSettingsExample example = new AccountSpecialSettingsExample();
-        example.createCriteria().andEffectiveDateEqualTo(dateString);
+        example.createCriteria().andEffectiveDateEqualTo(dateString).andIsDeleteEqualTo(0);
         return accountSpecialSettingsMapper.selectByExample(example);
     }
 
     public List<AccountSpecialSettings> getSendAccountSpecialSettings() {
         String dateString = DateUtil.getTomorrowDateString();
         AccountSpecialSettingsExample example = new AccountSpecialSettingsExample();
-        example.createCriteria().andEffectiveDateEqualTo(dateString);
+        example.createCriteria().andEffectiveDateEqualTo(dateString).andIsDeleteEqualTo(0);
         return accountSpecialSettingsMapper.selectByExample(example);
     }
 
@@ -50,5 +50,14 @@ public class AccountServiceImpl implements AccountService {
         }
     }
 
+    @Override
+    public boolean isSendSpecialSettings(String accountId) {
+        String dateString = DateUtil.getTomorrowDateString();
+        AccountSpecialSettingsExample example = new AccountSpecialSettingsExample();
+        example.createCriteria().andEffectiveDateEqualTo(dateString)
+                .andAccountIdEqualTo(accountId).andIsDeleteEqualTo(0);
+        return accountSpecialSettingsMapper.countByExample(example) > 0;
+    }
+
 
 }

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

@@ -750,8 +750,10 @@ public class CoreServiceImpl implements CoreService {
     @Override
     public void initPlanAccount() {
         //例外设置查询和存储
+        //获取当天不能发送操作计划的账号列表
         List<AccountSpecialSettings> accountSpecialSettings = accountService.getAccountSpecialSettings();
         List<String> specialAccountIds = accountSpecialSettings.stream().map(AccountSpecialSettings::getAccountId).collect(Collectors.toList());
+        //获取当天需要额外推送的例外设置账号列表
         List<AccountSpecialSettings> sendAccountSpecialSettings = accountService.getSendAccountSpecialSettings();
         //操作计划遍历
         List<Plan> planList = planAccountService.getPlanList();
@@ -1089,22 +1091,26 @@ public class CoreServiceImpl implements CoreService {
         PushRecordParam param = new PushRecordParam();
         param.setPlanId(planAccount.getPlanId());
         param.setPublishAccountId(planAccount.getAccountId());
-        List<PushRecordVO> todayPushRecords = aigcService.getTodayPushRecords(param);
+        boolean sendSpecialSettings = accountService.isSendSpecialSettings(planAccount.getAccountId());
 
-
-        //查询aigc发布成功数量
+        //例外设置不查询aigc数量  一定会多发
         int aigcCount = 0;
-        if (!CollectionUtils.isEmpty(todayPushRecords)) {
-            List<PushRecordVO> collect = todayPushRecords.stream()
-                    .filter(e -> ((e.getPushStatus() != 3) && (e.getPublishStatus() != 3))).collect(Collectors.toList());
-            if (!CollectionUtils.isEmpty(collect)) {
-                for (PushRecordVO pushRecordVO : collect) {
-                    if (pushRecordVO.getPublishContentCount() != null) {
-                        aigcCount += pushRecordVO.getPublishContentCount();
+        if (!sendSpecialSettings) {
+            //查询aigc发布成功数量
+            List<PushRecordVO> todayPushRecords = aigcService.getTodayPushRecords(param);
+            if (!CollectionUtils.isEmpty(todayPushRecords)) {
+                List<PushRecordVO> collect = todayPushRecords.stream()
+                        .filter(e -> ((e.getPushStatus() != 3) && (e.getPublishStatus() != 3))).collect(Collectors.toList());
+                if (!CollectionUtils.isEmpty(collect)) {
+                    for (PushRecordVO pushRecordVO : collect) {
+                        if (pushRecordVO.getPublishContentCount() != null) {
+                            aigcCount += pushRecordVO.getPublishContentCount();
+                        }
                     }
                 }
             }
         }
+
         //长文系统发布数量
         int sendCount = publicContentService.getSendCount(planAccount.getId());
         //取发布数量多的