chengqiang 2 лет назад
Родитель
Сommit
c421f1c3b1

+ 4 - 10
src/main/java/com/jeeplus/modules/cg/reservemanagementcenter/reserveManage/web/ProcessController.java

@@ -163,17 +163,11 @@ public class ProcessController extends BaseController {
             demoliteService.deleteByProjectReserveId(projectReserveId);
             //获取拆旧清册数据
             File file = new File(reserveProcess.getDemolition());
-            System.out.println("file.getAbsolutePath():" + file.getAbsolutePath());
-//            String path = file.getAbsolutePath().replace("\\a", "");
             String path = file.getAbsolutePath();
-            String newPath = "";
-            for (int i=0;i<path.length();i++){
-                if (i<2 || i>=4){
-                    newPath += path.charAt(i);
-                }
-            }
-            System.out.println("newPath: " + newPath);
-            File demoFile = new File(newPath);
+            int index = file.getAbsolutePath().indexOf("\\fileServer");
+            path = path.substring(index);
+
+            File demoFile = new File(path);
 
             InputStream inputStream = new FileInputStream(demoFile);
             MultipartFile multipartFile = new MockMultipartFile("file", demoFile.getName(), null, inputStream);