智慧保安后台管理-外网项目备份
zhongrj
2023-09-17 8853292babb2ad94de4a3207966f1e83b767cd2d
src/main/java/org/springblade/modules/exam/service/impl/ScoreAuditRecordsServiceImpl.java
@@ -119,13 +119,6 @@
         //判断实操成绩是否为空
         if (null == examScore.getLearnGrade()) {
            //如果为空,之间修改理论成绩和总成绩
            //总成绩
            if (userVO.getAge() <= 50) {
               examScore.setAllGrade(Math.round(examScore.getTheoryGrade()/2));
            }
            if (userVO.getAge() > 50) {
               examScore.setAllGrade(Math.round(examScore.getTheoryGrade()/2));
            }
            if (examScore.getTheoryGrade() >= 60) {
               //实操成绩暂未录入
               examScore.setQualified(2);
@@ -141,7 +134,6 @@
            //内网培训报名,人员,成绩数据同步
            String s1 =
               "update exam_score set theory_grade = " + "'" + examScore.getTheoryGrade() + "'" +
                  ",all_grade = " + "'" + examScore.getAllGrade() + "'" +
                  ",qualified = " + "'" + examScore.getQualified() + "'" +
                  " " + "where id = " + "'" + examScore.getId() + "';"+
               "update sys_training_registration set is_exam = " + "'" + trainingRegistration.getIsExam() + "'" +
@@ -153,7 +145,7 @@
            myAsyncService.dataSync(s1);
         } else {
            //实操成绩不为空
            if (examScore.getTheoryGrade() >= 60 && examScore.getLearnGrade() >= 60) {
            if (examScore.getTheoryGrade() >= 60 && examScore.getLearnGrade() ==0) {
               //合格
               examScore.setQualified(0);
               //设置为未制证的状态
@@ -166,10 +158,10 @@
                  int count = userService.getSecurityPaperCount(pre);
                  String result = null;
                  if (count == 0) {
                     result = pre + "00001";
                     result = pre + "000001";
                  } else {
                     //格式化
                     DecimalFormat decimalFormat = new DecimalFormat("00000");
                     DecimalFormat decimalFormat = new DecimalFormat("000000");
                     count++;
                     result = pre + (decimalFormat.format(count));
                  }
@@ -210,22 +202,6 @@
               //不合格
               examScore.setQualified(1);
            }
            //总成绩
            if (userVO.getAge() <= 50) {
               if (null != examScore.getTheoryGrade()) {
                  examScore.setAllGrade(Math.round((examScore.getTheoryGrade() + examScore.getLearnGrade()) / 2));
               } else {
                  examScore.setAllGrade(Math.round(examScore.getLearnGrade() / 2));
               }
            }
            if (userVO.getAge() > 50) {
               if (null != examScore.getTheoryGrade()) {
                  examScore.setAllGrade(Integer.parseInt(String.valueOf(Math.round(examScore.getTheoryGrade() * 0.5)))
                     + Integer.parseInt(String.valueOf(Math.round(examScore.getLearnGrade() * 0.5))));
               } else {
                  examScore.setAllGrade(Math.round(examScore.getLearnGrade() / 2));
               }
            }
            //更新成绩数据
            examScoreService.updateById(examScore);
@@ -233,7 +209,6 @@
            //内网培训报名,人员,成绩数据同步
            String s1 =
               "update exam_score set theory_grade = " + "'" + examScore.getTheoryGrade() + "'" +
                  ",all_grade = " + "'" + examScore.getAllGrade() + "'" +
                  ",qualified = " + "'" + examScore.getQualified() + "'" +
                  " " + "where id = " + "'" + examScore.getId() + "';"+
               "update sys_training_registration set is_exam = " + "'" + trainingRegistration.getIsExam() + "'" +
@@ -290,13 +265,6 @@
            //判断实操成绩是否为空
            if (null == examScore.getLearnGrade()) {
               //如果为空,之间修改理论成绩和总成绩
               //总成绩
               if (userVO.getAge() <= 50) {
                  examScore.setAllGrade(Math.round(examScore.getTheoryGrade()/2));
               }
               if (userVO.getAge() > 50) {
                  examScore.setAllGrade(Math.round(examScore.getTheoryGrade()/2));
               }
               if (examScore.getTheoryGrade() >= 60) {
                  //实操成绩暂未录入
                  examScore.setQualified(2);
@@ -312,7 +280,6 @@
               //内网培训报名,人员,成绩数据同步
               String s1 =
                  "update exam_score set theory_grade = " + "'" + examScore.getTheoryGrade() + "'" +
                     ",all_grade = " + "'" + examScore.getAllGrade() + "'" +
                     ",qualified = " + "'" + examScore.getQualified() + "'" +
                     " " + "where id = " + "'" + examScore.getId() + "';"+
                  "update sys_training_registration set is_exam = " + "'" + trainingRegistration.getIsExam() + "'" +
@@ -323,7 +290,7 @@
               myAsyncService.dataSync(s1);
            } else {
               //实操成绩不为空
               if (examScore.getTheoryGrade() >= 60 && examScore.getLearnGrade() >= 60) {
               if (examScore.getTheoryGrade() >= 60 && examScore.getLearnGrade() == 0) {
                  //合格
                  examScore.setQualified(0);
                  //设置为未制证的状态
@@ -336,10 +303,10 @@
                     int count = userService.getSecurityPaperCount(pre);
                     String result = null;
                     if (count == 0) {
                        result = pre + "00001";
                        result = pre + "000001";
                     } else {
                        //格式化
                        DecimalFormat decimalFormat = new DecimalFormat("00000");
                        DecimalFormat decimalFormat = new DecimalFormat("000000");
                        count++;
                        result = pre + (decimalFormat.format(count));
                     }
@@ -375,22 +342,6 @@
                  //不合格
                  examScore.setQualified(1);
               }
               //总成绩
               if (userVO.getAge() <= 50) {
                  if (null != examScore.getTheoryGrade()) {
                     examScore.setAllGrade(Math.round((examScore.getTheoryGrade() + examScore.getLearnGrade()) / 2));
                  } else {
                     examScore.setAllGrade(Math.round(examScore.getLearnGrade() / 2));
                  }
               }
               if (userVO.getAge() > 50) {
                  if (null != examScore.getTheoryGrade()) {
                     examScore.setAllGrade(Integer.parseInt(String.valueOf(Math.round(examScore.getTheoryGrade() * 0.5)))
                        + Integer.parseInt(String.valueOf(Math.round(examScore.getLearnGrade() * 0.5))));
                  } else {
                     examScore.setAllGrade(Math.round(examScore.getLearnGrade() / 2));
                  }
               }
               //更新成绩数据
               examScoreService.updateById(examScore);
@@ -398,7 +349,6 @@
               //内网培训报名,人员,成绩数据同步
               String s1 =
                  "update exam_score set theory_grade = " + "'" + examScore.getTheoryGrade() + "'" +
                     ",all_grade = " + "'" + examScore.getAllGrade() + "'" +
                     ",qualified = " + "'" + examScore.getQualified() + "'" +
                     " " + "where id = " + "'" + examScore.getId() + "';"+
                  "update sys_training_registration set is_exam = " + "'" + trainingRegistration.getIsExam() + "'" +