| | |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.modules.exam.entity.ExamPaper; |
| | | import org.springblade.modules.exam.entity.ExamSubjectChoices; |
| | | import org.springblade.modules.exam.service.ExamPaperService; |
| | | import org.springblade.modules.exam.vo.ExamPaperSubjectVO; |
| | | import org.springblade.modules.exam.vo.ExamPaperVO; |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | public R<IPage<ExamPaperVO>> list(@ApiIgnore @RequestParam Map<String, Object> exam, Query query) { |
| | | IPage<ExamPaper> pages = examPaperService.page(Condition.getPage(query), Condition.getQueryWrapper(exam, ExamPaper.class)); |
| | | return R.data(ExamPaperWrapper.build().pageVO(pages)); |
| | | } |
| | | |
| | | /** |
| | | * 分页 |
| | | */ |
| | | @GetMapping("/pages") |
| | | public R<IPage<ExamPaperVO>> page(ExamPaperVO exam, Query query) { |
| | | IPage<ExamPaperVO> pages = examPaperService.selectExamPaperPage(Condition.getPage(query), exam); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | |
| | |
| | | return R.data(subject); |
| | | } |
| | | |
| | | /** |
| | | * 随机生成考试题目 |
| | | */ |
| | | @GetMapping("/queryRandomSubject") |
| | | @ApiOperationSupport(order = 8) |
| | | @ApiOperation(value = "考试题目绑定", notes = "传入exam") |
| | | public R<List> queryRandomSubject(@ApiParam(value = "主键集合") ExamPaper exam) { |
| | | List<ExamPaperSubjectVO> subject = examPaperService.queryRandomSubject(exam); |
| | | return R.data(subject); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 返回当前时间 |
| | | */ |
| | | @GetMapping("/getdate") |
| | | @ApiOperationSupport(order = 9) |
| | | public R getdate() { |
| | | Date date = new Date(); |
| | | String strDateFormat = "yyyy-MM-dd HH:mm:ss"; |
| | | SimpleDateFormat sdf = new SimpleDateFormat(strDateFormat); |
| | | System.out.println(sdf.format(date)); |
| | | return R.data(sdf.format(date)); |
| | | } |
| | | |
| | | /** |
| | | * 自定义树 |
| | | * @param examPaper |
| | | * @return |
| | | */ |
| | | @GetMapping("/page-tree") |
| | | public R pageTree(ExamPaper examPaper) { |
| | | List<ExamPaper> pages = examPaperService.selectExamPaperPageTree(examPaper); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 解除绑定 |
| | | */ |
| | | @GetMapping("/UnbindSubject") |
| | | public R UnbindSubject(String paperid,String subjectid){ |
| | | |
| | | return R.status(examPaperService.UnbindSubject(paperid,subjectid)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询考生考试信息 |
| | | * @param userId 用户id |
| | | * @return |
| | | */ |
| | | @GetMapping("/getExamDetail") |
| | | public R getExamDetail(String userId){ |
| | | return R.data(examPaperService.getExamDetail(userId)); |
| | | } |
| | | |
| | | |
| | | |
| | | } |