|
|
@@ -16,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.time.LocalDateTime;
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
|
@@ -46,6 +47,7 @@ public class FosterwxCashAccountScheduleServiceImpl extends ServiceImpl<Fosterwx
|
|
|
* @param handle
|
|
|
* @return
|
|
|
*/
|
|
|
+ @Override
|
|
|
public ResHandle<List<FosterwxCashAccountSchedule>> getList(FosterwxCashAccountScheduleHandle handle) {
|
|
|
Integer pagesize = handle.getPageSize();
|
|
|
Integer page = handle.getPage();
|
|
|
@@ -54,6 +56,7 @@ public class FosterwxCashAccountScheduleServiceImpl extends ServiceImpl<Fosterwx
|
|
|
fosterwxCashAccountScheduleLambdaQueryWrapper.eq(FosterwxCashAccountSchedule::getScheduleDate, handle.getScheduleDate());
|
|
|
// 任务类型 1:个微任务 2:企微任务
|
|
|
fosterwxCashAccountScheduleLambdaQueryWrapper.eq(FosterwxCashAccountSchedule::getType, handle.getType());
|
|
|
+
|
|
|
// 任务模板
|
|
|
if (null != handle.getTemplateId())
|
|
|
fosterwxCashAccountScheduleLambdaQueryWrapper.eq(FosterwxCashAccountSchedule::getTemplateId, handle.getTemplateId());
|
|
|
@@ -79,13 +82,17 @@ public class FosterwxCashAccountScheduleServiceImpl extends ServiceImpl<Fosterwx
|
|
|
*
|
|
|
*/
|
|
|
@Override
|
|
|
- public void createTask(Integer id) {
|
|
|
+ public List<FosterwxCashScheduleTaskList> createTask(Integer id) {
|
|
|
FosterwxCashAccountSchedule fosterwxCashAccountSchedule = fosterwxCashAccountScheduleMapper.selectById(id);
|
|
|
|
|
|
if (null != fosterwxCashAccountSchedule) {
|
|
|
+ // 该接口由立即生成和任务链接生成失败后两种调用方式 因此 在生成任务之前要删除旧任务
|
|
|
+ fosterwxCashScheduleTaskListMapper.delete(new LambdaQueryWrapper<FosterwxCashScheduleTaskList>().eq(FosterwxCashScheduleTaskList::getScheduleId, id));
|
|
|
+
|
|
|
// 根据任务模板id获取任务模板详情
|
|
|
ResHandle<List<FosterwxCashTaskList>> resHandle = fosterwxCashTaskTemplateService.getTaskByTemplateId(fosterwxCashAccountSchedule.getTemplateId());
|
|
|
|
|
|
+ List<FosterwxCashScheduleTaskList> newsList = new ArrayList<>();
|
|
|
resHandle.getList().forEach(fosterwxCashTaskList -> {
|
|
|
// 创建任务
|
|
|
FosterwxCashScheduleTaskList fosterwxCashScheduleTaskList = new FosterwxCashScheduleTaskList();
|
|
|
@@ -96,7 +103,6 @@ public class FosterwxCashAccountScheduleServiceImpl extends ServiceImpl<Fosterwx
|
|
|
fosterwxCashScheduleTaskList.setTaskType(fosterwxCashTaskList.getTaskType());
|
|
|
fosterwxCashScheduleTaskList.setRemark(fosterwxCashTaskList.getRemark());
|
|
|
fosterwxCashScheduleTaskList.setTaskContent("");
|
|
|
- //TODO 传递组别 随机获取ghid
|
|
|
fosterwxCashScheduleTaskList.setGhId("");
|
|
|
fosterwxCashScheduleTaskList.setStatus(1);
|
|
|
fosterwxCashScheduleTaskList.setErrInfo("");
|
|
|
@@ -109,14 +115,18 @@ public class FosterwxCashAccountScheduleServiceImpl extends ServiceImpl<Fosterwx
|
|
|
|
|
|
fosterwxCashScheduleTaskListMapper.insert(fosterwxCashScheduleTaskList);
|
|
|
|
|
|
- // 调用typer生成链接
|
|
|
- fosterwxCashScheduleTaskListService.create(fosterwxCashScheduleTaskList);
|
|
|
+ if (4 != fosterwxCashTaskList.getTaskType()) {
|
|
|
+ newsList.add(fosterwxCashScheduleTaskList);
|
|
|
+ }
|
|
|
});
|
|
|
|
|
|
// 任务列表创建完成后 账号排期状态设置成正常
|
|
|
fosterwxCashAccountSchedule.setStatus(1);
|
|
|
fosterwxCashAccountSchedule.setUpdateAt(LocalDateTime.now());
|
|
|
fosterwxCashAccountScheduleMapper.updateById(fosterwxCashAccountSchedule);
|
|
|
+
|
|
|
+ return newsList;
|
|
|
}
|
|
|
+ return null;
|
|
|
}
|
|
|
}
|