|
@@ -1,7 +1,5 @@
|
|
package com.qmth.distributed.print.api;
|
|
package com.qmth.distributed.print.api;
|
|
|
|
|
|
-import com.qmth.boot.api.annotation.Aac;
|
|
|
|
-import com.qmth.boot.api.annotation.BOOL;
|
|
|
|
import com.qmth.boot.api.constant.ApiConstant;
|
|
import com.qmth.boot.api.constant.ApiConstant;
|
|
import com.qmth.boot.api.exception.ApiException;
|
|
import com.qmth.boot.api.exception.ApiException;
|
|
import com.qmth.distributed.print.business.bean.dto.ExamTaskDetailCardDto;
|
|
import com.qmth.distributed.print.business.bean.dto.ExamTaskDetailCardDto;
|
|
@@ -10,7 +8,6 @@ import com.qmth.distributed.print.business.bean.dto.ExamTaskPrintDto;
|
|
import com.qmth.distributed.print.business.bean.params.ApproveFormParams;
|
|
import com.qmth.distributed.print.business.bean.params.ApproveFormParams;
|
|
import com.qmth.distributed.print.business.bean.params.ExamTaskApplyParam;
|
|
import com.qmth.distributed.print.business.bean.params.ExamTaskApplyParam;
|
|
import com.qmth.distributed.print.business.bean.params.ExamTaskPrintParams;
|
|
import com.qmth.distributed.print.business.bean.params.ExamTaskPrintParams;
|
|
-import com.qmth.distributed.print.business.bean.params.PrintPlanParams;
|
|
|
|
import com.qmth.distributed.print.business.bean.result.EditResult;
|
|
import com.qmth.distributed.print.business.bean.result.EditResult;
|
|
import com.qmth.distributed.print.business.entity.*;
|
|
import com.qmth.distributed.print.business.entity.*;
|
|
import com.qmth.distributed.print.business.enums.ExamStatusEnum;
|
|
import com.qmth.distributed.print.business.enums.ExamStatusEnum;
|
|
@@ -18,10 +15,8 @@ import com.qmth.distributed.print.business.enums.MakeMethodEnum;
|
|
import com.qmth.distributed.print.business.enums.MessageEnum;
|
|
import com.qmth.distributed.print.business.enums.MessageEnum;
|
|
import com.qmth.distributed.print.business.enums.ReviewStatusEnum;
|
|
import com.qmth.distributed.print.business.enums.ReviewStatusEnum;
|
|
import com.qmth.distributed.print.business.service.*;
|
|
import com.qmth.distributed.print.business.service.*;
|
|
-import com.qmth.distributed.print.business.templete.execute.AsyncCreatePdfTempleteService;
|
|
|
|
import com.qmth.distributed.print.business.templete.execute.AsyncTaskReviewSampleExportService;
|
|
import com.qmth.distributed.print.business.templete.execute.AsyncTaskReviewSampleExportService;
|
|
import com.qmth.teachcloud.common.bean.params.ArraysParams;
|
|
import com.qmth.teachcloud.common.bean.params.ArraysParams;
|
|
-import com.qmth.teachcloud.common.contant.SpringContextHolder;
|
|
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
import com.qmth.teachcloud.common.contant.SystemConstant;
|
|
import com.qmth.teachcloud.common.entity.BasicAttachment;
|
|
import com.qmth.teachcloud.common.entity.BasicAttachment;
|
|
import com.qmth.teachcloud.common.entity.SysUser;
|
|
import com.qmth.teachcloud.common.entity.SysUser;
|
|
@@ -29,7 +24,6 @@ import com.qmth.teachcloud.common.entity.TBTask;
|
|
import com.qmth.teachcloud.common.enums.*;
|
|
import com.qmth.teachcloud.common.enums.*;
|
|
import com.qmth.teachcloud.common.service.BasicAttachmentService;
|
|
import com.qmth.teachcloud.common.service.BasicAttachmentService;
|
|
import com.qmth.teachcloud.common.service.BasicStudentService;
|
|
import com.qmth.teachcloud.common.service.BasicStudentService;
|
|
-import com.qmth.teachcloud.common.service.TBTaskService;
|
|
|
|
import com.qmth.teachcloud.common.util.Result;
|
|
import com.qmth.teachcloud.common.util.Result;
|
|
import com.qmth.teachcloud.common.util.ResultUtil;
|
|
import com.qmth.teachcloud.common.util.ResultUtil;
|
|
import com.qmth.teachcloud.common.util.ServletUtil;
|
|
import com.qmth.teachcloud.common.util.ServletUtil;
|
|
@@ -39,13 +33,15 @@ import org.activiti.engine.task.Task;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.util.CollectionUtils;
|
|
import org.springframework.util.CollectionUtils;
|
|
import org.springframework.validation.BindingResult;
|
|
import org.springframework.validation.BindingResult;
|
|
|
|
+import org.springframework.validation.annotation.Validated;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
import javax.annotation.Resource;
|
|
-import javax.servlet.http.HttpServletRequest;
|
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.servlet.http.HttpServletResponse;
|
|
import javax.validation.Valid;
|
|
import javax.validation.Valid;
|
|
|
|
+import javax.validation.constraints.Max;
|
|
|
|
+import javax.validation.constraints.Min;
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
import java.util.*;
|
|
import java.util.*;
|
|
import java.util.stream.Collectors;
|
|
import java.util.stream.Collectors;
|
|
@@ -61,7 +57,7 @@ import java.util.stream.Collectors;
|
|
@Api(tags = "命题任务Controller")
|
|
@Api(tags = "命题任务Controller")
|
|
@RestController
|
|
@RestController
|
|
@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + "/${prefix.url.exam}/task")
|
|
@RequestMapping(ApiConstant.DEFAULT_URI_PREFIX + "/${prefix.url.exam}/task")
|
|
-
|
|
|
|
|
|
+@Validated
|
|
public class ExamTaskController {
|
|
public class ExamTaskController {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
@@ -128,8 +124,8 @@ public class ExamTaskController {
|
|
@RequestParam(required = false) Long endTime,
|
|
@RequestParam(required = false) Long endTime,
|
|
@RequestParam(required = false) String userName,
|
|
@RequestParam(required = false) String userName,
|
|
@RequestParam(required = false) String createName,
|
|
@RequestParam(required = false) String createName,
|
|
- @RequestParam Integer pageNumber,
|
|
|
|
- @RequestParam Integer pageSize) {
|
|
|
|
|
|
+ @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
|
|
|
|
+ @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
|
|
return ResultUtil.ok(examTaskService.list(enable, status, SystemConstant.convertIdToLong(cardRuleId), courseCode, paperNumber, startTime, endTime, userName, createName, pageNumber, pageSize));
|
|
return ResultUtil.ok(examTaskService.list(enable, status, SystemConstant.convertIdToLong(cardRuleId), courseCode, paperNumber, startTime, endTime, userName, createName, pageNumber, pageSize));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -289,8 +285,8 @@ public class ExamTaskController {
|
|
@RequestParam(value = "startTime", required = false) Long startTime,
|
|
@RequestParam(value = "startTime", required = false) Long startTime,
|
|
@RequestParam(value = "endTime", required = false) Long endTime,
|
|
@RequestParam(value = "endTime", required = false) Long endTime,
|
|
@RequestParam(value = "userName", required = false) String userName,
|
|
@RequestParam(value = "userName", required = false) String userName,
|
|
- @RequestParam("pageNumber") Integer pageNumber,
|
|
|
|
- @RequestParam("pageSize") Integer pageSize) {
|
|
|
|
|
|
+ @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
|
|
|
|
+ @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
|
|
return ResultUtil.ok(examTaskService.listTaskApply(auditStatus, SystemConstant.convertIdToLong(cardRuleId), courseCode, paperNumber, startTime, endTime, userName, pageNumber, pageSize));
|
|
return ResultUtil.ok(examTaskService.listTaskApply(auditStatus, SystemConstant.convertIdToLong(cardRuleId), courseCode, paperNumber, startTime, endTime, userName, pageNumber, pageSize));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -372,8 +368,8 @@ public class ExamTaskController {
|
|
@RequestParam(value = "startCreateTime", required = false) Long startCreateTime,
|
|
@RequestParam(value = "startCreateTime", required = false) Long startCreateTime,
|
|
@RequestParam(value = "endCreateTime", required = false) Long endCreateTime,
|
|
@RequestParam(value = "endCreateTime", required = false) Long endCreateTime,
|
|
@RequestParam(value = "createName", required = false) String createName,
|
|
@RequestParam(value = "createName", required = false) String createName,
|
|
- @RequestParam("pageNumber") Integer pageNumber,
|
|
|
|
- @RequestParam("pageSize") Integer pageSize) {
|
|
|
|
|
|
+ @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
|
|
|
|
+ @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
|
|
return ResultUtil.ok(examTaskService.listTaskReviewUnaudited(courseCode, paperNumber, userId, SystemConstant.convertIdToLong(cardRuleId), startTime, endTime, startCreateTime, endCreateTime, createName, pageNumber, pageSize));
|
|
return ResultUtil.ok(examTaskService.listTaskReviewUnaudited(courseCode, paperNumber, userId, SystemConstant.convertIdToLong(cardRuleId), startTime, endTime, startCreateTime, endCreateTime, createName, pageNumber, pageSize));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -406,8 +402,8 @@ public class ExamTaskController {
|
|
@RequestParam(value = "startCreateTime", required = false) Long startCreateTime,
|
|
@RequestParam(value = "startCreateTime", required = false) Long startCreateTime,
|
|
@RequestParam(value = "endCreateTime", required = false) Long endCreateTime,
|
|
@RequestParam(value = "endCreateTime", required = false) Long endCreateTime,
|
|
@RequestParam(value = "createName", required = false) String createName,
|
|
@RequestParam(value = "createName", required = false) String createName,
|
|
- @RequestParam("pageNumber") Integer pageNumber,
|
|
|
|
- @RequestParam("pageSize") Integer pageSize) {
|
|
|
|
|
|
+ @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
|
|
|
|
+ @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
|
|
return ResultUtil.ok(examTaskService.listTaskReviewAudited(reviewStatus, courseCode, paperNumber, userId, SystemConstant.convertIdToLong(cardRuleId), startTime, endTime, startCreateTime, endCreateTime, createName, pageNumber, pageSize));
|
|
return ResultUtil.ok(examTaskService.listTaskReviewAudited(reviewStatus, courseCode, paperNumber, userId, SystemConstant.convertIdToLong(cardRuleId), startTime, endTime, startCreateTime, endCreateTime, createName, pageNumber, pageSize));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -516,8 +512,8 @@ public class ExamTaskController {
|
|
@RequestParam(value = "endTime", required = false) Long endTime,
|
|
@RequestParam(value = "endTime", required = false) Long endTime,
|
|
@RequestParam(value = "makeMethod", required = false) MakeMethodEnum makeMethod,
|
|
@RequestParam(value = "makeMethod", required = false) MakeMethodEnum makeMethod,
|
|
@RequestParam(value = "cardRuleId", required = false) String cardRuleId,
|
|
@RequestParam(value = "cardRuleId", required = false) String cardRuleId,
|
|
- @RequestParam("pageNumber") Integer pageNumber,
|
|
|
|
- @RequestParam("pageSize") Integer pageSize) {
|
|
|
|
|
|
+ @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
|
|
|
|
+ @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
|
|
return ResultUtil.ok(examTaskService.listTaskPaper(courseCode, paperNumber, startTime, endTime, makeMethod, SystemConstant.convertIdToLong(cardRuleId), pageNumber, pageSize));
|
|
return ResultUtil.ok(examTaskService.listTaskPaper(courseCode, paperNumber, startTime, endTime, makeMethod, SystemConstant.convertIdToLong(cardRuleId), pageNumber, pageSize));
|
|
}
|
|
}
|
|
|
|
|
|
@@ -775,8 +771,8 @@ public class ExamTaskController {
|
|
@ApiOperation(value = "卷库查询-发布印刷任务-查看考生")
|
|
@ApiOperation(value = "卷库查询-发布印刷任务-查看考生")
|
|
@RequestMapping(value = "/list_task_print_student", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/list_task_print_student", method = RequestMethod.POST)
|
|
public Result listTaskPrintStudent(@RequestParam(value = "classId") String classId,
|
|
public Result listTaskPrintStudent(@RequestParam(value = "classId") String classId,
|
|
- @RequestParam Integer pageNumber,
|
|
|
|
- @RequestParam Integer pageSize) {
|
|
|
|
|
|
+ @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
|
|
|
|
+ @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
|
|
Set<Long> classIds = Arrays.stream(classId.split(",")).map(SystemConstant::convertIdToLong).collect(Collectors.toSet());
|
|
Set<Long> classIds = Arrays.stream(classId.split(",")).map(SystemConstant::convertIdToLong).collect(Collectors.toSet());
|
|
return ResultUtil.ok(basicStudentService.basicStudentPage(null, null, classIds, pageNumber, pageSize));
|
|
return ResultUtil.ok(basicStudentService.basicStudentPage(null, null, classIds, pageNumber, pageSize));
|
|
}
|
|
}
|
|
@@ -817,7 +813,7 @@ public class ExamTaskController {
|
|
throw ExceptionResultEnum.ERROR.exception(bindingResult.getAllErrors().get(0).getDefaultMessage());
|
|
throw ExceptionResultEnum.ERROR.exception(bindingResult.getAllErrors().get(0).getDefaultMessage());
|
|
}
|
|
}
|
|
HttpServletResponse response = ServletUtil.getResponse();
|
|
HttpServletResponse response = ServletUtil.getResponse();
|
|
- examTaskService.findExamTaskApprovalPdf(response,approveFormParams.getExamTaskId(), approveFormParams.getHtmlContent());
|
|
|
|
|
|
+ examTaskService.findExamTaskApprovalPdf(response, approveFormParams.getExamTaskId(), approveFormParams.getHtmlContent());
|
|
}
|
|
}
|
|
|
|
|
|
@ApiOperation(value = "命题任务-考试对象查询")
|
|
@ApiOperation(value = "命题任务-考试对象查询")
|