|
@@ -45,6 +45,7 @@ import cn.com.qmth.examcloud.core.examwork.service.ExamStudentService;
|
|
|
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.bean.ExamStudentBean;
|
|
|
+import cn.com.qmth.examcloud.examwork.api.bean.ExamStudentBean4Reset;
|
|
|
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;
|
|
@@ -435,7 +436,7 @@ public class ExamStudentCloudServiceProvider extends ControllerSupport
|
|
|
if (null != examId) {
|
|
|
examEntity = GlobalHelper.getPresentEntity(examRepo, examId, ExamEntity.class);
|
|
|
GlobalHelper.uniformRootOrg(examEntity.getRootOrgId(), rootOrgId);
|
|
|
- } else if (StringUtils.isNotBlank(courseCode)) {
|
|
|
+ } else if (StringUtils.isNotBlank(examCode)) {
|
|
|
examEntity = examRepo.findByCodeAndRootOrgId(examCode, rootOrgId);
|
|
|
if (null == examEntity) {
|
|
|
throw new StatusException("088002", "exam is not present");
|
|
@@ -477,7 +478,96 @@ public class ExamStudentCloudServiceProvider extends ControllerSupport
|
|
|
@Override
|
|
|
public ResetExamStudentResp resetExamStudent(@RequestBody ResetExamStudentReq req) {
|
|
|
|
|
|
+ Long rootOrgId = req.getRootOrgId();
|
|
|
+ Long examId = req.getExamId();
|
|
|
+ String examCode = req.getExamCode();
|
|
|
+ Long studentId = req.getStudentId();
|
|
|
+ String identityNumber = req.getIdentityNumber();
|
|
|
+ String studentName = req.getStudentName();
|
|
|
+ String studentCode = req.getStudentCode();
|
|
|
+
|
|
|
+ if (null == rootOrgId) {
|
|
|
+ throw new StatusException("088001", "rootOrgId is null");
|
|
|
+ }
|
|
|
+
|
|
|
+ ExamEntity examEntity = null;
|
|
|
+ if (null != examId) {
|
|
|
+ examEntity = GlobalHelper.getPresentEntity(examRepo, examId, ExamEntity.class);
|
|
|
+ GlobalHelper.uniformRootOrg(examEntity.getRootOrgId(), rootOrgId);
|
|
|
+ } else if (StringUtils.isNotBlank(examCode)) {
|
|
|
+ examEntity = examRepo.findByCodeAndRootOrgId(examCode, rootOrgId);
|
|
|
+ if (null == examEntity) {
|
|
|
+ throw new StatusException("088002", "exam is not present");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ GetStudentReq gsReq = new GetStudentReq();
|
|
|
+ gsReq.setRootOrgId(rootOrgId);
|
|
|
+ gsReq.setIdentityNumber(identityNumber);
|
|
|
+ gsReq.setStudentId(studentId);
|
|
|
+ gsReq.setStudentCode(studentCode);
|
|
|
+
|
|
|
+ GetStudentResp gsResp = studentCloudService.getStudent(gsReq);
|
|
|
+ StudentBean studentBean = gsResp.getStudentInfo();
|
|
|
+
|
|
|
+ examStudentRepo.updateExamStudnetDisabled(examId, studentBean.getId());
|
|
|
+
|
|
|
+ List<ExamStudentBean4Reset> examStudentList = req.getExamStudentList();
|
|
|
+ List<ExamStudentBean> savedExamStudentList = Lists.newArrayList();
|
|
|
+
|
|
|
+ for (ExamStudentBean4Reset cur : examStudentList) {
|
|
|
+
|
|
|
+ ExamStudentInfo info = new ExamStudentInfo();
|
|
|
+ info.setCourseCode(cur.getCourseCode());
|
|
|
+ info.setCourseName(cur.getCourseName());
|
|
|
+ info.setCourseLevel(cur.getCourseLevel());
|
|
|
+ info.setCourseId(cur.getCourseId());
|
|
|
+ info.setRootOrgId(req.getRootOrgId());
|
|
|
+ info.setExamId(req.getExamId());
|
|
|
+ info.setExamName(examEntity.getName());
|
|
|
+ info.setIdentityNumber(identityNumber);
|
|
|
+ info.setPaperType(cur.getPaperType());
|
|
|
+ info.setStudentCode(studentCode);
|
|
|
+ info.setStudentName(studentName);
|
|
|
+ info.setInfoCollector(cur.getInfoCollector());
|
|
|
+ info.setGrade(cur.getGrade());
|
|
|
+ info.setExamSite(cur.getExamSite());
|
|
|
+ info.setSpecialtyName(cur.getSpecialtyName());
|
|
|
+ info.setRemark(cur.getRemark());
|
|
|
+
|
|
|
+ info.setExt1(cur.getExt1());
|
|
|
+ info.setExt2(cur.getExt2());
|
|
|
+ info.setExt3(cur.getExt3());
|
|
|
+ info.setExt4(cur.getExt4());
|
|
|
+ info.setExt5(cur.getExt5());
|
|
|
+
|
|
|
+ ExamStudentInfo saved = examStudentService.saveExamStudent(info);
|
|
|
+
|
|
|
+ ExamStudentBean examStudentBean = new ExamStudentBean();
|
|
|
+ examStudentBean.setId(saved.getId());
|
|
|
+ examStudentBean.setCourseCode(saved.getCourseCode());
|
|
|
+ examStudentBean.setCourseLevel(saved.getCourseLevel());
|
|
|
+ examStudentBean.setCourseName(saved.getCourseName());
|
|
|
+ examStudentBean.setExamId(saved.getExamId());
|
|
|
+ examStudentBean.setExamName(saved.getExamName());
|
|
|
+ examStudentBean.setIdentityNumber(saved.getIdentityNumber());
|
|
|
+ examStudentBean.setStudentCode(saved.getStudentCode());
|
|
|
+ examStudentBean.setPaperType(saved.getPaperType());
|
|
|
+ examStudentBean.setRootOrgId(saved.getRootOrgId());
|
|
|
+ examStudentBean.setStudentName(saved.getStudentName());
|
|
|
+ examStudentBean.setGrade(saved.getGrade());
|
|
|
+ examStudentBean.setCourseId(saved.getCourseId());
|
|
|
+ examStudentBean.setInfoCollector(saved.getInfoCollector());
|
|
|
+ examStudentBean.setExamSite(saved.getExamSite());
|
|
|
+ examStudentBean.setOrgId(saved.getOrgId());
|
|
|
+ examStudentBean.setOrgCode(saved.getOrgCode());
|
|
|
+ examStudentBean.setOrgName(saved.getOrgName());
|
|
|
+
|
|
|
+ savedExamStudentList.add(examStudentBean);
|
|
|
+ }
|
|
|
+
|
|
|
ResetExamStudentResp resp = new ResetExamStudentResp();
|
|
|
+ resp.setExamStudentList(savedExamStudentList);
|
|
|
return resp;
|
|
|
}
|
|
|
|