From 3e881345e5e8753c0886407a98bff8da9ae54f76 Mon Sep 17 00:00:00 2001
From: xiangpei <xiangpei@timesnew.cn>
Date: 星期一, 17 二月 2025 09:55:13 +0800
Subject: [PATCH] 还原

---
 ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/sync/VideoPulSync.java |   25 +++++++++----------------
 1 files changed, 9 insertions(+), 16 deletions(-)

diff --git a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/sync/VideoPulSync.java b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/sync/VideoPulSync.java
index 2172790..e57afd1 100644
--- a/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/sync/VideoPulSync.java
+++ b/ruoyi-modules/ruoyi-system/src/main/java/org/dromara/system/sync/VideoPulSync.java
@@ -50,28 +50,21 @@
 
     @Scheduled(cron = "0 0/1 * * * ?")
     public void get() throws IOException {
-        log.error("鍚屾涓婁紶");
-        List<String> list = FtpApche.downloadList(ftpConfig);
-
-        if(CollectionUtils.isEmpty(list)){
-            log.error("no files in ftp");
+        log.error("鍚屾浜掕仈缃戞枃浠�");
+        List<String> list = FtpApche.downloadList(this.ftpConfig);
+        if (list.size() == 0)
             return;
-        }
-        log.info("ftp get all fileinfo锛�" + list.get(0));
         for (String str : list) {
             String password = str.substring(0, 6);
             String fileName = str.substring(6, str.length());
             InputStream input = FtpApche.downloadFileFromDailyDir(str);
-            if (Objects.nonNull(input)) {
-                byte[] fileBytesByName = FtpApche.getFileBytesByName(input);
-                OssClient storage = OssFactory.instance();
-                MockMultipartFile mockMultipartFile = new MockMultipartFile(fileName, fileName, fileName.substring(14, fileName.length()), input);
-                UploadResult uploadResult = storage.uploadSuffix2(fileBytesByName, getPath(fileName), "multipart/form-data; charset=ISO-8859-1");
-                buildResultEntity(fileName, fileName.substring(14, fileName.length()), "minio", uploadResult, (MultipartFile)mockMultipartFile, password, fileBytesByName);
-                FtpApche.deleteFile(str);
-            }
+            byte[] fileBytesByName = FtpApche.getFileBytesByName(input);
+            OssClient storage = OssFactory.instance();
+            MockMultipartFile mockMultipartFile = new MockMultipartFile(fileName, fileName, fileName.substring(14, fileName.length()), input);
+            UploadResult uploadResult = storage.uploadSuffix2(fileBytesByName, getPath(fileName), "multipart/form-data; charset=ISO-8859-1");
+            FtpApche.deleteFile(str);
+            buildResultEntity(fileName, fileName.substring(14, fileName.length()), "minio", uploadResult, (MultipartFile)mockMultipartFile, password, fileBytesByName);
         }
-
     }
 
     @NotNull

--
Gitblit v1.8.0