File was renamed from src/main/java/com/ycl/jxkg/controller/admin/ExamPaperAnswerController.java |
| | |
| | | import com.github.pagehelper.PageInfo; |
| | | import com.ycl.jxkg.base.BaseApiController; |
| | | import com.ycl.jxkg.base.Result; |
| | | import com.ycl.jxkg.domain.entity.ExamPaperAnswer; |
| | | import com.ycl.jxkg.domain.entity.ExamPaperScore; |
| | | import com.ycl.jxkg.domain.vo.admin.exam.ExamPaperEditRequestVO; |
| | | import com.ycl.jxkg.domain.vo.admin.paper.ExamPaperAnswerPageRequestVO; |
| | | import com.ycl.jxkg.domain.vo.student.exam.ExamPaperReadVO; |
| | | import com.ycl.jxkg.domain.vo.student.exam.ExamPaperSubmitVO; |
| | | import com.ycl.jxkg.domain.vo.student.exampaper.ExamPaperAnswerExportVO; |
| | | import com.ycl.jxkg.domain.vo.student.exampaper.ExamPaperAnswerPageResponseVO; |
| | | import com.ycl.jxkg.service.ExamPaperAnswerService; |
| | | import com.ycl.jxkg.service.ExamPaperScoreService; |
| | | import com.ycl.jxkg.service.ExamPaperService; |
| | | import com.ycl.jxkg.utils.ExcelUtils; |
| | | import lombok.RequiredArgsConstructor; |
| | |
| | | @RequiredArgsConstructor |
| | | @RestController("AdminExamPaperAnswerController") |
| | | @RequestMapping(value = "/api/admin/examPaperAnswer") |
| | | public class ExamPaperAnswerController extends BaseApiController { |
| | | public class ExamPaperScoreController extends BaseApiController { |
| | | |
| | | private final ExamPaperAnswerService examPaperAnswerService; |
| | | private final ExamPaperScoreService examPaperScoreService; |
| | | private final ExamPaperService examPaperService; |
| | | |
| | | @PostMapping("/pageExamPaper") |
| | | public Result<PageInfo<ExamPaperAnswerPageResponseVO>> pageExamPaper(@RequestBody ExamPaperAnswerPageRequestVO model) { |
| | | return Result.ok(examPaperAnswerService.pageExamPaper(model)); |
| | | return Result.ok(examPaperScoreService.pageExamPaper(model)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/page", method = RequestMethod.POST) |
| | | public Result<PageInfo<ExamPaperAnswerPageResponseVO>> pageJudgeList(@RequestBody ExamPaperAnswerPageRequestVO model) { |
| | | return Result.ok(examPaperAnswerService.adminPage(model)); |
| | | return Result.ok(examPaperScoreService.adminPage(model)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/exportExcel", method = RequestMethod.POST) |
| | | @SneakyThrows |
| | | public void exportExcel(ExamPaperAnswerPageRequestVO model, HttpServletResponse response) { |
| | | List<ExamPaperAnswerPageResponseVO> list = examPaperAnswerService.list(model); |
| | | List<ExamPaperAnswerPageResponseVO> list = examPaperScoreService.list(model); |
| | | ExcelUtils.exportExcelToTarget(response, "", "成绩列表", list, ExamPaperAnswerExportVO.class); |
| | | } |
| | | |
| | | @PostMapping("/read/{id}") |
| | | public Result<ExamPaperReadVO> read(@PathVariable Integer id) { |
| | | ExamPaperAnswer examPaperAnswer = examPaperAnswerService.getById(id); |
| | | ExamPaperScore examPaperScore = examPaperScoreService.getById(id); |
| | | ExamPaperReadVO vm = new ExamPaperReadVO(); |
| | | ExamPaperEditRequestVO paper = examPaperService.examPaperToVM(examPaperAnswer.getExamPaperId()); |
| | | ExamPaperSubmitVO answer = examPaperAnswerService.examPaperAnswerToVM(examPaperAnswer.getId()); |
| | | ExamPaperEditRequestVO paper = examPaperService.examPaperToVM(examPaperScore.getPaperId()); |
| | | ExamPaperSubmitVO answer = examPaperScoreService.examPaperAnswerToVM(examPaperScore.getId()); |
| | | vm.setPaper(paper); |
| | | vm.setAnswer(answer); |
| | | return Result.ok(vm); |