| | |
| | | import io.swagger.annotations.ApiParam; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import lombok.AllArgsConstructor; |
| | | |
| | | import javax.validation.Valid; |
| | | |
| | | import org.springblade.core.mp.support.Condition; |
| | |
| | | import org.springblade.modules.task.vo.TaskVO; |
| | | import org.springblade.modules.task.service.ITaskService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 控制器 |
| | |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入task") |
| | | public R save(@Valid @RequestBody Task task) { |
| | | task.setStatus(1); |
| | | task.setStatus(2); |
| | | return R.status(taskService.save(task)); |
| | | } |
| | | |
| | |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入task") |
| | | public R update(@Valid @RequestBody Task task) { |
| | | return R.status(taskService.updateById(task)); |
| | | } |
| | | |
| | | /** |
| | | * 任务处理 |
| | | */ |
| | | @PostMapping("/updatechuli") |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入task") |
| | | public R updatechuli(@Valid @RequestBody Task task) { |
| | | task.setStatus(0); |
| | | return R.status(taskService.updateById(task)); |
| | | } |
| | | |
| | |
| | | return R.status(taskService.deleteLogic(Func.toLongList(ids))); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 统计待处理任务数量 |
| | | * |
| | | * @param task |
| | | * @return |
| | | */ |
| | | @GetMapping("/selectCount") |
| | | public R selectCount(Task task) { |
| | | int i = taskService.selectCount(task.getTaskUser()); |
| | | Map map = new HashMap(); |
| | | map.put("num",i); |
| | | return R.data(map); |
| | | } |
| | | } |