1
0
chenendian 4 дней назад
Родитель
Сommit
f93381824c

+ 6 - 3
siwei-modules/siwei-apply/src/main/java/com/siwei/apply/utils/ServiceFileUtil.java

@@ -106,12 +106,15 @@ public class ServiceFileUtil {
             logger.warn("目录不存在: {}", directoryPath);
             throw new ServiceException("目录不存在: " + directoryPath);
         }
-        //这里拼接文件名
+
+        //这里拼接文件名,把前缀去掉
+        String tmpFileName = file.getFileName().toString().replaceAll("^[0-9]+[_]{1}","");
         if (directoryPath.endsWith("/")) {
-            directoryPath += file.getFileName();
+            directoryPath += tmpFileName;
         } else {
-            directoryPath += "/" + file.getFileName();
+            directoryPath += "/" + tmpFileName;
         }
+
         dirPath = Paths.get(directoryPath);
         try {
             //Files.copy(file, dirPath, StandardCopyOption.REPLACE_EXISTING);