| | |
| | | import org.springblade.modules.exam.service.ExamPaperService; |
| | | import org.springblade.modules.exam.vo.ExamPaperSubjectVO; |
| | | import org.springblade.modules.exam.vo.ExamPaperVO; |
| | | import org.springblade.modules.exam.vo.ExamStatisticsVO; |
| | | import org.springblade.modules.exam.vo.ExamSubjectChoicesVO; |
| | | import org.springblade.modules.exam.wrapper.ExamPaperWrapper; |
| | | import org.springblade.modules.system.entity.User; |
| | |
| | | |
| | | /** |
| | | * 查询考生考试信息 |
| | | * @param userId 用户id |
| | | * @param examPaper 用户id |
| | | * @return |
| | | */ |
| | | @GetMapping("/getExamDetail") |
| | | public R getExamDetail(String userId){ |
| | | return R.data(examPaperService.getExamDetail(userId)); |
| | | @PostMapping("/getExamDetail") |
| | | public R getExamDetail(@RequestBody ExamPaperVO examPaper){ |
| | | System.out.println("examPaper = " + examPaper); |
| | | return R.data(examPaperService.getExamDetail(examPaper)); |
| | | } |
| | | |
| | | /** |
| | | * 考试名单确认 |
| | | * @param |
| | | * @return |
| | | */ |
| | | @PostMapping("/applyConfirm") |
| | | public R applyConfirm(@RequestBody ExamPaper exam) { |
| | | exam.setConfirmTime(new Date()); |
| | | boolean status = examPaperService.updateById(exam); |
| | | //内网数据同步 |
| | | String s1 = |
| | | "update ksxt_exam set confirm_user = " + "'" + exam.getConfirmUser()+ "'" |
| | | + ",confirm_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(exam.getConfirmTime())+ "'" |
| | | + " " +"where id = " + "'" + exam.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | //返回数据 |
| | | return R.data(status); |
| | | } |
| | | |
| | | |
| | |
| | | public R updateAudit(@RequestBody ExamPaper examPaper){ |
| | | //查询之前的审核状态,如果审核状态没有发生改变,则不会去修改审核信息 |
| | | ExamPaper paper = examPaperService.getById(examPaper.getId()); |
| | | boolean status = false; |
| | | if (null!=paper.getAuditStatus()){ |
| | | //审核状态发生改变 |
| | | if (!paper.getAuditStatus().equals(examPaper.getAuditStatus())){ |
| | | // if (!paper.getAuditStatus().equals(examPaper.getAuditStatus())){ |
| | | examPaper.setAuditTime(new Date()); |
| | | //修改考试审核状态 |
| | | boolean status = examPaperService.updateById(examPaper); |
| | | status = examPaperService.updateById(examPaper); |
| | | //数据同步 |
| | | String s1 = |
| | | "update ksxt_exam set audit_status = " + "'" + examPaper.getAuditStatus()+ "'" |
| | |
| | | } |
| | | } |
| | | } |
| | | //生成准考证号 |
| | | trainingRegistration.setCandidateNo(getCandidateNo(examPaper)); |
| | | if(null==trainingRegistration.getCandidateNo() || trainingRegistration.getCandidateNo().equals("")){ |
| | | //生成准考证号 |
| | | trainingRegistration.setCandidateNo(getCandidateNo(examPaper)); |
| | | } |
| | | } |
| | | //审核不通过 |
| | | if (examPaper.getAuditStatus()==2) { |
| | |
| | | }); |
| | | } |
| | | return R.status(status); |
| | | } |
| | | // } |
| | | } |
| | | //返回 |
| | | return R.status(false); |
| | | return R.status(status); |
| | | } |
| | | |
| | | /** |
| | |
| | | return R.data(examPaperService.getExamRefreshInfo(examPaperVO)); |
| | | } |
| | | |
| | | /** |
| | | * 查询考试统计信息 |
| | | * @param examPaperVO |
| | | * @return |
| | | */ |
| | | @GetMapping("/getExamStatistics") |
| | | public R getExamStatistics(ExamPaperVO examPaperVO, Query query){ |
| | | IPage<ExamStatisticsVO> pages = examPaperService.getExamStatistics(Condition.getPage(query), examPaperVO); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | /** |
| | | * 根据考试id 统计查询考试信息 |
| | | * @param examPaperVO |
| | | * @return |
| | | */ |
| | | @GetMapping("/getExamInfoByExamId") |
| | | public R getExamInfoByExamId(ExamStatisticsVO examPaperVO, Query query){ |
| | | IPage<ExamStatisticsVO> pages = examPaperService.getExamInfoByExamId(Condition.getPage(query), examPaperVO); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | |
| | | |
| | | } |