|
@@ -1,6 +1,8 @@
|
|
package com.qmth.themis.business.templete.impl;
|
|
package com.qmth.themis.business.templete.impl;
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
+import com.alibaba.fastjson.JSONArray;
|
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
@@ -119,6 +121,7 @@ public class TaskMarkResultStandardExportTemplete implements TaskExportTemplete
|
|
markResultQueryExportIpage = teExamStudentService.markResultQueryExportIpage(new Page<>(pageNumber, pageSize), examId, activityId, identity, name, courseCode);
|
|
markResultQueryExportIpage = teExamStudentService.markResultQueryExportIpage(new Page<>(pageNumber, pageSize), examId, activityId, identity, name, courseCode);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ Map<Long, Map<String, Double>> subjectiveScoreMap = null;
|
|
if (!CollectionUtils.isEmpty(markResultSimpleExportDtoList)) {
|
|
if (!CollectionUtils.isEmpty(markResultSimpleExportDtoList)) {
|
|
Set<String> examRecordIdsSet = new LinkedHashSet<>(markResultSimpleExportDtoList.size());
|
|
Set<String> examRecordIdsSet = new LinkedHashSet<>(markResultSimpleExportDtoList.size());
|
|
for (MarkResultSimpleExportDto markResultSimpleExportDto : markResultSimpleExportDtoList) {
|
|
for (MarkResultSimpleExportDto markResultSimpleExportDto : markResultSimpleExportDtoList) {
|
|
@@ -148,9 +151,30 @@ public class TaskMarkResultStandardExportTemplete implements TaskExportTemplete
|
|
//获取云阅卷同步成绩
|
|
//获取云阅卷同步成绩
|
|
List<TSyncExamStudentScore> tSyncExamStudentScoreList = tSyncExamStudentScoreService.findByExamRecordIds(examRecordIdsSet);
|
|
List<TSyncExamStudentScore> tSyncExamStudentScoreList = tSyncExamStudentScoreService.findByExamRecordIds(examRecordIdsSet);
|
|
if (!CollectionUtils.isEmpty(tSyncExamStudentScoreList)) {
|
|
if (!CollectionUtils.isEmpty(tSyncExamStudentScoreList)) {
|
|
|
|
+ subjectiveScoreMap = new LinkedHashMap<>(tSyncExamStudentScoreList.size());
|
|
for (TSyncExamStudentScore t : tSyncExamStudentScoreList) {
|
|
for (TSyncExamStudentScore t : tSyncExamStudentScoreList) {
|
|
MarkResultSimpleExportDto markResultSimpleExportDto = markResultSimpleExportDtoMap.get(t.getExamNumber());
|
|
MarkResultSimpleExportDto markResultSimpleExportDto = markResultSimpleExportDtoMap.get(t.getExamNumber());
|
|
if (Objects.nonNull(markResultSimpleExportDto)) {
|
|
if (Objects.nonNull(markResultSimpleExportDto)) {
|
|
|
|
+ if (Objects.nonNull(t.getSubjectiveScoreDetail()) && !Objects.equals(t.getSubjectiveScoreDetail().trim(), "")) {
|
|
|
|
+ JSONArray subjectiveScoreDetailJsonArray = JSONArray.parseArray(t.getSubjectiveScoreDetail());
|
|
|
|
+ Map<String, Double> tOeExamAnswerMap = new LinkedHashMap<>(subjectiveScoreDetailJsonArray.size());
|
|
|
|
+ for (int i = 0; i < subjectiveScoreDetailJsonArray.size(); i++) {
|
|
|
|
+ JSONObject jsonObject = subjectiveScoreDetailJsonArray.getJSONObject(i);
|
|
|
|
+ Integer mainNumber = jsonObject.getInteger("mainNumber");
|
|
|
|
+ Integer subNumber = jsonObject.getInteger("subNumber");
|
|
|
|
+ Integer subIndex = jsonObject.getInteger("subIndex");
|
|
|
|
+ Double score = jsonObject.getDouble("score");
|
|
|
|
+ String questionsTitle = String.valueOf(mainNumber);
|
|
|
|
+ questionsTitle = Objects.nonNull(subNumber) ?
|
|
|
|
+ questionsTitle + "_" + subNumber :
|
|
|
|
+ questionsTitle;
|
|
|
|
+ questionsTitle = Objects.nonNull(subIndex) ?
|
|
|
|
+ questionsTitle + "_" + subIndex :
|
|
|
|
+ questionsTitle;
|
|
|
|
+ tOeExamAnswerMap.put(questionsTitle, score);
|
|
|
|
+ }
|
|
|
|
+ subjectiveScoreMap.put(Long.parseLong(t.getExamNumber()), tOeExamAnswerMap);
|
|
|
|
+ }
|
|
markResultSimpleExportDto.setSubjectiveScore(Objects.isNull(t.getSubjectiveScore()) ? "0" : String.valueOf(t.getSubjectiveScore()));
|
|
markResultSimpleExportDto.setSubjectiveScore(Objects.isNull(t.getSubjectiveScore()) ? "0" : String.valueOf(t.getSubjectiveScore()));
|
|
markResultSimpleExportDto.setSumScore(String.valueOf(Double.parseDouble(markResultSimpleExportDto.getObjectiveScore()) + Double.parseDouble(markResultSimpleExportDto.getSubjectiveScore())));
|
|
markResultSimpleExportDto.setSumScore(String.valueOf(Double.parseDouble(markResultSimpleExportDto.getObjectiveScore()) + Double.parseDouble(markResultSimpleExportDto.getSubjectiveScore())));
|
|
}
|
|
}
|
|
@@ -210,6 +234,7 @@ public class TaskMarkResultStandardExportTemplete implements TaskExportTemplete
|
|
String title = QuestionTypeEnum.convertToTitle(structType) + questionsTitle;
|
|
String title = QuestionTypeEnum.convertToTitle(structType) + questionsTitle;
|
|
String answer = null;
|
|
String answer = null;
|
|
ExcelDto excelAnswerDto = null;
|
|
ExcelDto excelAnswerDto = null;
|
|
|
|
+ Double score = null;
|
|
if (structType.intValue() == 1 || structType.intValue() == 2) {
|
|
if (structType.intValue() == 1 || structType.intValue() == 2) {
|
|
String string = s.getAnswer().replace("[", "").replace("]", "")
|
|
String string = s.getAnswer().replace("[", "").replace("]", "")
|
|
.replaceAll(" ", "").replaceAll("\n", "");
|
|
.replaceAll(" ", "").replaceAll("\n", "");
|
|
@@ -222,13 +247,21 @@ public class TaskMarkResultStandardExportTemplete implements TaskExportTemplete
|
|
answer = answerList.toString();
|
|
answer = answerList.toString();
|
|
}
|
|
}
|
|
excelAnswerDto = new ExcelDto(title + "作答", answer);
|
|
excelAnswerDto = new ExcelDto(title + "作答", answer);
|
|
|
|
+ score = s.getScore();
|
|
} else if (structType.intValue() == 3) {
|
|
} else if (structType.intValue() == 3) {
|
|
answer = AnswerTypeEnum
|
|
answer = AnswerTypeEnum
|
|
.convertToTitle(s.getAnswer().replaceAll("\n", "").toUpperCase());
|
|
.convertToTitle(s.getAnswer().replaceAll("\n", "").toUpperCase());
|
|
excelAnswerDto = new ExcelDto(title + "作答", answer);
|
|
excelAnswerDto = new ExcelDto(title + "作答", answer);
|
|
|
|
+ score = s.getScore();
|
|
|
|
+ }
|
|
|
|
+ if (Objects.isNull(score) && !CollectionUtils.isEmpty(subjectiveScoreMap)) {
|
|
|
|
+ Map<String, Double> tOeExamAnswerMap = subjectiveScoreMap.get(s.getExamRecordId());
|
|
|
|
+ if (!CollectionUtils.isEmpty(tOeExamAnswerMap) && Objects.nonNull(tOeExamAnswerMap.get(questionsTitle))) {
|
|
|
|
+ score = tOeExamAnswerMap.get(questionsTitle);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
ExcelDto excelScoreDto = new ExcelDto(title + "得分",
|
|
ExcelDto excelScoreDto = new ExcelDto(title + "得分",
|
|
- Objects.nonNull(s.getScore()) ? String.valueOf(s.getScore()) : null);
|
|
|
|
|
|
+ Objects.nonNull(score) ? String.valueOf(score) : "0");
|
|
List<ExcelDto> excelDtoList = null;
|
|
List<ExcelDto> excelDtoList = null;
|
|
if (!excelDtoMap.containsKey(m.getExamStudentId())) {
|
|
if (!excelDtoMap.containsKey(m.getExamStudentId())) {
|
|
excelDtoList = new ArrayList<>();
|
|
excelDtoList = new ArrayList<>();
|