Browse Source

修改URL路径

DESKTOP-2K9OVK9\siwei 5 months ago
parent
commit
ff033ef09a

+ 9 - 2
onemap-modules/onemap-apply/src/main/java/com/onemap/apply/service/supervise/impl/TSupervisePcsjServiceImpl.java

@@ -114,13 +114,20 @@ public class TSupervisePcsjServiceImpl implements ITSupervisePcsjService {
         String d0_filepath = d0.getFilepath();
         int d1_unzip_len = d0_unzippath.lastIndexOf("/");
         int d1_filepath = d0_filepath.lastIndexOf("/");
-        String d2_unzippath = d0_unzippath.substring(0, d1_unzip_len) + "/REMOVE" + d0_unzippath.substring(d1_unzip_len);
-        String d2_filepath = d0_filepath.substring(0, d1_filepath) + "/REMOVE" + d0_filepath.substring(d1_filepath);
+        String uuid = StringUtils.getUUID();
+        String d2_unzippath = d0_unzippath.substring(0, d1_unzip_len) + "/REMOVE/" + uuid + d0_unzippath.substring(d1_unzip_len);
+        String d2_filepath = d0_filepath.substring(0, d1_filepath) + "/REMOVE/" + uuid + d0_filepath.substring(d1_filepath);
 
         try {
+            if (new File(d0_unzippath.substring(0, d1_unzip_len) + "/REMOVE/" + uuid).exists()) {
+                Files.createDirectories(Paths.get(d0_unzippath.substring(0, d1_unzip_len) + "/REMOVE/" + uuid));
+            }
             if (new File(d0_unzippath).exists()) {
                 Files.move(Paths.get(d0_unzippath), Paths.get(d2_unzippath));
             }
+            if (new File(d0_filepath.substring(0, d1_filepath) + "/REMOVE/" + uuid).exists()) {
+                Files.createDirectories(Paths.get(d0_filepath.substring(0, d1_filepath) + "/REMOVE/" + uuid));
+            }
             if (new File(d0_filepath).exists()) {
                 Files.move(Paths.get(d0_filepath), Paths.get(d2_filepath));
             }