|
@@ -737,9 +737,10 @@ public class ExamStudentServiceImpl extends BaseQueryService<ExamStudent> implem
|
|
|
*/
|
|
|
@Override
|
|
|
public Map<Integer, List<PictureTag>> buildSheetTags(ExamStudent student) {
|
|
|
+ DecimalFormat format = new DecimalFormat("###.#");
|
|
|
Map<MarkGroup, List<OriginTag>> tagMap = new HashMap<MarkGroup, List<OriginTag>>();
|
|
|
Exam exam = examService.findById(student.getExamId());
|
|
|
- List<PictureConfigItem> sliceConfig = PictureConfigItem.parse(exam.getSliceConfig());
|
|
|
+ List<PictureConfigItem> sliceConfig = exam.getSliceConfigList();
|
|
|
if (!sliceConfig.isEmpty()) {
|
|
|
// 裁切图配置存在时才继续下面内容
|
|
|
List<ExamQuestion> questions = questionService.findByExamAndSubjectAndObjective(student.getExamId(),
|
|
@@ -751,7 +752,50 @@ public class ExamStudentServiceImpl extends BaseQueryService<ExamStudent> implem
|
|
|
tagMap.put(group, buildOriginTags(student, group, questions, scoreList));
|
|
|
}
|
|
|
}
|
|
|
- return PictureConfigTransform.process(sliceConfig, tagMap);
|
|
|
+ Map<Integer, List<PictureTag>> map = PictureConfigTransform.process(sliceConfig, tagMap);
|
|
|
+ // 开始构建总分与客观题得分明细
|
|
|
+ List<String> lines = new LinkedList<>();
|
|
|
+ lines.add("成绩明细");
|
|
|
+ lines.add("总分 (客观+主观) | " + format.format(student.getTotalScore()) + "="
|
|
|
+ + format.format(student.getObjectiveScore() != null ? student.getObjectiveScore() : 0) + "+"
|
|
|
+ + format.format(student.getSubjectiveScore() != null ? student.getSubjectiveScore() : 0));
|
|
|
+ lines.add("客观题结果");
|
|
|
+
|
|
|
+ List<ExamQuestion> questions = questionService.findByExamAndSubjectAndObjective(student.getExamId(),
|
|
|
+ student.getSubjectCode(), true);
|
|
|
+ List<ScoreItem> scoreList = student.getScoreList(true);
|
|
|
+ List<String> details = new ArrayList<>();
|
|
|
+ int i = 0;
|
|
|
+ for (ScoreItem item : scoreList) {
|
|
|
+ i++;
|
|
|
+ if (questions.size() < i) {
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ ExamQuestion question = questions.get(i - 1);
|
|
|
+ if (question.getTotalScore() == null || question.getTotalScore() == 0) {
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ details.add(item.getAnswer() + ":" + format.format(item.getScore()));
|
|
|
+ if (details.size() == 20) {
|
|
|
+ lines.add(StringUtils.join(details, ","));
|
|
|
+ details.clear();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if (!details.isEmpty()) {
|
|
|
+ lines.add(StringUtils.join(details, ","));
|
|
|
+ details.clear();
|
|
|
+ }
|
|
|
+ PictureTag headerTag = new PictureTag();
|
|
|
+ headerTag.setSize(30);
|
|
|
+ headerTag.setContent(lines);
|
|
|
+ // 添加到第一张图片的标记列表中
|
|
|
+ List<PictureTag> list = map.get(1);
|
|
|
+ if (list == null) {
|
|
|
+ list = new LinkedList<>();
|
|
|
+ map.put(1, list);
|
|
|
+ }
|
|
|
+ list.add(headerTag);
|
|
|
+ return map;
|
|
|
}
|
|
|
|
|
|
/**
|