From 6dc4345f9c84d829566ae1632477f11c22fac2f5 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期一, 27 五月 2024 11:48:02 +0800
Subject: [PATCH] 题目查询增加题干搜索
---
src/main/java/com/mindskip/xzs/service/impl/ExamPaperAnswerServiceImpl.java | 22 +++++++++++++++++++++-
1 files changed, 21 insertions(+), 1 deletions(-)
diff --git a/src/main/java/com/mindskip/xzs/service/impl/ExamPaperAnswerServiceImpl.java b/src/main/java/com/mindskip/xzs/service/impl/ExamPaperAnswerServiceImpl.java
index cc3f478..3f362f2 100644
--- a/src/main/java/com/mindskip/xzs/service/impl/ExamPaperAnswerServiceImpl.java
+++ b/src/main/java/com/mindskip/xzs/service/impl/ExamPaperAnswerServiceImpl.java
@@ -32,6 +32,7 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
+import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
@@ -317,7 +318,25 @@
@Override
public Map<String, Object> statistic(ExamPaperStatisticVO examPaperStatisticVO) {
// 鑾峰彇鍘熷鏁版嵁
- Map<String, Object> histogram = examPaperAnswerMapper.histogram(examPaperStatisticVO);
+ Map<String, Object> histogram;
+ ExamPaperDataExportVO examPaperDataExportVO;
+ if (Objects.equals(examPaperStatisticVO.getExamPaperType(), 7)) {
+ histogram = examPaperAnswerMapper.histogramByTemplate(examPaperStatisticVO);
+ examPaperDataExportVO = examPaperAnswerMapper.totalByTemplate(new ExamPaperDataVO().setId(examPaperStatisticVO.getExamPaperId()).setDeptIds(examPaperStatisticVO.getDepartmentId()));
+ } else {
+ histogram = examPaperAnswerMapper.histogram(examPaperStatisticVO);
+ examPaperDataExportVO = examPaperAnswerMapper.totalByPaper(new ExamPaperDataVO().setId(examPaperStatisticVO.getExamPaperId()).setDeptIds(examPaperStatisticVO.getDepartmentId()));
+ }
+
+ // 涓嶅瓨鍦ㄦ椂濉厖0
+ if (Objects.isNull(examPaperDataExportVO)) {
+ examPaperDataExportVO = new ExamPaperDataExportVO()
+ .setExamTotal(examPaperAnswerMapper.getExamTotal(examPaperStatisticVO))
+ .setFactPeopleTotal(0)
+ .setAverageScore(BigDecimal.ZERO)
+ .setReferencePercentage(BigDecimal.ZERO);
+ }
+
Map<String, Object> pieChart = examPaperAnswerMapper.pieChart(examPaperStatisticVO);
// 鍒濆鍖栫粨鏋滃鍣�
HashMap<String, Object> map = new HashMap<>();
@@ -349,6 +368,7 @@
map.put("score", score);
map.put("age", age);
map.put("examPeopleNum", examPeopleNum);
+ map.put("total", examPaperDataExportVO);
return map;
}
--
Gitblit v1.8.0