lyhzzz 2 gadi atpakaļ
vecāks
revīzija
608b28209c

+ 1 - 1
src/main/java/com/fdkankan/fusion/common/util/FileWriterUtil.java

@@ -94,7 +94,7 @@ public class FileWriterUtil {
             }
             if(file.isFile()){
                 if(file.getName().endsWith(".json")){
-                    return file.getName();
+                    return file.getPath();
                 }
             }
 

+ 6 - 4
src/main/java/com/fdkankan/fusion/service/impl/ModelServiceImpl.java

@@ -217,16 +217,18 @@ public class ModelServiceImpl extends ServiceImpl<IModelMapper, Model> implement
                         }
                         redisUtil.set(RedisKeyUtil.modelUpload+model.getModelId(),"80");
 
-
-                        ShellUtil.yunUpload(localPath,b3dmPath);
-                        model.setModelGlbUrl((JSONArray.toJSONString(Arrays.asList(queryPath +  b3dmPath+"/"+jsonPath))));
+                        String replace = b3dmJsonPath.replace(FilePath.MNT_BASE_PATH, "fusion/test");
+                        File file2 = new File(replace);
+                        ShellUtil.yunUpload(localPath,file2.getParent());
+                        model.setModelGlbUrl((JSONArray.toJSONString(Arrays.asList(queryPath +  replace))));
                     }
+
                     if(name.contains(".b3dm") && b3dmJsonPath != null){
                         model.setModelDateType("b3dm");
                         model.setModelType("b3dm");
                         redisUtil.set(RedisKeyUtil.modelUpload+model.getModelId(),"60");
                         ShellUtil.yunUpload(objPathFile.getPath(),b3dmPath);
-                        model.setModelGlbUrl((JSONArray.toJSONString(Arrays.asList(queryPath +  b3dmPath + "/" + b3dmJsonPath))));
+                        model.setModelGlbUrl((JSONArray.toJSONString(Arrays.asList(queryPath +  b3dmJsonPath.replace(FilePath.LOCAL_BASE_PATH,"fusion/")))));
                     }
 
                     setCreateStatus(model,1);