From 99f528e235f11126fea44480c6e8888a9e463f2f Mon Sep 17 00:00:00 2001
From: wlzboy <66905212@qq.com>
Date: 星期六, 08 十一月 2025 21:09:53 +0800
Subject: [PATCH] feat:任务附件上传和同步

---
 ruoyi-system/src/main/java/com/ruoyi/system/file/FileUploadServiceImpl.java |   21 ++++++---------------
 1 files changed, 6 insertions(+), 15 deletions(-)

diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/file/FileUploadServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/file/FileUploadServiceImpl.java
index 1abb2aa..ae26026 100644
--- a/ruoyi-system/src/main/java/com/ruoyi/system/file/FileUploadServiceImpl.java
+++ b/ruoyi-system/src/main/java/com/ruoyi/system/file/FileUploadServiceImpl.java
@@ -85,7 +85,7 @@
             log.info("寮�濮嬩笂浼犳枃浠跺埌PHP鎺ュ彛: fileName={}, targetPath={}", fileName, targetPath);
             
             // 璋冪敤PHP涓婁紶鎺ュ彛
-            String response = HttpUtils.postFile(legacyConfig.getFileServerUrl(), params, fileName);
+            String response = HttpUtils.postFile(legacyConfig.getFileUploadUrl(), params, fileName);
             
             log.info("PHP鎺ュ彛鍝嶅簲: {}", response);
             
@@ -305,6 +305,8 @@
                         int end = dataSection.indexOf("\"", start);
                         if (start > 11 && end > start) {
                             String filePath = dataSection.substring(start, end);
+                            // 鍘婚櫎杞箟瀛楃
+                            filePath = filePath.replace("\\", "");
                             log.info("鎻愬彇鍒版枃浠惰矾寰�: {}", filePath);
                             return filePath;
                         }
@@ -346,6 +348,7 @@
                         if (start > 16 && end > start) {
                             String thumbnailPath = dataSection.substring(start, end);
                             log.info("鎻愬彇鍒扮缉鐣ュ浘璺緞: {}", thumbnailPath);
+                            thumbnailPath = thumbnailPath.replace("\\", ""); // 鍘婚櫎杞箟瀛楃
                             return thumbnailPath;
                         }
                     }
@@ -359,6 +362,7 @@
                 if (start > 16 && end > start) {
                     String thumbnailPath = response.substring(start, end);
                     log.info("鎻愬彇鍒扮缉鐣ュ浘璺緞(鏃ф牸寮�): {}", thumbnailPath);
+                    thumbnailPath = thumbnailPath.replace("\\", ""); // 鍘婚櫎杞箟瀛楃
                     return thumbnailPath;
                 }
             }
@@ -471,20 +475,7 @@
                 return uploadResponse;
             }
             
-            // 濡傛灉鏄浘鐗囷紝鐢熸垚缂╃暐鍥�
-            if (isImage && uploadResponse.getFilePath() != null) {
-                String originalPath = uploadResponse.getFilePath();
-                String thumbnailPath = generateThumbnailPath(originalPath);
-                
-                // 鐢熸垚缂╃暐鍥�
-                if (createThumbnail(originalPath, thumbnailPath, 100, 0)) {
-                    uploadResponse.setThumbnailPath(thumbnailPath);
-                    log.info("缂╃暐鍥剧敓鎴愭垚鍔燂細{}", thumbnailPath);
-                } else {
-                    log.warn("缂╃暐鍥剧敓鎴愬け璐ワ細{}", originalPath);
-                }
-            }
-            
+            log.info("涓婁紶鏂囦欢鎴愬姛 鏂囦欢:{} 缂╃暐:{}",uploadResponse.getFilePath(),uploadResponse.getThumbnailPath());
             return uploadResponse;
             
         } catch (Exception e) {

--
Gitblit v1.9.1