|
@@ -19,6 +19,7 @@ import com.fdkankan.common.constant.ConstantUrl;
|
|
|
import com.fdkankan.common.constant.ErrorCode;
|
|
|
import com.fdkankan.common.constant.RecStatus;
|
|
|
import com.fdkankan.common.exception.BusinessException;
|
|
|
+import com.fdkankan.model.constants.UploadFilePath;
|
|
|
import com.fdkankan.model.utils.ComputerUtil;
|
|
|
import com.fdkankan.model.utils.SceneUtil;
|
|
|
import com.fdkankan.scene.bean.RequestScene;
|
|
@@ -81,7 +82,7 @@ import org.springframework.web.multipart.MultipartFile;
|
|
|
* pro场景表 服务实现类
|
|
|
* </p>
|
|
|
*
|
|
|
- * @author
|
|
|
+ * @author
|
|
|
* @since 2022-07-04
|
|
|
*/
|
|
|
@Slf4j
|
|
@@ -1063,8 +1064,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
|
|
|
for(String imagesName : images.list()){
|
|
|
//覆盖原始图片资源
|
|
|
- FileUtils.copyFile(target + File.separator + "extras/images/" + imagesName,
|
|
|
- path + File.separator + "caches/images/" + imagesName, true);
|
|
|
+ fYunFileService.uploadFile(target + File.separator + "extras/images/" + imagesName, String.format(UploadFilePath.scene_result_data_path, base.getSceneNum()) + "caches/images/" + imagesName);
|
|
|
FileUtils.deleteFile(target + File.separator + "extras/images/" + imagesName);
|
|
|
}
|
|
|
}
|
|
@@ -1133,6 +1133,11 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
scenejson.put("buildImages", 0);
|
|
|
sceneProEditEntity.setImagesVersion(sceneProEditEntity.getImagesVersion() + 1);
|
|
|
|
|
|
+ //计算完全景图和球幕视频后,删除计算目录
|
|
|
+ if(FileUtil.exist(target)){
|
|
|
+ FileUtil.del(target);
|
|
|
+ }
|
|
|
+
|
|
|
}
|
|
|
|
|
|
if(scenejson.containsKey("uploadBgMusic") && scenejson.getIntValue("uploadBgMusic") == 1){
|
|
@@ -2391,8 +2396,8 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
file.transferTo(targetFile);
|
|
|
|
|
|
//调用算法切全景图
|
|
|
- FileUtils.copyFile(path + File.separator + "data.json", target + File.separator+"data.json", true);
|
|
|
- FileUtils.copyFile(path + File.separator + "project.json", target + File.separator+"project.json", true);
|
|
|
+// FileUtils.copyFile(path + File.separator + "data.json", target + File.separator+"data.json", true);
|
|
|
+// FileUtils.copyFile(path + File.separator + "project.json", target + File.separator+"project.json", true);
|
|
|
|
|
|
JSONObject visionJson = new JSONObject();
|
|
|
JSONArray visionArray = new JSONArray();
|
|
@@ -2406,13 +2411,13 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
FileUtils.writeFile(target + "/extras" + File.separator + "vision.txt", new String(vision.toString().getBytes(), "UTF-8"));
|
|
|
|
|
|
//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);
|
|
|
//V5表示不需要生成high,low文件
|
|
|
dataJson.put("skybox_type", "SKYBOX_V6");
|
|
@@ -2428,7 +2433,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
dataJson.put("skybox_type", skybox_type);
|
|
|
}
|
|
|
FileUtils.writeFile(target + File.separator+"data.json", new String(dataJson.toString().getBytes(), "UTF-8"));
|
|
|
- }
|
|
|
+// }
|
|
|
|
|
|
//创建文件夹软连接并且复制data.json和project.json
|
|
|
if(new File(target + File.separator + "capture").exists()){
|
|
@@ -2699,18 +2704,12 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
String url = "";
|
|
|
|
|
|
if("image".equals(type)){
|
|
|
- if(!new File(path + "/caches/images/" + fileName).exists()){
|
|
|
+ String ossKey = String.format(UploadFilePath.scene_result_data_path, sceneNum) + "caches/images/" + fileName;
|
|
|
+ if(!fYunFileService.fileExist(ossKey)){
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_3018);
|
|
|
}
|
|
|
|
|
|
- //备份原始数据
|
|
|
- if(!new File(imagesBuffer.toString() + "caches/back-" + fileName).exists()){
|
|
|
- FileUtils.copyFile(path + "/caches/images/" + fileName, imagesBuffer.toString() + "caches/back-" + fileName, false);
|
|
|
- }
|
|
|
- //复制打包数据,并且改名
|
|
|
- FileUtils.copyFile(path + "/caches/images/" + fileName, imagesBuffer.toString() + "caches/" + planId + ".jpg", true);
|
|
|
-
|
|
|
- url = mainUrl + "/scene/" + imagesBuf.toString() + "caches/" + planId + ".jpg";
|
|
|
+ url = ossPrefixUrl + ossKey;
|
|
|
}
|
|
|
|
|
|
if("video".equals(type)){
|