| | |
| | | import org.springblade.modules.exam.wrapper.ExamPaperWrapper; |
| | | import org.springblade.modules.system.entity.User; |
| | | import org.springblade.modules.system.service.IUserService; |
| | | import org.springblade.modules.system.service.MyAsyncService; |
| | | import org.springblade.modules.training.entity.TrainExam; |
| | | import org.springblade.modules.training.entity.TrainingRegistration; |
| | | import org.springblade.modules.training.service.TrainingRegistrationService; |
| | |
| | | |
| | | |
| | | private final IUserService userService; |
| | | private final MyAsyncService myAsyncService; |
| | | |
| | | |
| | | /** |
| | |
| | | |
| | | /** |
| | | * 自定义查询 |
| | | * |
| | | * @param query 分页条件 |
| | | * @param examPaperVO 查询参数 |
| | | * @return |
| | |
| | | public R save(@RequestBody ExamPaper examPaper) { |
| | | boolean save = examPaperService.save(examPaper); |
| | | String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(examPaper.getStartTime()); |
| | | if (save) { |
| | | String s = "insert into ksxt_exam(id,exam_name,exam_type,start_time) " + |
| | | "values(" + "'" + examPaper.getId() + "'" + "," + "'" + examPaper.getExamName() + |
| | | "'" + "," + "'" + examPaper.getExamType() + |
| | | "'" + "," +"'" + format + "'" + ")"; |
| | | FtpUtil.sqlFileUpload(s); |
| | | //FtpUtil.sqlFileUpload(s); |
| | | myAsyncService.FTP(s); |
| | | } |
| | | return R.status(save); |
| | | } |
| | | |
| | |
| | | @ApiOperationSupport(order = 5) |
| | | @ApiOperation(value = "修改", notes = "传入exam") |
| | | public R update(@RequestBody ExamPaper exam) { |
| | | boolean b = examPaperService.updateById(exam); |
| | | if (b) { |
| | | String s1 = |
| | | "update ksxt_exam set exam_name = " + "'" + exam.getExamName() + "'" + |
| | | ",start_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(exam.getStartTime()) + "'" + |
| | | " " +"where id = " + "'" + exam.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | return R.status(examPaperService.updateById(exam)); |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.FTP(s1); |
| | | } |
| | | return R.status(b); |
| | | } |
| | | |
| | | /** |
| | |
| | | list.forEach(id ->{ |
| | | //内网同步 |
| | | String s1 = "delete from ksxt_exam where id = " + "'" + id + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.FTP(s1); |
| | | }); |
| | | boolean temp = examPaperService.removeByIds(Func.toLongList(ids)); |
| | | return R.status(temp); |
| | |
| | | |
| | | /** |
| | | * 自定义树 |
| | | * |
| | | * @param examPaper |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 查询考生考试信息 |
| | | * |
| | | * @param examPaper 用户id |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 考试名单确认 |
| | | * |
| | | * @param |
| | | * @return |
| | | */ |
| | |
| | | public R applyConfirm(@RequestBody ExamPaper exam) { |
| | | exam.setConfirmTime(new Date()); |
| | | boolean status = examPaperService.updateById(exam); |
| | | if (status) { |
| | | //内网数据同步 |
| | | 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); |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.FTP(s1); |
| | | } |
| | | //返回数据 |
| | | return R.data(status); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 审核修改 |
| | | * |
| | | * @param examPaper 报名培训申请信息对象 |
| | | */ |
| | | @PostMapping("/update-audit") |
| | |
| | | examPaper.setAuditTime(new Date()); |
| | | //修改考试审核状态 |
| | | status = examPaperService.updateById(examPaper); |
| | | if (status) { |
| | | //数据同步 |
| | | 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); |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.FTP(s1); |
| | | } |
| | | //查询当前考试已报名的人员培训报名数据集合 |
| | | List<TrainingRegistration> trainingRegistrations = examPaperService.getTrainList(examPaper.getId()); |
| | | // System.out.println("trainingRegistrations = " + trainingRegistrations); |
| | |
| | | trainingRegistration.setAuditStatus(3); |
| | | } |
| | | //修改培训报名信息 |
| | | trainingRegistrationService.updateById(trainingRegistration); |
| | | boolean b = trainingRegistrationService.updateById(trainingRegistration); |
| | | if (b) { |
| | | //数据同步 |
| | | String s2 = |
| | | "update sys_training_registration set candidate_no = " + "'" + trainingRegistration.getCandidateNo()+ "'" |
| | | + ",audit_status = " + "'" + trainingRegistration.getAuditStatus() + "'" |
| | | + " " +"where id = " + "'" + trainingRegistration.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s2); |
| | | //FtpUtil.sqlFileUpload(s2); |
| | | myAsyncService.FTP(s2); |
| | | } |
| | | }); |
| | | } |
| | | return R.status(status); |
| | |
| | | |
| | | /** |
| | | * 生成准考证号码 |
| | | * |
| | | * @param examPaper 考试报名信息对象 |
| | | */ |
| | | private String getCandidateNo(ExamPaper examPaper) { |
| | |
| | | |
| | | /** |
| | | * 考试中页面刷新,1查询所有的答题信息,2查询所有的已答信息 3其他信息 |
| | | * |
| | | * @param examPaperVO 必须包含 scoreId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 查询考试统计信息 |
| | | * |
| | | * @param examPaperVO |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 根据考试id 统计查询考试信息 |
| | | * |
| | | * @param examPaperVO |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 导出考试统计情况信息 |
| | | * |
| | | * @param examScoreVO 需要传三个参数 1:培训学校名称,2:培训学校id 3:日期 4:考试类型,培训考试 |
| | | */ |
| | | @GetMapping("export-examStatistics") |