xiangpei
2024-05-23 161d73fef78ab215077a5f1e87d8b586f29c764f
src/main/java/com/mindskip/xzs/service/impl/ExamPaperAnswerServiceImpl.java
@@ -10,6 +10,8 @@
import com.mindskip.xzs.domain.other.ExamPaperAnswerUpdate;
import com.mindskip.xzs.domain.other.KeyValue;
import com.mindskip.xzs.domain.task.TaskItemAnswerObject;
import com.mindskip.xzs.domain.vo.ExamPaperDataVO;
import com.mindskip.xzs.domain.vo.ExamPaperStatisticVO;
import com.mindskip.xzs.repository.ExamPaperAnswerMapper;
import com.mindskip.xzs.repository.ExamPaperMapper;
import com.mindskip.xzs.repository.QuestionMapper;
@@ -160,8 +162,8 @@
    }
    @Override
    public Integer selectAllCount() {
        return examPaperAnswerMapper.selectAllCount();
    public Integer selectAllCount(List<Integer> deptIds) {
        return examPaperAnswerMapper.selectAllCount(deptIds);
    }
    @Override
@@ -312,10 +314,10 @@
    }
    @Override
    public Map<String, Object> statistic(String examPaperId, String departmentId) {
    public Map<String, Object> statistic(ExamPaperStatisticVO examPaperStatisticVO) {
        // 获取原始数据
        Map<String, Object> histogram = examPaperAnswerMapper.histogram(examPaperId, departmentId);
        Map<String, Object> pieChart = examPaperAnswerMapper.pieChart(examPaperId, departmentId);
        Map<String, Object> histogram = examPaperAnswerMapper.histogram(examPaperStatisticVO);
        Map<String, Object> pieChart = examPaperAnswerMapper.pieChart(examPaperStatisticVO);
        // 初始化结果容器
        HashMap<String, Object> map = new HashMap<>();
        List<Map<String, Object>> score = new ArrayList<>();
@@ -348,4 +350,20 @@
        map.put("examPeopleNum", examPeopleNum);
        return map;
    }
    @Override
    public Map<String, Object> data(ExamPaperDataVO examPaperDataVO) {
        Map<String, Object> map = new HashMap<>();
        // 随机试卷
        if (Objects.equals(examPaperDataVO.getType(), 7)) {
            map.put("data", examPaperAnswerMapper.dataByTemplate(examPaperDataVO));
            map.put("total", examPaperAnswerMapper.totalByTemplate(examPaperDataVO));
        }
        // 普通试卷
        else {
            map.put("data", examPaperAnswerMapper.dataByPaper(examPaperDataVO));
            map.put("total", examPaperAnswerMapper.totalByPaper(examPaperDataVO));
        }
        return map;
    }
}