|
@@ -0,0 +1,54 @@
|
|
|
|
+package com.qmth.themis.backend.api;
|
|
|
|
+
|
|
|
|
+import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
|
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
|
+import com.qmth.themis.business.constant.SystemConstant;
|
|
|
|
+import com.qmth.themis.business.entity.TBTaskHistory;
|
|
|
|
+import com.qmth.themis.business.enums.TaskTypeEnum;
|
|
|
|
+import com.qmth.themis.business.service.TBTaskHistoryService;
|
|
|
|
+import com.qmth.themis.common.enums.ExceptionResultEnum;
|
|
|
|
+import com.qmth.themis.common.exception.BusinessException;
|
|
|
|
+import com.qmth.themis.common.util.Result;
|
|
|
|
+import com.qmth.themis.common.util.ResultUtil;
|
|
|
|
+import io.swagger.annotations.*;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestMethod;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
|
+
|
|
|
|
+import javax.annotation.Resource;
|
|
|
|
+import java.util.HashMap;
|
|
|
|
+import java.util.Map;
|
|
|
|
+import java.util.Objects;
|
|
|
|
+
|
|
|
|
+/**
|
|
|
|
+ * @Description: 任务 前端控制器
|
|
|
|
+ * @Param:
|
|
|
|
+ * @return:
|
|
|
|
+ * @Author: wangliang
|
|
|
|
+ * @Date: 2020/6/25
|
|
|
|
+ */
|
|
|
|
+@Api(tags = "任务Controller")
|
|
|
|
+@RestController
|
|
|
|
+@RequestMapping("/${prefix.url.admin}/task")
|
|
|
|
+public class TBTaskHistoryController {
|
|
|
|
+
|
|
|
|
+ @Resource
|
|
|
|
+ TBTaskHistoryService tbTaskHistoryService;
|
|
|
|
+
|
|
|
|
+ @ApiOperation(value = "任务查询接口")
|
|
|
|
+ @RequestMapping(value = "/query", method = RequestMethod.GET)
|
|
|
|
+ @ApiResponses({@ApiResponse(code = 200, message = "任务信息", response = TBTaskHistory.class)})
|
|
|
|
+ public Result query(@ApiParam(value = "任务id", required = false) @RequestParam(required = false) Long id, @ApiParam(value = "业务对象id", required = false) @RequestParam(required = false) Long entityId, @ApiParam(value = "任务类型", required = true) @RequestParam Integer type, @ApiParam(value = "任务状态", required = false) @RequestParam(required = false) Integer status, @ApiParam(value = "分页页码", required = true) @RequestParam int pageNumber, @ApiParam(value = "分页数", required = true) @RequestParam int pageSize) {
|
|
|
|
+ if (Objects.isNull(type) || Objects.equals(type, "")) {
|
|
|
|
+ throw new BusinessException(ExceptionResultEnum.TASK_TYPE_IS_NULL);
|
|
|
|
+ }
|
|
|
|
+ if (Objects.isNull(TaskTypeEnum.convertToName(type))) {
|
|
|
|
+ throw new BusinessException(ExceptionResultEnum.TASK_TYPE_ERROR);
|
|
|
|
+ }
|
|
|
|
+ IPage<Map> teExamStudentIPage = tbTaskHistoryService.taskQuery(new Page<>(pageNumber, pageSize), id, entityId, type, status);
|
|
|
|
+ Map map = new HashMap<>();
|
|
|
|
+ map.put(SystemConstant.RECORDS, teExamStudentIPage);
|
|
|
|
+ return ResultUtil.ok(map);
|
|
|
|
+ }
|
|
|
|
+}
|