lyhzzz 2 سال پیش
والد
کامیت
b005e1c068

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

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

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

@@ -203,7 +203,7 @@ public class ModelServiceImpl extends ServiceImpl<IModelMapper, Model> implement
 
 
                     String b3dmPath = objPathFile.getPath().replace(FilePath.LOCAL_BASE_PATH,"fusion/");
                     String b3dmPath = objPathFile.getPath().replace(FilePath.LOCAL_BASE_PATH,"fusion/");
                     if(name.contains(".osgb")){
                     if(name.contains(".osgb")){
-                        model.setModelDateType("osgb");
+                        model.setModelDateType("b3dm");
                         model.setModelType("b3dm");
                         model.setModelType("b3dm");
 
 
                         redisUtil.set(RedisKeyUtil.modelUpload+model.getModelId(),"60");
                         redisUtil.set(RedisKeyUtil.modelUpload+model.getModelId(),"60");
@@ -216,15 +216,17 @@ public class ModelServiceImpl extends ServiceImpl<IModelMapper, Model> implement
                             throw new BusinessException(-1,"缺少tileset.json文件");
                             throw new BusinessException(-1,"缺少tileset.json文件");
                         }
                         }
                         redisUtil.set(RedisKeyUtil.modelUpload+model.getModelId(),"80");
                         redisUtil.set(RedisKeyUtil.modelUpload+model.getModelId(),"80");
+
+
                         ShellUtil.yunUpload(localPath,b3dmPath);
                         ShellUtil.yunUpload(localPath,b3dmPath);
-                        model.setModelGlbUrl((JSONArray.toJSONString(Arrays.asList(queryPath +  jsonPath.replace(FilePath.LOCAL_BASE_PATH,"fusion/")))));
+                        model.setModelGlbUrl((JSONArray.toJSONString(Arrays.asList(queryPath +  b3dmPath+"/"+jsonPath))));
                     }
                     }
                     if(name.contains(".b3dm") && b3dmJsonPath != null){
                     if(name.contains(".b3dm") && b3dmJsonPath != null){
                         model.setModelDateType("b3dm");
                         model.setModelDateType("b3dm");
                         model.setModelType("b3dm");
                         model.setModelType("b3dm");
                         redisUtil.set(RedisKeyUtil.modelUpload+model.getModelId(),"60");
                         redisUtil.set(RedisKeyUtil.modelUpload+model.getModelId(),"60");
                         ShellUtil.yunUpload(objPathFile.getPath(),b3dmPath);
                         ShellUtil.yunUpload(objPathFile.getPath(),b3dmPath);
-                        model.setModelGlbUrl((JSONArray.toJSONString(Arrays.asList(queryPath +  b3dmJsonPath.replace(FilePath.LOCAL_BASE_PATH,"fusion/")))));
+                        model.setModelGlbUrl((JSONArray.toJSONString(Arrays.asList(queryPath +  b3dmPath + "/" + b3dmJsonPath))));
                     }
                     }
 
 
                     setCreateStatus(model,1);
                     setCreateStatus(model,1);