智慧保安后台管理-外网
Administrator
2022-06-11 3a5d12b67221a19ff199846c19c4e74b71f3be84
src/main/java/org/springblade/modules/quartz/task/Task.java
@@ -121,7 +121,6 @@
         FTPFile[] files = ftp.listFiles();
         if (files.length==0){
            ftp.logout();
            return false;
         }
         else {
@@ -167,13 +166,18 @@
               }
            }
            //关闭流
            ftp.completePendingCommand();
            ftp.logout();
//            ftp.completePendingCommand();
//            ftp.logout();
         }
      } catch (Exception e) {
         System.out.println("ftp连接失败");
         e.printStackTrace();
      } finally {
         try {
            ftp.logout();
         } catch (IOException e) {
            e.printStackTrace();
         }
         if (ftp.isConnected()) {
            try {
               ftp.disconnect();
@@ -225,7 +229,7 @@
         //文件个数大于10个时开始处理
//         if (files.length==0 || files.length<10){
         if (files.length==0){
            ftp.logout();
//            ftp.logout();
            return false;
         }
         else {
@@ -270,13 +274,18 @@
               }
            }
            //关闭流
            ftp.completePendingCommand();
            ftp.logout();
//            ftp.completePendingCommand();
//            ftp.logout();
         }
      } catch (Exception e) {
         System.out.println("ftp连接失败");
         e.printStackTrace();
      } finally {
         try {
            ftp.logout();
         } catch (IOException e) {
            e.printStackTrace();
         }
         if (ftp.isConnected()) {
            try {
               ftp.disconnect();
@@ -327,7 +336,7 @@
         FTPFile[] files = ftp.listFiles();
         //文件个数大于10个时开始处理
         if (files.length==0){
            ftp.logout();
            return false;
         }
         else {
@@ -369,13 +378,18 @@
               }
            }
            //关闭流
            ftp.completePendingCommand();
            ftp.logout();
//            ftp.completePendingCommand();
//            ftp.logout();
         }
      } catch (Exception e) {
         System.out.println("ftp连接失败");
         e.printStackTrace();
      } finally {
         try {
            ftp.logout();
         } catch (IOException e) {
            e.printStackTrace();
         }
         if (ftp.isConnected()) {
            try {
               ftp.disconnect();
@@ -391,7 +405,8 @@
    * 用户集合信息处理
    * @param result
    */
   private void userListInfoHandler(Result result) {
   @Async
   public void userListInfoHandler(Result result) {
      //获取 result
      List<Result> data1 = result.getData();
      System.out.println("批量导入数据 = " + data1);
@@ -515,7 +530,7 @@
         ftp.setControlEncoding("GBK");
         // 检验文件是否存在
         ftp.changeWorkingDirectory(ftpPath);
//         ftp.changeWorkingDirectory(ftpPath);
         // Use passive mode as default
         ftp.enterLocalPassiveMode();
@@ -523,7 +538,7 @@
         FTPFile[] files = ftp.listFiles();
         //文件个数大于10个时开始处理
         if (files.length==0){
            ftp.logout();
//            ftp.logout();
            return false;
         }
         else {
@@ -561,13 +576,18 @@
               }
            }
            //关闭流
            ftp.completePendingCommand();
            ftp.logout();
//            ftp.completePendingCommand();
//            ftp.logout();
         }
      } catch (Exception e) {
         System.out.println("ftp连接失败");
         e.printStackTrace();
      } finally {
         try {
            ftp.logout();
         } catch (IOException e) {
            e.printStackTrace();
         }
         if (ftp.isConnected()) {
            try {
               ftp.disconnect();
@@ -583,7 +603,8 @@
    * 报名信息处理
    * @param result
    */
   private void applyHandler(String uuid,Result result) {
   @Async
   public void applyHandler(String uuid,Result result) {
      //取出培训学校id
      //从redis 中获取用户数据
      String s = redisTemplate.opsForValue().get(uuid).toString();