|
@@ -14,6 +14,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.dao.DataIntegrityViolationException;
|
|
|
import org.springframework.data.domain.Example;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
|
import cn.com.qmth.examcloud.commons.exception.StatusException;
|
|
|
import cn.com.qmth.examcloud.commons.util.DateUtil;
|
|
@@ -242,6 +243,13 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public ExamStudentInfo saveExamStudent(ExamStudentInfo examStudentInfo) {
|
|
|
+ ExamStudentInfo savedExamStudent = examStudentService.saveExamStudentData(examStudentInfo);
|
|
|
+ examStudentService.syncExamStudent(savedExamStudent);
|
|
|
+ return savedExamStudent;
|
|
|
+ }
|
|
|
+
|
|
|
/*
|
|
|
* 实现
|
|
|
*
|
|
@@ -251,8 +259,9 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
|
* saveExamStudent(cn.com.qmth.examcloud.core.examwork.service.bean.
|
|
|
* ExamStudentInfo)
|
|
|
*/
|
|
|
+ @Transactional
|
|
|
@Override
|
|
|
- public ExamStudentInfo saveExamStudent(ExamStudentInfo examStudentInfo) {
|
|
|
+ public ExamStudentInfo saveExamStudentData(ExamStudentInfo examStudentInfo) {
|
|
|
String paperType = examStudentInfo.getPaperType();
|
|
|
String studentCode = examStudentInfo.getStudentCode();
|
|
|
|
|
@@ -433,7 +442,7 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
|
relation.setWeixinAnswerEnabled(true);
|
|
|
relation.setPassScoreLine(Constants.OE_PASSS_CORE_LINE);
|
|
|
relation.setGoodScoreLine(Constants.OE_GOOD_SCORE_LINE);
|
|
|
- examCourseRelationRepo.save(relation);
|
|
|
+ examCourseRelationRepo.saveAndFlush(relation);
|
|
|
} else {
|
|
|
relation.setCourseLevel(saved.getCourseLevel());
|
|
|
relation.setCourseName(saved.getCourseName());
|
|
@@ -460,6 +469,49 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
|
throw new StatusException("500500", "保存考生相关信息异常!", e);
|
|
|
}
|
|
|
|
|
|
+ ExamStudentInfo ret = new ExamStudentInfo();
|
|
|
+ ret.setId(saved.getId());
|
|
|
+
|
|
|
+ ret.setEnable(saved.getEnable());
|
|
|
+
|
|
|
+ ret.setCourseId(courseBean.getId());
|
|
|
+ ret.setCourseCode(courseBean.getCode());
|
|
|
+ ret.setCourseLevel(courseBean.getLevel());
|
|
|
+ ret.setCourseName(courseBean.getName());
|
|
|
+
|
|
|
+ ret.setExamId(exam.getId());
|
|
|
+ ret.setExamName(exam.getName());
|
|
|
+
|
|
|
+ ret.setRootOrgId(saved.getRootOrgId());
|
|
|
+ ret.setStudentName(studentInfo.getName());
|
|
|
+ ret.setIdentityNumber(saved.getIdentityNumber());
|
|
|
+ ret.setStudentCode(saved.getStudentCode());
|
|
|
+ ret.setOrgId(studentInfo.getOrgId());
|
|
|
+ ret.setOrgName(studentInfo.getOrgName());
|
|
|
+ ret.setOrgCode(studentInfo.getOrgCode());
|
|
|
+ ret.setStudentId(studentInfo.getId());
|
|
|
+
|
|
|
+ ret.setPaperType(saved.getPaperType());
|
|
|
+ ret.setRemark(saved.getRemark());
|
|
|
+ ret.setInfoCollector(saved.getInfoCollector());
|
|
|
+ ret.setExamSite(saved.getExamSite());
|
|
|
+
|
|
|
+ ret.setGrade(saved.getGrade());
|
|
|
+ ret.setSpecialtyName(saved.getSpecialtyName());
|
|
|
+ ret.setExamStageId(saved.getExamStageId());
|
|
|
+ ret.setExamStageOrder(saved.getExamStageOrder());
|
|
|
+
|
|
|
+ ret.setExt1(saved.getExt1());
|
|
|
+ ret.setExt2(saved.getExt2());
|
|
|
+ ret.setExt3(saved.getExt3());
|
|
|
+ ret.setExt4(saved.getExt4());
|
|
|
+ ret.setExt5(saved.getExt5());
|
|
|
+
|
|
|
+ return ret;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public void syncExamStudent(ExamStudentInfo saved) {
|
|
|
// 同步操作
|
|
|
SyncExamStudentReq req = new SyncExamStudentReq();
|
|
|
req.setSyncType("update");
|
|
@@ -467,22 +519,22 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
|
|
|
|
req.setEnable(saved.getEnable());
|
|
|
|
|
|
- req.setCourseId(courseBean.getId());
|
|
|
- req.setCourseCode(courseBean.getCode());
|
|
|
- req.setCourseLevel(courseBean.getLevel());
|
|
|
- req.setCourseName(courseBean.getName());
|
|
|
+ req.setCourseId(saved.getCourseId());
|
|
|
+ req.setCourseCode(saved.getCourseCode());
|
|
|
+ req.setCourseLevel(saved.getCourseLevel());
|
|
|
+ req.setCourseName(saved.getCourseName());
|
|
|
|
|
|
- req.setExamId(exam.getId());
|
|
|
- req.setExamName(exam.getName());
|
|
|
+ req.setExamId(saved.getExamId());
|
|
|
+ req.setExamName(saved.getExamName());
|
|
|
|
|
|
req.setRootOrgId(saved.getRootOrgId());
|
|
|
- req.setStudentId(studentInfo.getId());
|
|
|
- req.setStudentName(studentInfo.getName());
|
|
|
+ req.setStudentId(saved.getStudentId());
|
|
|
+ req.setStudentName(saved.getStudentName());
|
|
|
req.setIdentityNumber(saved.getIdentityNumber());
|
|
|
req.setStudentCode(saved.getStudentCode());
|
|
|
- req.setOrgId(studentInfo.getOrgId());
|
|
|
- req.setOrgName(studentInfo.getOrgName());
|
|
|
- req.setOrgCode(studentInfo.getOrgCode());
|
|
|
+ req.setOrgId(saved.getOrgId());
|
|
|
+ req.setOrgName(saved.getOrgName());
|
|
|
+ req.setOrgCode(saved.getOrgCode());
|
|
|
|
|
|
req.setGrade(saved.getGrade());
|
|
|
req.setSpecialtyName(saved.getSpecialtyName());
|
|
@@ -504,33 +556,6 @@ public class ExamStudentServiceImpl implements ExamStudentService {
|
|
|
req.getExamId(), req.getCourseCode(), req.getStudentId(), req.getId(), req.getStudentCode(),
|
|
|
req.getIdentityNumber());
|
|
|
dataSyncCloudService.syncExamStudent(req);
|
|
|
-
|
|
|
- ExamStudentInfo ret = new ExamStudentInfo();
|
|
|
- ret.setId(saved.getId());
|
|
|
-
|
|
|
- ret.setCourseId(courseBean.getId());
|
|
|
- ret.setCourseCode(courseBean.getCode());
|
|
|
- ret.setCourseLevel(courseBean.getLevel());
|
|
|
- ret.setCourseName(courseBean.getName());
|
|
|
-
|
|
|
- ret.setExamId(exam.getId());
|
|
|
- ret.setExamName(exam.getName());
|
|
|
-
|
|
|
- ret.setRootOrgId(saved.getRootOrgId());
|
|
|
- ret.setStudentName(studentInfo.getName());
|
|
|
- ret.setIdentityNumber(saved.getIdentityNumber());
|
|
|
- ret.setStudentCode(saved.getStudentCode());
|
|
|
- ret.setOrgId(studentInfo.getOrgId());
|
|
|
- ret.setOrgName(studentInfo.getOrgName());
|
|
|
- ret.setOrgCode(studentInfo.getOrgCode());
|
|
|
- ret.setStudentId(studentInfo.getId());
|
|
|
-
|
|
|
- ret.setPaperType(saved.getPaperType());
|
|
|
- ret.setRemark(saved.getRemark());
|
|
|
- ret.setInfoCollector(saved.getInfoCollector());
|
|
|
- ret.setExamSite(saved.getExamSite());
|
|
|
-
|
|
|
- return ret;
|
|
|
}
|
|
|
|
|
|
@Override
|