|
@@ -12,6 +12,7 @@ import com.qmth.themis.business.dto.ExcelDto;
|
|
import com.qmth.themis.business.dto.MarkResultSimpleExportDto;
|
|
import com.qmth.themis.business.dto.MarkResultSimpleExportDto;
|
|
import com.qmth.themis.business.dto.MarkResultStandardExportDto;
|
|
import com.qmth.themis.business.dto.MarkResultStandardExportDto;
|
|
import com.qmth.themis.business.entity.TOeExamAnswer;
|
|
import com.qmth.themis.business.entity.TOeExamAnswer;
|
|
|
|
+import com.qmth.themis.business.enums.AnswerTypeEnum;
|
|
import com.qmth.themis.business.enums.QuestionTypeEnum;
|
|
import com.qmth.themis.business.enums.QuestionTypeEnum;
|
|
import com.qmth.themis.business.service.TEExamPaperService;
|
|
import com.qmth.themis.business.service.TEExamPaperService;
|
|
import com.qmth.themis.business.service.TEExamStudentService;
|
|
import com.qmth.themis.business.service.TEExamStudentService;
|
|
@@ -89,10 +90,11 @@ public class TaskMarkResultStandardExportTemplete implements TaskExportTemplete
|
|
Gson gson = new Gson();
|
|
Gson gson = new Gson();
|
|
List<MarkResultStandardExportDto> markResultStandardExportDtoList = gson.fromJson(gson.toJson(markResultSimpleExportDtoList), new TypeToken<List<MarkResultStandardExportDto>>() {
|
|
List<MarkResultStandardExportDto> markResultStandardExportDtoList = gson.fromJson(gson.toJson(markResultSimpleExportDtoList), new TypeToken<List<MarkResultStandardExportDto>>() {
|
|
}.getType());
|
|
}.getType());
|
|
- Map<Long, ExcelDto> excelDtoMap = new HashMap<>();
|
|
|
|
|
|
+ Map<Long, List<ExcelDto>> excelDtoMap = null;
|
|
Map<Long, Map<String, ObjectiveAnswerCacheBean>> paperObjectiveAnswerMap = new HashMap<>();
|
|
Map<Long, Map<String, ObjectiveAnswerCacheBean>> paperObjectiveAnswerMap = new HashMap<>();
|
|
if (Objects.nonNull(markResultStandardExportDtoList) && markResultStandardExportDtoList.size() > 0) {
|
|
if (Objects.nonNull(markResultStandardExportDtoList) && markResultStandardExportDtoList.size() > 0) {
|
|
for (MarkResultStandardExportDto m : markResultStandardExportDtoList) {
|
|
for (MarkResultStandardExportDto m : markResultStandardExportDtoList) {
|
|
|
|
+ excelDtoMap = new HashMap<>();
|
|
Map<String, ObjectiveAnswerCacheBean> objectiveAnswerCacheBeanMap = null;
|
|
Map<String, ObjectiveAnswerCacheBean> objectiveAnswerCacheBeanMap = null;
|
|
if (Objects.nonNull(m.getPaperId())) {//处理试卷
|
|
if (Objects.nonNull(m.getPaperId())) {//处理试卷
|
|
if (!paperObjectiveAnswerMap.containsKey(m.getPaperId())) {
|
|
if (!paperObjectiveAnswerMap.containsKey(m.getPaperId())) {
|
|
@@ -112,10 +114,33 @@ public class TaskMarkResultStandardExportTemplete implements TaskExportTemplete
|
|
String questionsTitle = s.getMainNumber() + "_" + s.getSubNumber();
|
|
String questionsTitle = s.getMainNumber() + "_" + s.getSubNumber();
|
|
if (Objects.nonNull(s.getAnswer())) {
|
|
if (Objects.nonNull(s.getAnswer())) {
|
|
ObjectiveAnswerCacheBean objectiveAnswerCacheBean = objectiveAnswerCacheBeanMap.get(questionsTitle);
|
|
ObjectiveAnswerCacheBean objectiveAnswerCacheBean = objectiveAnswerCacheBeanMap.get(questionsTitle);
|
|
-// String questionType = QuestionTypeEnum.valueOf(Long.parseLong(objectiveAnswerCacheBean.getStructType())).getTitle();
|
|
|
|
|
|
+ String title = QuestionTypeEnum.convertToTitle(objectiveAnswerCacheBean.getStructType()) + questionsTitle;
|
|
|
|
+ String answer = null;
|
|
|
|
+ if (objectiveAnswerCacheBean.getStructType().intValue() == 1 || objectiveAnswerCacheBean.getStructType().intValue() == 2) {
|
|
|
|
+ List<String> list = Arrays.asList(s.getAnswer().replace("[", "").replace("]", "").replaceAll(" ", "").replaceAll("\n", "").split(","));
|
|
|
|
+ List<String> answerList = new ArrayList<>();
|
|
|
|
+ for (String s1 : list) {
|
|
|
|
+ answerList.add(AnswerTypeEnum.convertToTitle(s1.toUpperCase()));
|
|
|
|
+ }
|
|
|
|
+ answer = answerList.toString();
|
|
|
|
+ } else if (objectiveAnswerCacheBean.getStructType().intValue() == 3) {
|
|
|
|
+ answer = AnswerTypeEnum.convertToTitle(s.getAnswer().toUpperCase());
|
|
|
|
+ }
|
|
|
|
+ ExcelDto excelAnswerDto = new ExcelDto(title + "作答", answer);
|
|
|
|
+ ExcelDto excelScoreDto = new ExcelDto(title + "得分", String.valueOf(s.getScore()));
|
|
|
|
+ List<ExcelDto> excelDtoList = null;
|
|
|
|
+ if (!excelDtoMap.containsKey(m.getExamStudentId())) {
|
|
|
|
+ excelDtoList = new ArrayList<>();
|
|
|
|
+ } else {
|
|
|
|
+ excelDtoList = excelDtoMap.get(m.getExamStudentId());
|
|
|
|
+ }
|
|
|
|
+ excelDtoList.add(excelAnswerDto);
|
|
|
|
+ excelDtoList.add(excelScoreDto);
|
|
|
|
+ excelDtoMap.put(m.getExamStudentId(), excelDtoList);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ m.setAnswerExcetDto(excelDtoMap);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
boolean oss = (boolean) taskExportCommon.getOssEnv().get(SystemConstant.OSS);
|
|
boolean oss = (boolean) taskExportCommon.getOssEnv().get(SystemConstant.OSS);
|