|
@@ -1160,17 +1160,17 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
target + File.separator + "extras" + File.separator + "vision.txt");
|
|
|
|
|
|
String ossResultPath = String.format(UploadFilePath.scene_result_data_path, num);
|
|
|
- fYunFileService.downloadFile(bucket, ossResultPath + "data.json", target + File.separator+"data.json");
|
|
|
- fYunFileService.downloadFile(bucket, ossResultPath + "project.json", target + File.separator+"project.json");
|
|
|
+// fYunFileService.downloadFile(bucket, ossResultPath + "data.json", target + File.separator+"data.json");
|
|
|
+// fYunFileService.downloadFile(bucket, ossResultPath + "project.json", target + File.separator+"project.json");
|
|
|
|
|
|
//data.json增加extras为执行重建算法
|
|
|
- String data = FileUtils.readFile(target + File.separator+"data.json");
|
|
|
- if(data != null){
|
|
|
+// String data = FileUtils.readFile(target + File.separator+"data.json");
|
|
|
+// if(data != null){
|
|
|
JSONObject floorplanJson = new JSONObject();
|
|
|
floorplanJson.put("has_source_images", true);
|
|
|
floorplanJson.put("has_vision_txt", true);
|
|
|
|
|
|
- JSONObject dataJson = JSONObject.parseObject(data);
|
|
|
+ JSONObject dataJson = new JSONObject();
|
|
|
dataJson.put("extras", floorplanJson);
|
|
|
dataJson.put("split_type", "SPLIT_V8");
|
|
|
//V5表示不需要生成high,low文件
|
|
@@ -1188,7 +1188,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
}
|
|
|
dataJson.put("skybox_type", skyboxType);
|
|
|
FileUtils.writeFile(target + File.separator+"data.json", new String(dataJson.toString().getBytes(), "UTF-8"));
|
|
|
- }
|
|
|
+// }
|
|
|
if(new File(target + File.separator + "capture").exists()){
|
|
|
new File(target + File.separator + "capture").delete();
|
|
|
}
|
|
@@ -1196,7 +1196,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
FileUtils.delAllFile(target + File.separator + "results");
|
|
|
}
|
|
|
|
|
|
- fYunFileService.downloadFile(ConstantFilePath.OSS_PREFIX + path.replace(ConstantFilePath.BUILD_MODEL_PATH, "") + "/data.fdage", target + File.separator + "capture/data.fdage");
|
|
|
+// fYunFileService.downloadFile(ConstantFilePath.OSS_PREFIX + path.replace(ConstantFilePath.BUILD_MODEL_PATH, "") + "/data.fdage", target + File.separator + "capture/data.fdage");
|
|
|
|
|
|
//如果部分成功,则需要返回成功数量和失败列表
|
|
|
if(CollUtil.isNotEmpty(notExistFileList)){
|
|
@@ -1318,6 +1318,8 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
this.upgradeVersionAndImgVersionById(sceneEditInfo.getId());
|
|
|
//更新scenejson缓存和oss文件版本号
|
|
|
this.upgradeSceneJsonVersion(num, sceneEditInfo.getVersion() + 1, sceneEditInfo.getImgVersion() + 1, bucket);
|
|
|
+
|
|
|
+ FileUtil.del(target);
|
|
|
}
|
|
|
|
|
|
|
|
@@ -2016,8 +2018,8 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
|
|
|
//调用算法切全景图
|
|
|
String ossResultPath = String.format(UploadFilePath.scene_result_data_path, num);
|
|
|
- fYunFileService.downloadFile(bucket, ossResultPath + "data.json", target + File.separator+"data.json");
|
|
|
- fYunFileService.downloadFile(bucket, ossResultPath + "project.json", target + File.separator+"project.json");
|
|
|
+// fYunFileService.downloadFile(bucket, ossResultPath + "data.json", target + File.separator+"data.json");
|
|
|
+// fYunFileService.downloadFile(bucket, ossResultPath + "project.json", target + File.separator+"project.json");
|
|
|
JSONObject visionJson = new JSONObject();
|
|
|
JSONArray visionArray = new JSONArray();
|
|
|
visionJson.put("uuid", sid);
|
|
@@ -2030,13 +2032,13 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
|
|
|
//data.json增加extras为执行重建算法
|
|
|
String type = "4k";
|
|
|
- String data = FileUtils.readFile(target + File.separator + "data.json");
|
|
|
- if(data != null){
|
|
|
+// String data = FileUtils.readFile(target + File.separator + "data.json");
|
|
|
+// if(data != null){
|
|
|
JSONObject floorplanJson = new JSONObject();
|
|
|
floorplanJson.put("has_source_images", true);
|
|
|
floorplanJson.put("has_vision_txt", true);
|
|
|
|
|
|
- JSONObject dataJson = JSONObject.parseObject(data);
|
|
|
+ JSONObject dataJson = new JSONObject();
|
|
|
dataJson.put("extras", floorplanJson);
|
|
|
dataJson.put("split_type", "SPLIT_V8");//替换全景图算法
|
|
|
|
|
@@ -2055,7 +2057,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
dataJson.put("skybox_type", skyboxType);
|
|
|
|
|
|
cn.hutool.core.io.FileUtil.writeString(dataJson.toString(), target + File.separator+"data.json", StandardCharsets.UTF_8);
|
|
|
- }
|
|
|
+// }
|
|
|
|
|
|
//创建文件夹软连接并且复制data.json和project.json
|
|
|
String capturePath = target + File.separator + "capture";
|
|
@@ -2069,7 +2071,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
cn.hutool.core.io.FileUtil.del(resultPath);
|
|
|
}
|
|
|
//下载data.fdage
|
|
|
- fYunFileService.downloadFile(ConstantFilePath.OSS_PREFIX + path.replace(ConstantFilePath.BUILD_MODEL_PATH, "") + "/data.fdage", capturePath + "/data.fdage");
|
|
|
+// fYunFileService.downloadFile(ConstantFilePath.OSS_PREFIX + path.replace(ConstantFilePath.BUILD_MODEL_PATH, "") + "/data.fdage", capturePath + "/data.fdage");
|
|
|
CreateObjUtil.build3dModel(target , "1");
|
|
|
|
|
|
//读取upload文件,获取需要上传的文件
|
|
@@ -2102,6 +2104,8 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
|
|
|
fYunFileService.uploadMulFiles(bucket, map);
|
|
|
|
|
|
+ FileUtil.del(target);
|
|
|
+
|
|
|
Map<String, String> result = new HashMap<>();
|
|
|
result.put("type", type);
|
|
|
return ResultData.ok(result);
|