| | |
| | | @Override |
| | | public IPage<ExamStatisticsVO> getExamInfoByExamId(IPage<ExamStatisticsVO> page, ExamStatisticsVO examPaperVO) { |
| | | List<ExamStatisticsVO> statisticsVOS = baseMapper.getExamInfoByExamId(page, examPaperVO); |
| | | System.out.println("statisticsVOS = " + statisticsVOS); |
| | | //遍历,计算占比 |
| | | if (statisticsVOS.size()>0){ |
| | | statisticsVOS.forEach(examStatisticsVO -> { |
| | |
| | | } |
| | | return page.setRecords(statisticsVOS); |
| | | } |
| | | |
| | | /** |
| | | * 根据考试id 统计查询考试信息 |
| | | * @param examScoreVO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<ExamStatisticsVO> getExamInfoByExamIdList(ExamScoreVO examScoreVO) { |
| | | List<ExamStatisticsVO> statisticsVOS = baseMapper.getExamInfoByExamIdList(examScoreVO); |
| | | //遍历,计算占比 |
| | | if (statisticsVOS.size()>0){ |
| | | statisticsVOS.forEach(examStatisticsVO -> { |
| | | //格式化小数 |
| | | DecimalFormat df = new DecimalFormat("0.00"); |
| | | //返回的是String类型 |
| | | examStatisticsVO.setAbsentProportion(df.format((float)examStatisticsVO.getQknum()/examStatisticsVO.getZnum()*100)); |
| | | DecimalFormat df1 = new DecimalFormat("0.00"); |
| | | examStatisticsVO.setQualifiedProportion(df1.format((float)examStatisticsVO.getYknum()/examStatisticsVO.getZnum()*100)); |
| | | }); |
| | | } |
| | | return statisticsVOS; |
| | | } |
| | | |
| | | /** |
| | | * 查询考试成绩明细 |
| | | * @param examScoreVO |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<ExamScoreVO> getExamScoreList(ExamScoreVO examScoreVO) { |
| | | return baseMapper.getExamScoreList(examScoreVO); |
| | | } |
| | | } |