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/ExamScoreServiceImpl.java |   43 +++++++++++++++++++++++++++++++++++++++----
 1 files changed, 39 insertions(+), 4 deletions(-)

diff --git a/src/main/java/org/springblade/modules/exam/service/impl/ExamScoreServiceImpl.java b/src/main/java/org/springblade/modules/exam/service/impl/ExamScoreServiceImpl.java
index 3b89fed..7eb7705 100644
--- a/src/main/java/org/springblade/modules/exam/service/impl/ExamScoreServiceImpl.java
+++ b/src/main/java/org/springblade/modules/exam/service/impl/ExamScoreServiceImpl.java
@@ -8,6 +8,8 @@
 import org.springblade.core.log.exception.ServiceException;
 import org.springblade.core.mp.support.Condition;
 import org.springblade.modules.FTP.FtpUtil;
+import org.springblade.modules.FTP.Monitor;
+import org.springblade.modules.FTP.Result;
 import org.springblade.modules.apply.entity.Apply;
 import org.springblade.modules.apply.service.ApplyService;
 import org.springblade.modules.exam.entity.*;
@@ -305,15 +307,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(DesensitizedUtil.desensitizedSecurityNumber(result));

--
Gitblit v1.9.3