|
@@ -125,6 +125,8 @@ public class ModelServiceImpl extends ServiceImpl<IModelMapper, Model> implement
|
|
File newObjFile = null;
|
|
File newObjFile = null;
|
|
File objPathFile = null;
|
|
File objPathFile = null;
|
|
File mntFile = null;
|
|
File mntFile = null;
|
|
|
|
+ File b3dmFile = null;
|
|
|
|
+ File osgbFile = null;
|
|
try {
|
|
try {
|
|
String fileName = UUID.randomUUID().toString().replace("-","") +".zip";
|
|
String fileName = UUID.randomUUID().toString().replace("-","") +".zip";
|
|
String objPath = String.format(FilePath.OBJ_LOCAL_PATH,environment , "modelId_"+model.getModelId()) ;
|
|
String objPath = String.format(FilePath.OBJ_LOCAL_PATH,environment , "modelId_"+model.getModelId()) ;
|
|
@@ -206,18 +208,16 @@ public class ModelServiceImpl extends ServiceImpl<IModelMapper, Model> implement
|
|
|
|
|
|
redisUtil.set(RedisKeyUtil.modelUpload+model.getModelId(),"60");
|
|
redisUtil.set(RedisKeyUtil.modelUpload+model.getModelId(),"60");
|
|
String localPath = OBJToGLBUtil.OsgbToB3dm(objPathFile);
|
|
String localPath = OBJToGLBUtil.OsgbToB3dm(objPathFile);
|
|
-
|
|
|
|
|
|
+ osgbFile = new File(localPath.replace("b3dm","osgb"));
|
|
|
|
+ b3dmFile = new File(localPath);
|
|
String jsonPath = null;
|
|
String jsonPath = null;
|
|
- jsonPath = FileWriterUtil.checkB3dmTileset(new File(localPath));
|
|
|
|
|
|
+ jsonPath = FileWriterUtil.checkB3dmTileset(b3dmFile);
|
|
if(jsonPath == null){
|
|
if(jsonPath == null){
|
|
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 + jsonPath.replace(FilePath.LOCAL_BASE_PATH,"fusion/")))));
|
|
- FileUtil.del(localPath);
|
|
|
|
}
|
|
}
|
|
if(name.contains(".b3dm") && b3dmJsonPath != null){
|
|
if(name.contains(".b3dm") && b3dmJsonPath != null){
|
|
model.setModelDateType("b3dm");
|
|
model.setModelDateType("b3dm");
|
|
@@ -243,6 +243,12 @@ public class ModelServiceImpl extends ServiceImpl<IModelMapper, Model> implement
|
|
if(mntFile!=null){
|
|
if(mntFile!=null){
|
|
FileUtil.del(mntFile.getParentFile());
|
|
FileUtil.del(mntFile.getParentFile());
|
|
}
|
|
}
|
|
|
|
+ if(b3dmFile != null){
|
|
|
|
+ FileUtil.del(b3dmFile);
|
|
|
|
+ }
|
|
|
|
+ if(osgbFile != null){
|
|
|
|
+ FileUtil.del(osgbFile);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
}, executor).whenComplete((reslut, e) -> {
|
|
}, executor).whenComplete((reslut, e) -> {
|
|
log.info("uploadObj--ThreadEnd-modeId:{}",model.getModelId());
|
|
log.info("uploadObj--ThreadEnd-modeId:{}",model.getModelId());
|