| | |
| | | |
| | | |
| | | /** |
| | | * 生成试卷,报名 |
| | | * 生成考试,报名 |
| | | * @param ids 报名ids |
| | | */ |
| | | @PostMapping("/batchExam") |
| | | public R batchExam(@RequestParam String ids, |
| | | String examTime, |
| | | @RequestParam Date startTime, |
| | | @RequestParam Integer number, |
| | | Date endTime){ |
| | | if (!ids.equals("")){ |
| | | List<String> list = Arrays.asList(ids.split(",")); |
| | |
| | | |
| | | }else { |
| | | //查询已报名未关联试卷的人员 |
| | | List<Long> applyIds = applyService.getApplyIds(); |
| | | List<Long> applyIds = applyService.getApplyIds(number); |
| | | if (applyIds.size()>0){ |
| | | //生成考试 |
| | | ExamPaper examPaper = new ExamPaper(); |
| | |
| | | //内网同步 |
| | | Long sid = examScore.getId(); |
| | | String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(examScore.getExamTime()); |
| | | String s = "insert into exam_score(id,exam_time,user_id,exam_id,apply_id) " + |
| | | "values(" + "'" + sid + "'" + "," + "'" + |
| | | format + "'" + "," + "'" + |
| | | examScore.getUserId() +"'" + "," +"'" + |
| | | examScore.getExamId() +"'" + "," +"'" + |
| | | examScore.getApplyId() + "'" + ")"; |
| | | FtpUtil.sqlFileUpload(s); |
| | | // String s = "insert into exam_score(id,exam_time,user_id,exam_id,apply_id) " + |
| | | // "values(" + "'" + sid + "'" + "," + "'" + |
| | | // format + "'" + "," + "'" + |
| | | // examScore.getUserId() +"'" + "," +"'" + |
| | | // examScore.getExamId() +"'" + "," +"'" + |
| | | // examScore.getApplyId() + "'" + ")"; |
| | | // FtpUtil.sqlFileUpload(s); |
| | | return examScore; |
| | | } |
| | | |