|
|
@@ -6,15 +6,16 @@ import com.mokamrp.privates.controller.BaseController;
|
|
|
import com.mokamrp.privates.entity.ResHandle;
|
|
|
import com.mokamrp.privates.entity.VoltaHandle;
|
|
|
import com.mokamrp.privates.entity.pangu.FosterwxCashAccountScheduleHandle;
|
|
|
+import com.mokamrp.privates.entity.pangu.FosterwxCashScheduleTaskListHandle;
|
|
|
import com.mokamrp.privates.help.AjaxResult;
|
|
|
import com.mokamrp.privates.help.Analysis;
|
|
|
import com.mokamrp.privates.interceptor.AuthUser;
|
|
|
import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashAccountSchedule;
|
|
|
import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashScheduleTaskList;
|
|
|
-import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashTaskList;
|
|
|
import com.mokamrp.privates.mapper.pojo.User;
|
|
|
import com.mokamrp.privates.service.pangu.FosterwxCashAccountScheduleService;
|
|
|
import com.mokamrp.privates.service.pangu.FosterwxCashScheduleTaskListService;
|
|
|
+import com.mokamrp.privates.service.pangu.FosterwxCashTaskListService;
|
|
|
import com.mokamrp.privates.service.pangu.FosterwxCashTaskTemplateService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
@@ -56,6 +57,9 @@ public class FosterwxCashAccountScheduleController extends BaseController<Foster
|
|
|
@Autowired
|
|
|
public FosterwxCashTaskTemplateService fosterwxCashTaskTemplateService;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ public FosterwxCashTaskListService fosterwxCashTaskListService;
|
|
|
+
|
|
|
/*
|
|
|
* @fast
|
|
|
* 默认生成的控制器所继承的父类中有index/add/edit/del四个基础方法,均为post json请求
|
|
|
@@ -125,8 +129,8 @@ public class FosterwxCashAccountScheduleController extends BaseController<Foster
|
|
|
|
|
|
@PostMapping("/immediateCreate")
|
|
|
@Transactional(rollbackFor = Exception.class)
|
|
|
- @ApiOperation(value = "立即生成")
|
|
|
- public Object immediateCreate(FosterwxCashAccountScheduleHandle handle) {
|
|
|
+ @ApiOperation(value = "生成")
|
|
|
+ public Object immediateCreate(@RequestBody FosterwxCashAccountScheduleHandle handle) {
|
|
|
Arrays.asList(handle.getIds().split(REGEX)).forEach(id -> {
|
|
|
List<FosterwxCashScheduleTaskList> newsList = fosterwxCashAccountScheduleService.createTask(Integer.valueOf(id));
|
|
|
// 由于不能浪费公众号发文为 需要整合起来一起发送
|
|
|
@@ -134,20 +138,26 @@ public class FosterwxCashAccountScheduleController extends BaseController<Foster
|
|
|
fosterwxCashScheduleTaskListService.create(newsList);
|
|
|
});
|
|
|
|
|
|
- return AjaxResult.success("立即生成成功");
|
|
|
+ return AjaxResult.success("生成成功");
|
|
|
}
|
|
|
|
|
|
@PostMapping("/preview")
|
|
|
- @ApiOperation(value = "预览按钮")
|
|
|
- public Object priview(FosterwxCashAccountScheduleHandle handle) {
|
|
|
- ResHandle<List<FosterwxCashTaskList>> resHandle = fosterwxCashTaskTemplateService.getTaskByTemplateId(handle.getTemplateId());
|
|
|
+ @ApiOperation(value = "预览按钮 只需要传任务排期的id")
|
|
|
+ public Object priview(@RequestBody FosterwxCashAccountScheduleHandle handle) {
|
|
|
+ FosterwxCashScheduleTaskListHandle fosterwxCashScheduleTaskListHandle = new FosterwxCashScheduleTaskListHandle();
|
|
|
+ fosterwxCashScheduleTaskListHandle.setPage(1);
|
|
|
+ fosterwxCashScheduleTaskListHandle.setPageSize(100000);
|
|
|
+ fosterwxCashScheduleTaskListHandle.setScheduleId(handle.getId());
|
|
|
+ ResHandle<List<FosterwxCashScheduleTaskList>> resHandle = fosterwxCashScheduleTaskListService.getList(fosterwxCashScheduleTaskListHandle);
|
|
|
+
|
|
|
+ resHandle.getList().forEach(fosterwxCashScheduleTaskList -> fosterwxCashScheduleTaskList.setFosterwxCashTaskList(fosterwxCashTaskListService.getById(fosterwxCashScheduleTaskList.getTaskId())));
|
|
|
|
|
|
return AjaxResult.success(resHandle);
|
|
|
}
|
|
|
|
|
|
@PostMapping("/cancelTask")
|
|
|
@ApiOperation(value = "取消任务按钮")
|
|
|
- public Object cancelTask(FosterwxCashAccountScheduleHandle handle, @AuthUser User user) {
|
|
|
+ public Object cancelTask(@RequestBody FosterwxCashAccountScheduleHandle handle, @AuthUser User user) {
|
|
|
Arrays.asList(handle.getIds().split(REGEX)).forEach(id -> {
|
|
|
fosterwxCashAccountScheduleService.updateById(new FosterwxCashAccountSchedule() {{
|
|
|
setId(Integer.valueOf(id));
|