|
@@ -301,6 +301,8 @@ public class DataSyncServiceImpl implements DataSyncService {
|
|
|
examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.GROUP.getType(), "sync", saveMarkerGroup));
|
|
|
}
|
|
|
|
|
|
+ // 所有分组下评卷员集合(分班阅使用)
|
|
|
+ List<ExamPaperGroupMarker> examPaperGroupMarkerList = new ArrayList<>();
|
|
|
// 同步绑定评卷员
|
|
|
try {
|
|
|
errorMessage = "[绑定评卷员]";
|
|
@@ -313,6 +315,8 @@ public class DataSyncServiceImpl implements DataSyncService {
|
|
|
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());
|
|
|
+
|
|
|
+ examPaperGroupMarkerList.add(examPaperGroupMarker);
|
|
|
}
|
|
|
}
|
|
|
examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.MARKER.getType(), "sync", true));
|
|
@@ -321,18 +325,27 @@ public class DataSyncServiceImpl implements DataSyncService {
|
|
|
}
|
|
|
|
|
|
errorMessage = "[分班阅]";
|
|
|
- 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);
|
|
|
+ try {
|
|
|
+ if (examPaperStructure.getOpenClassReading()) {
|
|
|
+ List<ExamPaperClassMarker> examPaperClassMarkers = examPaperClassMarkerService.listByExamPaperStructureId(examPaperStructure.getId());
|
|
|
+ if (!CollectionUtils.isEmpty(examPaperClassMarkers)) {
|
|
|
+
|
|
|
+ for (ExamPaperClassMarker examPaperClassMarker : examPaperClassMarkers) {
|
|
|
+ String className = examPaperClassMarker.getClassName();
|
|
|
+ List<String> classNames = Arrays.asList(className.split(","));
|
|
|
+ cloudMarkingTaskUtils.saveUserClass(schoolId, examId, examPaperClassMarker.getLoginName(), classNames);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ // 同步空集合对象,就是删除云阅卷分班阅班级信息
|
|
|
+ List<String> classNames = new ArrayList<>();
|
|
|
+ for (ExamPaperGroupMarker examPaperGroupMarker : examPaperGroupMarkerList) {
|
|
|
+ cloudMarkingTaskUtils.saveUserClass(schoolId, examId, examPaperGroupMarker.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));
|
|
|
}
|
|
|
+ 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;
|
|
|
} catch (Exception e) {
|
|
@@ -569,6 +582,7 @@ public class DataSyncServiceImpl implements DataSyncService {
|
|
|
// 同步客观题
|
|
|
String orgCode = cloudMarkingTaskUtils.isCollegeMode(schoolId) ? sysOrgService.findCollegeByCourseCode(schoolId, examPaperStructure.getCourseCode()).getCode() : null;
|
|
|
|
|
|
+ List<ExamPaperGroupMarker> examPaperGroupMarkerList = new ArrayList<>();
|
|
|
try {
|
|
|
List<ExamPaperGroup> examPaperGroups = examPaperGroupService.listByExamPaperStructureId(examPaperStructure.getId());
|
|
|
for (ExamPaperGroup examPaperGroup : examPaperGroups) {
|
|
@@ -579,6 +593,8 @@ public class DataSyncServiceImpl implements DataSyncService {
|
|
|
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());
|
|
|
+
|
|
|
+ examPaperGroupMarkerList.add(examPaperGroupMarker);
|
|
|
}
|
|
|
}
|
|
|
examPaperStructure.setStatus(ExamPaperStructure.parseStatus(examPaperStructure.getStatus(), ExamPaperStructureStatusTypeEnum.MARKER.getType(), "sync", true));
|
|
@@ -586,18 +602,26 @@ public class DataSyncServiceImpl implements DataSyncService {
|
|
|
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);
|
|
|
+ try {
|
|
|
+ if (examPaperStructure.getOpenClassReading()) {
|
|
|
+ List<ExamPaperClassMarker> examPaperClassMarkers = examPaperClassMarkerService.listByExamPaperStructureId(examPaperStructure.getId());
|
|
|
+ if (!CollectionUtils.isEmpty(examPaperClassMarkers)) {
|
|
|
+
|
|
|
+ for (ExamPaperClassMarker examPaperClassMarker : examPaperClassMarkers) {
|
|
|
+ String className = examPaperClassMarker.getClassName();
|
|
|
+ List<String> classNames = Arrays.asList(className.split(","));
|
|
|
+ cloudMarkingTaskUtils.saveUserClass(schoolId, examId, examPaperClassMarker.getLoginName(), classNames);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ List<String> classNames = new ArrayList<>();
|
|
|
+ for (ExamPaperGroupMarker examPaperGroupMarker : examPaperGroupMarkerList) {
|
|
|
+ cloudMarkingTaskUtils.saveUserClass(schoolId, examId, examPaperGroupMarker.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));
|
|
|
}
|
|
|
+ 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;
|
|
|
} catch (Exception e) {
|
|
@@ -605,6 +629,7 @@ public class DataSyncServiceImpl implements DataSyncService {
|
|
|
errorMessage = e.getMessage();
|
|
|
} finally {
|
|
|
tbSyncTaskService.updateStatusAndResultById(tbSyncTask.getId(), examPaperStructure.getThirdRelateId(), TaskStatusEnum.FINISH, result, errorMessage);
|
|
|
+ examPaperStructureService.updateById(examPaperStructure);
|
|
|
}
|
|
|
}
|
|
|
|