From 8853292babb2ad94de4a3207966f1e83b767cd2d Mon Sep 17 00:00:00 2001
From: zhongrj <646384940@qq.com>
Date: Sun, 17 Sep 2023 16:38:34 +0800
Subject: [PATCH] 新增流程节点进程查询接口

---
 src/main/java/org/springblade/modules/exam/service/impl/ScoreAuditRecordsServiceImpl.java |   94 ++++++++++++++++------------------------------
 1 files changed, 33 insertions(+), 61 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 f3b18a9..49831ac 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
@@ -18,6 +18,7 @@
 import org.springblade.modules.securitypaper.service.SecurityPaperService;
 import org.springblade.modules.system.entity.User;
 import org.springblade.modules.system.service.IUserService;
+import org.springblade.modules.system.service.MyAsyncService;
 import org.springblade.modules.system.vo.UserVO;
 import org.springblade.modules.training.entity.TrainingRegistration;
 import org.springblade.modules.training.service.TrainingRegistrationService;
@@ -53,6 +54,8 @@
 
 	@Autowired
 	private SecurityPaperService securityPaperService;
+	@Autowired
+	private  MyAsyncService myAsyncService;
 
 	/**
 	 * 自定义分页
@@ -116,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);
@@ -138,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() + "'" +
@@ -146,10 +141,11 @@
 						" " + "where id = " + "'" + trainingRegistration.getId() + "';"+
 					"update blade_user set is_train = " + "'" +  user.getIsTrain() + "'" +
 						" " + "where id = " + "'" + user.getId() + "'";
-				FtpUtil.sqlFileUpload(s1);
+				//FtpUtil.sqlFileUpload(s1);
+				myAsyncService.dataSync(s1);
 			} else {
 				//实操成绩不为空
-				if (examScore.getTheoryGrade() >= 60 && examScore.getLearnGrade() >= 60) {
+				if (examScore.getTheoryGrade() >= 60 && examScore.getLearnGrade() ==0) {
 					//合格
 					examScore.setQualified(0);
 					//设置为未制证的状态
@@ -162,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));
 						}
@@ -184,6 +180,7 @@
 						securityPaper.setPeopleName(user.getRealName());
 						securityPaper.setExamId(Long.parseLong(examScore.getExamId()));
 						securityPaper.setApplyId(examScore.getApplyId());
+						securityPaper.setSource(1);
 						//新增保安员证信息
 						securityPaperService.save(securityPaper);
 
@@ -198,27 +195,12 @@
 								+ "," + "'" + securityPaper.getUserId() + "'"
 								+ "," + "'" + securityPaper.getApplyId() + "'"
 								+ "," +"'" + securityPaper.getExamId() + "'" + ")";
-						FtpUtil.sqlFileUpload(s1);
+						//FtpUtil.sqlFileUpload(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));
-					}
 				}
 
 				//更新成绩数据
@@ -227,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() + "'" +
@@ -238,7 +219,8 @@
 						",user_type = " + "'" + user.getUserType() + "'" +
 						",is_train = " + "'" + user.getIsTrain() + "'" +
 						" " + "where id = " + "'" + user.getId() + "'";
-				FtpUtil.sqlFileUpload(s1);
+				//FtpUtil.sqlFileUpload(s1);
+				myAsyncService.dataSync(s1);
 			}
 		}
 		//审核时间
@@ -283,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);
@@ -305,17 +280,17 @@
 					//内网培训报名,人员,成绩数据同步
 					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() + "'" +
 							" " + "where id = " + "'" + trainingRegistration.getId() + "';"+
 						"update blade_user set is_train = " + "'" +  user.getIsTrain() + "'" +
 							" " + "where id = " + "'" + user.getId() + "'";
-					FtpUtil.sqlFileUpload(s1);
+					//FtpUtil.sqlFileUpload(s1);
+					myAsyncService.dataSync(s1);
 				} else {
 					//实操成绩不为空
-					if (examScore.getTheoryGrade() >= 60 && examScore.getLearnGrade() >= 60) {
+					if (examScore.getTheoryGrade() >= 60 && examScore.getLearnGrade() == 0) {
 						//合格
 						examScore.setQualified(0);
 						//设置为未制证的状态
@@ -328,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));
 							}
@@ -342,6 +317,19 @@
 							user.setHold("1");
 							//更新保安数据
 							userService.updateById(user);
+
+							//生成保安证的同时向保安证管理表中插入一条数据
+							SecurityPaper securityPaper = new SecurityPaper();
+							securityPaper.setUserId(user.getId());
+							securityPaper.setNumber(result);
+							securityPaper.setCreateTime(new Date());
+							securityPaper.setIdCardNo(user.getCardid());
+							securityPaper.setPeopleName(user.getRealName());
+							securityPaper.setExamId(Long.parseLong(examScore.getExamId()));
+							securityPaper.setApplyId(examScore.getApplyId());
+							securityPaper.setSource(1);
+							//新增保安员证信息
+							securityPaperService.save(securityPaper);
 
 //						String s1 =
 //							"update blade_user set hold = " + "'" + user.getHold() + "'" +
@@ -354,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);
@@ -377,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() + "'" +
@@ -387,7 +358,8 @@
 							",user_type = " + "'" + user.getUserType() + "'" +
 							",is_train = " + "'" + user.getIsTrain() + "'" +
 							" " + "where id = " + "'" + user.getId() + "'";
-					FtpUtil.sqlFileUpload(s1);
+					//FtpUtil.sqlFileUpload(s1);
+					myAsyncService.dataSync(s1);
 				}
 			}
 			//审核时间

--
Gitblit v1.9.3