| | |
| | | |
| | | |
| | | /** |
| | | * 点击了开始考试后超过60分钟后再考试的,计算之前的考试成绩 |
| | | * 点击了开始考试后超过90分钟后再考试的,计算之前的考试成绩 |
| | | * |
| | | * @param examScore 考试成绩信息对象 |
| | | */ |
| | |
| | | if (null != examScore.getLearnGrade() && null != examScore.getTheoryGrade()) { |
| | | ExamScore examScore1 = examScoreService.getById(examScore.getId()); |
| | | //查询当前保安信息 |
| | | UserVO user = userService.getUserAgeById(Long.parseLong(examScore1.getUserId())); |
| | | UserVO user = userService.getUserAgeById(examScore1.getUserId()); |
| | | //再根据身份证号查询用户,方式用户考了试,被删除,又新建的情况,修改最新用户的状态信息 |
| | | User user1 = userService.getUserInfoByIdCardNo(user.getCardid()); |
| | | //考试合格 |
| | | if (examScore.getTheoryGrade() >= 60 && examScore.getLearnGrade() >= 60) { |
| | | if (examScore.getTheoryGrade() >= 60 && examScore.getLearnGrade()== 0) { |
| | | //合格 |
| | | examScore.setQualified(0); |
| | | //设置为未制证的状态 |
| | |
| | | int max = userService.getSecurityPaperCount(pre); |
| | | String result = null; |
| | | if (max == 0) { |
| | | result = pre + "00001"; |
| | | result = pre + "000001"; |
| | | } else { |
| | | //格式化 |
| | | DecimalFormat decimalFormat = new DecimalFormat("00000"); |
| | | DecimalFormat decimalFormat = new DecimalFormat("000000"); |
| | | max++; |
| | | result = pre + (decimalFormat.format(max)); |
| | | } |
| | |
| | | } else { |
| | | //不合格 |
| | | examScore.setQualified(1); |
| | | } |
| | | //总成绩 |
| | | if (user.getAge() <= 50) { |
| | | if (null != examScore1.getTheoryGrade()) { |
| | | examScore.setAllGrade(Math.round((examScore.getLearnGrade() + examScore1.getTheoryGrade()) / 2)); |
| | | } else { |
| | | examScore.setAllGrade(Math.round(examScore.getLearnGrade() / 2)); |
| | | } |
| | | } |
| | | if (user.getAge() > 50) { |
| | | if (null != examScore1.getTheoryGrade()) { |
| | | examScore.setAllGrade(Integer.parseInt(String.valueOf(Math.round(examScore1.getTheoryGrade() * 0.5))) |
| | | + Integer.parseInt(String.valueOf(Math.round(examScore.getLearnGrade() * 0.5)))); |
| | | } else { |
| | | examScore.setAllGrade(Math.round(examScore.getLearnGrade() / 2)); |
| | | } |
| | | } |
| | | } |
| | | //内网同步 |
| | |
| | | examScoreExcel.setName("张三"); |
| | | examScoreExcel.setIdCardNo("360XXX19XXXXXX****"); |
| | | // examScoreExcel.setCandidateNo("2110**m0001"); |
| | | examScoreExcel.setLearnGrade(80); |
| | | examScoreExcel.setLearnGrade("合格"); |
| | | list.add(examScoreExcel); |
| | | |
| | | ExamScoreExcel examScoreExcel1 = new ExamScoreExcel(); |
| | |
| | | examScoreExcel1.setName("李四"); |
| | | examScoreExcel1.setIdCardNo("360XXX19XXXXXX****"); |
| | | // examScoreExcel1.setCandidateNo("2110**m0002"); |
| | | examScoreExcel1.setLearnGrade(88); |
| | | examScoreExcel1.setLearnGrade("不合格"); |
| | | list.add(examScoreExcel1); |
| | | // ExcelUtil.export(response, "实操成绩数据模板", "实操成绩数据表", list, ExamScoreExcel.class); |
| | | String fileName = null; |
| | |
| | | */ |
| | | @PostMapping("/refreshTrainExamInfo") |
| | | public R refreshTrainExamInfo(@RequestBody UpdateParamVo updateParamVo) { |
| | | return R.status(examScoreService.refreshTrainExamInfo(updateParamVo)); |
| | | return R.data(examScoreService.refreshTrainExamInfo(updateParamVo)); |
| | | } |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 获取考试成绩列表 |
| | | * @param examScoreVO |
| | | * @return |
| | | */ |
| | | @GetMapping("/getList") |
| | | public R getList(ExamScoreVO examScoreVO) { |
| | | return R.data(examScoreService.getList(examScoreVO)); |
| | | } |
| | | |
| | | |
| | | } |