钟日健
2022-04-28 2f3462ccabb710c89a656e34f81b64785ff0dfe2
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,21 @@
   }
   /**
    * 执行 对象数据(用户,报名对象信息等) 上传
    * @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");
   }
}