lqc il y a 4 ans
Parent
commit
b3d557e27e

+ 10 - 8
src/main/java/com/mokamrp/privates/service/pangu/impl/FosterwxCashScheduleTaskListServiceImpl.java

@@ -99,33 +99,35 @@ public class FosterwxCashScheduleTaskListServiceImpl extends ServiceImpl<Fosterw
 
 
     /**
     /**
      * 生成任务 正常生成 | 生成失败|检测到公众号封禁重新生成链接
      * 生成任务 正常生成 | 生成失败|检测到公众号封禁重新生成链接
-     * @param newsList
+     * @param editList
      */
      */
     @Override
     @Override
     public void create(List<FosterwxCashScheduleTaskList> newsList) {
     public void create(List<FosterwxCashScheduleTaskList> newsList) {
         if (newsList.isEmpty()) return;
         if (newsList.isEmpty()) return;
+        List<FosterwxCashScheduleTaskList> editList = new ArrayList<>();
+        newsList.forEach(fosterwxCashScheduleTaskList -> editList.add(fosterwxCashScheduleTaskList));
 
 
         String ghid = "";
         String ghid = "";
-        Integer groupId = newsList.get(0).getGroupId();
-        FosterwxCashOasBox fosterwxCashOasBox = fosterwxCashOasBoxService.getRandOas(newsList.get(0).getGroupId());
+        Integer groupId = editList.get(0).getGroupId();
+        FosterwxCashOasBox fosterwxCashOasBox = fosterwxCashOasBoxService.getRandOas(editList.get(0).getGroupId());
         if (null != fosterwxCashOasBox) {
         if (null != fosterwxCashOasBox) {
             ghid = fosterwxCashOasBox.getGhId();
             ghid = fosterwxCashOasBox.getGhId();
         }
         }
         int count = 0;
         int count = 0;
         List<FosterwxCashScheduleTaskList> tempList = new ArrayList<>();
         List<FosterwxCashScheduleTaskList> tempList = new ArrayList<>();
-        for (int i = 0; i < newsList.size(); i++) {
+        for (int i = 0; i < editList.size(); i++) {
             if (count == 8) {
             if (count == 8) {
-                fosterwxCashOasBoxService.addSendTextCnt(newsList.get(0).getGroupId(), ghid);
+                fosterwxCashOasBoxService.addSendTextCnt(editList.get(0).getGroupId(), ghid);
 
 
                 taskRedis.createUrlByTyper(JSON.toJSONString(tempList));
                 taskRedis.createUrlByTyper(JSON.toJSONString(tempList));
                 tempList.clear();
                 tempList.clear();
-                fosterwxCashOasBox = fosterwxCashOasBoxService.getRandOas(newsList.get(0).getGroupId());
+                fosterwxCashOasBox = fosterwxCashOasBoxService.getRandOas(editList.get(0).getGroupId());
                 if (null != fosterwxCashOasBox) {
                 if (null != fosterwxCashOasBox) {
                     ghid = fosterwxCashOasBox.getGhId();
                     ghid = fosterwxCashOasBox.getGhId();
                 }
                 }
                 count = 0;
                 count = 0;
             }
             }
-            FosterwxCashScheduleTaskList fosterwxCashScheduleTaskList = newsList.get(i);
+            FosterwxCashScheduleTaskList fosterwxCashScheduleTaskList = editList.get(i);
 
 
             // 状态
             // 状态
             fosterwxCashScheduleTaskList.setStatus(1);
             fosterwxCashScheduleTaskList.setStatus(1);
@@ -144,7 +146,7 @@ public class FosterwxCashScheduleTaskListServiceImpl extends ServiceImpl<Fosterw
             fosterwxCashScheduleTaskList.setFosterwxCashTaskList(fosterwxCashTaskListService.getById(fosterwxCashScheduleTaskList.getTaskId()));
             fosterwxCashScheduleTaskList.setFosterwxCashTaskList(fosterwxCashTaskListService.getById(fosterwxCashScheduleTaskList.getTaskId()));
             tempList.add(fosterwxCashScheduleTaskList);
             tempList.add(fosterwxCashScheduleTaskList);
             count++;
             count++;
-            newsList.remove(i);
+            editList.remove(i);
             i--;
             i--;
         }
         }
         fosterwxCashOasBoxService.addSendTextCnt(groupId, ghid);
         fosterwxCashOasBoxService.addSendTextCnt(groupId, ghid);

+ 12 - 2
src/test/java/com/mokamrp/Tests.java

@@ -11,9 +11,7 @@ import java.text.NumberFormat;
 import java.time.LocalDate;
 import java.time.LocalDate;
 import java.time.LocalDateTime;
 import java.time.LocalDateTime;
 import java.util.ArrayList;
 import java.util.ArrayList;
-import java.util.HashMap;
 import java.util.List;
 import java.util.List;
-import java.util.Map;
 
 
 @Slf4j
 @Slf4j
 public class Tests {
 public class Tests {
@@ -93,4 +91,16 @@ public class Tests {
             log.info("{}:{}", i, group);
             log.info("{}:{}", i, group);
         }
         }
     }
     }
+
+    @Test
+    public void test8() {
+        List<String> list = new ArrayList<String>() {{
+            add("1");
+            add("2");
+        }};
+
+        list.remove(0);
+
+        log.info("{}", list);
+    }
 }
 }

+ 1 - 2
src/test/java/com/mokamrp/WebTest.java

@@ -110,7 +110,6 @@ public class WebTest {
 
 
     @Test
     @Test
     public void test4() {
     public void test4() {
-        Object o = coralApiService.getBoxInfo("gh_e529abe24cce");
-        log.info("{}", o);
+        syncCreateCashTask.syncCreateCashTask();
     }
     }
 }
 }