Procházet zdrojové kódy

储备项目新-流程中拆旧清册上传报错bug

wangqiang před 2 roky
rodič
revize
03f13ed79f

+ 5 - 2
src/main/java/com/jeeplus/modules/cg/reservemanagementcenter/reserveManage/web/ProcessController.java

@@ -167,10 +167,13 @@ public class ProcessController extends BaseController {
             String projectReserveId = reserveProcess.getProjectReserveId();
             demoliteService.deleteByProjectReserveId(projectReserveId);
             //获取拆旧清册数据
+            //String index out of range: -1 这个异常一般是截取字符串时报的错误。
             File file = new File(reserveProcess.getDemolition());
             String path = file.getAbsolutePath();
-            int index = file.getAbsolutePath().indexOf("\\fileServer");
-            path = path.substring(index);
+//            int index = file.getAbsolutePath().indexOf("\\fileServer");
+            int index = file.getAbsolutePath().indexOf("fileServer");
+//            path = path.substring(index);
+            path = path.substring(index-1);
 
             File demoFile = new File(path);