|
@@ -118,30 +118,20 @@ public class CaseNumServiceImpl extends ServiceImpl<ICaseNumMapper, CaseNumEntit
|
|
private String getGlbUrl(Integer type, String num,Model model) {
|
|
private String getGlbUrl(Integer type, String num,Model model) {
|
|
if(type == 0 || type == 1 || type == 4 || type == 6){ //看看,看见
|
|
if(type == 0 || type == 1 || type == 4 || type == 6){ //看看,看见
|
|
String objPath = String.format(FilePath.OBJ_LOCAL_PATH ,environment,num);
|
|
String objPath = String.format(FilePath.OBJ_LOCAL_PATH ,environment,num);
|
|
-// if(uploadToOssUtil.existKey(glbOssPath)){
|
|
|
|
-// return queryPath + "/"+glbOssPath;
|
|
|
|
-// }
|
|
|
|
|
|
+ String ossGlbPath =String.format(FilePath.MODEL_OSS_PATH,environment,num);
|
|
|
|
+
|
|
ShellUtil.yunDownload(String.format(FilePath.OBJ_OSS_PATH, num)+"/data/mesh" ,objPath);
|
|
ShellUtil.yunDownload(String.format(FilePath.OBJ_OSS_PATH, num)+"/data/mesh" ,objPath);
|
|
List<String> localGlbPaths = new ArrayList<>();
|
|
List<String> localGlbPaths = new ArrayList<>();
|
|
List<String> ossGlbPaths = new ArrayList<>();
|
|
List<String> ossGlbPaths = new ArrayList<>();
|
|
File localFile = new File(objPath);
|
|
File localFile = new File(objPath);
|
|
this.toGlB(localFile,localGlbPaths);
|
|
this.toGlB(localFile,localGlbPaths);
|
|
|
|
|
|
- if(localGlbPaths.size() >0){
|
|
|
|
|
|
+ if(!localGlbPaths.isEmpty()){
|
|
for (String localGlbPath : localGlbPaths) {
|
|
for (String localGlbPath : localGlbPaths) {
|
|
File file = new File(localGlbPath);
|
|
File file = new File(localGlbPath);
|
|
- if(file!=null){
|
|
|
|
- model.setModelSize(FileWriterUtil.setFileSize(file.length()));
|
|
|
|
- }
|
|
|
|
- String ossGlbPath = localGlbPath.replace(FilePath.LOCAL_BASE_PATH,"fusion/");
|
|
|
|
- uploadToOssUtil.uploadOss(localGlbPath,ossGlbPath);
|
|
|
|
- if(ossGlbPath.contains("lod_")){
|
|
|
|
- if(ossGlbPath.contains("lod_0")){
|
|
|
|
- ossGlbPaths.add(queryPath +ossGlbPath);
|
|
|
|
- }
|
|
|
|
- continue;
|
|
|
|
- }
|
|
|
|
- ossGlbPaths.add(queryPath +ossGlbPath);
|
|
|
|
|
|
+ model.setModelSize(FileWriterUtil.setFileSize(file.length()));
|
|
|
|
+ ShellUtil.yunUpload(localGlbPath,objPath);
|
|
|
|
+ ossGlbPaths.add(queryPath +ossGlbPath+"/tileset.json");
|
|
}
|
|
}
|
|
return JSONArray.toJSONString(ossGlbPaths);
|
|
return JSONArray.toJSONString(ossGlbPaths);
|
|
}
|
|
}
|
|
@@ -157,8 +147,14 @@ public class CaseNumServiceImpl extends ServiceImpl<ICaseNumMapper, CaseNumEntit
|
|
if(file.isDirectory()){
|
|
if(file.isDirectory()){
|
|
toGlB(file,localGlbPath);
|
|
toGlB(file,localGlbPath);
|
|
}
|
|
}
|
|
|
|
+ if(file.getParent().contains("lod_") && file.getParent().contains("lod_0") ){
|
|
|
|
+ String glbPath = OBJToGLBUtil.objToB3dm(file.getPath(),file.getPath());
|
|
|
|
+ localGlbPath.add(glbPath);
|
|
|
|
+ continue;
|
|
|
|
+ }
|
|
|
|
+
|
|
if(file.getName().contains(".obj")){
|
|
if(file.getName().contains(".obj")){
|
|
- String glbPath = OBJToGLBUtil.objToB3dm(file.getPath(),file.getPath().replace(".obj",".glb") );
|
|
|
|
|
|
+ String glbPath = OBJToGLBUtil.objToB3dm(file.getPath(),file.getPath());
|
|
localGlbPath.add(glbPath);
|
|
localGlbPath.add(glbPath);
|
|
}
|
|
}
|
|
}
|
|
}
|