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