|
@@ -76,19 +76,18 @@ public class ThreadService {
|
|
|
}
|
|
|
redisUtil.set(RedisKeyUtil.modelUpload+model.getModelId(),"20");
|
|
|
|
|
|
- String glbOssPath = String.format(FilePath.GLB_OSS_PATH,environment, model.getModelId());
|
|
|
+ String ossPath = String.format(FilePath.MODEL_OSS_PATH,environment, model.getModelId());
|
|
|
|
|
|
String name = file1.getName();
|
|
|
if(name.contains("obj") || name.contains("OBJ")){
|
|
|
- glbOssPath = glbOssPath.replace("mesh.glb",file1.getName().replace(".obj",".glb"));
|
|
|
+ String localPath = FilePath.LOCAL_BASE_PATH + String.format(FilePath.MODEL_OSS_PATH,environment, model.getModelId());
|
|
|
model.setModelDateType("obj");
|
|
|
- model.setModelType("glb");
|
|
|
- OBJToGLBUtil.objToB3dm2(file1.getPath(), file1.getPath().replace(".obj",".glb"));
|
|
|
+ model.setModelType("b3dm");
|
|
|
+ OBJToGLBUtil.objToB3dm2(file1.getPath(),localPath);
|
|
|
redisUtil.set(RedisKeyUtil.modelUpload+model.getModelId(),"65");
|
|
|
- uploadToOssUtil.uploadOss(file1.getPath().replace(".obj",".glb"),glbOssPath);
|
|
|
- if(!uploadToOssUtil.existKey(glbOssPath)){
|
|
|
- throw new BusinessException(-1,"缺少.glb文件");
|
|
|
- }
|
|
|
+ ShellUtil.yunUpload(localPath,ossPath);
|
|
|
+ model.setModelGlbUrl(JSONArray.toJSONString(Arrays.asList(queryPath + ossPath+"/tileset.json")));
|
|
|
+
|
|
|
}
|
|
|
if(name.contains(".ply")){
|
|
|
model.setModelDateType("ply");
|
|
@@ -101,14 +100,14 @@ public class ThreadService {
|
|
|
|
|
|
if("las".equals(model.getModelType()) || "ply".equals(model.getModelType()) ){
|
|
|
mntFile = OBJToGLBUtil.lasOrPlyToBin(file1);
|
|
|
- glbOssPath = mntFile.getPath().replace("/mnt/","")+"/webcloud";
|
|
|
+ ossPath = mntFile.getPath().replace("/mnt/","")+"/webcloud";
|
|
|
redisUtil.set(RedisKeyUtil.modelUpload+model.getModelId(),"65");
|
|
|
uploadToOssUtil.uploadFileOss(mntFile );
|
|
|
- if(!uploadToOssUtil.existKey(glbOssPath+"/cloud.js")){
|
|
|
+ model.setModelGlbUrl(JSONArray.toJSONString(Arrays.asList(queryPath + ossPath)));
|
|
|
+ if(!uploadToOssUtil.existKey(ossPath+"/cloud.js")){
|
|
|
throw new BusinessException(-1,"缺少cloud.js文件");
|
|
|
}
|
|
|
}
|
|
|
- model.setModelGlbUrl(JSONArray.toJSONString(Arrays.asList(queryPath + glbOssPath)));
|
|
|
|
|
|
String b3dmPath = objPathFile.getPath().replace(FilePath.LOCAL_BASE_PATH,"fusion/");
|
|
|
if(name.contains(".osgb")){
|