智慧保安后台管理-外网
Administrator
2022-06-17 6c9adc4164f0af8a6391bc5ff91ef124d773fc4a
src/main/java/org/springblade/modules/exam/controller/ExamScoreController.java
@@ -496,7 +496,7 @@
      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));
@@ -509,22 +509,22 @@
                  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);
               }
            }
//            }
         }
      }
@@ -533,7 +533,7 @@
      if (examScoreLists.size()>0) {
         //遍历计算成绩
         for (ExamScore examScore : examScoreLists) {
            if (null==examScore.getTheoryGrade()){
//            if (null==examScore.getTheoryGrade()){
               if (examScore.getTheoryGrade()>=startScore && examScore.getTheoryGrade()<=endScore){
                  //生成随机数,在60-79 之间
                  int score = (int) ((Math.random() * 20));
@@ -543,16 +543,16 @@
                  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);
//                  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);
               }
            }
         }
//         }
      }
   }
@@ -562,12 +562,30 @@
   @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 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 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);
   }
}