|
@@ -2,12 +2,15 @@ package com.mokamrp.privates.controller.pangu;
|
|
|
|
|
|
|
|
import com.mokamrp.privates.constant.HttpStatus;
|
|
import com.mokamrp.privates.constant.HttpStatus;
|
|
|
import com.mokamrp.privates.controller.BaseController;
|
|
import com.mokamrp.privates.controller.BaseController;
|
|
|
-import com.mokamrp.privates.entity.PostBasePageHandle;
|
|
|
|
|
import com.mokamrp.privates.entity.ResHandle;
|
|
import com.mokamrp.privates.entity.ResHandle;
|
|
|
|
|
+import com.mokamrp.privates.entity.pangu.FosterwxCashScheduleTaskListHandle;
|
|
|
import com.mokamrp.privates.help.AjaxResult;
|
|
import com.mokamrp.privates.help.AjaxResult;
|
|
|
|
|
+import com.mokamrp.privates.interceptor.AuthUser;
|
|
|
import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashScheduleTaskList;
|
|
import com.mokamrp.privates.mapper.pangu.pojo.FosterwxCashScheduleTaskList;
|
|
|
|
|
+import com.mokamrp.privates.mapper.pojo.User;
|
|
|
import com.mokamrp.privates.service.pangu.FosterwxCashScheduleTaskListService;
|
|
import com.mokamrp.privates.service.pangu.FosterwxCashScheduleTaskListService;
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.validation.BindingResult;
|
|
import org.springframework.validation.BindingResult;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
@@ -16,6 +19,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
import javax.validation.Valid;
|
|
import javax.validation.Valid;
|
|
|
|
|
+import java.util.Arrays;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
|
|
|
|
|
@@ -32,6 +36,8 @@ import java.util.List;
|
|
|
@Api(tags = "变现-任务列表")
|
|
@Api(tags = "变现-任务列表")
|
|
|
public class FosterwxCashScheduleTaskListController extends BaseController<FosterwxCashScheduleTaskList> {
|
|
public class FosterwxCashScheduleTaskListController extends BaseController<FosterwxCashScheduleTaskList> {
|
|
|
|
|
|
|
|
|
|
+ public static final String REGEX = ",";
|
|
|
|
|
+
|
|
|
@Autowired
|
|
@Autowired
|
|
|
public FosterwxCashScheduleTaskListService fosterwxCashScheduleTaskListService;
|
|
public FosterwxCashScheduleTaskListService fosterwxCashScheduleTaskListService;
|
|
|
|
|
|
|
@@ -42,14 +48,29 @@ public class FosterwxCashScheduleTaskListController extends BaseController<Foste
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
@PostMapping("/list")
|
|
@PostMapping("/list")
|
|
|
- public Object list(@Valid @RequestBody PostBasePageHandle postBasePageHandle, BindingResult bindingResult) {
|
|
|
|
|
|
|
+ @ApiOperation(value = "获取任务列表")
|
|
|
|
|
+ public Object list(@Valid @RequestBody FosterwxCashScheduleTaskListHandle handle, BindingResult bindingResult) {
|
|
|
if (bindingResult.hasErrors()) {
|
|
if (bindingResult.hasErrors()) {
|
|
|
return AjaxResult.error(HttpStatus.ERROR, bindingResult.getFieldError().getDefaultMessage());
|
|
return AjaxResult.error(HttpStatus.ERROR, bindingResult.getFieldError().getDefaultMessage());
|
|
|
}
|
|
}
|
|
|
- ResHandle<List<FosterwxCashScheduleTaskList>> res = fosterwxCashScheduleTaskListService.getList(postBasePageHandle);
|
|
|
|
|
|
|
+ ResHandle<List<FosterwxCashScheduleTaskList>> res = fosterwxCashScheduleTaskListService.getList(handle);
|
|
|
return AjaxResult.success(res);
|
|
return AjaxResult.success(res);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @PostMapping("/cancelTask")
|
|
|
|
|
+ @ApiOperation(value = "取消任务按钮")
|
|
|
|
|
+ public Object cancelTask(FosterwxCashScheduleTaskListHandle handle, @AuthUser User user) {
|
|
|
|
|
+ Arrays.asList(handle.getIds().split(REGEX)).forEach(id -> fosterwxCashScheduleTaskListService.cancelTask(Integer.valueOf(id), user.getId()));
|
|
|
|
|
+
|
|
|
|
|
+ return AjaxResult.success("取消任务成功");
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ @PostMapping("/reCreate")
|
|
|
|
|
+ @ApiOperation("重新生成")
|
|
|
|
|
+ public Object reCreate(FosterwxCashScheduleTaskList fosterwxCashScheduleTaskList) {
|
|
|
|
|
+ //TODO 等typer接口
|
|
|
|
|
+
|
|
|
|
|
+ return AjaxResult.success("重新生成成功");
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|