|
@@ -11,6 +11,9 @@ import com.qmth.themis.business.bean.admin.OpenRecordAnswerStructBean;
|
|
import com.qmth.themis.business.bean.admin.OpenRecordAnswerTempBean;
|
|
import com.qmth.themis.business.bean.admin.OpenRecordAnswerTempBean;
|
|
import com.qmth.themis.business.bean.admin.OpenRecordNeedMarkBean;
|
|
import com.qmth.themis.business.bean.admin.OpenRecordNeedMarkBean;
|
|
import com.qmth.themis.business.bean.cloudmark.FileUploadParams;
|
|
import com.qmth.themis.business.bean.cloudmark.FileUploadParams;
|
|
|
|
+import com.qmth.themis.business.bean.cloudmark.SaveExamParams;
|
|
|
|
+import com.qmth.themis.business.bean.cloudmark.SaveStudentParams;
|
|
|
|
+import com.qmth.themis.business.bean.cloudmark.SaveSubjectParams;
|
|
import com.qmth.themis.business.cache.RedisKeyHelper;
|
|
import com.qmth.themis.business.cache.RedisKeyHelper;
|
|
import com.qmth.themis.business.cache.bean.ExamCacheBean;
|
|
import com.qmth.themis.business.cache.bean.ExamCacheBean;
|
|
import com.qmth.themis.business.cache.bean.ExamCourseCacheBean;
|
|
import com.qmth.themis.business.cache.bean.ExamCourseCacheBean;
|
|
@@ -409,8 +412,8 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
|
|
public Map<String, Object> execPushCloudMarkDataLogic(Map<String, Object> map) throws IOException {
|
|
public Map<String, Object> execPushCloudMarkDataLogic(Map<String, Object> map) throws IOException {
|
|
checkData(map);
|
|
checkData(map);
|
|
Long examId = (Long) map.get(SystemConstant.EXAM_ID);
|
|
Long examId = (Long) map.get(SystemConstant.EXAM_ID);
|
|
-// Long orgId = (Long) map.get(SystemConstant.ORG_ID);
|
|
|
|
-// String examCode = (String) map.get(SystemConstant.EXAM_CODE);
|
|
|
|
|
|
+ Long orgId = (Long) map.get(SystemConstant.ORG_ID);
|
|
|
|
+ String examCode = (String) map.get(SystemConstant.EXAM_CODE);
|
|
|
|
|
|
//先推送考试
|
|
//先推送考试
|
|
ExamCacheBean examCacheBean = teExamService.getExamCacheBean(examId);
|
|
ExamCacheBean examCacheBean = teExamService.getExamCacheBean(examId);
|
|
@@ -421,8 +424,8 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
|
|
|
|
|
|
TEExam teExam = teExamService.cacheConvert(examCacheBean);
|
|
TEExam teExam = teExamService.cacheConvert(examCacheBean);
|
|
if (Objects.isNull(tbTaskHistory.getEntityId())) {
|
|
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, examId, examCode, examCacheBean.getName(), DateUtil.format(new Date(examCacheBean.getStartTime()), Constants.DEFAULT_DATE_PATTERN)));
|
|
|
|
+// cloudMarkExamId = Long.parseLong((int) (Math.random() * 1000) + "");
|
|
teExam.setUpdateTime(System.currentTimeMillis());
|
|
teExam.setUpdateTime(System.currentTimeMillis());
|
|
teExam.setThirdExamId(String.valueOf(cloudMarkExamId));
|
|
teExam.setThirdExamId(String.valueOf(cloudMarkExamId));
|
|
teExamService.updateById(teExam);
|
|
teExamService.updateById(teExam);
|
|
@@ -620,9 +623,6 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
|
|
while (max <= size) {
|
|
while (max <= size) {
|
|
List<TEExamStudent> subList = teExamStudentList.subList(min, max);
|
|
List<TEExamStudent> subList = teExamStudentList.subList(min, max);
|
|
for (int y = 0; y < subList.size(); y++) {
|
|
for (int y = 0; y < subList.size(); y++) {
|
|
-// if (y == 300) {
|
|
|
|
-// int k = 1 / 0;
|
|
|
|
-// }
|
|
|
|
TEExamStudent t = subList.get(y);
|
|
TEExamStudent t = subList.get(y);
|
|
if (jsCurrentTaskSize.intValue() > 0 && currentTaskSize.intValue() < jsCurrentTaskSize.intValue()) {
|
|
if (jsCurrentTaskSize.intValue() > 0 && currentTaskSize.intValue() < jsCurrentTaskSize.intValue()) {
|
|
jsonObject.put("currentTaskSize", currentTaskSize);
|
|
jsonObject.put("currentTaskSize", currentTaskSize);
|
|
@@ -630,17 +630,14 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
|
|
tbTaskHistory.setRemark(jsonObject.toJSONString());
|
|
tbTaskHistory.setRemark(jsonObject.toJSONString());
|
|
continue;
|
|
continue;
|
|
} else {
|
|
} else {
|
|
-// cloudMarkUtil.callStudentSaveApi(new SaveStudentParams(orgId, cloudMarkExamId, SystemConstant.VALUE_OF_BLANK_REQUIRED_FIELD,
|
|
|
|
-// t.getIdentity(),
|
|
|
|
-// t.getName(),
|
|
|
|
-// tbOrg.getName(),
|
|
|
|
-// t.getClassNo(), SystemConstant.VALUE_OF_BLANK_REQUIRED_FIELD,
|
|
|
|
-// t.getCourseCode(),
|
|
|
|
-// t.getCourseName()));
|
|
|
|
|
|
+ cloudMarkUtil.callStudentSaveApi(new SaveStudentParams(orgId, cloudMarkExamId, SystemConstant.VALUE_OF_BLANK_REQUIRED_FIELD,
|
|
|
|
+ t.getIdentity(),
|
|
|
|
+ t.getName(),
|
|
|
|
+ tbOrg.getName(),
|
|
|
|
+ t.getClassNo(), SystemConstant.VALUE_OF_BLANK_REQUIRED_FIELD,
|
|
|
|
+ t.getCourseCode(),
|
|
|
|
+ t.getCourseName()));
|
|
TOeExamRecord tOeExamRecord = tOeExamRecordMap.get(t.getId());
|
|
TOeExamRecord tOeExamRecord = tOeExamRecordMap.get(t.getId());
|
|
-// if (Objects.isNull(tOeExamRecord)) {
|
|
|
|
-// continue;
|
|
|
|
-// }
|
|
|
|
Optional.ofNullable(tOeExamRecord).orElseThrow(() -> new BusinessException(ExceptionResultEnum.NOT_FOUND_EXAM_RECORD));
|
|
Optional.ofNullable(tOeExamRecord).orElseThrow(() -> new BusinessException(ExceptionResultEnum.NOT_FOUND_EXAM_RECORD));
|
|
|
|
|
|
Gson gson = new Gson();
|
|
Gson gson = new Gson();
|
|
@@ -683,8 +680,7 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
|
|
}
|
|
}
|
|
IOUtils.write(JacksonUtil.parseJson(openRecordNeedMarkBean).getBytes(SystemConstant.CHARSET_NAME), new FileOutputStream(fileAnswerJson));
|
|
IOUtils.write(JacksonUtil.parseJson(openRecordNeedMarkBean).getBytes(SystemConstant.CHARSET_NAME), new FileOutputStream(fileAnswerJson));
|
|
recordJsonList.add(fileAnswerJson);
|
|
recordJsonList.add(fileAnswerJson);
|
|
- FileUploadParams fileUploadParamsAnswerJson = new FileUploadParams(orgId, cloudMarkExamId, String.valueOf(tOeExamRecord.getId()), fileAnswerJson);
|
|
|
|
-// cloudMarkUtil.callFileUploadApi(fileUploadParamsAnswerJson);
|
|
|
|
|
|
+ cloudMarkUtil.callFileUploadApi(new FileUploadParams(orgId, cloudMarkExamId, String.valueOf(tOeExamRecord.getId()), fileAnswerJson));
|
|
|
|
|
|
jsonObject.put("currentTaskSize", currentTaskSize);
|
|
jsonObject.put("currentTaskSize", currentTaskSize);
|
|
currentTaskSize++;
|
|
currentTaskSize++;
|
|
@@ -816,9 +812,6 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
|
|
paperJsonList = new ArrayList<>(teExamPaperList.size());
|
|
paperJsonList = new ArrayList<>(teExamPaperList.size());
|
|
map.put("paperJsonList", paperJsonList);
|
|
map.put("paperJsonList", paperJsonList);
|
|
for (int i = 0; i < teExamPaperList.size(); i++) {
|
|
for (int i = 0; i < teExamPaperList.size(); i++) {
|
|
-// if (i == 10) {
|
|
|
|
-// int y = 1 / 0;
|
|
|
|
-// }
|
|
|
|
TEExamPaper t = teExamPaperList.get(i);
|
|
TEExamPaper t = teExamPaperList.get(i);
|
|
examPaperIdSet.add(t.getId());
|
|
examPaperIdSet.add(t.getId());
|
|
if (jsCurrentTaskSize.intValue() > 0 && currentTaskSize.intValue() < jsCurrentTaskSize.intValue()) {
|
|
if (jsCurrentTaskSize.intValue() > 0 && currentTaskSize.intValue() < jsCurrentTaskSize.intValue()) {
|
|
@@ -828,7 +821,7 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
|
|
continue;
|
|
continue;
|
|
} else {
|
|
} else {
|
|
String courseCode = t.getCourseCode() + SystemConstant.JOINT_MARK + t.getId();
|
|
String courseCode = t.getCourseCode() + SystemConstant.JOINT_MARK + t.getId();
|
|
-// cloudMarkUtil.callSubjectSaveApi(new SaveSubjectParams(orgId, cloudMarkExamId, courseCode, t.getName()));
|
|
|
|
|
|
+ cloudMarkUtil.callSubjectSaveApi(new SaveSubjectParams(orgId, cloudMarkExamId, courseCode, t.getName()));
|
|
//解析试卷JSON文件
|
|
//解析试卷JSON文件
|
|
JSONObject paperResult = JSONObject.parseObject(new String(ossUtil.download(false, t.getPaperViewPath()), StandardCharsets.UTF_8));
|
|
JSONObject paperResult = JSONObject.parseObject(new String(ossUtil.download(false, t.getPaperViewPath()), StandardCharsets.UTF_8));
|
|
paperResult.put(SystemConstant.ID, t.getId());
|
|
paperResult.put(SystemConstant.ID, t.getId());
|
|
@@ -866,7 +859,7 @@ public class TempleteLogicServiceImpl implements TempleteLogicService {
|
|
paperJsonList.add(filePaperJson);
|
|
paperJsonList.add(filePaperJson);
|
|
FileUploadParams fileUploadParamsPaperJson = new FileUploadParams(orgId, cloudMarkExamId, courseCode, CloudMarkFileUploadTypeEnum.PAPER, filePaperJson);
|
|
FileUploadParams fileUploadParamsPaperJson = new FileUploadParams(orgId, cloudMarkExamId, courseCode, CloudMarkFileUploadTypeEnum.PAPER, filePaperJson);
|
|
fileUploadParamsPaperJson.setFormat(CloudMarkFileUploadTypeEnum.JSON.getCode());
|
|
fileUploadParamsPaperJson.setFormat(CloudMarkFileUploadTypeEnum.JSON.getCode());
|
|
-// cloudMarkUtil.callFileUploadApi(fileUploadParamsPaperJson);
|
|
|
|
|
|
+ cloudMarkUtil.callFileUploadApi(fileUploadParamsPaperJson);
|
|
|
|
|
|
jsonObject.put("currentTaskSize", currentTaskSize);
|
|
jsonObject.put("currentTaskSize", currentTaskSize);
|
|
currentTaskSize++;
|
|
currentTaskSize++;
|