lyhzzz 1 tuần trước cách đây
mục cha
commit
7148ff1a93
1 tập tin đã thay đổi với 4 bổ sung11 xóa
  1. 4 11
      src/main/java/com/fdkankan/fusion/down/CaseDownService.java

+ 4 - 11
src/main/java/com/fdkankan/fusion/down/CaseDownService.java

@@ -30,6 +30,8 @@ import org.springframework.stereotype.Service;
 
 import java.io.File;
 import java.io.FileOutputStream;
+import java.net.URLDecoder;
+import java.net.URLEncoder;
 import java.nio.charset.StandardCharsets;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -318,7 +320,7 @@ public class CaseDownService {
         List<CaseFiles> caseFilesList = caseFilesService.allList(caseId, null);
         for (CaseFiles files : caseFilesList) {
             if(StringUtils.isNotBlank(files.getFilesUrl())){
-                downResourceParent(caseId,files.getFilesUrl());
+                downResource(caseId,files.getFilesUrl());
             }
 
         }
@@ -526,6 +528,7 @@ public class CaseDownService {
             return;
         }
         url = url.replace(queryPath, "");
+        url = URLDecoder.decode(url);
         String path = String.format(FilePath.OFFLINE_OSS_PATH,caseId);
         String desPath = path + "/oss/" + url;
         log.info("downResource:{}",url);
@@ -536,16 +539,6 @@ public class CaseDownService {
         ShellUtil.yunDownload(url,desPath);
     }
 
-    public void downResourceParent(Integer caseId,String url) {
-        if(StringUtils.isBlank(url) ){
-            return;
-        }
-        url = url.replace(queryPath, "");
-        String path = String.format(FilePath.OFFLINE_OSS_PATH,caseId);
-        String desPath = path + "/oss/" + url;
-        log.info("downResourceParent:{}",url);
-        ShellUtil.yunDownload(new File(url).getParentFile().getPath(), new File(desPath).getParentFile().getParentFile().getPath());
-    }
 
     public void downWordByTemplate(Integer caseId,XWPFTemplate template,String name){
         // 指定输出文件的路径