From 49c5471cc12d7ec57db3cad6964b7e4f61d472f2 Mon Sep 17 00:00:00 2001
From: Administrator <admin>
Date: Fri, 06 May 2022 09:31:26 +0800
Subject: [PATCH] 枪支,考试成绩,保安员证编号生成,单位信息基本信息,许可证信息,主要管理人,出资人信息,社保记录信息新增导入敏感数据处理

---
 src/main/java/org/springblade/modules/exam/service/impl/ScoreAuditRecordsServiceImpl.java |   48 ++++++++++++++++++++++++++++++++++++++++--------
 1 files changed, 40 insertions(+), 8 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 f054d9f..bcf0c02 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
@@ -7,6 +7,8 @@
 import org.springblade.common.utils.DesensitizedUtil;
 import org.springblade.common.utils.QRCodeUtil;
 import org.springblade.modules.FTP.FtpUtil;
+import org.springblade.modules.FTP.Monitor;
+import org.springblade.modules.FTP.Result;
 import org.springblade.modules.accreditation.excel.ExportSecurityPaperExcel;
 import org.springblade.modules.exam.entity.ExamScore;
 import org.springblade.modules.exam.entity.ScoreAuditRecords;
@@ -32,10 +34,7 @@
 import java.net.URLEncoder;
 import java.text.DecimalFormat;
 import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
+import java.util.*;
 
 /**
  * 考试成绩修改申请记录服务实现类
@@ -164,15 +163,48 @@
 						//去生成保安证编号
 						String pre = SecurityPaperUtil.getSecurityPaper();
 						//查询当前年份已有的保安证编号
-						int count = userService.getSecurityPaperCount(pre);
+//						int count = userService.getSecurityPaperCount(pre);
+						//需调用内网查询
+						//生成随机数
+						String uuid = UUID.randomUUID().toString();
+
+						//数据推送
+						Map<String, Object> map = new HashMap<>(1);
+						map.put(uuid,pre);
+						myAsyncService.FTPSecurityNumberBit(map);
+
+						int count = 0;
+						Result result0 = new Result();
+						//调用ftp获取返回数据
+						while (true){
+							try {
+								Thread.sleep(1000);
+							} catch (InterruptedException e) {
+								e.printStackTrace();
+							}
+							//调用ftp获取返回数据
+							result0 = Monitor.getSecurityNumberBit(uuid);
+							//如果返回true,就退处
+							if (result0.getCode()==200){
+								break;
+							}else{
+								//计数
+								count++;
+								//如果超过100s 没有读取到,则退出
+								if (count == 100) {
+									break;
+								}
+							}
+						}
+						int max = Integer.parseInt(result0.getMsg());
 						String result = null;
-						if (count == 0) {
+						if (max == 0) {
 							result = pre + "00001";
 						} else {
 							//格式化
 							DecimalFormat decimalFormat = new DecimalFormat("00000");
-							count++;
-							result = pre + (decimalFormat.format(count));
+							max++;
+							result = pre + (decimalFormat.format(max));
 						}
 						user.setSecuritynumber(result);
 						//修改为持证保安

--
Gitblit v1.9.3