| | |
| | | if (1==user.getIsApply()){ |
| | | return R.data(201,"已报名,不能重复报名"); |
| | | } |
| | | if (2==user.getIsApply() || -1==user.getIsApply()){ |
| | | if (2==user.getIsApply() || -1==user.getIsApply() || 3==user.getIsApply()){ |
| | | //默认通过 |
| | | apply.setApplyStatus(2); |
| | | //默认为未考试状态 |
| | |
| | | return R.data(200,"取消报名成功"); |
| | | } |
| | | }else { |
| | | if (user.getIsApply()==2) { |
| | | return R.data(201,"尚未报名"); |
| | | } |
| | | if(user.getIsApply()==1){ |
| | | apply.setApplyStatus(4); |
| | | boolean status = applyService.updateById(apply); |
| | |
| | | if (status){ |
| | | return R.data(200,"取消报名成功"); |
| | | } |
| | | }else { |
| | | return R.data(201,"尚未报名"); |
| | | } |
| | | } |
| | | return R.data(202,"取消报名失败"); |
| | |
| | | user.setIsApply(1); |
| | | userService.updateById(user); |
| | | } else { |
| | | if (user.getIsApply() == 2 || -1==user.getIsApply()) { |
| | | if (user.getIsApply() == 2 || -1==user.getIsApply() || 3==user.getIsApply()) { |
| | | Apply apply1 = new Apply(); |
| | | apply1.setApplyStatus(2); |
| | | //默认为未考试状态 |
| | |
| | | user.setIsApply(1); |
| | | userService.updateById(user); |
| | | } else { |
| | | if (user.getIsApply() == 2 || -1==user.getIsApply()) { |
| | | if (user.getIsApply() == 2 || -1==user.getIsApply() || 3==user.getIsApply()) { |
| | | Apply apply1 = new Apply(); |
| | | apply1.setApplyStatus(2); |
| | | //默认为未考试状态 |
| | |
| | | */ |
| | | @PostMapping("/batchExam") |
| | | public R batchExam(@RequestParam String ids, |
| | | @RequestParam String examTime, |
| | | String examTime, |
| | | @RequestParam Date startTime, |
| | | @RequestParam Date endTime){ |
| | | Date endTime){ |
| | | if (!ids.equals("")){ |
| | | List<String> list = Arrays.asList(ids.split(",")); |
| | | if (list.size()>0){ |
| | | ExamPaper examPaper = new ExamPaper(); |
| | | examPaper.setExamTime(examTime); |
| | | // examPaper.setExamTime(examTime); |
| | | examPaper.setExamType(1); |
| | | examPaper.setStartTime(startTime); |
| | | examPaper.setEndTime(endTime); |
| | | // examPaper.setEndTime(endTime); |
| | | Calendar instance = Calendar.getInstance(); |
| | | instance.setTime(startTime); |
| | | int year = instance.get(Calendar.YEAR); |
| | |
| | | if (applyIds.size()>0){ |
| | | //生成考试 |
| | | ExamPaper examPaper = new ExamPaper(); |
| | | examPaper.setExamTime(examTime); |
| | | // examPaper.setExamTime(examTime); |
| | | examPaper.setExamType(1); |
| | | examPaper.setStartTime(startTime); |
| | | examPaper.setEndTime(endTime); |
| | | // examPaper.setEndTime(endTime); |
| | | Calendar instance = Calendar.getInstance(); |
| | | instance.setTime(startTime); |
| | | int year = instance.get(Calendar.YEAR); |