|
@@ -1,14 +1,21 @@
|
|
|
package com.qmth.themis.business.templete.impl;
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.google.common.reflect.TypeToken;
|
|
|
import com.google.gson.Gson;
|
|
|
import com.qmth.themis.business.annotation.ExcelNotExport;
|
|
|
import com.qmth.themis.business.annotation.ExcelNote;
|
|
|
+import com.qmth.themis.business.cache.bean.ObjectiveAnswerCacheBean;
|
|
|
import com.qmth.themis.business.constant.SystemConstant;
|
|
|
+import com.qmth.themis.business.dto.ExcelDto;
|
|
|
import com.qmth.themis.business.dto.MarkResultSimpleExportDto;
|
|
|
import com.qmth.themis.business.dto.MarkResultStandardExportDto;
|
|
|
+import com.qmth.themis.business.entity.TOeExamAnswer;
|
|
|
+import com.qmth.themis.business.enums.QuestionTypeEnum;
|
|
|
+import com.qmth.themis.business.service.TEExamPaperService;
|
|
|
import com.qmth.themis.business.service.TEExamStudentService;
|
|
|
+import com.qmth.themis.business.service.TOeExamAnswerService;
|
|
|
import com.qmth.themis.business.templete.TaskExportCommon;
|
|
|
import com.qmth.themis.business.templete.TaskExportTemplete;
|
|
|
import com.qmth.themis.business.templete.service.TempleteLogicService;
|
|
@@ -47,6 +54,12 @@ public class TaskMarkResultStandardExportTemplete implements TaskExportTemplete
|
|
|
@Resource
|
|
|
TempleteLogicService templeteLogicService;
|
|
|
|
|
|
+ @Resource
|
|
|
+ TOeExamAnswerService tOeExamAnswerService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ TEExamPaperService teExamPaperService;
|
|
|
+
|
|
|
/**
|
|
|
* 考场导出模版
|
|
|
*
|
|
@@ -76,6 +89,35 @@ public class TaskMarkResultStandardExportTemplete implements TaskExportTemplete
|
|
|
Gson gson = new Gson();
|
|
|
List<MarkResultStandardExportDto> markResultStandardExportDtoList = gson.fromJson(gson.toJson(markResultSimpleExportDtoList), new TypeToken<List<MarkResultStandardExportDto>>() {
|
|
|
}.getType());
|
|
|
+ Map<Long, ExcelDto> excelDtoMap = new HashMap<>();
|
|
|
+ Map<Long, Map<String, ObjectiveAnswerCacheBean>> paperObjectiveAnswerMap = new HashMap<>();
|
|
|
+ if (Objects.nonNull(markResultStandardExportDtoList) && markResultStandardExportDtoList.size() > 0) {
|
|
|
+ for (MarkResultStandardExportDto m : markResultStandardExportDtoList) {
|
|
|
+ Map<String, ObjectiveAnswerCacheBean> objectiveAnswerCacheBeanMap = null;
|
|
|
+ if (Objects.nonNull(m.getPaperId())) {//处理试卷
|
|
|
+ if (!paperObjectiveAnswerMap.containsKey(m.getPaperId())) {
|
|
|
+ objectiveAnswerCacheBeanMap = teExamPaperService.getObjectiveAnswerCacheBean(m.getPaperId());
|
|
|
+ paperObjectiveAnswerMap.put(m.getPaperId(), objectiveAnswerCacheBeanMap);
|
|
|
+ } else {
|
|
|
+ objectiveAnswerCacheBeanMap = paperObjectiveAnswerMap.get(m.getPaperId());
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ if (Objects.nonNull(m.getRecordId())) {//处理考生答案
|
|
|
+ QueryWrapper<TOeExamAnswer> tOeExamAnswerQueryWrapper = new QueryWrapper<>();
|
|
|
+ tOeExamAnswerQueryWrapper.lambda().eq(TOeExamAnswer::getExamRecordId, m.getRecordId());
|
|
|
+ List<TOeExamAnswer> tOeExamAnswerList = tOeExamAnswerService.list(tOeExamAnswerQueryWrapper);
|
|
|
+ for (TOeExamAnswer s : tOeExamAnswerList) {
|
|
|
+ String questionsTitle = s.getMainNumber() + "_" + s.getSubNumber();
|
|
|
+ if (Objects.nonNull(s.getAnswer())) {
|
|
|
+ ObjectiveAnswerCacheBean objectiveAnswerCacheBean = objectiveAnswerCacheBeanMap.get(questionsTitle);
|
|
|
+// String questionType = QuestionTypeEnum.valueOf(Long.parseLong(objectiveAnswerCacheBean.getStructType())).getTitle();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
boolean oss = (boolean) taskExportCommon.getOssEnv().get(SystemConstant.OSS);
|
|
|
StringJoiner stringJoiner = new StringJoiner("");
|
|
|
if (!oss) {
|