Pārlūkot izejas kodu

修改分组数量

xueyiming 3 nedēļas atpakaļ
vecāks
revīzija
a5ee472fbb

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

@@ -559,7 +559,7 @@ public class CoreServiceImpl implements CoreService {
                 LarkRobotUtil.sendMessage("计划发布失败3次,请查看 账号计划id为" + planAccount.getPlanId());
                 return false;
             }
-        }else {
+        } else {
             //其他群发最多重试5次
             if (planAccount.getRetryCount() >= 5) {
                 planAccount.setStatus(3);
@@ -807,13 +807,15 @@ public class CoreServiceImpl implements CoreService {
                 return;
             }
         }
+        //分组数量
+        int groupNum = 7;
         List<Integer> userGroupIds = articleUseGroupMapper.selectUserGroupId(planAccount.getGhId());
         LocalDate today = LocalDate.now(); // 获取当前日期
         int dayOfMonth = today.getDayOfMonth();
-        int tailNum = dayOfMonth % 7;
+        int tailNum = dayOfMonth % groupNum;
         List<Integer> needPushUserGroupIds = new ArrayList<>();
         for (int userGroupId : userGroupIds) {
-            if (userGroupId % 8 == tailNum) {
+            if (userGroupId % groupNum == tailNum) {
                 needPushUserGroupIds.add(userGroupId);
             }
         }