|
@@ -22,7 +22,6 @@ import org.springframework.data.domain.Sort.Direction;
|
|
|
import org.springframework.data.jpa.domain.Specification;
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
|
-import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
import org.springframework.web.bind.annotation.DeleteMapping;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
@@ -179,7 +178,12 @@ public class ExamController extends ControllerSupport {
|
|
|
|
|
|
@ApiOperation(value = "新增考试批次", notes = "新增")
|
|
|
@PostMapping()
|
|
|
- public Exam addExam(HttpServletRequest request, @RequestBody Exam exam) {
|
|
|
+ public Exam addExam(@RequestBody Exam exam) {
|
|
|
+ trim(exam);
|
|
|
+
|
|
|
+ if (null == exam.getExamType()) {
|
|
|
+ throw new StatusException("E-001005", "考试类型为空");
|
|
|
+ }
|
|
|
|
|
|
if (null != exam.getBeforeExamRemark() && exam.getBeforeExamRemark().length() > 250000) {
|
|
|
throw new StatusException("E-001002", "考前说明内容过大");
|
|
@@ -205,6 +209,12 @@ public class ExamController extends ControllerSupport {
|
|
|
@ApiOperation(value = "更新考试批次", notes = "更新")
|
|
|
@PutMapping()
|
|
|
public Exam updateExam(@RequestBody Exam exam) {
|
|
|
+ trim(exam);
|
|
|
+
|
|
|
+ if (null == exam.getExamType()) {
|
|
|
+ throw new StatusException("E-001005", "考试类型为空");
|
|
|
+ }
|
|
|
+
|
|
|
if (!examService.checkExamName(exam)) {
|
|
|
throw new StatusException("E-001001", "考试名称已存在,请重新填写");
|
|
|
}
|