|
@@ -1,5 +1,27 @@
|
|
package cn.com.qmth.examcloud.core.examwork.api.provider;
|
|
package cn.com.qmth.examcloud.core.examwork.api.provider;
|
|
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
|
+import java.util.Iterator;
|
|
|
|
+import java.util.List;
|
|
|
|
+
|
|
|
|
+import javax.persistence.criteria.Predicate;
|
|
|
|
+
|
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.data.domain.Page;
|
|
|
|
+import org.springframework.data.domain.PageRequest;
|
|
|
|
+import org.springframework.data.domain.Pageable;
|
|
|
|
+import org.springframework.data.domain.Sort;
|
|
|
|
+import org.springframework.data.domain.Sort.Direction;
|
|
|
|
+import org.springframework.data.jpa.domain.Specification;
|
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
+import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
+import org.springframework.web.bind.annotation.RestController;
|
|
|
|
+
|
|
|
|
+import com.google.common.collect.Lists;
|
|
|
|
+
|
|
import cn.com.qmth.examcloud.api.commons.security.bean.UserType;
|
|
import cn.com.qmth.examcloud.api.commons.security.bean.UserType;
|
|
import cn.com.qmth.examcloud.commons.exception.StatusException;
|
|
import cn.com.qmth.examcloud.commons.exception.StatusException;
|
|
import cn.com.qmth.examcloud.core.basic.api.CourseCloudService;
|
|
import cn.com.qmth.examcloud.core.basic.api.CourseCloudService;
|
|
@@ -16,10 +38,8 @@ import cn.com.qmth.examcloud.core.basic.api.response.GetOrgResp;
|
|
import cn.com.qmth.examcloud.core.basic.api.response.GetStudentResp;
|
|
import cn.com.qmth.examcloud.core.basic.api.response.GetStudentResp;
|
|
import cn.com.qmth.examcloud.core.examwork.dao.ExamPaperTypeRelationRepo;
|
|
import cn.com.qmth.examcloud.core.examwork.dao.ExamPaperTypeRelationRepo;
|
|
import cn.com.qmth.examcloud.core.examwork.dao.ExamRepo;
|
|
import cn.com.qmth.examcloud.core.examwork.dao.ExamRepo;
|
|
-import cn.com.qmth.examcloud.core.examwork.dao.ExamStageRepo;
|
|
|
|
import cn.com.qmth.examcloud.core.examwork.dao.ExamStudentRepo;
|
|
import cn.com.qmth.examcloud.core.examwork.dao.ExamStudentRepo;
|
|
import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamEntity;
|
|
import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamEntity;
|
|
-import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamStageEntity;
|
|
|
|
import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamStudentEntity;
|
|
import cn.com.qmth.examcloud.core.examwork.dao.entity.ExamStudentEntity;
|
|
import cn.com.qmth.examcloud.core.examwork.service.ExamService;
|
|
import cn.com.qmth.examcloud.core.examwork.service.ExamService;
|
|
import cn.com.qmth.examcloud.core.examwork.service.ExamStudentService;
|
|
import cn.com.qmth.examcloud.core.examwork.service.ExamStudentService;
|
|
@@ -27,34 +47,25 @@ import cn.com.qmth.examcloud.core.examwork.service.bean.ExamStudentInfo;
|
|
import cn.com.qmth.examcloud.examwork.api.ExamStudentCloudService;
|
|
import cn.com.qmth.examcloud.examwork.api.ExamStudentCloudService;
|
|
import cn.com.qmth.examcloud.examwork.api.bean.ExamStudentBean;
|
|
import cn.com.qmth.examcloud.examwork.api.bean.ExamStudentBean;
|
|
import cn.com.qmth.examcloud.examwork.api.bean.ExamStudentBean4Reset;
|
|
import cn.com.qmth.examcloud.examwork.api.bean.ExamStudentBean4Reset;
|
|
-import cn.com.qmth.examcloud.examwork.api.request.*;
|
|
|
|
-import cn.com.qmth.examcloud.examwork.api.response.*;
|
|
|
|
|
|
+import cn.com.qmth.examcloud.examwork.api.request.CopyExamStudentsReq;
|
|
|
|
+import cn.com.qmth.examcloud.examwork.api.request.GetExamStudentPageReq;
|
|
|
|
+import cn.com.qmth.examcloud.examwork.api.request.GetExamStudentReq;
|
|
|
|
+import cn.com.qmth.examcloud.examwork.api.request.ResetExamStudentReq;
|
|
|
|
+import cn.com.qmth.examcloud.examwork.api.request.SaveExamStudentReq;
|
|
|
|
+import cn.com.qmth.examcloud.examwork.api.request.UpdateExamStudentStatusReq;
|
|
|
|
+import cn.com.qmth.examcloud.examwork.api.response.CopyExamStudentsResp;
|
|
|
|
+import cn.com.qmth.examcloud.examwork.api.response.GetExamStudentPageResp;
|
|
|
|
+import cn.com.qmth.examcloud.examwork.api.response.GetExamStudentResp;
|
|
|
|
+import cn.com.qmth.examcloud.examwork.api.response.ResetExamStudentResp;
|
|
|
|
+import cn.com.qmth.examcloud.examwork.api.response.SaveExamStudentResp;
|
|
|
|
+import cn.com.qmth.examcloud.examwork.api.response.UpdateExamStudentStatusResp;
|
|
import cn.com.qmth.examcloud.reports.commons.bean.OperateReport;
|
|
import cn.com.qmth.examcloud.reports.commons.bean.OperateReport;
|
|
import cn.com.qmth.examcloud.reports.commons.enums.OperateContent;
|
|
import cn.com.qmth.examcloud.reports.commons.enums.OperateContent;
|
|
import cn.com.qmth.examcloud.reports.commons.util.ReportsUtil;
|
|
import cn.com.qmth.examcloud.reports.commons.util.ReportsUtil;
|
|
import cn.com.qmth.examcloud.web.helpers.GlobalHelper;
|
|
import cn.com.qmth.examcloud.web.helpers.GlobalHelper;
|
|
import cn.com.qmth.examcloud.web.support.ControllerSupport;
|
|
import cn.com.qmth.examcloud.web.support.ControllerSupport;
|
|
-import com.google.common.collect.Lists;
|
|
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.Api;
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
-import org.apache.commons.lang3.StringUtils;
|
|
|
|
-import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
-import org.springframework.data.domain.Page;
|
|
|
|
-import org.springframework.data.domain.PageRequest;
|
|
|
|
-import org.springframework.data.domain.Pageable;
|
|
|
|
-import org.springframework.data.domain.Sort;
|
|
|
|
-import org.springframework.data.domain.Sort.Direction;
|
|
|
|
-import org.springframework.data.jpa.domain.Specification;
|
|
|
|
-import org.springframework.transaction.annotation.Transactional;
|
|
|
|
-import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
-import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
|
-import org.springframework.web.bind.annotation.RestController;
|
|
|
|
-
|
|
|
|
-import javax.persistence.criteria.Predicate;
|
|
|
|
-import java.util.ArrayList;
|
|
|
|
-import java.util.Iterator;
|
|
|
|
-import java.util.List;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
* {@link StatusException} 状态码范围:088XXX<br>
|
|
* {@link StatusException} 状态码范围:088XXX<br>
|
|
@@ -93,8 +104,6 @@ public class ExamStudentCloudServiceProvider extends ControllerSupport
|
|
@Autowired
|
|
@Autowired
|
|
CourseCloudService courseCloudService;
|
|
CourseCloudService courseCloudService;
|
|
@Autowired
|
|
@Autowired
|
|
- private ExamStageRepo examStageRepo;
|
|
|
|
- @Autowired
|
|
|
|
ExamPaperTypeRelationRepo examPaperTypeRelationRepo;
|
|
ExamPaperTypeRelationRepo examPaperTypeRelationRepo;
|
|
|
|
|
|
@ApiOperation(value = "保存考生")
|
|
@ApiOperation(value = "保存考生")
|
|
@@ -134,13 +143,7 @@ public class ExamStudentCloudServiceProvider extends ControllerSupport
|
|
|
|
|
|
info.setExamStageId(req.getExamStageId());
|
|
info.setExamStageId(req.getExamStageId());
|
|
info.setExamStageOrder(req.getExamStageOrder());
|
|
info.setExamStageOrder(req.getExamStageOrder());
|
|
- if(req.getExamStageOrder()!=null) {
|
|
|
|
- ExamStageEntity esEntity = examStageRepo.findByExamIdAndStageOrder(req.getExamId(), req.getExamStageOrder());
|
|
|
|
- if(esEntity==null) {
|
|
|
|
- throw new StatusException("该场次号还未创建,场次号:"+req.getExamStageOrder());
|
|
|
|
- }
|
|
|
|
- info.setExamStageId(esEntity.getId());
|
|
|
|
- }
|
|
|
|
|
|
+
|
|
|
|
|
|
ExamStudentInfo saved = examStudentService.saveExamStudent(info);
|
|
ExamStudentInfo saved = examStudentService.saveExamStudent(info);
|
|
|
|
|
|
@@ -175,7 +178,7 @@ public class ExamStudentCloudServiceProvider extends ControllerSupport
|
|
OperateContent.EXAM_STUDENT_IMPORT.getDesc()));
|
|
OperateContent.EXAM_STUDENT_IMPORT.getDesc()));
|
|
return resp;
|
|
return resp;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
@ApiOperation(value = "复制考生")
|
|
@ApiOperation(value = "复制考生")
|
|
@PostMapping("copyExamStudents")
|
|
@PostMapping("copyExamStudents")
|
|
@Transactional
|
|
@Transactional
|