| | |
| | | //正式考试 |
| | | if (apply.getApplyExamType()==1){ |
| | | ApplyPaPerVO applyPaPerVO = baseMapper.getApplyInfo(apply); |
| | | String time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(applyPaPerVO.getStartTime()).split(" ")[0]; |
| | | String startTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(applyPaPerVO.getStartTime()).split(" ")[1]; |
| | | String endTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(applyPaPerVO.getEndTime()).split(" ")[1]; |
| | | applyPaPerVO.setStringTime(time+" "+startTime.substring(0,startTime.length()-3) +"-"+ endTime.substring(0,endTime.length()-3)); |
| | | // String time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(applyPaPerVO.getStartTime()).split(" ")[0]; |
| | | // String startTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(applyPaPerVO.getStartTime()).split(" ")[1]; |
| | | // String endTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(applyPaPerVO.getEndTime()).split(" ")[1]; |
| | | applyPaPerVO.setStringTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(applyPaPerVO.getStartTime())); |
| | | return applyPaPerVO; |
| | | } |
| | | |
| | | //模拟考试 |
| | | if (apply.getApplyExamType()==2){ |
| | | ApplyPaPerVO applyPaPerVO = baseMapper.getTrainApplyInfo(apply); |
| | | String time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(applyPaPerVO.getStartTime()).split(" ")[0]; |
| | | String startTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(applyPaPerVO.getStartTime()).split(" ")[1]; |
| | | String endTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(applyPaPerVO.getEndTime()).split(" ")[1]; |
| | | applyPaPerVO.setStringTime(time+" "+startTime.substring(0,startTime.length()-3) +"-"+ endTime.substring(0,endTime.length()-3)); |
| | | // String time = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(applyPaPerVO.getStartTime()).split(" ")[0]; |
| | | // String startTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(applyPaPerVO.getStartTime()).split(" ")[1]; |
| | | // String endTime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(applyPaPerVO.getEndTime()).split(" ")[1]; |
| | | applyPaPerVO.setStringTime(new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(applyPaPerVO.getStartTime())); |
| | | return applyPaPerVO; |
| | | } |
| | | |
| | | |
| | | |
| | | return null; |
| | | } |
| | | |
| | |
| | | List<ExamScoreVO> selectExamScorePage(IPage page, @Param("examScore") ExamScoreVO examScore); |
| | | |
| | | /** |
| | | * 自定义分页-模拟考试 |
| | | * |
| | | * @param page 分页 |
| | | * @param examScore 实体 |
| | | * @return |
| | | */ |
| | | List<ExamScoreVO> selectTrainExamScorePage(IPage page, @Param("examScore") ExamScoreVO examScore); |
| | | |
| | | /** |
| | | * 详情 |
| | | * |
| | | * @param examScore 考试成绩信息对象 |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.springblade.modules.exam.mapper.ExamScoreMapper"> |
| | | |
| | | <!--考试成绩分页信息--> |
| | | <!--考试成绩分页信息-正式考试--> |
| | | <select id="selectExamScorePage" resultType="org.springblade.modules.exam.vo.ExamScoreVO"> |
| | | SELECT |
| | | es.id,es.theory_grade theoryGrade,ifnull(learn_grade,-1) learnGrade,es.user_id userId,es.exam_id examId, |
| | |
| | | </if> |
| | | </select> |
| | | |
| | | |
| | | <!--考试成绩分页信息-模拟考试--> |
| | | <select id="selectTrainExamScorePage" resultType="org.springblade.modules.exam.vo.ExamScoreVO"> |
| | | SELECT |
| | | es.id,es.theory_grade theoryGrade,ifnull(learn_grade,-1) learnGrade,es.user_id userId,es.exam_id examId, |
| | | es.exam_time examTime,all_grade allGrade,exam_end_time examEndTime,qualified, |
| | | ke.exam_name examName, |
| | | bu.real_name securityName,company,bu.account, |
| | | str.is_exam isExam, |
| | | bd.dept_name companyName |
| | | FROM |
| | | exam_score es |
| | | left join |
| | | blade_user bu |
| | | on |
| | | es.user_id = bu.id |
| | | left join |
| | | blade_dept bd |
| | | on |
| | | bd.id = es.company |
| | | left join |
| | | ksxt_exam ke |
| | | on |
| | | ke.id = es.exam_id |
| | | left join |
| | | sys_training_registration str |
| | | on |
| | | str.user_id = bu.id |
| | | WHERE |
| | | 1=1 |
| | | <if test="examScore.examName!=null and examScore.examName!=''"> |
| | | and ke.exam_name like concat('%', #{examScore.examName},'%') |
| | | </if> |
| | | <if test="examScore.companyName!=null and examScore.companyName!=''"> |
| | | and bd.dept_name like concat('%', #{examScore.companyName},'%') |
| | | </if> |
| | | <if test="examScore.securityName!=null and examScore.securityName!=''"> |
| | | and bu.real_name like concat('%', #{examScore.securityName},'%') |
| | | </if> |
| | | <if test="examScore.userId!=null and examScore.userId!=''"> |
| | | and es.user_id = #{examScore.userId} |
| | | </if> |
| | | <if test="examScore.isExam!=null and examScore.isExam!=''"> |
| | | and str.is_exam = #{examScore.isExam} |
| | | </if> |
| | | <if test="examScore.examType!=null and examScore.examType!=''"> |
| | | and ke.exam_type = #{examScore.examType} |
| | | </if> |
| | | <if test="examScore.candidateNo!=null and examScore.candidateNo!=''"> |
| | | and es.candidate_no = #{examScore.candidateNo} |
| | | </if> |
| | | <if test="examScore.qualified!=null"> |
| | | and es.qualified = #{examScore.qualified} |
| | | </if> |
| | | </select> |
| | | |
| | | <!--考试成绩详情信息--> |
| | | <select id="selectExamScoreInfo" resultType="org.springblade.modules.exam.vo.ExamScoreVO"> |
| | | SELECT |
| | |
| | | */ |
| | | @Override |
| | | public IPage<ExamScoreVO> selectExamScorePage(IPage<ExamScoreVO> page, ExamScoreVO examScore) { |
| | | if (null!=examScore.getExamType()){ |
| | | if (examScore.getExamType()==1){ |
| | | return page.setRecords(baseMapper.selectExamScorePage(page, examScore)); |
| | | } |
| | | if (examScore.getExamType()==2){ |
| | | return page.setRecords(baseMapper.selectTrainExamScorePage(page, examScore)); |
| | | } |
| | | } |
| | | return page.setRecords(baseMapper.selectExamScorePage(page, examScore)); |
| | | } |
| | | |
| | |
| | | if (1==user.getIsTrain()){ |
| | | return R.data(201,"已报名,不能重复报名"); |
| | | } |
| | | if (2==user.getIsTrain()){ |
| | | if (2==user.getIsTrain() || -1==user.getIsTrain()){ |
| | | //已报名 |
| | | trainingRegistration.setCancel(1); |
| | | //默认为未考试状态 |
| | |
| | | user.setIsTrain(1); |
| | | userService.updateById(user); |
| | | }else { |
| | | if (user.getIsTrain()==2) { |
| | | if (user.getIsTrain()==2 || -1==user.getIsTrain()) { |
| | | TrainingRegistration trainingRegistration1 = new TrainingRegistration(); |
| | | trainingRegistration1.setCancel(1); |
| | | //默认为未考试状态 |
| | |
| | | */ |
| | | @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(2); |
| | | 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(2); |
| | | examPaper.setStartTime(startTime); |
| | | examPaper.setEndTime(endTime); |
| | | // examPaper.setEndTime(endTime); |
| | | Calendar instance = Calendar.getInstance(); |
| | | instance.setTime(startTime); |
| | | int year = instance.get(Calendar.YEAR); |
| | |
| | | user.setIsTrain(1); |
| | | userService.updateById(user); |
| | | }else { |
| | | if (2 == user.getIsTrain()) { |
| | | if (2 == user.getIsTrain() || -1==user.getIsTrain()) { |
| | | trainingRegistration.setIsExam(1); |
| | | trainingRegistration.setCancel(1); |
| | | trainingRegistration.setTrainingTime(new Date()); |