From 62eb499b0c969f246d3245d1429a97da4de1ce28 Mon Sep 17 00:00:00 2001
From: 钟日健 <arsn163@163.com>
Date: Mon, 01 Jun 2026 20:46:13 +0800
Subject: [PATCH] feat: 成绩查询增加年龄查询返回
---
src/main/java/org/springblade/modules/exam/service/impl/ScoreAuditRecordsServiceImpl.java | 76 ++++++-------------------------------
1 files changed, 13 insertions(+), 63 deletions(-)
diff --git a/src/main/java/org/springblade/modules/exam/service/impl/ScoreAuditRecordsServiceImpl.java b/src/main/java/org/springblade/modules/exam/service/impl/ScoreAuditRecordsServiceImpl.java
index 1184f99..f82b492 100644
--- a/src/main/java/org/springblade/modules/exam/service/impl/ScoreAuditRecordsServiceImpl.java
+++ b/src/main/java/org/springblade/modules/exam/service/impl/ScoreAuditRecordsServiceImpl.java
@@ -115,17 +115,10 @@
//3.修改考试理论成绩
examScore.setTheoryGrade(auditRecords.getNewScore());
//查询用户年龄
- UserVO userVO = userService.getUserAgeById(Long.parseLong(examScore.getUserId()));
+ UserVO userVO = userService.getUserAgeById(examScore.getUserId());
//判断实操成绩是否为空
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() + "'" +
@@ -150,10 +142,10 @@
"update blade_user set is_train = " + "'" + user.getIsTrain() + "'" +
" " + "where id = " + "'" + user.getId() + "'";
//FtpUtil.sqlFileUpload(s1);
- myAsyncService.FTP(s1);
+ 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));
}
@@ -204,27 +196,11 @@
+ "," + "'" + securityPaper.getApplyId() + "'"
+ "," +"'" + securityPaper.getExamId() + "'" + ")";
//FtpUtil.sqlFileUpload(s1);
- myAsyncService.FTP(s1);
+ myAsyncService.dataSync(s1);
}
} else {
//不合格
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));
- }
}
//更新成绩数据
@@ -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() + "'" +
@@ -245,7 +220,7 @@
",is_train = " + "'" + user.getIsTrain() + "'" +
" " + "where id = " + "'" + user.getId() + "'";
//FtpUtil.sqlFileUpload(s1);
- myAsyncService.FTP(s1);
+ myAsyncService.dataSync(s1);
}
}
//审核时间
@@ -286,17 +261,10 @@
//3.修改考试理论成绩
examScore.setTheoryGrade(records.getNewScore());
//查询用户年龄
- UserVO userVO = userService.getUserAgeById(Long.parseLong(examScore.getUserId()));
+ UserVO userVO = userService.getUserAgeById(examScore.getUserId());
//判断实操成绩是否为空
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() + "'" +
@@ -320,10 +287,10 @@
"update blade_user set is_train = " + "'" + user.getIsTrain() + "'" +
" " + "where id = " + "'" + user.getId() + "'";
//FtpUtil.sqlFileUpload(s1);
- myAsyncService.FTP(s1);
+ 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() + "'" +
@@ -409,7 +359,7 @@
",is_train = " + "'" + user.getIsTrain() + "'" +
" " + "where id = " + "'" + user.getId() + "'";
//FtpUtil.sqlFileUpload(s1);
- myAsyncService.FTP(s1);
+ myAsyncService.dataSync(s1);
}
}
//审核时间
--
Gitblit v1.9.3