Browse Source

恒轮上传文件

lxb 1 year ago
parent
commit
acd33bc2c3

+ 8 - 2
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/service/impl/RobotNodeServiceImpl.java

@@ -810,8 +810,7 @@ public class RobotNodeServiceImpl implements NodeOperationService {
                                     //文件上传只允许单个文件
                                     procedureProgramList.forEach(i -> {
                                         Map<String, String> m = new HashMap<>();
-                                        String filePath = i.getFilePath().replace(uriPath, storagePath);
-                                        m.put("fileName", filePath.replace("/", "\\"));
+                                        m.put("fileName", i.getSubmittedFileName());
                                         fileList.add(m);
                                     });
                                     locationMap.put("fileName",fileList.get(0).get("fileName"));
@@ -1548,4 +1547,11 @@ public class RobotNodeServiceImpl implements NodeOperationService {
         return targetStorge;
     }
 
+    public static void main(String[] args) {
+        String uriPath = "C:/data/projects/uploadfile/file/";
+        String storagePath ="http://${zuihou.nginx.ip}:${zuihou.nginx.port}/file/";
+        String i = "http://192.168.11.240:80/file/0000/2023/10/3.txt";
+        String filePath = i.replace(uriPath, storagePath);
+        System.out.println(filePath.replace("/", "\\"));
+    }
 }