| | |
| | | user = userService.getUserAgeById(Long.parseLong(trainingRegistration1.getUserId())); |
| | | //修改用户的培训状态,理论考试结束 |
| | | user.setIsTrain(3); |
| | | age = user.getAge(); |
| | | // age = user.getAge(); |
| | | userService.updateById(user); |
| | | //修改为已考试 |
| | | trainingRegistration1.setIsExam(2); |
| | |
| | | //设置理论得分 |
| | | examScore.setTheoryGrade(theoryGrade); |
| | | //计算总成绩,此时没有实操成绩,总成绩为实操成绩和理论成绩和的一半 |
| | | if (age <= 50) { |
| | | examScore.setAllGrade(Math.round(theoryGrade / 2)); |
| | | } |
| | | if (age > 50) { |
| | | examScore.setAllGrade(Integer.parseInt(String.valueOf(Math.round(theoryGrade * 0.5)))); |
| | | } |
| | | examScore.setAllGrade(Math.round(theoryGrade / 2)); |
| | | // if (age <= 50) { |
| | | // } |
| | | // if (age > 50) { |
| | | // examScore.setAllGrade(Integer.parseInt(String.valueOf(Math.round(theoryGrade * 0.5)))); |
| | | // } |
| | | //设置状态 |
| | | if (theoryGrade >= 60) { |
| | | examScore.setQualified(2); |
| | |
| | | examScore.setQualified(1); |
| | | } |
| | | //修改成绩数据 |
| | | // int i = baseMapper.updateById(examScore); |
| | | int i = baseMapper.updateById(examScore); |
| | | |
| | | String s1 = |
| | | "update exam_score set exam_id = " + examScore.getExamId() + |
| | |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.FTP(s1); |
| | | |
| | | // if (i > 0) { |
| | | if (i > 0) { |
| | | //返回结果 |
| | | return true; |
| | | // } |
| | | } |
| | | } |
| | | //返回结果 |
| | | return false; |
| | |
| | | // //去生成保安证编号 |
| | | // String pre = SecurityPaperUtil.getSecurityPaper(); |
| | | // //查询当前年份已有的保安证编号 |
| | | //// int count = userService.getSecurityPaperCount(pre); |
| | | // int count = userService.getSecurityPaperCount(pre); |
| | | // //需调用内网查询 |
| | | // //生成随机数 |
| | | // String uuid = UUID.randomUUID().toString(); |