| | |
| | | |
| | | import com.alibaba.excel.EasyExcel; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import io.swagger.annotations.ApiOperation; |
| | |
| | | import org.springblade.modules.FTP.FtpUtil; |
| | | import org.springblade.modules.FTP.Monitor; |
| | | import org.springblade.modules.FTP.Result; |
| | | import org.springblade.modules.exam.entity.ExamAnswerRecord; |
| | | import org.springblade.modules.exam.entity.ExamPaper; |
| | | import org.springblade.modules.exam.entity.ExamScore; |
| | | import org.springblade.modules.exam.excel.ExamScoreExcel; |
| | | import org.springblade.modules.exam.excel.ExamScoreImporter; |
| | | import org.springblade.modules.exam.excel.ExportExamScoreExcel; |
| | | import org.springblade.modules.exam.service.ExamAnswerRecordService; |
| | | import org.springblade.modules.exam.service.ExamPaperService; |
| | | import org.springblade.modules.exam.service.ExamScoreService; |
| | | import org.springblade.modules.exam.util.SecurityPaperUtil; |
| | |
| | | private final MyAsyncService myAsyncService; |
| | | |
| | | private final RedisTemplate redisTemplate; |
| | | |
| | | |
| | | private final ExamAnswerRecordService examAnswerRecordService; |
| | | |
| | | /** |
| | | * 自定义分页 |
| | |
| | | public R<ExamScore> detail(ExamScore examScore) { |
| | | //查询考试成绩详情 |
| | | ExamScore detail = examScoreService.getOne(Condition.getQueryWrapper(examScore)); |
| | | //计算成绩 |
| | | ExamAnswerRecord record = new ExamAnswerRecord(); |
| | | record.setScoreId(detail.getId()); |
| | | List<ExamAnswerRecord> list = examAnswerRecordService.list(new QueryWrapper<>(record)); |
| | | int num = 0; |
| | | if (list.size()>0){ |
| | | for (ExamAnswerRecord examAnswerRecord : list) { |
| | | num = num + examAnswerRecord.getAnswerScore(); |
| | | } |
| | | } |
| | | detail.setTheoryGrade(num); |
| | | //返回 |
| | | return R.data(detail); |
| | | } |