lyhzzz 3 gadi atpakaļ
vecāks
revīzija
360930832c

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

@@ -124,7 +124,7 @@ public class OBJToGLBUtil {
         ShellUtil.execCmd(cmd);
         String cloudJs = mntPathEmt +"/webcloud/"+ "cloud.js";
         JSONObject jsonObject = ShellUtil.fixCloud(cloudJs);
-        FileWriterUtil.writerJson(mntPathEmt,"cloud.js",jsonObject.toJSONString());
+        FileWriterUtil.writerJson(mntPathEmt +"/webcloud/","cloud.js",jsonObject.toJSONString());
         return file;
     }
 

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

@@ -115,22 +115,21 @@ public class ModelServiceImpl extends ServiceImpl<IModelMapper, Model> implement
                     model.setModelType("glb");
                     OBJToGLBUtil.objToGlb(objPath,name,  file1.getPath().replace("obj","glb"));
                     uploadToOssUtil.uploadOss(file1.getPath(),glbOssPath);
-
                 }
                 if(name.contains(".ply")){
-                    glbOssPath = glbOssPath.replace("mesh.glb","webcloud");
                     model.setModelDateType("ply");
                     model.setModelType("ply");
-                    File mntFile = OBJToGLBUtil.lasOrPlyToBin(file1);
-                    uploadToOssUtil.uploadFileOss(mntFile ,glbOssPath);
                 }
                 if(name.contains(".las")){
-                    glbOssPath = glbOssPath.replace("mesh.glb","webcloud");
                     model.setModelDateType("las");
                     model.setModelType("las");
+                }
+                if(model.getModelType().equals("las") || model.getModelType().equals("ply")){
+                    glbOssPath = glbOssPath.replace("model","model_"+model.getModelId());
+                    glbOssPath = glbOssPath.replace("glb","res");
+                    glbOssPath = glbOssPath.replace("mesh.glb","webcloud");
                     File mntFile =  OBJToGLBUtil.lasOrPlyToBin(file1);
                     uploadToOssUtil.uploadFileOss(mntFile ,glbOssPath);
-
                 }
             }
             model.setModelObjUrl(objPath);