|
@@ -70,15 +70,21 @@ public class ExamStudentServiceImpl extends ServiceImpl<ExamStudentMapper, ExamS
|
|
|
if (StringUtils.isBlank(examStudent.getStudentCode())) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("学号必填");
|
|
|
}
|
|
|
+ // 学号去掉空格
|
|
|
+ examStudent.setStudentCode(StringUtils.deleteWhitespace(examStudent.getStudentCode()));
|
|
|
if (StringUtils.isBlank(examStudent.getStudentName())) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("姓名必填");
|
|
|
}
|
|
|
if (StringUtils.isBlank(examStudent.getCourseCode())) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("课程代码必填");
|
|
|
}
|
|
|
+ // 课程代码去掉空格
|
|
|
+ examStudent.setCourseCode(StringUtils.deleteWhitespace(examStudent.getCourseCode()));
|
|
|
if (StringUtils.isBlank(examStudent.getCourseName())) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("课程名称必填");
|
|
|
}
|
|
|
+ // 课程名称去掉空格
|
|
|
+ examStudent.setCourseName(StringUtils.deleteWhitespace(examStudent.getCourseName()));
|
|
|
|
|
|
// 校验是否设置了存储方式
|
|
|
SimpleObject recognitionTypeSimpleObject = commonCacheService.getSysSetting(sysUser.getSchoolId()).get(SysSettingConstant.RECOGNITION_TYPE);
|
|
@@ -104,6 +110,11 @@ public class ExamStudentServiceImpl extends ServiceImpl<ExamStudentMapper, ExamS
|
|
|
examStudent.setSchoolId(sysUser.getSchoolId());
|
|
|
examStudent.setCreateId(sysUser.getId());
|
|
|
examStudent.setCreateTime(System.currentTimeMillis());
|
|
|
+
|
|
|
+ // 考场去掉空格
|
|
|
+ examStudent.setExamRoom(StringUtils.isNotBlank(examStudent.getExamRoom()) ? StringUtils.deleteWhitespace(examStudent.getExamRoom()) : null);
|
|
|
+ // 班级去掉空格
|
|
|
+ examStudent.setClassName(StringUtils.isNotBlank(examStudent.getClassName()) ? StringUtils.deleteWhitespace(examStudent.getClassName()) : null);
|
|
|
boolean save = this.save(examStudent);
|
|
|
|
|
|
if (save) {
|
|
@@ -193,14 +204,14 @@ public class ExamStudentServiceImpl extends ServiceImpl<ExamStudentMapper, ExamS
|
|
|
validStudentData(semesterId, examId, basicStudentList, storeType, sysUser);
|
|
|
// 保存课程
|
|
|
List<ExamCourse> examCourses = examCourseService.saveBatchStudentCourse(examId, basicStudentList);
|
|
|
- // 新建任务
|
|
|
- paperScanTaskService.addBatchScanTask(examId, recognitionType, storeType, examCourses, basicStudentList);
|
|
|
for (ExamCourse examCourse : examCourses) {
|
|
|
this.removeByExamIdAndCourseCode(examId, examCourse.getCourseCode());
|
|
|
}
|
|
|
// 保存学生
|
|
|
this.saveBatch(basicStudentList);
|
|
|
- }catch (Exception e) {
|
|
|
+ // 新建任务
|
|
|
+ paperScanTaskService.addBatchScanTask(examId, recognitionType, storeType, examCourses, basicStudentList);
|
|
|
+ } catch (Exception e) {
|
|
|
throw ExceptionResultEnum.ERROR.exception(e.getMessage());
|
|
|
}
|
|
|
}
|
|
@@ -275,10 +286,21 @@ public class ExamStudentServiceImpl extends ServiceImpl<ExamStudentMapper, ExamS
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- if(StringUtils.isNotBlank(errorMsg.toString())){
|
|
|
+ if (StringUtils.isNotBlank(errorMsg.toString())) {
|
|
|
throw ExceptionResultEnum.ERROR.exception(errorMsg.toString());
|
|
|
}
|
|
|
|
|
|
+ // 学号去掉空格
|
|
|
+ basicStudent.setStudentCode(StringUtils.isNotBlank(basicStudent.getStudentCode()) ? StringUtils.deleteWhitespace(basicStudent.getStudentCode()) : null);
|
|
|
+ // 课程代码去掉空格
|
|
|
+ basicStudent.setCourseCode(StringUtils.isNotBlank(basicStudent.getCourseCode()) ? StringUtils.deleteWhitespace(basicStudent.getCourseCode()) : null);
|
|
|
+ // 课程名称去掉空格
|
|
|
+ basicStudent.setCourseName(StringUtils.isNotBlank(basicStudent.getCourseName()) ? StringUtils.deleteWhitespace(basicStudent.getCourseName()) : null);
|
|
|
+ // 考场去掉空格
|
|
|
+ basicStudent.setExamRoom(StringUtils.isNotBlank(basicStudent.getExamRoom()) ? StringUtils.deleteWhitespace(basicStudent.getExamRoom()) : null);
|
|
|
+ // 班级去掉空格
|
|
|
+ basicStudent.setClassName(StringUtils.isNotBlank(basicStudent.getClassName()) ? StringUtils.deleteWhitespace(basicStudent.getClassName()) : null);
|
|
|
+
|
|
|
basicStudent.setId(SystemConstant.getDbUuid());
|
|
|
basicStudent.setSchoolId(sysUser.getSchoolId());
|
|
|
basicStudent.setSemesterId(semesterId);
|