| | |
| | | import org.springblade.modules.exam.service.ExamScoreService; |
| | | 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.vo.TrainingRegistrationVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | |
| | | // @Autowired |
| | | private final ExamScoreService examScoreService; |
| | | private final MyAsyncService myAsyncService; |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | * |
| | | * @param query page,size |
| | | * @param apply 考试报名信息对象 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 新增报名 |
| | | * |
| | | * @param apply 考试报名信息对象 |
| | | */ |
| | | @PostMapping("/save") |
| | |
| | | "values(" + "'" + id + "'" + "," + "'" + apply.getUserId() + "'" + "," + "'" + formatStr + |
| | | "'" + "," + "'" + apply.getApplyStatus() + "'" + "," +"'" + apply.getIsExam() + "'" + ");" + |
| | | "update blade_user set is_apply = " + user1.getIsApply() + " " +"where id = " + "'" + user1.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s); |
| | | //FtpUtil.sqlFileUpload(s); |
| | | myAsyncService.FTP(s); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改 |
| | | * |
| | | * @param apply 考试报名信息对象 |
| | | */ |
| | | @PostMapping("/update") |
| | |
| | | |
| | | /** |
| | | * 新增或修改 |
| | | * |
| | | * @param apply 考试报名信息对象 |
| | | */ |
| | | @PostMapping("/submit") |
| | |
| | | |
| | | /** |
| | | * 导出报名数数据 |
| | | * |
| | | * @param response |
| | | * @param apply 报名对象 |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 生成准考证号码 |
| | | * |
| | | * @param apply 考试报名信息对象 |
| | | */ |
| | | private String getCandidateNo(Apply apply) { |
| | |
| | | |
| | | /** |
| | | * 生成报名编号 |
| | | * |
| | | * @param apply 考试报名信息对象 |
| | | */ |
| | | private String getApplyCode(Apply apply) { |
| | |
| | | |
| | | /** |
| | | * 获取字符串拼音的第一个字母 |
| | | * |
| | | * @param chinese |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 删除 |
| | | * |
| | | * @param ids 考试报名信息ids 数组 |
| | | */ |
| | | @PostMapping("/remove") |
| | |
| | | list.forEach(id -> { |
| | | //内网同步 |
| | | String s1 = "delete from sys_apply where id = " + "'" + id + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.FTP(s1); |
| | | }); |
| | | return R.status(applyService.removeByIds(Func.toLongList(ids))); |
| | | } |
| | | |
| | | /** |
| | | * 查询用户详情 |
| | | * |
| | | * @param user |
| | | */ |
| | | @GetMapping("/userDetail") |
| | |
| | | |
| | | /** |
| | | * 详情 |
| | | * |
| | | * @param apply 考试报名信息对象 |
| | | */ |
| | | @GetMapping("/detail") |
| | |
| | | |
| | | /** |
| | | * 获取准考证信息 |
| | | * |
| | | * @param apply |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 取消报名 |
| | | * |
| | | * @param apply 考试报名信息对象 |
| | | */ |
| | | @PostMapping("/cancelApply") |
| | |
| | | String s = |
| | | "update sys_apply set apply_status = " + apply.getApplyStatus() + " " +"where id = " + "'" + apply.getId() + "';" + |
| | | "update blade_user set is_apply = " + user.getIsApply() + " " +"where id = " + "'" + user.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s); |
| | | //FtpUtil.sqlFileUpload(s); |
| | | myAsyncService.FTP(s); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 公司报名列表取消报名,无applyId |
| | | * |
| | | * @param apply 考试报名信息对象 |
| | | */ |
| | | @PostMapping("/cancelApplyNotApplyId") |
| | |
| | | |
| | | /** |
| | | * 批量报名 |
| | | * |
| | | * @param ids userIds 人员 |
| | | */ |
| | | @PostMapping("/batchApply") |
| | |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 生成考试,报名 |
| | | * |
| | | * @param applyVO 报名info |
| | | */ |
| | | @PostMapping("/batchExam") |
| | |
| | | "," + "'" + examPaper.getExamType() +"'" + |
| | | "," + "'" + format +"'" + |
| | | "," +"'" + endTimeFormat + "'" + ")"; |
| | | FtpUtil.sqlFileUpload(s); |
| | | //FtpUtil.sqlFileUpload(s); |
| | | myAsyncService.FTP(s); |
| | | |
| | | //修改报名信息 |
| | | applyIds.forEach(apply ->{ |
| | |
| | | String s1 = |
| | | "update sys_apply set exam_id = " + apply.getExamId() + ",candidate_no = " + "'" + apply.getCandidateNo() + "'" + |
| | | " " +"where id = " + "'" + apply.getId() + "'"; |
| | | FtpUtil.sqlFileUpload(s1); |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.FTP(s1); |
| | | } |
| | | }); |
| | | } |
| | |
| | | |
| | | /** |
| | | * 查询报名清册信息 |
| | | * |
| | | * @param apply 报名信息 |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 查询保安员个人报名信息 |
| | | * |
| | | * @param apply 报名信息,包含userId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | /** |
| | | * 修改考试状态 |
| | | * |
| | | * @param apply 报名信息,包含userId,applyid |
| | | * @return |
| | | */ |
| | |
| | | examScore.setCandidateNo(apply.getCandidateNo()); |
| | | examScore.setExamTime(new Date()); |
| | | //新增考试成绩 |
| | | examScoreService.save(examScore); |
| | | boolean save = examScoreService.save(examScore); |
| | | if (save) { |
| | | //内网同步 |
| | | Long sid = examScore.getId(); |
| | | String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(examScore.getExamTime()); |
| | |
| | | "," + "'" + examScore.getUserId() +"'" + |
| | | "," +"'" + examScore.getExamId() +"'" + |
| | | "," +"'" + examScore.getApplyId() + "'" + ")"; |
| | | FtpUtil.sqlFileUpload(s); |
| | | //FtpUtil.sqlFileUpload(s); |
| | | myAsyncService.FTP(s); |
| | | } |
| | | return examScore; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * test |
| | | * |
| | | * @return |
| | | */ |
| | | @GetMapping("/test") |