|
@@ -1,10 +1,9 @@
|
|
|
package com.fdkankan.scene.service.impl;
|
|
|
import cn.hutool.core.net.multipart.UploadFile;
|
|
|
import cn.hutool.core.util.CharsetUtil;
|
|
|
-import com.fdkankan.common.constant.CommonOperStatus;
|
|
|
-import com.fdkankan.common.constant.SceneAsynFuncType;
|
|
|
-import com.fdkankan.common.constant.SceneAsynModuleType;
|
|
|
-import com.fdkankan.common.constant.SceneAsynOperType;
|
|
|
+import com.fdkankan.common.constant.*;
|
|
|
+import com.fdkankan.common.util.FileSizeUtil;
|
|
|
+import com.fdkankan.common.util.MD5;
|
|
|
import com.fdkankan.scene.vo.SaveFiltersParamVO;
|
|
|
import io.opencensus.metrics.LongGauge;
|
|
|
import java.util.Date;
|
|
@@ -21,13 +20,6 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
-import com.fdkankan.common.constant.CommonStatus;
|
|
|
-import com.fdkankan.common.constant.ErrorCode;
|
|
|
-import com.fdkankan.common.constant.FileBizType;
|
|
|
-import com.fdkankan.common.constant.OperationType;
|
|
|
-import com.fdkankan.common.constant.SceneFrom;
|
|
|
-import com.fdkankan.common.constant.SceneInfoReqType;
|
|
|
-import com.fdkankan.common.constant.ServerCode;
|
|
|
import com.fdkankan.common.exception.BusinessException;
|
|
|
import com.fdkankan.common.util.FileMd5Util;
|
|
|
import com.fdkankan.common.util.FileUtils;
|
|
@@ -319,7 +311,10 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
|
|
|
//删除发布数据中的user目录
|
|
|
String publicUserPath = String.format(UploadFilePath.USER_VIEW_PATH, num);
|
|
|
- fYunFileService.deleteFolder(bucket, publicUserPath);
|
|
|
+ List<String> userViewFileList = fYunFileService.listRemoteFiles(bucket, publicUserPath);
|
|
|
+ if(CollUtil.isNotEmpty(userViewFileList)){
|
|
|
+ fYunFileService.deleteFolder(bucket, publicUserPath);
|
|
|
+ }
|
|
|
|
|
|
//复制编辑目录到发布目录
|
|
|
String editPath = String.format(UploadFilePath.USER_EDIT_PATH, param.getNum());
|
|
@@ -338,11 +333,18 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
|
|
|
scenePlus.setTitle(sceneEditInfo.getTitle());
|
|
|
scenePlus.setDescription(sceneEditInfo.getDescription());
|
|
|
+ scenePlus.setHouseType(this.existsHouseType(bucket, num));
|
|
|
scenePlusService.updateById(scenePlus);
|
|
|
|
|
|
return ResultData.ok();
|
|
|
}
|
|
|
|
|
|
+ private int existsHouseType(String bucket, String num){
|
|
|
+ String houseTypePath = String.format(UploadFilePath.USER_VIEW_PATH, num) + "houseType.json";
|
|
|
+ boolean exist = fYunFileService.fileExist(bucket, houseTypePath);
|
|
|
+ return exist ? CommonStatus.YES.code().intValue() : CommonStatus.NO.code().intValue();
|
|
|
+ }
|
|
|
+
|
|
|
private void publicSurveillance(String num, Integer surveillances, String bucket) throws IOException {
|
|
|
String surveillanceJsonPath = String.format(UploadFilePath.USER_EDIT_PATH, num) + "surveillance.json";
|
|
|
if(surveillances == CommonStatus.NO.code().intValue()){
|
|
@@ -374,7 +376,9 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
String imgViewPath = String.format(UploadFilePath.IMG_VIEW_PATH, num);
|
|
|
|
|
|
//清除发布目录中的场景关联图片
|
|
|
- fYunFileService.deleteFolder(bucket,imgViewPath + "panorama");
|
|
|
+ if(fYunFileService.fileExist(bucket,imgViewPath + "panorama")){
|
|
|
+ fYunFileService.deleteFolder(bucket,imgViewPath + "panorama");
|
|
|
+ }
|
|
|
|
|
|
//生成links.json并上传到发布目录
|
|
|
String linkPanKey = String.format(RedisKey.SCENE_LINKPAN_DATA, num);
|
|
@@ -417,7 +421,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
|
|
|
String hotJsonPath = String.format(UploadFilePath.USER_EDIT_PATH, sceneNum) + "hot.json";
|
|
|
fYunFileService.uploadFile(bucket, tags.toString().getBytes(), hotJsonPath);
|
|
|
- this.saveTagsToSceneEditInfo(sceneNum, sceneEditInfo);
|
|
|
+// this.saveTagsToSceneEditInfo(sceneNum, sceneEditInfo);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -480,6 +484,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
if(CommonStatus.YES.code().intValue() == sceneEditInfoExt.getMosaic()){
|
|
|
sceneInfoVO.setMosaicList(this.getMosaicList(num));
|
|
|
}
|
|
|
+ sceneInfoVO.setSpace(FileSizeUtil.convert(scenePlusExt.getSpace(), FileSizeUnitType.MB.code()));
|
|
|
|
|
|
this.SortBoxVideos(sceneInfoVO);
|
|
|
|
|
@@ -623,7 +628,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
//处理户型图数据
|
|
|
//上传floorplan_user.json文件
|
|
|
FileUtils.writeFile(localDataPath + "floorplan_user.json", floorJsonData);
|
|
|
- fYunFileService.uploadFile(bucket, localDataPath + "floorplan_user.json", editUserPath + "floorplan_user.json");
|
|
|
+ fYunFileService.uploadFile(bucket, localDataPath + "floorplan_user.json", editUserPath + "floorplan.json");
|
|
|
|
|
|
//写入数据库
|
|
|
Byte floorPlanUser = null;
|
|
@@ -682,17 +687,21 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
String path = scenePlusExt.getDataSource();
|
|
|
|
|
|
//户型图上传
|
|
|
- String userEditPath = UploadFilePath.USER_EDIT_PATH + "floor-cad-%s.%s";
|
|
|
- String floorCadPath = path + "/results/floorplan_cad";
|
|
|
- List<String> floorCadList = FileUtils.getFileList(floorCadPath);
|
|
|
- if(CollUtil.isNotEmpty(floorCadList)){
|
|
|
- floorCadList.stream().forEach(str->{
|
|
|
- String substring = str.substring(str.lastIndexOf(File.separator) + 1);
|
|
|
- String[] arr = substring.split("floor");
|
|
|
- String[] arr2 = arr[1].split("\\.");
|
|
|
- fYunFileService.uploadFile(bucket, str, String.format(userEditPath, num, arr2[0], arr2[1]));
|
|
|
- });
|
|
|
- }
|
|
|
+ String ossResultPath = String.format(UploadFilePath.scene_result_data_path, num);
|
|
|
+ String floorplanCadPath = ossResultPath + "floorplan_cad/";
|
|
|
+ fYunFileService.copyFileBetweenBucket(bucket, floorplanCadPath, bucket, String.format(UploadFilePath.USER_EDIT_PATH, num));
|
|
|
+
|
|
|
+// String userEditPath = UploadFilePath.USER_EDIT_PATH + "floor-cad-%s.%s";
|
|
|
+// String floorCadPath = path + "/results/floorplan_cad";
|
|
|
+// List<String> floorCadList = FileUtils.getFileList(floorCadPath);
|
|
|
+// if(CollUtil.isNotEmpty(floorCadList)){
|
|
|
+// floorCadList.stream().forEach(str->{
|
|
|
+// String substring = str.substring(str.lastIndexOf(File.separator) + 1);
|
|
|
+// String[] arr = substring.split("floor");
|
|
|
+// String[] arr2 = arr[1].split("\\.");
|
|
|
+// fYunFileService.uploadFile(bucket, str, String.format(userEditPath, num, arr2[0], arr2[1]));
|
|
|
+// });
|
|
|
+// }
|
|
|
|
|
|
//根据floorplan_cad.json生成houseType.json
|
|
|
// this.uploadHouseTypeJson(num, bucket);
|
|
@@ -733,6 +742,10 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
result.put("version", "2.1");
|
|
|
|
|
|
String floorplanCadPath = String.format(UploadFilePath.DATA_VIEW_PATH, num) + "floorplan_cad.json";
|
|
|
+ if(!fYunFileService.fileExist(bucket, floorplanCadPath)){
|
|
|
+ log.warn("生成houseType.json失败,原因:floorplan_cad.json文件不存在,num:{}", num);
|
|
|
+ return;
|
|
|
+ }
|
|
|
String floorcadStr = fYunFileService.getFileContent(bucket, floorplanCadPath);
|
|
|
|
|
|
JSONObject floorcadObj = JSON.parseObject(floorcadStr);
|
|
@@ -915,9 +928,11 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
String sceneJson = redisUtil.get(key);
|
|
|
if(StrUtil.isNotEmpty(sceneJson)){
|
|
|
SceneJsonBean sceneJsonBean = JSON.parseObject(sceneJson, SceneJsonBean.class);
|
|
|
- sceneJsonBean.setVersion(version);
|
|
|
+ if(Objects.nonNull(version)){
|
|
|
+ sceneJsonBean.setVersion(version);
|
|
|
+ }
|
|
|
if(Objects.nonNull(imgVersion)){
|
|
|
- sceneJsonBean.setImgVersion(imgVersion + 1);
|
|
|
+ sceneJsonBean.setImgVersion(imgVersion);
|
|
|
}
|
|
|
redisUtil.set(key, JSON.toJSONString(sceneJsonBean));
|
|
|
}
|
|
@@ -927,9 +942,11 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
sceneJson= fYunFileService.getFileContent(bucket, sceneJsonPath);
|
|
|
if(StrUtil.isNotEmpty(sceneJson)){
|
|
|
SceneJsonBean sceneJsonBean = JSON.parseObject(sceneJson, SceneJsonBean.class);
|
|
|
- sceneJsonBean.setVersion(version);
|
|
|
+ if(Objects.nonNull(version)){
|
|
|
+ sceneJsonBean.setVersion(version);
|
|
|
+ }
|
|
|
if(Objects.nonNull(imgVersion)){
|
|
|
- sceneJsonBean.setImgVersion(imgVersion + 1);
|
|
|
+ sceneJsonBean.setImgVersion(imgVersion);
|
|
|
}
|
|
|
fYunFileService.uploadFile(bucket, JSON.toJSONString(sceneJsonBean).getBytes(StandardCharsets.UTF_8), sceneJsonPath);
|
|
|
}
|
|
@@ -974,7 +991,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
String zipTargetFilePath = targetImagesPath + file.getOriginalFilename();
|
|
|
|
|
|
//判断全景图缓存是否存在,如果不存在,从计算目录中拷贝到缓存目录
|
|
|
- this.cachePanorama(path, num);
|
|
|
+// this.cachePanorama(path, num);
|
|
|
|
|
|
//先删除本地文件
|
|
|
FileUtils.deleteDirectory(targetImagesPath);
|
|
@@ -1026,11 +1043,13 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
}
|
|
|
|
|
|
//比对图片列表,不存在的要返回名称集合
|
|
|
- String visionPath = path + "/results/vision.txt";
|
|
|
+ String ossVisionPath = String.format(UploadFilePath.IMG_VIEW_PATH, num) + "vision.txt";
|
|
|
+ String visionPath = String.format(ConstantFilePath.SCENE_DATA_PATH_V4, num) + "vision.txt";
|
|
|
+ fYunFileService.downloadFile(ossVisionPath, visionPath);
|
|
|
List<String> panoramaImageList = SceneUtil.getPanoramaImageList(visionPath);
|
|
|
List<String> notExistFileList = uploadFileList.stream().filter(filePath -> {
|
|
|
filePath = filePath.substring(filePath.lastIndexOf(File.separator) + 1);
|
|
|
- if(panoramaImageList.contains(filePath)){
|
|
|
+ if(CollUtil.isEmpty(panoramaImageList) || panoramaImageList.contains(filePath)){
|
|
|
return false;
|
|
|
}
|
|
|
return true;
|
|
@@ -1062,8 +1081,9 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
CreateObjUtil.convertVisionmodeldataToTxt(target + File.separator + "extras" + File.separator + "vision.modeldata",
|
|
|
target + File.separator + "extras" + File.separator + "vision.txt");
|
|
|
|
|
|
- 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);
|
|
|
+ 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");
|
|
|
|
|
|
//data.json增加extras为执行重建算法
|
|
|
String data = FileUtils.readFile(target + File.separator+"data.json");
|
|
@@ -1097,10 +1117,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
if(new File(target + File.separator + "results").exists()){
|
|
|
FileUtils.delAllFile(target + File.separator + "results");
|
|
|
}
|
|
|
-// if(FYunTypeEnum.AWS.code().equals(fyunType)){
|
|
|
-// //亚马逊保持旧方式,超链接capture
|
|
|
-// CreateObjUtil.createSoftConnection(path + File.separator + "capture", target + File.separator + "capture");
|
|
|
-// }
|
|
|
+
|
|
|
fYunFileService.downloadFile(ConstantFilePath.OSS_PREFIX + path.replace(ConstantFilePath.BUILD_MODEL_PATH, "") + "/data.fdage", target + File.separator + "capture/data.fdage");
|
|
|
|
|
|
//如果部分成功,则需要返回成功数量和失败列表
|
|
@@ -1226,16 +1243,17 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
continue;
|
|
|
}
|
|
|
}
|
|
|
- if(map.size()>0) {
|
|
|
- fYunFileService.uploadMulFiles(bucket, map);
|
|
|
- }
|
|
|
|
|
|
- //拷贝修改后的全景图到缓存目录
|
|
|
- String cachedImagesPath = String.format(ConstantFilePath.SCENE_CACHE_IMAGES, num);
|
|
|
+ //用户上传的全景图上传到ossresult目录
|
|
|
+ String ossCachesImagesPath = String.format(UploadFilePath.scene_result_data_path, num) + "caches/images/";
|
|
|
uploadFileList.stream().forEach(srcPath->{
|
|
|
- cn.hutool.core.io.FileUtil.copy(srcPath, srcPath.replace(targetImagesPath, cachedImagesPath), true);
|
|
|
+ map.put(srcPath, srcPath.replace(targetImagesPath, ossCachesImagesPath));
|
|
|
});
|
|
|
|
|
|
+ if(map.size()>0) {
|
|
|
+ fYunFileService.uploadMulFiles(bucket, map);
|
|
|
+ }
|
|
|
+
|
|
|
//更新数据库版本号
|
|
|
ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
|
|
|
SceneEditInfo sceneEditInfo = this.getByScenePlusId(scenePlus.getId());
|
|
@@ -1272,32 +1290,37 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
String cacheImageFormat = "downloads/scene/%s/caches/images/";
|
|
|
|
|
|
//判断全景图缓存是否存在,如果不存在,从计算目录中拷贝到缓存目录
|
|
|
- this.cachePanorama(scenePlusExt.getDataSource(), num);
|
|
|
+// this.cachePanorama(scenePlusExt.getDataSource(), num);
|
|
|
+
|
|
|
+ //根据vision.txt获取到有效的全景图名称
|
|
|
+ String ossVisionPath = String.format(UploadFilePath.IMG_VIEW_PATH, num) + "vision.txt";
|
|
|
+ String visionPath = String.format(ConstantFilePath.SCENE_DATA_PATH_V4, num) + "vision.txt";
|
|
|
+ fYunFileService.downloadFile(ossVisionPath, visionPath);
|
|
|
+ List<String> panoramaImageList = SceneUtil.getPanoramaImageList(visionPath);
|
|
|
+ if(CollUtil.isEmpty(panoramaImageList)){
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_5063);
|
|
|
+ }
|
|
|
|
|
|
Map<String, Object> map = new HashMap<>();
|
|
|
|
|
|
//标记是否是异步操作,默认是同步操作
|
|
|
//如果入参文件名不为空,则是单个文件下载,不需要打包
|
|
|
+ String ossResultPath = String.format(UploadFilePath.scene_result_data_path, num) + "caches/images/";
|
|
|
if(StrUtil.isNotEmpty(fileName)){
|
|
|
//如果是单张图片,直接提供oss url
|
|
|
- String localFilePath = localImagesPath + fileName;
|
|
|
- String ossFilePath = imgCachePath + fileName;
|
|
|
- if(!cn.hutool.core.io.FileUtil.exist(localFilePath)){
|
|
|
+// if(!fYunFileService.fileExist(bucket, ossResultPath + fileName)){
|
|
|
+// throw new BusinessException(ErrorCode.FAILURE_CODE_5063);
|
|
|
+// }
|
|
|
+ if(!panoramaImageList.contains(fileName)){
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5063);
|
|
|
}
|
|
|
- fYunFileService.uploadFile(bucket, localFilePath, ossFilePath);
|
|
|
- String url = ossUrlPrefix + ossFilePath;
|
|
|
+ String url = ossUrlPrefix + ossResultPath + fileName;
|
|
|
String downloadName = fileName;
|
|
|
map.put("asyn", CommonStatus.NO.code());
|
|
|
map.put("fileUrl", url + "?t=" + System.currentTimeMillis());
|
|
|
map.put("fileName", downloadName);
|
|
|
return ResultData.ok(map);
|
|
|
}else{
|
|
|
- if(!cn.hutool.core.io.FileUtil.exist(localImagesPath)
|
|
|
- || cn.hutool.core.io.FileUtil.isDirEmpty(new File(localImagesPath))){
|
|
|
- throw new BusinessException(ErrorCode.FAILURE_CODE_5063);
|
|
|
- }
|
|
|
-
|
|
|
//清除旧的下载记录
|
|
|
sceneAsynOperLogService.remove(
|
|
|
new LambdaQueryWrapper<SceneAsynOperLog>()
|
|
@@ -1317,6 +1340,18 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
sceneAsynOperLog.setVersion(sceneEditInfo.getImgVersion());
|
|
|
sceneAsynOperLogService.save(sceneAsynOperLog);
|
|
|
try {
|
|
|
+
|
|
|
+ //下载到本地目录
|
|
|
+ FileUtil.del(localImagesPath);
|
|
|
+ fYunFileService.downloadFileByCommand(bucket, localImagesPath, ossResultPath);
|
|
|
+ //移除非必须文件
|
|
|
+ List<String> fileNames = FileUtil.listFileNames(localImagesPath);
|
|
|
+ fileNames.stream().forEach(name->{
|
|
|
+ if(!panoramaImageList.contains(name)){
|
|
|
+ FileUtil.del(localImagesPath + name);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
String downloadName = num + "_images.zip";
|
|
|
long start = Calendar.getInstance().getTimeInMillis();
|
|
|
//打包
|
|
@@ -1555,8 +1590,8 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
fYunFileService.uploadFile(bucket, target + File.separator + "extras/video/" + videoName.replace("mp4", "flv"),videosViewPath + videoName.replace("mp4", "flv"));
|
|
|
|
|
|
//覆盖原始视频资源
|
|
|
- FileUtils.copyFile(target + File.separator + "extras/video/" + videoName,
|
|
|
- path + File.separator + "caches/videos/" + videoName, true);
|
|
|
+// FileUtils.copyFile(target + File.separator + "extras/video/" + videoName,
|
|
|
+// path + File.separator + "caches/videos/" + videoName, true);
|
|
|
|
|
|
}
|
|
|
FileUtils.deleteDirectory(target + File.separator + "extras/video/");
|
|
@@ -1628,15 +1663,20 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
if(new File(target + File.separator + "results").exists()){
|
|
|
FileUtils.delAllFile(target + File.separator + "results");
|
|
|
}
|
|
|
+
|
|
|
//创建文件夹,并link文件夹
|
|
|
new File(target + File.separator + "caches").mkdirs();
|
|
|
- CreateObjUtil.createSoftConnection(path + File.separator + "capture", target + File.separator + "capture");
|
|
|
+ fYunFileService.downloadFileByCommand(target + File.separator + "capture", SceneUtil.getHomePath(path));
|
|
|
+// CreateObjUtil.createSoftConnection(path + File.separator + "capture", target + File.separator + "capture");
|
|
|
if(new File(path + File.separator + "caches" + File.separator + "images").exists()){
|
|
|
CreateObjUtil.createSoftConnection(path + File.separator + "caches" + File.separator + "images", target + File.separator + "caches" + File.separator + "images");
|
|
|
}
|
|
|
|
|
|
- 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);
|
|
|
+ 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");
|
|
|
+// 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);
|
|
|
|
|
|
//data.json增加extras为执行重建算法
|
|
|
String project = FileUtils.readFile(target + File.separator+"project.json");
|
|
@@ -1908,7 +1948,6 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
|
String bucket = scenePlusExt.getYunFileBucket();
|
|
|
|
|
|
- String localDataPath = String.format(ConstantFilePath.DATABUFFER_FORMAT, num);
|
|
|
String localImagesPath = String.format(ConstantFilePath.IMAGESBUFFER_FORMAT, num);
|
|
|
String path = scenePlusExt.getDataSource();
|
|
|
String target = localImagesPath + "panorama/" + sid;
|
|
@@ -1923,8 +1962,9 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
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);
|
|
|
+ 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");
|
|
|
JSONObject visionJson = new JSONObject();
|
|
|
JSONArray visionArray = new JSONArray();
|
|
|
visionJson.put("uuid", sid);
|
|
@@ -1933,9 +1973,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
visionArray.add(visionJson);
|
|
|
JSONObject vision = new JSONObject();
|
|
|
vision.put("sweepLocations", visionArray);
|
|
|
- cn.hutool.core.io.FileUtil.writeString(vision.toString(),
|
|
|
- target + "/extras" + File.separator + "vision.txt",
|
|
|
- StandardCharsets.UTF_8);
|
|
|
+ cn.hutool.core.io.FileUtil.writeString(vision.toString(), target + "/extras" + File.separator + "vision.txt", StandardCharsets.UTF_8);
|
|
|
|
|
|
//data.json增加extras为执行重建算法
|
|
|
String type = "4k";
|
|
@@ -1963,8 +2001,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);
|
|
|
+ cn.hutool.core.io.FileUtil.writeString(dataJson.toString(), target + File.separator+"data.json", StandardCharsets.UTF_8);
|
|
|
}
|
|
|
|
|
|
//创建文件夹软连接并且复制data.json和project.json
|
|
@@ -1979,10 +2016,6 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
cn.hutool.core.io.FileUtil.del(resultPath);
|
|
|
}
|
|
|
//下载data.fdage
|
|
|
-// if(FYunTypeEnum.AWS.code().equals(this.fyunType)){
|
|
|
-// //亚马逊保持旧方式,超链接capture
|
|
|
-// CreateObjUtil.createSoftConnection(path + File.separator + "capture", capturePath);
|
|
|
-// }
|
|
|
fYunFileService.downloadFile(ConstantFilePath.OSS_PREFIX + path.replace(ConstantFilePath.BUILD_MODEL_PATH, "") + "/data.fdage", capturePath + "/data.fdage");
|
|
|
CreateObjUtil.build3dModel(target , "1");
|
|
|
|
|
@@ -2765,6 +2798,9 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
sceneEditInfoExt.setFilters(filters);
|
|
|
sceneEditInfoExtService.updateById(sceneEditInfoExt);
|
|
|
|
|
|
+ //更新版本号
|
|
|
+ this.upgradeVersionById(sceneEditInfoExt.getEditInfoId());
|
|
|
+
|
|
|
return ResultData.ok();
|
|
|
|
|
|
}
|