|
@@ -171,12 +171,19 @@ public class DataSyncServiceImpl implements DataSyncService {
|
|
// 同步考生
|
|
// 同步考生
|
|
List<SyncExamStudentDto> syncExamStudentDtoList = examStudentService.listStudentByExamDetailCourseId(examDetailCourseList);
|
|
List<SyncExamStudentDto> syncExamStudentDtoList = examStudentService.listStudentByExamDetailCourseId(examDetailCourseList);
|
|
|
|
|
|
- long count = syncExamStudentDtoList.stream().filter(m -> StringUtils.isBlank(m.getPaperType())).count();
|
|
|
|
- if (count > 0) {
|
|
|
|
- throw ExceptionResultEnum.ERROR.exception("部分学生未关联试卷类型,数量[" + count + "]");
|
|
|
|
|
|
+ // 没有考生就单独推送科目
|
|
|
|
+ if (CollectionUtils.isEmpty(syncExamStudentDtoList)) {
|
|
|
|
+ for (ExamDetailCourseDto examDetailCourseDto : examDetailCourseList) {
|
|
|
|
+ saveSubject(schoolId, thirdRelateId, examDetailCourseDto.getCourseCode(), examDetailCourseDto.getCourseName(), examDetailCourseDto.getSequence(), examDetailCourseDto.getPaperType());
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ long count = syncExamStudentDtoList.stream().filter(m -> StringUtils.isBlank(m.getPaperType())).count();
|
|
|
|
+ if (count > 0) {
|
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("部分学生未关联试卷类型,数量[" + count + "]");
|
|
|
|
+ }
|
|
|
|
+ // 同步考生
|
|
|
|
+ saveStudent(schoolId, thirdRelateId, syncExamStudentDtoList);
|
|
}
|
|
}
|
|
- // 同步考生
|
|
|
|
- saveStudent(schoolId, thirdRelateId, syncExamStudentDtoList);
|
|
|
|
|
|
|
|
// 同步题卡
|
|
// 同步题卡
|
|
for (ExamDetailCourseDto examDetailCourseDto : examDetailCourseList) {
|
|
for (ExamDetailCourseDto examDetailCourseDto : examDetailCourseList) {
|
|
@@ -622,6 +629,31 @@ public class DataSyncServiceImpl implements DataSyncService {
|
|
return thirdRelateId;
|
|
return thirdRelateId;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * 创建科目
|
|
|
|
+ *
|
|
|
|
+ * @param schoolId 学校ID
|
|
|
|
+ * @param thirdRelateId 云阅卷考试ID
|
|
|
|
+ * @param courseCode 课程代码
|
|
|
|
+ * @param sequence 课程序号
|
|
|
|
+ * @param paperType 卷型
|
|
|
|
+ */
|
|
|
|
+ public Boolean saveSubject(Long schoolId, Long thirdRelateId, String courseCode, String courseName, String sequence, String paperType) {
|
|
|
|
+ try {
|
|
|
|
+ // 支持多卷型
|
|
|
|
+ String[] paperTypes = paperType.split(",");
|
|
|
|
+ for (String type : paperTypes) {
|
|
|
|
+ //参数
|
|
|
|
+ String examId = String.valueOf(thirdRelateId);
|
|
|
|
+ String subjectCode = courseCode + type + sequence;
|
|
|
|
+ cloudMarkingTaskUtils.syncSubject(schoolId, examId, subjectCode, courseName);
|
|
|
|
+ }
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error("保存云阅卷科目数据失败");
|
|
|
|
+ }
|
|
|
|
+ return true;
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* 新增考生
|
|
* 新增考生
|
|
*
|
|
*
|