|
@@ -105,12 +105,25 @@ public class BuildV3SceneServiceImpl implements IBuildSceneService {
|
|
//根据相机类型,组装资源路径
|
|
//根据相机类型,组装资源路径
|
|
//下载资源到本地
|
|
//下载资源到本地
|
|
this.downLoadSource(message, message.getPath());
|
|
this.downLoadSource(message, message.getPath());
|
|
-
|
|
|
|
|
|
+ JSONObject fdageJson = JSONObject.parseObject(FileUtils.readFile(message.getPath().concat("/capture/data.fdage")));
|
|
|
|
+ boolean rewrite = false;
|
|
if (!ObjectUtils.isEmpty(modelSceneKind)) {
|
|
if (!ObjectUtils.isEmpty(modelSceneKind)) {
|
|
// 修改dataFdage文件
|
|
// 修改dataFdage文件
|
|
- JSONObject fdageJson = JSONObject.parseObject(FileUtils.readFile(message.getPath().concat("/capture/data.fdage")));
|
|
|
|
fdageJson.put("modelType", modelSceneKind);
|
|
fdageJson.put("modelType", modelSceneKind);
|
|
|
|
+ rewrite = true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ // 兼容旧的数据,防止OnlyExportMeshObj标志未删除掉
|
|
|
|
+ if (fdageJson.containsKey("OnlyExportMeshObj")) {
|
|
|
|
+ // 写入data.fdage 防止重算
|
|
|
|
+ fdageJson.remove("OnlyExportMeshObj");
|
|
|
|
+ rewrite = true;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (rewrite) {
|
|
FileUtils.writeFile(message.getPath().concat("/capture/data.fdage"), fdageJson.toJSONString());
|
|
FileUtils.writeFile(message.getPath().concat("/capture/data.fdage"), fdageJson.toJSONString());
|
|
|
|
+ String ossPath = getOssPath(message.getPath());
|
|
|
|
+ fYunFileService.uploadFile(message.getPath().concat("/capture/data.fdage"), ossPath + "data.fdage");
|
|
}
|
|
}
|
|
|
|
|
|
message.getBuildContext().put("cameraType",message.getCameraType());
|
|
message.getBuildContext().put("cameraType",message.getCameraType());
|
|
@@ -135,14 +148,19 @@ public class BuildV3SceneServiceImpl implements IBuildSceneService {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- @Override
|
|
|
|
- public void downLoadSource(BuildSceneCallMessage buildSceneMqMessage,String path){
|
|
|
|
|
|
+ private String getOssPath(String path) {
|
|
String ossPath = ConstantFilePath.OSS_PREFIX
|
|
String ossPath = ConstantFilePath.OSS_PREFIX
|
|
+ path.replace(ConstantFilePath.BUILD_MODEL_PATH, "")
|
|
+ path.replace(ConstantFilePath.BUILD_MODEL_PATH, "")
|
|
.replace(ConstantFilePath.BUILD_MODEL_LASER_PATH, "");
|
|
.replace(ConstantFilePath.BUILD_MODEL_LASER_PATH, "");
|
|
if (!ossPath.endsWith("/")) {
|
|
if (!ossPath.endsWith("/")) {
|
|
ossPath = ossPath.concat("/");
|
|
ossPath = ossPath.concat("/");
|
|
}
|
|
}
|
|
|
|
+ return ossPath;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public void downLoadSource(BuildSceneCallMessage buildSceneMqMessage,String path){
|
|
|
|
+ String ossPath = getOssPath(path);
|
|
fYunFileService.downloadFileByCommand(path + File.separator + "capture", ossPath);
|
|
fYunFileService.downloadFileByCommand(path + File.separator + "capture", ossPath);
|
|
}
|
|
}
|
|
|
|
|