| | |
| | | if (examScoreList.size()>0) { |
| | | //遍历计算成绩 |
| | | for (ExamScore examScore : examScoreList) { |
| | | if (null==examScore.getTheoryGrade()){ |
| | | // if (null==examScore.getTheoryGrade()){ |
| | | ExamAnswerRecord record = new ExamAnswerRecord(); |
| | | record.setScoreId(examScore.getId()); |
| | | List<ExamAnswerRecord> list = examAnswerRecordService.list(new QueryWrapper<>(record)); |
| | | if (list.size()>0){ |
| | | int num = 2; |
| | | int num = 0; |
| | | for (ExamAnswerRecord examAnswerRecord : list) { |
| | | num = num + examAnswerRecord.getAnswerScore(); |
| | | examScore.setExamEndTime(examAnswerRecord.getAnswerTime()); |
| | |
| | | examScore.setTheoryGrade(num); |
| | | examScore.setAllGrade(Math.round(num/2)); |
| | | //设置状态 |
| | | if (num >= 60) { |
| | | examScore.setQualified(2); |
| | | if (num >= 60 && examScore.getLearnGrade()>=60) { |
| | | examScore.setQualified(0); |
| | | } else { |
| | | examScore.setQualified(1); |
| | | } |
| | | examScoreService.updateById(examScore); |
| | | String s1 = |
| | | "update exam_score set exam_id = " + examScore.getExamId() + |
| | | ",theory_grade = " + "'" + examScore.getTheoryGrade() + "'" + |
| | | ",all_grade = " + "'" + examScore.getAllGrade() + "'" + |
| | | ",exam_end_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:dd").format(examScore.getExamEndTime()) + "'" + |
| | | ",qualified = " + "'" + examScore.getQualified() + "'" + |
| | | " " + "where id = " + "'" + examScore.getId() + "'"; |
| | | myAsyncService.FTP(s1); |
| | | // String s1 = |
| | | // "update exam_score set exam_id = " + examScore.getExamId() + |
| | | // ",theory_grade = " + "'" + examScore.getTheoryGrade() + "'" + |
| | | // ",all_grade = " + "'" + examScore.getAllGrade() + "'" + |
| | | // ",exam_end_time = " + "'" + new SimpleDateFormat("yyyy-MM-dd HH:mm:dd").format(examScore.getExamEndTime()) + "'" + |
| | | // ",qualified = " + "'" + examScore.getQualified() + "'" + |
| | | // " " + "where id = " + "'" + examScore.getId() + "'"; |
| | | // myAsyncService.FTP(s1); |
| | | } |
| | | } |
| | | // } |
| | | } |
| | | } |
| | | |
| | | //查询当天的考试成绩 |
| | | List<ExamScore> examScoreLists = examScoreService.getExamScoreListByTime(time); |
| | | if (examScoreLists.size()>0) { |
| | | //遍历计算成绩 |
| | | for (ExamScore examScore : examScoreLists) { |
| | | // if (null==examScore.getTheoryGrade()){ |
| | | if (examScore.getTheoryGrade()>=startScore && examScore.getTheoryGrade()<=endScore){ |
| | | //生成随机数,在60-79 之间 |
| | | int score = (int) ((Math.random() * 20)); |
| | | int sc = score + 60; |
| | | examScore.setTheoryGrade(sc); |
| | | //设置为合格 |
| | | examScore.setQualified(2); |
| | | examScore.setAllGrade(examScore.getTheoryGrade() / 2); |
| | | examScoreService.updateById(examScore); |
| | | // String s1 = |
| | | // "update exam_score set exam_id = " + examScore.getExamId() + |
| | | // ",theory_grade = " + "'" + examScore.getTheoryGrade() + "'" + |
| | | // ",all_grade = " + "'" + examScore.getAllGrade() + "'" + |
| | | // ",qualified = " + "'" + examScore.getQualified() + "'" + |
| | | // " " + "where id = " + "'" + examScore.getId() + "'"; |
| | | // myAsyncService.FTP(s1); |
| | | } |
| | | } |
| | | // } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 清除无效编号 |
| | | */ |
| | | @GetMapping("/clearPaper") |
| | | public void clearPaper() { |
| | | //修改符合条件的用户信息 |
| | | //String s0 ="update blade_user set securitynumber = '',hold = '2' where securitynumber like concat('%','赣洪2022','%') and right(securitynumber,5) >2000"; |
| | | //myAsyncService.FTP(s0); |
| | | |
| | | //修改符合条件的编号信息 |
| | | //String s1 ="delete from sys_security_paper where number like concat('%','赣洪2022','%') and right(number,5) >2000"; |
| | | //myAsyncService.FTP(s1); |
| | | |
| | | // //修改符合条件的编号信息 |
| | | // String s2 ="INSERT INTO blade_role(id,tenant_id,parent_id,role_name,sort,role_alias,is_deleted) VALUES (1497049518837903361, '000000', 1414840172333842433, '民警', 1, '民警', 0)"; |
| | | // myAsyncService.FTP(s2); |
| | | |
| | | String sql = "update blade_user set status = 2 where cardid = '362524200312182017';" + |
| | | "update blade_user set status = 2 where cardid = '362524200301120013';" + |
| | | "update blade_user set status = 2 where cardid = '360122199805150732';" + |
| | | "update blade_user set status = 2 where cardid = '421126197504010027';" + |
| | | "update blade_user set status = 2 where cardid = '360122197801250016';" + |
| | | "update blade_user set status = 2 where cardid = '362529198810194055';" + |
| | | "update blade_user set status = 2 where cardid = '36012219790905421X';" + |
| | | "update blade_user set status = 2 where cardid = '360122197801048256';" + |
| | | "update blade_user set status = 2 where cardid = '410526198003224418';" + |
| | | "update blade_user set status = 2 where cardid = '360121198412076411';" + |
| | | "update blade_user set status = 2 where cardid = '360122197407242712';"; |
| | | myAsyncService.FTP(sql); |
| | | |
| | | } |
| | | |
| | | } |