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 | 54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 54 insertions(+), 0 deletions(-)
diff --git a/src/main/java/org/springblade/modules/FTP/FtpUtil.java b/src/main/java/org/springblade/modules/FTP/FtpUtil.java
index 52b8bbe..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.*;
@@ -378,5 +380,57 @@
}
+ /**
+ * 执行 对象数据(用户,报名对象信息等) 上传
+ * @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