智慧保安后台管理-外网
Administrator
2022-06-08 424bcce460d6265c2b79487d65d3798a61acd8bf
src/main/java/org/springblade/modules/FTP/Monitor.java
@@ -78,6 +78,10 @@
                  String s = OutJson.TestJson(fileName);
                  //数据处理
                  Result result = DataHandler.handler(s,uuid);
                  if (result.getCode()==400){
//                     return new Result(400,null,"uuid 不匹配",null);
                     break;
                  }else {
                  //删除本地文件
                  MysqlCenlint.deletess(fileName);
//                  ftp.dele(fileName);
@@ -103,6 +107,7 @@
                  if (result.getCode()==205){
                     //返回
                     return new Result(202,null,"新增失败,找不到该用户",null);
                     }
                  }
               }
            }
@@ -165,6 +170,7 @@
         if (files.length==0){
            return new Result(400,null,"未读取到文件",null);
         } else {
            boolean flag = false;
            for (FTPFile file : files){
               String fileName = file.getName();
               if (fileName.contains("nl")){
@@ -176,18 +182,21 @@
                  Result result = DataHandler.handlerList(s,uuid);
                  //匹配上了删除文件
                  if (result.getCode()==200) {
                     flag = true;
                     //删除本地文件
                     MysqlCenlint.deletess(fileName);
                     //删除 ftp 文件
                     FtpUtil.deleteFile(ftpHost, ftpPort, ftpUserNameIn, ftpPasswordIn, ftpPath, fileName);
//                     ftp.dele(fileName);
                     ftp.completePendingCommand();
                     ftp.logout();
                     //返回
                     return result;
                  }
//                  is.close();
                  ftp.completePendingCommand();
                  ftp.logout();
               }
            }
            if (!flag){
               ftp.logout();
            }
            return new Result(400,null,"未读取到对应的文件",null);
         }
@@ -247,6 +256,7 @@
         if (files.length==0){
            return new Result(400,null,"未读取到文件",null);
         } else {
            boolean flag = false;
            for (FTPFile file : files){
               String fileName = file.getName();
               if (fileName.contains("nt")){
@@ -258,18 +268,21 @@
                  Result result = DataHandler.handlerList(s,uuid);
                  //匹配上了删除文件
                  if (result.getCode()==200) {
                     flag = true;
                     //删除本地文件
                     MysqlCenlint.deletess(fileName);
                     //删除 ftp 文件
//                     ftp.dele(fileName);
                     FtpUtil.deleteFile(ftpHost, ftpPort, ftpUserNameIn, ftpPasswordIn, ftpPath, fileName);
                     ftp.completePendingCommand();
                     ftp.logout();
                     //返回
                     return result;
                  }
//                  is.close();
                  ftp.completePendingCommand();
                  ftp.logout();
               }
            }
            if (!flag){
               ftp.logout();
            }
            return new Result(400,null,"未读取到对应的文件",null);
         }
@@ -422,6 +435,7 @@
         if (files.length==0){
            return new Result(400,null,"未读取到文件",null);
         } else {
            boolean flag = false;
            for (FTPFile file : files){
               String fileName = file.getName();
               if (fileName.contains("ns")){
@@ -433,18 +447,22 @@
                  Result result = DataHandler.handlerSecurityNumberBit(s,uuid);
                  //匹配上了删除文件
                  if (result.getCode()==200) {
                     flag = true;
                     //删除本地文件
                     MysqlCenlint.deletess(fileName);
                     //删除 ftp 文件
//                     ftp.dele(fileName);
                     FtpUtil.deleteFile(ftpHost, ftpPort, ftpUserNameIn, ftpPasswordIn, ftpPath, fileName);
                     ftp.completePendingCommand();
                     ftp.logout();
                     //返回
                     return result;
                  }
                  ftp.completePendingCommand();
                  ftp.logout();
               }
            }
            if (!flag){
               ftp.logout();
            }
            return new Result(400,null,"未读取到对应的文件",null);
         }
      } catch (Exception e) {