|
@@ -334,8 +334,7 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
|
|
|
|
|
|
TEExam teExam = teExamService.cacheConvert(examCacheBean);
|
|
|
if (Objects.isNull(tbTaskHistory.getEntityId())) {
|
|
|
- cloudMarkExamId = cloudMarkUtil.callExamSaveApi(new SaveExamParams(orgId, examId, examCode, examCacheBean.getName(), DateUtil.format(new Date(examCacheBean.getStartTime()), Constants.DEFAULT_DATE_PATTERN)));
|
|
|
-// cloudMarkExamId = Long.parseLong((int) (Math.random() * 1000) + "");
|
|
|
+ cloudMarkExamId = cloudMarkUtil.callExamSaveApi(new SaveExamParams(orgId, null, examCode, examCacheBean.getName(), DateUtil.format(new Date(examCacheBean.getStartTime()), Constants.DEFAULT_DATE_PATTERN)));
|
|
|
teExam.setUpdateTime(System.currentTimeMillis());
|
|
|
teExam.setThirdExamId(String.valueOf(cloudMarkExamId));
|
|
|
teExamService.updateById(teExam);
|
|
@@ -438,22 +437,23 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
|
|
|
Long examId = (Long) map.get(SystemConstant.EXAM_ID);
|
|
|
TBTaskHistory tbTaskHistory = (TBTaskHistory) map.get("tbTaskHistory");
|
|
|
List<TOeExamRecord> tOeExamRecordList = tOeExamRecordService.findExamRecordNeedMarkAll(examId, examPaperIdSet, false);
|
|
|
- if (CollectionUtils.isEmpty(tOeExamRecordList)) {
|
|
|
- throw new BusinessException("没有待阅卷的考试记录");
|
|
|
- }
|
|
|
- jsonObject.put("examRecordListSize", tOeExamRecordList.size());
|
|
|
+ if (!CollectionUtils.isEmpty(tOeExamRecordList)) {
|
|
|
+ jsonObject.put("examRecordListSize", tOeExamRecordList.size());
|
|
|
|
|
|
- Integer totalTaskSize = jsonObject.getInteger("totalTaskSize");
|
|
|
- Integer currentTaskSize = jsonObject.getInteger("currentTaskSize");
|
|
|
+ Integer totalTaskSize = jsonObject.getInteger("totalTaskSize");
|
|
|
+ Integer currentTaskSize = jsonObject.getInteger("currentTaskSize");
|
|
|
|
|
|
- BigDecimal progress = new BigDecimal(0);
|
|
|
- BigDecimal b = new BigDecimal(100);
|
|
|
- progress = new BigDecimal(currentTaskSize).divide(new BigDecimal(totalTaskSize), 2, BigDecimal.ROUND_HALF_UP).multiply(b);
|
|
|
- if (Objects.isNull(tbTaskHistory.getProgress()) || (Objects.nonNull(tbTaskHistory.getProgress()) && tbTaskHistory.getProgress().doubleValue() < progress.doubleValue())) {
|
|
|
- tbTaskHistory.setProgress(progress.doubleValue());
|
|
|
- tbTaskHistoryService.updateById(tbTaskHistory);
|
|
|
+ BigDecimal progress = new BigDecimal(0);
|
|
|
+ BigDecimal b = new BigDecimal(100);
|
|
|
+ progress = new BigDecimal(currentTaskSize).divide(new BigDecimal(totalTaskSize), 2, BigDecimal.ROUND_HALF_UP).multiply(b);
|
|
|
+ if (Objects.isNull(tbTaskHistory.getProgress()) || (Objects.nonNull(tbTaskHistory.getProgress()) && tbTaskHistory.getProgress().doubleValue() < progress.doubleValue())) {
|
|
|
+ tbTaskHistory.setProgress(progress.doubleValue());
|
|
|
+ tbTaskHistoryService.updateById(tbTaskHistory);
|
|
|
+ }
|
|
|
+ tbTaskHistory.setRemark(jsonObject.toJSONString());
|
|
|
+ } else {
|
|
|
+ tOeExamRecordList = new ArrayList<>();
|
|
|
}
|
|
|
- tbTaskHistory.setRemark(jsonObject.toJSONString());
|
|
|
return tOeExamRecordList;
|
|
|
}
|
|
|
|
|
@@ -543,16 +543,19 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
|
|
|
tbTaskHistory.setRemark(jsonObject.toJSONString());
|
|
|
continue;
|
|
|
} else {
|
|
|
- cloudMarkUtil.callStudentSaveApi(new SaveStudentParams(orgId, cloudMarkExamId, SystemConstant.VALUE_OF_BLANK_REQUIRED_FIELD,
|
|
|
+ TOeExamRecord tOeExamRecord = tOeExamRecordMap.get(t.getId());
|
|
|
+ if (Objects.isNull(tOeExamRecord)) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ String courseCode = t.getCourseCode() + SystemConstant.JOINT_MARK + tOeExamRecord.getPaperId();
|
|
|
+ cloudMarkUtil.callStudentSaveApi(new SaveStudentParams(orgId, cloudMarkExamId, String.valueOf(tOeExamRecord.getId()),
|
|
|
t.getIdentity(),
|
|
|
t.getName(),
|
|
|
tbOrg.getName(),
|
|
|
- t.getClassNo(), SystemConstant.VALUE_OF_BLANK_REQUIRED_FIELD,
|
|
|
- t.getCourseCode(),
|
|
|
+ Objects.isNull(t.getClassNo()) ? SystemConstant.VALUE_OF_BLANK_REQUIRED_FIELD : t.getClassNo(),
|
|
|
+ SystemConstant.VALUE_OF_BLANK_REQUIRED_FIELD,
|
|
|
+ courseCode,
|
|
|
t.getCourseName()));
|
|
|
- TOeExamRecord tOeExamRecord = tOeExamRecordMap.get(t.getId());
|
|
|
- Optional.ofNullable(tOeExamRecord).orElseThrow(() -> new BusinessException(ExceptionResultEnum.NOT_FOUND_EXAM_RECORD));
|
|
|
-
|
|
|
Gson gson = new Gson();
|
|
|
OpenRecordNeedMarkBean openRecordNeedMarkBean = gson.fromJson(gson.toJson(tOeExamRecord), OpenRecordNeedMarkBean.class);
|
|
|
List<OpenRecordAnswerTempBean> answersTemp = examAnswerService.findByExamRecordId(tOeExamRecord.getId());
|
|
@@ -593,7 +596,7 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
|
|
|
}
|
|
|
IOUtils.write(JacksonUtil.parseJson(openRecordNeedMarkBean).getBytes(SystemConstant.CHARSET_NAME), new FileOutputStream(fileAnswerJson));
|
|
|
recordJsonList.add(fileAnswerJson);
|
|
|
- cloudMarkUtil.callFileUploadApi(new FileUploadParams(orgId, cloudMarkExamId, String.valueOf(tOeExamRecord.getId()), fileAnswerJson));
|
|
|
+ cloudMarkUtil.callFileUploadApi(new FileUploadParams(orgId, cloudMarkExamId, String.valueOf(tOeExamRecord.getId()), fileAnswerJson, CloudMarkFileUploadTypeEnum.JSON));
|
|
|
|
|
|
jsonObject.put("currentTaskSize", currentTaskSize);
|
|
|
currentTaskSize++;
|
|
@@ -782,8 +785,7 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
|
|
|
}
|
|
|
IOUtils.write(paperResult.toJSONString().getBytes(SystemConstant.CHARSET_NAME), new FileOutputStream(filePaperJson));
|
|
|
paperJsonList.add(filePaperJson);
|
|
|
- FileUploadParams fileUploadParamsPaperJson = new FileUploadParams(orgId, cloudMarkExamId, courseCode, CloudMarkFileUploadTypeEnum.PAPER, filePaperJson);
|
|
|
- fileUploadParamsPaperJson.setFormat(CloudMarkFileUploadTypeEnum.JSON.getCode());
|
|
|
+ FileUploadParams fileUploadParamsPaperJson = new FileUploadParams(orgId, cloudMarkExamId, courseCode, CloudMarkFileUploadTypeEnum.JSON, filePaperJson, CloudMarkFileUploadTypeEnum.PAPER);
|
|
|
cloudMarkUtil.callFileUploadApi(fileUploadParamsPaperJson);
|
|
|
|
|
|
jsonObject.put("currentTaskSize", currentTaskSize);
|