From 61cfb19a3864e70cedaa8de38f4caf032f528455 Mon Sep 17 00:00:00 2001
From: 钟日健 <5689795+arsn@user.noreply.gitee.com>
Date: Fri, 06 May 2022 09:35:54 +0800
Subject: [PATCH] 新增查询保安员证编号,新增 ftp 读取

---
 src/main/java/org/springblade/modules/FTP/FtpUtil.java |   91 ++++++++++++++++++++++++++++++++++++---------
 1 files changed, 73 insertions(+), 18 deletions(-)

diff --git a/src/main/java/org/springblade/modules/FTP/FtpUtil.java b/src/main/java/org/springblade/modules/FTP/FtpUtil.java
index 0c9dca7..201a824 100644
--- a/src/main/java/org/springblade/modules/FTP/FtpUtil.java
+++ b/src/main/java/org/springblade/modules/FTP/FtpUtil.java
@@ -11,6 +11,8 @@
 import java.io.*;
 import java.net.SocketException;
 import java.util.Date;
+import java.util.Map;
+
 import net.lingala.zip4j.core.ZipFile;
 
 import static org.springblade.common.config.FtpConfig.*;
@@ -288,23 +290,7 @@
 			}
 		}
 	}
-	/**
-	 * 执行sql 上传
-	 * @param s1 sql
-	 */
-	public static void sqlFileUpload(String s1){
-		String json1 = JSON.toJSONString(s1);
-		String response1 = String.valueOf((new Date()).getTime());
-		OutJson.createJsonFile(json1, localPath, "nsql"+response1);
-		FileInputStream in1 = null;
-		try {
-			in1 = new FileInputStream(new File(localPath + "nsql"+response1+".json"));
-		} catch (FileNotFoundException e) {
-			e.printStackTrace();
-		}
-		FtpUtil.uploadFile(ftpHost, ftpPort, ftpUserName, ftpPassword, ftpPath, "/",  "nsql"+response1+".json", in1);
-//		MysqlCenlint.deletess("nsql"+response1+".json");
-	}
+
 	/**
 	 *
 	 * 解压zip 包
@@ -357,6 +343,23 @@
 		}
 	}
 
+	/**
+	 * 执行sql 上传
+	 * @param obj sql
+	 */
+	public static void sqlFileUpload(String obj){
+		String json1 = JSON.toJSONString(obj);
+		String response1 = String.valueOf((new Date()).getTime());
+		OutJson.createJsonFile(json1, localPath, "nsql"+response1);
+		FileInputStream in1 = null;
+		try {
+			in1 = new FileInputStream(new File(localPath + "nsql"+response1+".json"));
+		} catch (FileNotFoundException e) {
+			e.printStackTrace();
+		}
+		FtpUtil.uploadFile(ftpHost, ftpPort, ftpUserName, ftpPassword, ftpPath, "/",  "nsql"+response1+".json", in1);
+		MysqlCenlint.deletess("nsql"+response1+".json");
+	}
 
 	/**
 	 * 执行 对象数据(用户,报名对象信息等) 上传
@@ -373,9 +376,61 @@
 			e.printStackTrace();
 		}
 		FtpUtil.uploadFile(ftpHost, ftpPort, ftpUserName, ftpPassword, ftpPath, "/",  "n"+response1+".json", in1);
-//		MysqlCenlint.deletess("n"+response1+".json");
+		MysqlCenlint.deletess("n"+response1+".json");
 	}
 
 
+	/**
+	 * 执行 对象数据(用户,报名对象信息等) 上传
+	 * @param obj 对象信息
+	 */
+	public static void objectFileUploadList(Object obj){
+		String json1 = JSON.toJSONString(obj);
+		String response1 = String.valueOf((new Date()).getTime());
+		OutJson.createJsonFile(json1, localPath, "nl"+response1);
+		FileInputStream in1 = null;
+		try {
+			in1 = new FileInputStream(new File(localPath + "nl"+response1+".json"));
+		} catch (FileNotFoundException e) {
+			e.printStackTrace();
+		}
+		FtpUtil.uploadFile(ftpHost, ftpPort, ftpUserName, ftpPassword, ftpPath, "/",  "nl"+response1+".json", in1);
+		MysqlCenlint.deletess("nl"+response1+".json");
+	}
 
+	/**
+	 * 返回报名信息结果
+	 * @param obj
+	 */
+	public static void objectFileUploadListTrain(Object obj){
+		String json1 = JSON.toJSONString(obj);
+		String response1 = String.valueOf((new Date()).getTime());
+		OutJson.createJsonFile(json1, localPath, "nt"+response1);
+		FileInputStream in1 = null;
+		try {
+			in1 = new FileInputStream(new File(localPath + "nt"+response1+".json"));
+		} catch (FileNotFoundException e) {
+			e.printStackTrace();
+		}
+		FtpUtil.uploadFile(ftpHost, ftpPort, ftpUserName, ftpPassword, ftpPath, "/",  "nt"+response1+".json", in1);
+		MysqlCenlint.deletess("nt"+response1+".json");
+	}
+
+	/**
+	 * 向外网发送保安员证编号位数数据
+	 * @param map1
+	 */
+	public static void objectFileUploadSecurityNumberCount(Object obj){
+		String json1 = JSON.toJSONString(obj);
+		String response1 = String.valueOf((new Date()).getTime());
+		OutJson.createJsonFile(json1, localPath, "ns"+response1);
+		FileInputStream in1 = null;
+		try {
+			in1 = new FileInputStream(new File(localPath + "ns"+response1+".json"));
+		} catch (FileNotFoundException e) {
+			e.printStackTrace();
+		}
+		FtpUtil.uploadFile(ftpHost, ftpPort, ftpUserName, ftpPassword, ftpPath, "/",  "ns"+response1+".json", in1);
+		MysqlCenlint.deletess("ns"+response1+".json");
+	}
 }

--
Gitblit v1.9.3