|
@@ -199,12 +199,9 @@ public class DataSyncServiceImpl implements DataSyncService {
|
|
|
structureStatus = ExamPaperStructureStatusEnum.SUBJECTIVE_FINISH;
|
|
|
|
|
|
errorMessage = "[主观题分组]";
|
|
|
- // 同步分组
|
|
|
- int countGroup = cloudMarkingTaskUtils.countGroup(schoolId, examId, subjectCode);
|
|
|
- // 如果存在分组,先删掉
|
|
|
- if (countGroup > 0) {
|
|
|
- cloudMarkingTaskUtils.deleteGroup(schoolId, examId, subjectCode);
|
|
|
- }
|
|
|
+ // 同步分组(检查,若存在,先删除)
|
|
|
+ deleteGroup(schoolId, examId, subjectCode);
|
|
|
+
|
|
|
List<ExamPaperGroup> examPaperGroups = examPaperGroupService.listByExamPaperStructureId(examPaperStructure.getId());
|
|
|
if (!CollectionUtils.isEmpty(examPaperGroups)) {
|
|
|
List<GroupDetailDTO> groupDetailDTOS = new ArrayList<>();
|
|
@@ -259,6 +256,35 @@ public class DataSyncServiceImpl implements DataSyncService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 云阅卷分组删除是异步任务
|
|
|
+ *
|
|
|
+ * @param schoolId 学校ID
|
|
|
+ * @param examId 考试ID
|
|
|
+ * @param subjectCode 科目代码
|
|
|
+ */
|
|
|
+ private boolean deleteGroup(Long schoolId, String examId, String subjectCode) {
|
|
|
+ // 同步分组
|
|
|
+ int countGroup = cloudMarkingTaskUtils.countGroup(schoolId, examId, subjectCode);
|
|
|
+ // 如果存在分组,先删掉
|
|
|
+ boolean deleteGroup;
|
|
|
+ if (countGroup > 0) {
|
|
|
+ deleteGroup = cloudMarkingTaskUtils.deleteGroup(schoolId, examId, subjectCode);
|
|
|
+ } else {
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+ // 调用成功,再查询判断是否还有分组
|
|
|
+ if (deleteGroup) {
|
|
|
+ countGroup = cloudMarkingTaskUtils.countGroup(schoolId, examId, subjectCode);
|
|
|
+ if (countGroup > 0) {
|
|
|
+ deleteGroup(schoolId, examId, subjectCode);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ throw ExceptionResultEnum.ERROR.exception("云阅卷分组删除异常");
|
|
|
+ }
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+
|
|
|
@Async
|
|
|
@Override
|
|
|
public void syncPaperAndAnswer(ExamPaperStructure examPaperStructure, TBSyncTask tbSyncTask) {
|