|
@@ -142,6 +142,7 @@ public class ModelServiceImpl extends ServiceImpl<IModelMapper, Model> implement
|
|
|
setCreateStatus(model,-1);
|
|
|
throw new BusinessException(ResultCode.UPLOAD_FILE_MSG_ERROR);
|
|
|
}
|
|
|
+
|
|
|
File file1 = fileList.get(0);
|
|
|
if(file1 == null){
|
|
|
setCreateStatus(model,-1);
|
|
@@ -151,6 +152,13 @@ public class ModelServiceImpl extends ServiceImpl<IModelMapper, Model> implement
|
|
|
setCreateStatus(model,-1);
|
|
|
throw new BusinessException(ResultCode.UPLOAD_FILE_CHINA_NAME);
|
|
|
}
|
|
|
+
|
|
|
+ if(file1.getName().endsWith(".b3dm") ){
|
|
|
+ if(!FileWriterUtil.checkB3dmTileset(objPathFile)){
|
|
|
+ setCreateStatus(model,-1);
|
|
|
+ throw new BusinessException(ResultCode.UPLOAD_FILE_MSG_ERROR);
|
|
|
+ }
|
|
|
+ }
|
|
|
redisUtil.set(RedisKeyUtil.modelUpload+model.getModelId(),"20");
|
|
|
|
|
|
File mntFile = null;
|
|
@@ -196,16 +204,24 @@ public class ModelServiceImpl extends ServiceImpl<IModelMapper, Model> implement
|
|
|
model.setModelDateType("osgb");
|
|
|
model.setModelType("b3dm");
|
|
|
|
|
|
+ redisUtil.set(RedisKeyUtil.modelUpload+model.getModelId(),"60");
|
|
|
String localPath = OBJToGLBUtil.OsgbToB3dm(objPathFile);
|
|
|
+
|
|
|
+ if(!FileWriterUtil.checkB3dmTileset(new File(localPath))){
|
|
|
+ throw new BusinessException(ResultCode.UPLOAD_FILE_MSG_ERROR);
|
|
|
+ }
|
|
|
+
|
|
|
+ redisUtil.set(RedisKeyUtil.modelUpload+model.getModelId(),"80");
|
|
|
ShellUtil.yunUpload(localPath,b3dmPath);
|
|
|
- model.setModelGlbUrl((JSONArray.toJSONString(Arrays.asList(queryPath + b3dmPath))));
|
|
|
+ model.setModelGlbUrl((JSONArray.toJSONString(Arrays.asList(queryPath + b3dmPath+ objPathFile.getName() +"/tileset.json"))));
|
|
|
//FileUtil.del(localPath);
|
|
|
}
|
|
|
if(name.contains(".b3dm")){
|
|
|
model.setModelDateType("b3dm");
|
|
|
model.setModelType("b3dm");
|
|
|
+ redisUtil.set(RedisKeyUtil.modelUpload+model.getModelId(),"60");
|
|
|
ShellUtil.yunUpload(objPathFile.getPath(),b3dmPath);
|
|
|
- model.setModelGlbUrl((JSONArray.toJSONString(Arrays.asList(queryPath + b3dmPath))));
|
|
|
+ model.setModelGlbUrl((JSONArray.toJSONString(Arrays.asList(queryPath + b3dmPath + objPathFile.getName() +"/tileset.json"))));
|
|
|
}
|
|
|
|
|
|
setCreateStatus(model,1);
|