|
@@ -156,9 +156,10 @@ public class ModelServiceImpl extends ServiceImpl<IModelMapper, Model> implement
|
|
|
if(com.fdkankan.fusion.common.util.StringUtils.isChinese(file1.getName())){
|
|
|
throw new BusinessException(-1,"压缩包中文");
|
|
|
}
|
|
|
-
|
|
|
+ String b3dmJsonPath = null;
|
|
|
if(file1.getName().endsWith(".b3dm") ){
|
|
|
- if(!FileWriterUtil.checkB3dmTileset(objPathFile)){
|
|
|
+ b3dmJsonPath = FileWriterUtil.checkB3dmTileset(objPathFile);
|
|
|
+ if(b3dmJsonPath == null){
|
|
|
throw new BusinessException(-1,"缺少tileset.json文件");
|
|
|
|
|
|
}
|
|
@@ -205,13 +206,15 @@ public class ModelServiceImpl extends ServiceImpl<IModelMapper, Model> implement
|
|
|
redisUtil.set(RedisKeyUtil.modelUpload+model.getModelId(),"60");
|
|
|
String localPath = OBJToGLBUtil.OsgbToB3dm(objPathFile);
|
|
|
|
|
|
- if(!FileWriterUtil.checkB3dmTileset(new File(localPath))){
|
|
|
+ String jsonPath = FileWriterUtil.checkB3dmTileset(objPathFile);
|
|
|
+ if(jsonPath == null){
|
|
|
throw new BusinessException(-1,"缺少tileset.json文件");
|
|
|
+
|
|
|
}
|
|
|
|
|
|
redisUtil.set(RedisKeyUtil.modelUpload+model.getModelId(),"80");
|
|
|
ShellUtil.yunUpload(localPath,b3dmPath);
|
|
|
- model.setModelGlbUrl((JSONArray.toJSONString(Arrays.asList(queryPath + b3dmPath+ objPathFile.getName() +"/tileset.json"))));
|
|
|
+ model.setModelGlbUrl((JSONArray.toJSONString(Arrays.asList(queryPath + b3dmPath+ objPathFile.getName() +"/" + jsonPath))));
|
|
|
//FileUtil.del(localPath);
|
|
|
}
|
|
|
if(name.contains(".b3dm")){
|
|
@@ -219,7 +222,7 @@ public class ModelServiceImpl extends ServiceImpl<IModelMapper, Model> implement
|
|
|
model.setModelType("b3dm");
|
|
|
redisUtil.set(RedisKeyUtil.modelUpload+model.getModelId(),"60");
|
|
|
ShellUtil.yunUpload(objPathFile.getPath(),b3dmPath);
|
|
|
- model.setModelGlbUrl((JSONArray.toJSONString(Arrays.asList(queryPath + b3dmPath + objPathFile.getName() +"/tileset.json"))));
|
|
|
+ model.setModelGlbUrl((JSONArray.toJSONString(Arrays.asList(queryPath + b3dmPath + objPathFile.getName() +"/" + b3dmJsonPath))));
|
|
|
}
|
|
|
|
|
|
setCreateStatus(model,1);
|