| | |
| | | /** |
| | | * 分页 |
| | | */ |
| | | @GetMapping("/page") |
| | | @GetMapping("/list") |
| | | @ApiOperationSupport(order = 2) |
| | | @ApiOperation(value = "分页", notes = "传入exam") |
| | | public R<IPage<ExamPaperVO>> list(@ApiIgnore @RequestParam Map<String, Object> exam, Query query) { |
| | |
| | | * 分页 |
| | | */ |
| | | @GetMapping("/pages") |
| | | public R<IPage<ExamPaperVO>> page(ExamPaperVO exam, Query query) { |
| | | IPage<ExamPaperVO> pages = examPaperService.selectExamPaperPage(Condition.getPage(query), exam); |
| | | public R<IPage<ExamPaperVO>> pages(ExamPaperVO exam, Query query) { |
| | | IPage<ExamPaperVO> pages = examPaperService.selectExamPaperPages(Condition.getPage(query), exam); |
| | | return R.data(pages); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 自定义查询 |
| | | * @param query 分页条件 |
| | | * @param examPaperVO 查询参数 |
| | | * @return |
| | | */ |
| | | @GetMapping("/page") |
| | | public R<IPage<ExamPaperVO>> page(ExamPaperVO examPaperVO, Query query) { |
| | | IPage<ExamPaperVO> pages = examPaperService.selectExamPaperPage(Condition.getPage(query), examPaperVO); |
| | | return R.data(pages); |
| | | } |
| | | |
| | |
| | | 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)); |
| | | } |
| | | |
| | |
| | | @PostMapping("/update-audit") |
| | | public R updateAudit(@RequestBody ExamPaper examPaper){ |
| | | examPaper.setAuditTime(new Date()); |
| | | //审核通过,插入一条考试信息 |
| | | if (examPaper.getAuditStatus()==1){ |
| | | examPaper.setAuditTime(new Date()); |
| | | //修改考试审核状态 |
| | | examPaperService.updateById(examPaper); |
| | | String s1 = |
| | | "update ksxt_exam set audit_status = " + "'" + examPaper.getAuditStatus()+ "'" |
| | | + ",audit_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(examPaper.getAuditTime())+ "'" |
| | | + " " +"where id = " + "'" + examPaper.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | |
| | | //查询当前考试已报名的人员培训报名数据集合 |
| | | List<TrainingRegistration> trainingRegistrations = examPaperService.getTrainList(examPaper.getId()); |
| | | if (trainingRegistrations.size()>0) { |
| | | trainingRegistrations.forEach(trainingRegistration -> { |
| | | //生成准考证号 |
| | | trainingRegistration.setCandidateNo(getCandidateNo(examPaper)); |
| | | //修改培训报名信息 |
| | | trainingRegistrationService.updateById(trainingRegistration); |
| | | String s2 = |
| | | "update sys_training_registration set candidate_no = " + "'" + trainingRegistration.getCandidateNo()+ "'" |
| | | + " " +"where id = " + "'" + trainingRegistration.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s2); |
| | | }); |
| | | } |
| | | return R.status(true); |
| | | }else { |
| | | examPaper.setAuditTime(new Date()); |
| | | //修改考试审核状态 |
| | | examPaperService.updateById(examPaper); |
| | | |
| | | String s3 = |
| | | "update ksxt_exam set audit_status = " + "'" + examPaper.getAuditStatus()+ "'" |
| | | + ",audit_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(examPaper.getAuditTime())+ "'" |
| | | + " " +"where id = " + "'" + examPaper.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s3); |
| | | return R.status(true); |
| | | //修改考试审核状态 |
| | | boolean status = examPaperService.updateById(examPaper); |
| | | //数据同步 |
| | | String s1 = |
| | | "update ksxt_exam set audit_status = " + "'" + examPaper.getAuditStatus()+ "'" |
| | | + ",audit_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(examPaper.getAuditTime())+ "'" |
| | | + " " +"where id = " + "'" + examPaper.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | //查询当前考试已报名的人员培训报名数据集合 |
| | | List<TrainingRegistration> trainingRegistrations = examPaperService.getTrainList(examPaper.getId()); |
| | | if (trainingRegistrations.size()>0) { |
| | | trainingRegistrations.forEach(trainingRegistration -> { |
| | | //生成准考证号 |
| | | trainingRegistration.setCandidateNo(getCandidateNo(examPaper)); |
| | | //审核通过 |
| | | if (examPaper.getAuditStatus()==1) { |
| | | trainingRegistration.setAuditStatus(1); |
| | | } |
| | | //审核不通过 |
| | | if (examPaper.getAuditStatus()==2) { |
| | | trainingRegistration.setAuditStatus(2); |
| | | } |
| | | //待审核 |
| | | if (examPaper.getAuditStatus()==3) { |
| | | trainingRegistration.setAuditStatus(3); |
| | | } |
| | | //修改培训报名信息 |
| | | trainingRegistrationService.updateById(trainingRegistration); |
| | | //数据同步 |
| | | String s2 = |
| | | "update sys_training_registration set candidate_no = " + "'" + trainingRegistration.getCandidateNo()+ "'" |
| | | + ",audit_status = " + "'" + trainingRegistration.getAuditStatus() + "'" |
| | | + " " +"where id = " + "'" + trainingRegistration.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s2); |
| | | }); |
| | | } |
| | | //返回 |
| | | return R.status(status); |
| | | } |
| | | |
| | | /** |