|
@@ -7,8 +7,7 @@ import com.qmth.boot.api.exception.ApiException;
|
|
import com.qmth.distributed.print.business.bean.dto.ExamDetailCourseDto;
|
|
import com.qmth.distributed.print.business.bean.dto.ExamDetailCourseDto;
|
|
import com.qmth.distributed.print.business.bean.dto.SyncExamStudentDto;
|
|
import com.qmth.distributed.print.business.bean.dto.SyncExamStudentDto;
|
|
import com.qmth.distributed.print.business.bean.dto.SyncExamTaskDto;
|
|
import com.qmth.distributed.print.business.bean.dto.SyncExamTaskDto;
|
|
-import com.qmth.distributed.print.business.bean.marking.GroupInfo;
|
|
|
|
-import com.qmth.distributed.print.business.bean.marking.Marker;
|
|
|
|
|
|
+import com.qmth.distributed.print.business.bean.marking.status.ExamPaperStructureStatus;
|
|
import com.qmth.distributed.print.business.entity.*;
|
|
import com.qmth.distributed.print.business.entity.*;
|
|
import com.qmth.distributed.print.business.enums.ExamPaperStructureStatusTypeEnum;
|
|
import com.qmth.distributed.print.business.enums.ExamPaperStructureStatusTypeEnum;
|
|
import com.qmth.distributed.print.business.enums.ExamTaskSyncStatusEnum;
|
|
import com.qmth.distributed.print.business.enums.ExamTaskSyncStatusEnum;
|
|
@@ -330,9 +329,9 @@ public class DataSyncServiceImpl implements DataSyncService {
|
|
List<String> classNames = Arrays.asList(className.split(","));
|
|
List<String> classNames = Arrays.asList(className.split(","));
|
|
cloudMarkingTaskUtils.saveUserClass(schoolId, examId, examPaperClassMarker.getLoginName(), classNames);
|
|
cloudMarkingTaskUtils.saveUserClass(schoolId, examId, examPaperClassMarker.getLoginName(), classNames);
|
|
}
|
|
}
|
|
- examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.CLASS.getType(), "sync", true));
|
|
|
|
|
|
+ examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.MARKER_CLASS.getType(), "sync", true));
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
- examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.CLASS.getType(), "sync", false));
|
|
|
|
|
|
+ examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.MARKER_CLASS.getType(), "sync", false));
|
|
}
|
|
}
|
|
}
|
|
}
|
|
result = TaskResultEnum.SUCCESS;
|
|
result = TaskResultEnum.SUCCESS;
|
|
@@ -340,6 +339,19 @@ public class DataSyncServiceImpl implements DataSyncService {
|
|
result = TaskResultEnum.ERROR;
|
|
result = TaskResultEnum.ERROR;
|
|
errorMessage = errorMessage + e.getMessage();
|
|
errorMessage = errorMessage + e.getMessage();
|
|
} finally {
|
|
} finally {
|
|
|
|
+ String status = examPaperStructure.getStatus();
|
|
|
|
+ ExamPaperStructureStatus examPaperStructureStatus = JSON.parseObject(status, ExamPaperStructureStatus.class);
|
|
|
|
+ if (examPaperStructureStatus.getStructure().getSave() && examPaperStructureStatus.getStructure().getSync()
|
|
|
|
+ && examPaperStructureStatus.getGroup().getSave() && examPaperStructureStatus.getGroup().getSync()) {
|
|
|
|
+ if (examPaperStructure.getOpenClassReading()) {
|
|
|
|
+ if (examPaperStructureStatus.getMarkerClass().getSave() && examPaperStructureStatus.getMarkerClass().getSync()) {
|
|
|
|
+ examPaperStructure.setFinish(true);
|
|
|
|
+ }
|
|
|
|
+ } else {
|
|
|
|
+ examPaperStructure.setFinish(true);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
examPaperStructureService.updateById(examPaperStructure);
|
|
examPaperStructureService.updateById(examPaperStructure);
|
|
tbSyncTaskService.updateStatusAndResultById(tbSyncTask.getId(), examPaperStructure.getThirdRelateId(), TaskStatusEnum.FINISH, result, mainProgress + errorMessage);
|
|
tbSyncTaskService.updateStatusAndResultById(tbSyncTask.getId(), examPaperStructure.getThirdRelateId(), TaskStatusEnum.FINISH, result, mainProgress + errorMessage);
|
|
}
|
|
}
|
|
@@ -416,10 +428,14 @@ public class DataSyncServiceImpl implements DataSyncService {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
// 同步试卷文件
|
|
// 同步试卷文件
|
|
- paperFile = downFileFromFss(paper, paperType, SyncFileTypeEnum.PAPER);
|
|
|
|
- String syncPaperFileUrl = cloudMarkingTaskUtils.syncFile(schoolId, examId, subjectCode, SyncFileTypeEnum.PAPER, paperFile);
|
|
|
|
- // 试卷文件保存url
|
|
|
|
- paperAnswerJson.put("paperUrl", syncPaperFileUrl);
|
|
|
|
|
|
+ try {
|
|
|
|
+ paperFile = downFileFromFss(paper, paperType, SyncFileTypeEnum.PAPER);
|
|
|
|
+ String syncPaperFileUrl = cloudMarkingTaskUtils.syncFile(schoolId, examId, subjectCode, SyncFileTypeEnum.PAPER, paperFile);
|
|
|
|
+ // 试卷文件保存url
|
|
|
|
+ paperAnswerJson.put("paperUrl", syncPaperFileUrl);
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error("试卷文件上传失败,不作处理");
|
|
|
|
+ }
|
|
|
|
|
|
// 同步标答
|
|
// 同步标答
|
|
String answer = paperAnswerJson.getString("answer");
|
|
String answer = paperAnswerJson.getString("answer");
|
|
@@ -490,16 +506,18 @@ public class DataSyncServiceImpl implements DataSyncService {
|
|
}
|
|
}
|
|
|
|
|
|
String cloudInfoJson = cloudMarkingTaskUtils.queryPaperStructure(schoolId, examId, subjectCode, null);
|
|
String cloudInfoJson = cloudMarkingTaskUtils.queryPaperStructure(schoolId, examId, subjectCode, null);
|
|
|
|
+ examPaperStructure.setCloudInfoJson(cloudInfoJson);
|
|
|
|
+ examPaperStructure.setStructureChange(false);
|
|
UpdateWrapper<ExamPaperStructure> updateWrapper = new UpdateWrapper<>();
|
|
UpdateWrapper<ExamPaperStructure> updateWrapper = new UpdateWrapper<>();
|
|
- updateWrapper.lambda().set(ExamPaperStructure::getCloudInfoJson, cloudInfoJson).set(ExamPaperStructure::getStructureChange, false).eq(ExamPaperStructure::getId, examPaperStructure.getId());
|
|
|
|
- examPaperStructureService.update(updateWrapper);
|
|
|
|
-
|
|
|
|
|
|
+ examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.OBJECTIVE.getType(), "sync", true));
|
|
result = TaskResultEnum.SUCCESS;
|
|
result = TaskResultEnum.SUCCESS;
|
|
} catch (ApiException e) {
|
|
} catch (ApiException e) {
|
|
|
|
+ examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.OBJECTIVE.getType(), "sync", false));
|
|
result = TaskResultEnum.ERROR;
|
|
result = TaskResultEnum.ERROR;
|
|
errorMessage = e.getMessage();
|
|
errorMessage = e.getMessage();
|
|
} finally {
|
|
} finally {
|
|
tbSyncTaskService.updateStatusAndResultById(tbSyncTask.getId(), examPaperStructure.getThirdRelateId(), TaskStatusEnum.FINISH, result, errorMessage);
|
|
tbSyncTaskService.updateStatusAndResultById(tbSyncTask.getId(), examPaperStructure.getThirdRelateId(), TaskStatusEnum.FINISH, result, errorMessage);
|
|
|
|
+ examPaperStructureService.updateById(examPaperStructure);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -539,7 +557,9 @@ public class DataSyncServiceImpl implements DataSyncService {
|
|
|
|
|
|
@Async
|
|
@Async
|
|
@Override
|
|
@Override
|
|
- public void syncMarker(ExamPaperStructure examPaperStructure, TBSyncTask tbSyncTask) {
|
|
|
|
|
|
+ public void syncMarkerAndClass(ExamPaperStructure examPaperStructure, TBSyncTask tbSyncTask) {
|
|
|
|
+ // 云阅卷考试ID
|
|
|
|
+ String examId = String.valueOf(examPaperStructure.getThirdRelateId());
|
|
// 同步初始参数
|
|
// 同步初始参数
|
|
TaskResultEnum result = null;
|
|
TaskResultEnum result = null;
|
|
String errorMessage = null;
|
|
String errorMessage = null;
|
|
@@ -548,15 +568,37 @@ public class DataSyncServiceImpl implements DataSyncService {
|
|
// 科目代码(课程代码+卷型+课程序号)
|
|
// 科目代码(课程代码+卷型+课程序号)
|
|
String subjectCode = examPaperStructure.getCourseCode().concat(examPaperStructure.getPaperType()).concat(examPaperStructure.getSequence());
|
|
String subjectCode = examPaperStructure.getCourseCode().concat(examPaperStructure.getPaperType()).concat(examPaperStructure.getSequence());
|
|
// 同步客观题
|
|
// 同步客观题
|
|
- GroupInfo groupInfo = JSON.parseObject(tbSyncTask.getRemark(), GroupInfo.class);
|
|
|
|
- List<Marker> markerList = groupInfo.getMarkerList();
|
|
|
|
-
|
|
|
|
String orgCode = cloudMarkingTaskUtils.isCollegeMode(schoolId) ? sysOrgService.findCollegeByCourseCode(schoolId, examPaperStructure.getCourseCode()).getCode() : null;
|
|
String orgCode = cloudMarkingTaskUtils.isCollegeMode(schoolId) ? sysOrgService.findCollegeByCourseCode(schoolId, examPaperStructure.getCourseCode()).getCode() : null;
|
|
- for (Marker marker : markerList) {
|
|
|
|
- // 推送用户
|
|
|
|
- cloudMarkingTaskUtils.syncUser(SpecialPrivilegeEnum.MARKER.getPrefix() + marker.getLoginName(), marker.getName(), SpecialPrivilegeEnum.MARKER.getValue(), true, schoolId, orgCode);
|
|
|
|
- // 绑定评卷员
|
|
|
|
- cloudMarkingTaskUtils.saveMarker(schoolId, String.valueOf(examPaperStructure.getThirdRelateId()), subjectCode, groupInfo.getGroupNumber(), marker.getLoginName());
|
|
|
|
|
|
+
|
|
|
|
+ try {
|
|
|
|
+ List<ExamPaperGroup> examPaperGroups = examPaperGroupService.listByExamPaperStructureId(examPaperStructure.getId());
|
|
|
|
+ for (ExamPaperGroup examPaperGroup : examPaperGroups) {
|
|
|
|
+ List<ExamPaperGroupMarker> examPaperGroupMarkers = examPaperGroupMarkerService.listByGroupId(examPaperGroup.getId());
|
|
|
|
+ for (ExamPaperGroupMarker examPaperGroupMarker : examPaperGroupMarkers) {
|
|
|
|
+ // 推送用户
|
|
|
|
+ SysUser markerUser = sysUserService.getById(examPaperGroupMarker.getMarkerId());
|
|
|
|
+ cloudMarkingTaskUtils.syncUser(SpecialPrivilegeEnum.MARKER.getPrefix() + markerUser.getLoginName(), markerUser.getRealName(), SpecialPrivilegeEnum.MARKER.getValue(), markerUser.getEnable(), schoolId, orgCode);
|
|
|
|
+ // 绑定评卷员
|
|
|
|
+ cloudMarkingTaskUtils.saveMarker(schoolId, examId, subjectCode, examPaperGroup.getGroupNumber(), examPaperGroupMarker.getLoginName());
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.MARKER.getType(), "sync", true));
|
|
|
|
+ } catch (IllegalAccessException e) {
|
|
|
|
+ examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.MARKER.getType(), "sync", false));
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ List<ExamPaperClassMarker> examPaperClassMarkers = examPaperClassMarkerService.listByExamPaperStructureId(examPaperStructure.getId());
|
|
|
|
+ if (!CollectionUtils.isEmpty(examPaperClassMarkers)) {
|
|
|
|
+ try {
|
|
|
|
+ for (ExamPaperClassMarker examPaperClassMarker : examPaperClassMarkers) {
|
|
|
|
+ String className = examPaperClassMarker.getClassName();
|
|
|
|
+ List<String> classNames = Arrays.asList(className.split(","));
|
|
|
|
+ cloudMarkingTaskUtils.saveUserClass(schoolId, examId, examPaperClassMarker.getLoginName(), classNames);
|
|
|
|
+ }
|
|
|
|
+ examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.MARKER_CLASS.getType(), "sync", true));
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.MARKER_CLASS.getType(), "sync", false));
|
|
|
|
+ }
|
|
}
|
|
}
|
|
result = TaskResultEnum.SUCCESS;
|
|
result = TaskResultEnum.SUCCESS;
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|