|
@@ -5,8 +5,6 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.qmth.boot.api.exception.ApiException;
|
|
|
-import com.qmth.distributed.print.business.bean.dto.ExamPaperObjectiveStructureDto;
|
|
|
-import com.qmth.distributed.print.business.bean.dto.ExamPaperSubjectiveStructureDto;
|
|
|
import com.qmth.distributed.print.business.bean.dto.SyncExamCardDto;
|
|
|
import com.qmth.distributed.print.business.bean.dto.SyncExamStudentDto;
|
|
|
import com.qmth.distributed.print.business.bean.params.SyncDataParam;
|
|
@@ -31,11 +29,12 @@ import com.qmth.teachcloud.common.enums.TaskStatusEnum;
|
|
|
import com.qmth.teachcloud.common.service.BasicAttachmentService;
|
|
|
import com.qmth.teachcloud.common.service.SysConfigService;
|
|
|
import com.qmth.teachcloud.common.service.TeachcloudCommonService;
|
|
|
-import com.qmth.teachcloud.common.sync.StmmsUtils;
|
|
|
+import com.qmth.teachcloud.common.sync.CloudMarkingTaskUtils;
|
|
|
import com.qmth.teachcloud.common.util.ServletUtil;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
+import org.springframework.scheduling.annotation.Async;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
@@ -88,7 +87,7 @@ public class DataSyncServiceImpl implements DataSyncService {
|
|
|
private ExamPaperGroupMarkerService examPaperGroupMarkerService;
|
|
|
|
|
|
@Resource
|
|
|
- StmmsUtils stmmsUtils;
|
|
|
+ private CloudMarkingTaskUtils cloudMarkingTaskUtils;
|
|
|
|
|
|
ExecutorService executorService = Executors.newFixedThreadPool(5);
|
|
|
|
|
@@ -154,7 +153,7 @@ public class DataSyncServiceImpl implements DataSyncService {
|
|
|
List<ExamPrintPlan> examPrintPlans = examPrintPlanService.list(printPlanQueryWrapper);
|
|
|
ExamPrintPlan examPrintPlan = examPrintPlans.stream().max(Comparator.comparingLong(ExamPrintPlan::getExamEndTime)).get();
|
|
|
String examTime = DateUtil.format(new Date(examPrintPlan.getExamEndTime()), DATE_FORMAT);
|
|
|
- syncDataParam.setThirdRelateId(stmmsUtils.syncExam(examPrintPlan.getSchoolId(), time, syncDataParam.getThirdRelateName(), examTime));
|
|
|
+ syncDataParam.setThirdRelateId(cloudMarkingTaskUtils.syncExam(examPrintPlan.getSchoolId(), time, syncDataParam.getThirdRelateName(), examTime));
|
|
|
}
|
|
|
|
|
|
for (Long printPlanId : printPlans) {
|
|
@@ -163,16 +162,6 @@ public class DataSyncServiceImpl implements DataSyncService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
- public void syncPaperStructure(ExamPaperStructure examPaperStructure) {
|
|
|
- executorService.execute(syncStructure(examPaperStructure));
|
|
|
- }
|
|
|
-
|
|
|
- @Override
|
|
|
- public void syncPaperStructureAndGroup(ExamPaperStructure examPaperStructure) {
|
|
|
- executorService.execute(syncPaperStructureAndGroup1(examPaperStructure));
|
|
|
- }
|
|
|
-
|
|
|
/**
|
|
|
* 同步基础信息
|
|
|
*
|
|
@@ -194,157 +183,9 @@ public class DataSyncServiceImpl implements DataSyncService {
|
|
|
};
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 同步试卷结构信息
|
|
|
- *
|
|
|
- * @param examPaperStructure
|
|
|
- * @return
|
|
|
- */
|
|
|
- private TimerTask syncStructure(ExamPaperStructure examPaperStructure) {
|
|
|
- return new TimerTask() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- SysConfig sysConfig = sysConfigService.getByKey("sys.sync.enable");
|
|
|
- if (sysConfig != null && "true".equals(sysConfig.getConfigValue())) {
|
|
|
- doSyncStructure(examPaperStructure);
|
|
|
- }
|
|
|
- }
|
|
|
- };
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 同步试卷结构信息
|
|
|
- *
|
|
|
- * @param evaluationParameters
|
|
|
- * @return
|
|
|
- */
|
|
|
- private TimerTask syncPaperStructureAndGroup1(ExamPaperStructure examPaperStructure) {
|
|
|
- return new TimerTask() {
|
|
|
- @Override
|
|
|
- public void run() {
|
|
|
- SysConfig sysConfig = sysConfigService.getByKey("sys.sync.enable");
|
|
|
- if (sysConfig != null && "true".equals(sysConfig.getConfigValue())) {
|
|
|
- doSyncStructureAndGroup(examPaperStructure);
|
|
|
- }
|
|
|
- }
|
|
|
- };
|
|
|
- }
|
|
|
-
|
|
|
- public void doSyncStructure(ExamPaperStructure examPaperStructure) {
|
|
|
- // 开始同步
|
|
|
- examPaperStructureService.updateStatusById(examPaperStructure.getId(), ExamPaperStructureStatusEnum.START_SYNC);
|
|
|
- ExamPaperStructureStatusEnum status = ExamPaperStructureStatusEnum.UPLOAD_FINISH;
|
|
|
- try {
|
|
|
- String paperTypes = examPaperStructure.getPaperType();
|
|
|
- if (StringUtils.isBlank(paperTypes)) {
|
|
|
- throw ExceptionResultEnum.ERROR.exception("没有可同步的试卷类型");
|
|
|
- }
|
|
|
-
|
|
|
- // 同步试卷
|
|
|
- String paperAnswer = examPaperStructure.getPaperAnswer();
|
|
|
- if (StringUtils.isNotBlank(paperAnswer)) {
|
|
|
- List<JSONObject> paperAnswerJsons = JSONObject.parseArray(paperAnswer, JSONObject.class);
|
|
|
- for (JSONObject paperAnswerJson : paperAnswerJsons) {
|
|
|
- if (paperAnswerJson.containsKey("paperType") && paperAnswerJson.containsKey("paper")) {
|
|
|
- String paperType = paperAnswerJson.getString("paperType");
|
|
|
- String paper = paperAnswerJson.getString("paper");
|
|
|
- if (StringUtils.isAnyBlank(paperType, paper)) {
|
|
|
- continue;
|
|
|
- }
|
|
|
-
|
|
|
- // 同步试卷文件
|
|
|
- File paperFile = downFileFromFss(paper, paperType, SyncFileTypeEnum.PAPER);
|
|
|
- String syncPaperFileUrl = stmmsUtils.syncFile(examPaperStructure.getSchoolId(), String.valueOf(examPaperStructure.getThirdRelateId()), examPaperStructure.getPaperNumberId() + paperType, SyncFileTypeEnum.PAPER, paperFile);
|
|
|
- // 试卷文件保存url
|
|
|
- paperAnswerJson.put("paperUrl", syncPaperFileUrl);
|
|
|
- }
|
|
|
- }
|
|
|
- status = ExamPaperStructureStatusEnum.PAPER_FINISH;
|
|
|
- examPaperStructure.setPaperAnswer(JSONObject.toJSONString(paperAnswerJsons));
|
|
|
- }
|
|
|
-
|
|
|
- // 同步标答
|
|
|
- if (StringUtils.isNotBlank(paperAnswer)) {
|
|
|
- List<JSONObject> paperAnswerJsons = JSONObject.parseArray(paperAnswer, JSONObject.class);
|
|
|
- for (JSONObject paperAnswerJson : paperAnswerJsons) {
|
|
|
- if (paperAnswerJson.containsKey("paperType") && paperAnswerJson.containsKey("answer")) {
|
|
|
- String paperType = paperAnswerJson.getString("paperType");
|
|
|
- String answer = paperAnswerJson.getString("answer");
|
|
|
- if (StringUtils.isAnyBlank(paperType, answer)) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- // 同步标答文件
|
|
|
- File answerFile = downFileFromFss(answer, paperType, SyncFileTypeEnum.ANSWER);
|
|
|
- String syncAnswerFileUrl = stmmsUtils.syncFile(examPaperStructure.getSchoolId(), String.valueOf(examPaperStructure.getThirdRelateId()), examPaperStructure.getPaperNumberId() + paperType, SyncFileTypeEnum.ANSWER, answerFile);
|
|
|
- // 标答文件保存url
|
|
|
- paperAnswerJson.put("answerUrl", syncAnswerFileUrl);
|
|
|
- }
|
|
|
- }
|
|
|
- examPaperStructure.setPaperAnswer(JSONObject.toJSONString(paperAnswerJsons));
|
|
|
- }
|
|
|
- status = ExamPaperStructureStatusEnum.ANSWER_FINISH;
|
|
|
-
|
|
|
- // 同步客观题
|
|
|
- String objectiveStructure = examPaperStructure.getObjectiveStructure();
|
|
|
- if (StringUtils.isNotBlank(objectiveStructure)) {
|
|
|
- List<JSONObject> objectiveJsons = JSONObject.parseArray(objectiveStructure, JSONObject.class);
|
|
|
- for (JSONObject objectiveJson : objectiveJsons) {
|
|
|
- if (objectiveJson.containsKey("paperType") && objectiveJson.containsKey("content")) {
|
|
|
- String objectivePaperType = objectiveJson.getString("paperType");
|
|
|
- String objectiveContent = objectiveJson.getString("content");
|
|
|
- if (StringUtils.isAnyBlank(objectivePaperType, objectiveContent)) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- List<ExamPaperObjectiveStructureDto> objectiveStructureDtos = JSONObject.parseArray(objectiveContent, ExamPaperObjectiveStructureDto.class);
|
|
|
- List<QuestionDTO> syncObjectiveStructureDatas = objectiveStructureDtos.stream().map(m -> {
|
|
|
- QuestionDTO syncStructureData = new QuestionDTO();
|
|
|
- syncStructureData.setMainNumber(Integer.valueOf(m.getMainNumber()));
|
|
|
- syncStructureData.setSubNumber(m.getSubNumber());
|
|
|
- syncStructureData.setMainTitle(m.getMainName());
|
|
|
- syncStructureData.setTotalScore(Double.valueOf(m.getScore()));
|
|
|
- syncStructureData.setAnswer(m.getAnswer());
|
|
|
- return syncStructureData;
|
|
|
- }).collect(Collectors.toList());
|
|
|
- stmmsUtils.syncPaperStructure(examPaperStructure.getSchoolId(), String.valueOf(examPaperStructure.getThirdRelateId()), examPaperStructure.getPaperNumberId() + objectivePaperType, true, null, syncObjectiveStructureDatas);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- status = ExamPaperStructureStatusEnum.OBJECTIVE_FINISH;
|
|
|
-
|
|
|
- // 同步主观题
|
|
|
- String subjectiveStructure = examPaperStructure.getSubjectiveStructure();
|
|
|
- if (StringUtils.isNotBlank(subjectiveStructure)) {
|
|
|
- List<JSONObject> subjectiveJsons = JSONObject.parseArray(subjectiveStructure, JSONObject.class);
|
|
|
- for (JSONObject subjectiveJson : subjectiveJsons) {
|
|
|
- if (subjectiveJson.containsKey("paperType") && subjectiveJson.containsKey("content")) {
|
|
|
- String subjectivePaperType = subjectiveJson.getString("paperType");
|
|
|
- String subjectiveContent = subjectiveJson.getString("content");
|
|
|
- if (StringUtils.isAnyBlank(subjectivePaperType, subjectiveContent)) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- List<ExamPaperSubjectiveStructureDto> subjectiveStructureDtos = JSONObject.parseArray(subjectiveContent, ExamPaperSubjectiveStructureDto.class);
|
|
|
- List<QuestionDTO> syncSubjectiveStructureDatas = subjectiveStructureDtos.stream().map(m -> {
|
|
|
- QuestionDTO syncStructureData = new QuestionDTO();
|
|
|
- syncStructureData.setMainNumber(Integer.valueOf(m.getMainNumber()));
|
|
|
- syncStructureData.setSubNumber(m.getSubNumber());
|
|
|
- syncStructureData.setMainTitle(m.getMainName());
|
|
|
- syncStructureData.setTotalScore(Double.valueOf(m.getScore()));
|
|
|
- return syncStructureData;
|
|
|
- }).collect(Collectors.toList());
|
|
|
- stmmsUtils.syncPaperStructure(examPaperStructure.getSchoolId(), String.valueOf(examPaperStructure.getThirdRelateId()), examPaperStructure.getPaperNumberId() + subjectivePaperType, false, null, syncSubjectiveStructureDatas);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- status = ExamPaperStructureStatusEnum.FINISH;
|
|
|
- } catch (ApiException e) {
|
|
|
- throw ExceptionResultEnum.ERROR.exception("试卷结构同步失败:" + e.getMessage());
|
|
|
- } finally {
|
|
|
- examPaperStructure.setStatus(status);
|
|
|
- examPaperStructureService.updateById(examPaperStructure);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- public void doSyncStructureAndGroup(ExamPaperStructure examPaperStructure) {
|
|
|
+ @Async
|
|
|
+ @Override
|
|
|
+ public void syncPaperStructureAndGroup(ExamPaperStructure examPaperStructure) {
|
|
|
// 开始同步
|
|
|
examPaperStructureService.updateStatusById(examPaperStructure.getId(), ExamPaperStructureStatusEnum.START_SYNC);
|
|
|
ExamPaperStructureStatusEnum status = ExamPaperStructureStatusEnum.UPLOAD_FINISH;
|
|
@@ -373,15 +214,15 @@ public class DataSyncServiceImpl implements DataSyncService {
|
|
|
return syncStructureData;
|
|
|
}).collect(Collectors.toList());
|
|
|
|
|
|
- stmmsUtils.syncPaperStructure(schoolId, examId, subjectCode, false, null, syncSubjectiveStructureDatas);
|
|
|
+ cloudMarkingTaskUtils.syncPaperStructure(schoolId, examId, subjectCode, false, null, syncSubjectiveStructureDatas);
|
|
|
}
|
|
|
// status = ExamPaperStructureStatusEnum.FINISH;
|
|
|
|
|
|
// 同步分组
|
|
|
- int countGroup = stmmsUtils.countGroup(schoolId, examId, subjectCode);
|
|
|
+ int countGroup = cloudMarkingTaskUtils.countGroup(schoolId, examId, subjectCode);
|
|
|
// 如果存在分组,先删掉
|
|
|
if (countGroup > 0) {
|
|
|
- stmmsUtils.deleteGroup(schoolId, examId, subjectCode);
|
|
|
+ cloudMarkingTaskUtils.deleteGroup(schoolId, examId, subjectCode);
|
|
|
}
|
|
|
List<ExamPaperGroup> examPaperGroups = examPaperGroupService.listByExamPaperStructureId(examPaperStructure.getId());
|
|
|
if (!CollectionUtils.isEmpty(examPaperGroups)) {
|
|
@@ -412,14 +253,14 @@ public class DataSyncServiceImpl implements DataSyncService {
|
|
|
}
|
|
|
groupDetailDTOS.add(groupDetailDTO);
|
|
|
}
|
|
|
- stmmsUtils.saveMarkerGroup(schoolId, examId, subjectCode, 0, groupDetailDTOS);
|
|
|
+ cloudMarkingTaskUtils.saveMarkerGroup(schoolId, examId, subjectCode, 0, groupDetailDTOS);
|
|
|
}
|
|
|
|
|
|
// 同步绑定评卷员
|
|
|
for (ExamPaperGroup examPaperGroup : examPaperGroups) {
|
|
|
List<ExamPaperGroupMarker> examPaperGroupMarkers = examPaperGroupMarkerService.listByGroupId(examPaperGroup.getId());
|
|
|
for (ExamPaperGroupMarker examPaperGroupMarker : examPaperGroupMarkers) {
|
|
|
- stmmsUtils.saveMarker(schoolId, examId, subjectCode, examPaperGroup.getGroupNumber(), examPaperGroupMarker.getLoginName());
|
|
|
+ cloudMarkingTaskUtils.saveMarker(schoolId, examId, subjectCode, examPaperGroup.getGroupNumber(), examPaperGroupMarker.getLoginName());
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -431,16 +272,10 @@ public class DataSyncServiceImpl implements DataSyncService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public void doSyncAnswerFile(ExamPaperStructure examPaperStructure) {
|
|
|
- // 开始同步
|
|
|
- examPaperStructureService.updateStatusById(examPaperStructure.getId(), ExamPaperStructureStatusEnum.START_SYNC);
|
|
|
- ExamPaperStructureStatusEnum status = ExamPaperStructureStatusEnum.UPLOAD_FINISH;
|
|
|
+ @Async
|
|
|
+ @Override
|
|
|
+ public void syncPaperAndAnswer(ExamPaperStructure examPaperStructure) {
|
|
|
try {
|
|
|
- String paperTypes = examPaperStructure.getPaperType();
|
|
|
- if (StringUtils.isBlank(paperTypes)) {
|
|
|
- throw ExceptionResultEnum.ERROR.exception("没有可同步的试卷类型");
|
|
|
- }
|
|
|
-
|
|
|
Long schoolId = examPaperStructure.getSchoolId();
|
|
|
// 云阅卷考试ID
|
|
|
String examId = String.valueOf(examPaperStructure.getThirdRelateId());
|
|
@@ -458,15 +293,13 @@ public class DataSyncServiceImpl implements DataSyncService {
|
|
|
if (StringUtils.isAnyBlank(paperType, paper)) {
|
|
|
continue;
|
|
|
}
|
|
|
-
|
|
|
// 同步试卷文件
|
|
|
File paperFile = downFileFromFss(paper, paperType, SyncFileTypeEnum.PAPER);
|
|
|
- String syncPaperFileUrl = stmmsUtils.syncFile(schoolId, examId, subjectCode, SyncFileTypeEnum.PAPER, paperFile);
|
|
|
+ String syncPaperFileUrl = cloudMarkingTaskUtils.syncFile(schoolId, examId, subjectCode, SyncFileTypeEnum.PAPER, paperFile);
|
|
|
// 试卷文件保存url
|
|
|
paperAnswerJson.put("paperUrl", syncPaperFileUrl);
|
|
|
}
|
|
|
}
|
|
|
- status = ExamPaperStructureStatusEnum.PAPER_FINISH;
|
|
|
examPaperStructure.setPaperAnswer(JSONObject.toJSONString(paperAnswerJsons));
|
|
|
}
|
|
|
|
|
@@ -482,64 +315,46 @@ public class DataSyncServiceImpl implements DataSyncService {
|
|
|
}
|
|
|
// 同步标答文件
|
|
|
File answerFile = downFileFromFss(answer, paperType, SyncFileTypeEnum.ANSWER);
|
|
|
- String syncAnswerFileUrl = stmmsUtils.syncFile(schoolId, examId, subjectCode, SyncFileTypeEnum.ANSWER, answerFile);
|
|
|
+ String syncAnswerFileUrl = cloudMarkingTaskUtils.syncFile(schoolId, examId, subjectCode, SyncFileTypeEnum.ANSWER, answerFile);
|
|
|
// 标答文件保存url
|
|
|
paperAnswerJson.put("answerUrl", syncAnswerFileUrl);
|
|
|
}
|
|
|
}
|
|
|
examPaperStructure.setPaperAnswer(JSONObject.toJSONString(paperAnswerJsons));
|
|
|
}
|
|
|
- status = ExamPaperStructureStatusEnum.ANSWER_FINISH;
|
|
|
-
|
|
|
} catch (ApiException e) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("试卷结构同步失败:" + e.getMessage());
|
|
|
} finally {
|
|
|
- examPaperStructure.setStatus(status);
|
|
|
- examPaperStructureService.updateById(examPaperStructure);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- public void doSyncObjectiveStructure(ExamPaperStructure examPaperStructure) {
|
|
|
- // 开始同步
|
|
|
- examPaperStructureService.updateStatusById(examPaperStructure.getId(), ExamPaperStructureStatusEnum.START_SYNC);
|
|
|
- ExamPaperStructureStatusEnum status = ExamPaperStructureStatusEnum.UPLOAD_FINISH;
|
|
|
+ @Async
|
|
|
+ @Override
|
|
|
+ public void syncObjectiveStructure(ExamPaperStructure examPaperStructure) {
|
|
|
try {
|
|
|
- String paperTypes = examPaperStructure.getPaperType();
|
|
|
- if (StringUtils.isBlank(paperTypes)) {
|
|
|
- throw ExceptionResultEnum.ERROR.exception("没有可同步的试卷类型");
|
|
|
- }
|
|
|
-
|
|
|
+ Long schoolId = examPaperStructure.getSchoolId();
|
|
|
+ // 云阅卷考试ID
|
|
|
+ String examId = String.valueOf(examPaperStructure.getThirdRelateId());
|
|
|
+ // 科目代码(课程代码+卷型+课程序号)
|
|
|
+ String subjectCode = examPaperStructure.getCourseCode().concat(examPaperStructure.getPaperType()).concat(examPaperStructure.getSequence());
|
|
|
// 同步客观题
|
|
|
String objectiveStructure = examPaperStructure.getObjectiveStructure();
|
|
|
if (StringUtils.isNotBlank(objectiveStructure)) {
|
|
|
List<JSONObject> objectiveJsons = JSONObject.parseArray(objectiveStructure, JSONObject.class);
|
|
|
- for (JSONObject objectiveJson : objectiveJsons) {
|
|
|
- if (objectiveJson.containsKey("paperType") && objectiveJson.containsKey("content")) {
|
|
|
- String objectivePaperType = objectiveJson.getString("paperType");
|
|
|
- String objectiveContent = objectiveJson.getString("content");
|
|
|
- if (StringUtils.isAnyBlank(objectivePaperType, objectiveContent)) {
|
|
|
- continue;
|
|
|
- }
|
|
|
- List<ExamPaperObjectiveStructureDto> objectiveStructureDtos = JSONObject.parseArray(objectiveContent, ExamPaperObjectiveStructureDto.class);
|
|
|
- List<QuestionDTO> syncObjectiveStructureDatas = objectiveStructureDtos.stream().map(m -> {
|
|
|
- QuestionDTO syncStructureData = new QuestionDTO();
|
|
|
- syncStructureData.setMainNumber(Integer.valueOf(m.getMainNumber()));
|
|
|
- syncStructureData.setSubNumber(m.getSubNumber());
|
|
|
- syncStructureData.setMainTitle(m.getMainName());
|
|
|
- syncStructureData.setTotalScore(Double.valueOf(m.getScore()));
|
|
|
- syncStructureData.setAnswer(m.getAnswer());
|
|
|
- return syncStructureData;
|
|
|
- }).collect(Collectors.toList());
|
|
|
- stmmsUtils.syncPaperStructure(examPaperStructure.getSchoolId(), String.valueOf(examPaperStructure.getThirdRelateId()), examPaperStructure.getPaperNumberId() + objectivePaperType, true, null, syncObjectiveStructureDatas);
|
|
|
- }
|
|
|
- }
|
|
|
+ List<QuestionDTO> syncObjectiveStructureDatas = objectiveJsons.stream().map(m -> {
|
|
|
+ QuestionDTO syncStructureData = new QuestionDTO();
|
|
|
+ syncStructureData.setMainNumber(m.getInteger("mainNumber"));
|
|
|
+ syncStructureData.setSubNumber(m.getString("subNumber"));
|
|
|
+ syncStructureData.setMainTitle(m.getString("mainTitle"));
|
|
|
+ syncStructureData.setTotalScore(m.getDouble("totalScore"));
|
|
|
+ syncStructureData.setAnswer(m.getString("answer"));
|
|
|
+ return syncStructureData;
|
|
|
+ }).collect(Collectors.toList());
|
|
|
+ cloudMarkingTaskUtils.syncPaperStructure(schoolId, examId, subjectCode, true, null, syncObjectiveStructureDatas);
|
|
|
}
|
|
|
- status = ExamPaperStructureStatusEnum.OBJECTIVE_FINISH;
|
|
|
} catch (ApiException e) {
|
|
|
throw ExceptionResultEnum.ERROR.exception("试卷结构同步失败:" + e.getMessage());
|
|
|
} finally {
|
|
|
- examPaperStructure.setStatus(status);
|
|
|
- examPaperStructureService.updateById(examPaperStructure);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -606,7 +421,7 @@ public class DataSyncServiceImpl implements DataSyncService {
|
|
|
String code = String.valueOf(examPrintPlan.getId());
|
|
|
String name = examPrintPlan.getName();
|
|
|
String examTime = DateUtil.format(new Date(examPrintPlan.getExamEndTime()), DATE_FORMAT);
|
|
|
- thirdRelateId = stmmsUtils.syncExam(examPrintPlan.getSchoolId(), code, name, examTime);
|
|
|
+ thirdRelateId = cloudMarkingTaskUtils.syncExam(examPrintPlan.getSchoolId(), code, name, examTime);
|
|
|
}
|
|
|
return thirdRelateId;
|
|
|
} catch (Exception e) {
|
|
@@ -634,7 +449,7 @@ public class DataSyncServiceImpl implements DataSyncService {
|
|
|
String teacher = "无";
|
|
|
String subjectCode = examStudent.getPaperNumberId() + examStudent.getPaperType(); // 取试卷编号
|
|
|
String subjectName = examStudent.getPaperNumber() + examStudent.getPaperType() + "-" + examStudent.getCourseName();
|
|
|
- boolean syncStudent = stmmsUtils.syncStudent(schoolId, examId, examNumber, studentCode, name, college, className, teacher, subjectCode, subjectName, null, null, null, null);
|
|
|
+ boolean syncStudent = cloudMarkingTaskUtils.syncStudent(schoolId, examId, examNumber, studentCode, name, college, className, teacher, subjectCode, subjectName, null, null, null, null);
|
|
|
|
|
|
if (syncStudent) {
|
|
|
UpdateWrapper<ExamStudent> updateWrapper = new UpdateWrapper<>();
|
|
@@ -684,7 +499,7 @@ public class DataSyncServiceImpl implements DataSyncService {
|
|
|
String filePath = getTempDir(SyncFileTypeEnum.CARD);
|
|
|
file = createJsonFile(filePath, syncExamCardDto.getContent());
|
|
|
if (file.exists()) {
|
|
|
- String uploadCardUrl = stmmsUtils.syncFile(schoolId, String.valueOf(thirdRelateId), syncExamCardDto.getPaperNumberId() + s, SyncFileTypeEnum.CARD, file);
|
|
|
+ String uploadCardUrl = cloudMarkingTaskUtils.syncFile(schoolId, String.valueOf(thirdRelateId), syncExamCardDto.getPaperNumberId() + s, SyncFileTypeEnum.CARD, file);
|
|
|
if (StringUtils.isNotBlank(uploadCardUrl)) {
|
|
|
UpdateWrapper<ExamCard> updateWrapper = new UpdateWrapper<>();
|
|
|
updateWrapper.lambda().set(ExamCard::getSyncStatus, true).eq(ExamCard::getId, syncExamCardDto.getId());
|