From afafd548b795b479409d270f2936827b38375f6c Mon Sep 17 00:00:00 2001
From: 陈昶聿 <chychen@nbjetron.com>
Date: 星期五, 14 八月 2026 16:56:15 +0800
Subject: [PATCH] 【丽水】uploadShow 调整,无法上传

---
 ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java |   75 +++++++++++++++++++++++++++++++++----
 1 files changed, 67 insertions(+), 8 deletions(-)

diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java
index bc0e282..507adde 100644
--- a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java
+++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/common/CommonController.java
@@ -3,6 +3,7 @@
 import com.ruoyi.common.config.RuoYiConfig;
 import com.ruoyi.common.constant.Constants;
 import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.core.redis.RedisCache;
 import com.ruoyi.common.enums.PhotoEnum;
 import com.ruoyi.common.enums.RadioEnum;
 import com.ruoyi.common.enums.VadioEnum;
@@ -38,9 +39,7 @@
 import javax.xml.transform.dom.DOMSource;
 import javax.xml.transform.stream.StreamResult;
 import java.io.*;
-import java.util.ArrayList;
-import java.util.Base64;
-import java.util.List;
+import java.util.*;
 
 /**
  * 閫氱敤璇锋眰澶勭悊
@@ -59,10 +58,22 @@
     @Autowired
     private SysConfigMapper sysConfigMapper;
 
+    @Autowired
+    private RedisCache redisCache;
+
     private static final String FILE_DELIMETER = ",";
 
     @Value("${uploadSwitch}")
     private Integer uploadSwitch;
+
+    @Value("${fileUpload}")
+    private String fileUpload;
+
+    @Value("${profile}")
+    private String profile;
+
+    @Value("${spring.profiles.active}")
+    private String active;
 
     /**
      * 閫氱敤涓嬭浇璇锋眰
@@ -112,8 +123,8 @@
             // 涓婁紶骞惰繑鍥炴柊鏂囦欢鍚嶇О
             String fileName = FileUploadUtils.uploadSort(filePath, file);
             String url = null;
-            //鏂板崕鍖婚櫌鐗规畩锛岃繖涓棰戠殑璁块棶寰楄浆
-            String xhPath = "http://218.108.11.22:8093/profile-api";
+            String xhPath = fileUpload + profile;
+
             if (uploadSwitch == 1) {
                 String fn = fileName.replaceAll("/profile", "");
                 url = xhPath + fn;
@@ -144,8 +155,10 @@
             filePath = filePath + "/show/" + file.getOriginalFilename().split("\\.", 2)[0];
             // 涓婁紶骞惰繑鍥炴柊鏂囦欢鍚嶇О
             String fileName = FileUploadUtils.uploadSort(filePath, file);
-            //灏唚ord杞垚html
-            convertDocToHtml(filePath + "\\" + file.getOriginalFilename(), filePath + "\\" + file.getOriginalFilename().split("\\.", 2)[0] + ".html");
+            // 灏唚ord杞垚html锛堟簮鏂囦欢浠ョ鐩樺疄闄呬繚瀛樿矾寰勪负鍑嗭紝淇濇寔鍒嗛殧绗︿竴鑷达紝閬垮厤"/"鍜�"\"娣风敤瀵艰嚧鎵句笉鍒版枃浠讹級
+            String docFilePath = RuoYiConfig.getProfile() + fileName.replace(Constants.RESOURCE_PREFIX, "");
+            String htmlFilePath = docFilePath.replaceAll("\\.[^.]*$", ".html");
+            convertDocToHtml(docFilePath, htmlFilePath);
 
             String url = null;
             SysConfig config = new SysConfig();
@@ -276,7 +289,7 @@
             e.printStackTrace();
         }
         String url = null;
-        String xhPath = "http://218.108.11.22:8093/profile-api";
+        String xhPath = fileUpload + profile;
         if (uploadSwitch == 1) {
             url = xhPath + "/upload/show/" + fileName.split("\\.", 2)[0] + "/" + fileName;
         } else {
@@ -341,6 +354,52 @@
         String fileName = filePath.toLowerCase();
         return fileName.endsWith(".doc") || fileName.endsWith(".docx");
     }
+
+    /**
+     * @param
+     * @return
+     */
+    @ApiOperation("鑾峰彇RedisCache")
+    @PostMapping("/getRedisCache")
+    public String getRedisCache(@RequestBody String key) {
+        String object = redisCache.getCacheObject(key);
+        return object;
+    }
+
+    /**
+     * @param
+     * @return
+     */
+    @ApiOperation("鏌ヨRedisCache")
+    @PostMapping("/findRedisCacheList")
+    public Set<String> findRedisCacheList(@RequestBody String key) {
+        Set<String> allKeys =  redisCache.getAllKeys();
+        Set<String> matchKeys = new HashSet<>();
+        for (String redisKey : allKeys) {
+            if(redisKey.contains(key)) {
+                matchKeys.add(redisKey);
+            }
+        }
+        return matchKeys;
+    }
+
+    /**
+     * @param
+     * @return
+     */
+    @ApiOperation("鍒犻櫎RedisCache")
+    @PostMapping("/deleteRedisCache")
+    public Set<String> deleteRedisCache(@RequestBody String key) {
+        Set<String> allKeys =  redisCache.getAllKeys();
+        Set<String> matchKeys = new HashSet<>();
+        for (String redisKey : allKeys) {
+            if(redisKey.contains(key)) {
+                redisCache.deleteObject(redisKey);
+                matchKeys.add(redisKey);
+            }
+        }
+        return matchKeys;
+    }
 }
 
 

--
Gitblit v1.9.3