| | |
| | | "values(" + "'" + sid + "'" + |
| | | "," + "'" + format + "'" + ")"; |
| | | //FtpUtil.sqlFileUpload(s); |
| | | myAsyncService.FTP(s); |
| | | //数据同步 |
| | | myAsyncService.dataSync(s); |
| | | } |
| | | //返回 |
| | | return R.status(save); |
| | |
| | | |
| | | |
| | | /** |
| | | * 点击了开始考试后超过60分钟后再考试的,计算之前的考试成绩 |
| | | * 点击了开始考试后超过90分钟后再考试的,计算之前的考试成绩 |
| | | * |
| | | * @param examScore 考试成绩信息对象 |
| | | */ |
| | |
| | | "update exam_score set qualified = " + "'" + examScore.getQualified() + "'" + |
| | | " " + "where id = " + "'" + examScore.getId() + "'"; |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.FTP(s1); |
| | | myAsyncService.dataSync(s1); |
| | | } |
| | | return R.status(status); |
| | | } |
| | |
| | | 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)); |
| | | } |
| | |
| | | securityPaperService.save(securityPaper); |
| | | //修改为持证保安 |
| | | user1.setHold("1"); |
| | | user1.setUpdateTime(new Date()); |
| | | //更新保安数据 |
| | | boolean b = userService.updateById(user1); |
| | | if (b) { |
| | |
| | | "update blade_user set hold = " + "'" + user1.getHold() + "'" + |
| | | ",securitynumber = " + "'" + user1.getSecuritynumber() + "'" + |
| | | ",user_type = " + "'" + user1.getUserType() + "'" + |
| | | ",update_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(user1.getUpdateTime()) + "'" + |
| | | " " + "where id = " + "'" + user1.getId() + "'"; |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.FTP(s1); |
| | | myAsyncService.dataSync(s1); |
| | | } |
| | | } |
| | | } 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)); |
| | | } |
| | | } |
| | | } |
| | | //内网同步 |
| | |
| | | ",qualified = " + "'" + examScore.getQualified() + "'" + |
| | | " " + "where id = " + "'" + examScore.getId() + "'"; |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.FTP(s1); |
| | | myAsyncService.dataSync(s1); |
| | | |
| | | //本地修改 |
| | | return R.status(examScoreService.updateById(examScore)); |
| | |
| | | //内网同步 |
| | | String s1 = "delete from exam_score where id = " + "'" + id + "'"; |
| | | //FtpUtil.sqlFileUpload(s1); |
| | | myAsyncService.FTP(s1); |
| | | myAsyncService.dataSync(s1); |
| | | }); |
| | | return R.status(examScoreService.removeByIds(Func.toLongList(ids))); |
| | | } |
| | |
| | | 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)); |
| | | } |
| | | |
| | | |
| | | } |