智慧保安后台管理-外网
Administrator
2022-06-16 b23b98d85b57832e2b615579347089904851f938
src/main/java/org/springblade/modules/exam/controller/ExamScoreController.java
@@ -501,7 +501,7 @@
               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());
@@ -527,6 +527,47 @@
            }
         }
      }
      //查询当天的考试成绩
      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);
   }
}