|
@@ -135,10 +135,13 @@ public class ExamStudentCloudServiceProvider extends ControllerSupport
|
|
|
|
|
|
ExamStudent examStudent = new ExamStudent();
|
|
|
|
|
|
- // 数据悲观修正 by wangwei
|
|
|
- if (CollectionUtils.isNotEmpty(examStudentList)) {
|
|
|
+ if (1 < examStudentList.size()) {
|
|
|
+ // 数据需要修正
|
|
|
+ throw new StatusException("E-100008", "考生数据重复. studentId: " + studentInfo.getId());
|
|
|
+ } else if (1 == examStudentList.size()) {
|
|
|
examStudent = examStudentList.get(0);
|
|
|
- examStudentRepo.deleteInBatch(examStudentList);
|
|
|
+ } else {
|
|
|
+ examStudent = new ExamStudent();
|
|
|
}
|
|
|
|
|
|
examStudent.setName(studentInfo.getName());
|
|
@@ -155,6 +158,7 @@ public class ExamStudentCloudServiceProvider extends ControllerSupport
|
|
|
SaveExamStudentResp resp = new SaveExamStudentResp();
|
|
|
|
|
|
ExamStudentBean examStudentBean = new ExamStudentBean();
|
|
|
+ examStudentBean.setId(saved.getId());
|
|
|
examStudentBean.setCourseCode(saved.getCourseCode());
|
|
|
examStudentBean.setCourseLevel(saved.getCourseLevel());
|
|
|
examStudentBean.setCourseName(saved.getCourseName());
|