|
@@ -29,6 +29,7 @@ import com.fdkankan.redis.constant.RedisLockKey;
|
|
|
import com.fdkankan.redis.util.RedisLockUtil;
|
|
|
import com.fdkankan.redis.util.RedisUtil;
|
|
|
import com.fdkankan.scene.bean.*;
|
|
|
+import com.fdkankan.scene.config.FdkkLaserConfig;
|
|
|
import com.fdkankan.scene.constant.ConstantFileLocPath;
|
|
|
import com.fdkankan.scene.entity.*;
|
|
|
import com.fdkankan.scene.mapper.ISceneEditInfoMapper;
|
|
@@ -252,12 +253,12 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
FileUtils.writeFile(localSceneJsonPath, JSON.toJSONString(sceneJson));
|
|
|
//上传sceneJson文件
|
|
|
String sceneJsonPath = String.format(UploadFilePath.DATA_VIEW_PATH+"scene.json", num);
|
|
|
- ossUtil.uploadFileBytes(sceneJsonPath, JSON.toJSONString(sceneJson).getBytes(StandardCharsets.UTF_8));
|
|
|
+ ossUtil.uploadFileBytes(bucket, sceneJsonPath, JSON.toJSONString(sceneJson).getBytes(StandardCharsets.UTF_8));
|
|
|
|
|
|
//删除发布数据中的user目录
|
|
|
String publicUserPath = String.format(UploadFilePath.USER_VIEW_PATH, num);
|
|
|
try{
|
|
|
- ossUtil.deleteObject(publicUserPath);
|
|
|
+ ossUtil.deleteObject(bucket, publicUserPath);
|
|
|
}catch (IORuntimeException e){
|
|
|
if (e.getMessage().contains("另一个程序正在使用此文件,进程无法访问")){
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5071);
|
|
@@ -267,7 +268,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
//复制编辑目录到发布目录
|
|
|
String editPath = String.format(UploadFilePath.USER_EDIT_PATH, param.getNum());
|
|
|
String viewPath = String.format(UploadFilePath.USER_VIEW_PATH, param.getNum()).replace("user/","");
|
|
|
- ossUtil.copyObject(editPath, viewPath);
|
|
|
+ ossUtil.copyObject(bucket, editPath, viewPath);
|
|
|
|
|
|
//sceneJson放入缓存
|
|
|
String key = String.format(RedisKey.SCENE_JSON, num);
|
|
@@ -294,25 +295,25 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
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()){
|
|
|
- ossUtil.deleteObject(surveillanceJsonPath);
|
|
|
+ ossUtil.deleteObject(bucket, surveillanceJsonPath);
|
|
|
return;
|
|
|
}
|
|
|
List<SurveillanceVO> surveillanceList = surveillanceService.listSurveillance(num);
|
|
|
- ossUtil.uploadFileBytes(surveillanceJsonPath, JSON.toJSONString(surveillanceList).getBytes(StandardCharsets.UTF_8));
|
|
|
+ ossUtil.uploadFileBytes(bucket, surveillanceJsonPath, JSON.toJSONString(surveillanceList).getBytes(StandardCharsets.UTF_8));
|
|
|
}
|
|
|
|
|
|
private void publicFilterData(String num, int filters, String bucket) throws IOException {
|
|
|
|
|
|
String userEditPath = String.format(UploadFilePath.USER_EDIT_PATH, num);
|
|
|
if(filters == CommonStatus.NO.code()){
|
|
|
- ossUtil.deleteObject(userEditPath + "filter.json");
|
|
|
+ ossUtil.deleteObject(bucket,userEditPath + "filter.json");
|
|
|
return;
|
|
|
}
|
|
|
String key = String.format(RedisKey.SCENE_filter_DATA, num);
|
|
|
List<String> list = redisUtil.lGet(key, 0, -1);
|
|
|
JSONArray jsonArray = new JSONArray();
|
|
|
list.stream().forEach(str->jsonArray.add(JSON.parseObject(str)));
|
|
|
- ossUtil.uploadFileBytes(userEditPath + "filter.json", JSON.toJSONBytes(jsonArray));
|
|
|
+ ossUtil.uploadFileBytes(bucket,userEditPath + "filter.json", JSON.toJSONBytes(jsonArray));
|
|
|
}
|
|
|
|
|
|
public void publicLinkSceneData(String num, String bucket) throws IOException {
|
|
@@ -322,8 +323,8 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
String imgViewPath = String.format(UploadFilePath.IMG_VIEW_PATH, num);
|
|
|
|
|
|
//清除发布目录中的场景关联图片
|
|
|
- if(ossUtil.doesObjectExist(imgViewPath + "panorama")){
|
|
|
- ossUtil.deleteObject(imgViewPath + "panorama");
|
|
|
+ if(ossUtil.doesObjectExist(bucket,imgViewPath + "panorama")){
|
|
|
+ ossUtil.deleteObject(bucket,imgViewPath + "panorama");
|
|
|
}
|
|
|
|
|
|
//生成links.json并上传到发布目录
|
|
@@ -337,11 +338,11 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
linkPanArr.add(JSON.parseObject(linkPan));
|
|
|
});
|
|
|
String linkScenePath = userEditPath + "links.json";
|
|
|
- ossUtil.uploadFileBytes(linkScenePath, linkPanArr.toString().getBytes(StandardCharsets.UTF_8));
|
|
|
+ ossUtil.uploadFileBytes(bucket, linkScenePath, linkPanArr.toString().getBytes(StandardCharsets.UTF_8));
|
|
|
|
|
|
//拷贝编辑目录到发布目录
|
|
|
- ossUtil.deleteObject(imgViewPath + "panorama");
|
|
|
- ossUtil.copyObject(imgEditPath + "panorama", imgViewPath + "panorama");
|
|
|
+ ossUtil.deleteObject(bucket,imgViewPath + "panorama");
|
|
|
+ ossUtil.copyObject(bucket, imgEditPath + "panorama", imgViewPath + "panorama");
|
|
|
|
|
|
}
|
|
|
|
|
@@ -367,7 +368,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
}
|
|
|
|
|
|
String hotJsonPath = String.format(UploadFilePath.USER_EDIT_PATH, sceneNum) + "hot.json";
|
|
|
- ossUtil.uploadFileBytes(hotJsonPath, tags.toString().getBytes(StandardCharsets.UTF_8));
|
|
|
+ ossUtil.uploadFileBytes(bucket, hotJsonPath, tags.toString().getBytes(StandardCharsets.UTF_8));
|
|
|
// this.saveTagsToSceneEditInfo(sceneNum, sceneEditInfo);
|
|
|
|
|
|
}
|
|
@@ -377,11 +378,11 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
String userEditPath = String.format(UploadFilePath.USER_EDIT_PATH, sceneNum) + "billboards.json";
|
|
|
List<String> list = redisUtil.hgetValues(Key);
|
|
|
if(CollUtil.isEmpty(list)){
|
|
|
- ossUtil.deleteObject(userEditPath);
|
|
|
+ ossUtil.deleteObject(bucket,userEditPath);
|
|
|
return;
|
|
|
}
|
|
|
List<JSONObject> collect = list.stream().map(str -> JSON.parseObject(str)).collect(Collectors.toList());
|
|
|
- ossUtil.uploadFileBytes(userEditPath, JSON.toJSONString(collect).getBytes());
|
|
|
+ ossUtil.uploadFileBytes(bucket, userEditPath, JSON.toJSONString(collect).getBytes());
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -452,9 +453,9 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
}
|
|
|
|
|
|
public static void main(String[] args) {
|
|
|
- String test = "";
|
|
|
- JSONObject jsonObject = JSON.parseObject(test);
|
|
|
- System.out.println(jsonObject);
|
|
|
+// String test = "";
|
|
|
+// JSONObject jsonObject = JSON.parseObject(test);
|
|
|
+ FileUtil.copyContent(new File("D:\\4DMega\\4DKK_PROGRAM_DATA\\dvt600001_202206291618176080\\caches\\images"), new File("/mnt/4Dkankan/scene/1680825957743071232/caches/"), true);
|
|
|
}
|
|
|
|
|
|
private void SortBoxVideos(SceneInfoVO sceneInfoVO){
|
|
@@ -527,6 +528,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
//校验场景是否为空、封存、计算中
|
|
|
ScenePlus scenePlus = scenePlusService.checkSceneAvail(num);
|
|
|
ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
|
+ String bucket = scenePlusExt.getYunFileBucket();
|
|
|
|
|
|
//访问量+1
|
|
|
scenePlusService.updateViewCount(num);
|
|
@@ -537,7 +539,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
//先查询redis
|
|
|
if(StrUtil.isEmpty(sceneJson)) {
|
|
|
String objectName = String.format(ConstantFilePath.SCENE_VIEW_DATA_DATA_SCENEJSON, num);
|
|
|
- sceneJson = ossUtil.getFileContent(objectName);
|
|
|
+ sceneJson = ossUtil.getFileContent(bucket, objectName);
|
|
|
redisUtil.set(key, sceneJson);
|
|
|
}
|
|
|
sceneInfoVO = JSON.parseObject(sceneJson, SceneInfoVO.class);
|
|
@@ -588,7 +590,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
//处理户型图数据
|
|
|
//上传floorplan_user.json文件
|
|
|
FileUtils.writeFile(localDataPath + "floorplan_user.json", floorJsonData);
|
|
|
- ossUtil.uploadFile(editUserPath + "floorplan.json", localDataPath + "floorplan_user.json", false);
|
|
|
+ ossUtil.uploadFile(bucket, editUserPath + "floorplan.json", localDataPath + "floorplan_user.json", false);
|
|
|
|
|
|
//写入数据库
|
|
|
Byte floorPlanUser = null;
|
|
@@ -596,7 +598,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
JSONObject houseTypeJson = CreateHouseJsonUtil
|
|
|
.createHouseTypeJsonByUser(localDataPath + "floorplan_user.json");
|
|
|
if(Objects.nonNull(houseTypeJson)) {
|
|
|
- ossUtil.uploadFileBytes(editUserPath + "houseType.json", houseTypeJson.toJSONString().getBytes(StandardCharsets.UTF_8));
|
|
|
+ ossUtil.uploadFileBytes(bucket, editUserPath + "houseType.json", houseTypeJson.toJSONString().getBytes(StandardCharsets.UTF_8));
|
|
|
}
|
|
|
|
|
|
floorPlanUser = CommonStatus.YES.code();
|
|
@@ -686,7 +688,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
String floorplanCadPath = String.format(UploadFilePath.DATA_VIEW_PATH, num) + "floorplan_cad.json";
|
|
|
String floorcadStr = null;
|
|
|
try {
|
|
|
- floorcadStr = ossUtil.getFileContent(floorplanCadPath);
|
|
|
+ floorcadStr = ossUtil.getFileContent(bucket, floorplanCadPath);
|
|
|
}catch (Exception e){
|
|
|
log.warn("场景没有生成floorplan_cad.json, num:{}", num);
|
|
|
return;
|
|
@@ -709,7 +711,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
}
|
|
|
|
|
|
String hourseTypeJsonPath = String.format(UploadFilePath.USER_EDIT_PATH, num) + "houseType.json";
|
|
|
- ossUtil.uploadFileBytes(hourseTypeJsonPath, result.toJSONString().getBytes(StandardCharsets.UTF_8));
|
|
|
+ ossUtil.uploadFileBytes(bucket, hourseTypeJsonPath, result.toJSONString().getBytes(StandardCharsets.UTF_8));
|
|
|
}
|
|
|
|
|
|
private JSONArray[] createHouseTypeJsonHandler(JSONObject floor){
|
|
@@ -800,7 +802,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
String bucket = scenePlusExt.getYunFileBucket();
|
|
|
|
|
|
String key = String.format(UploadFilePath.USER_EDIT_PATH, param.getNum()) + "floorplan.json";
|
|
|
- String floorplanJson = ossUtil.getFileContent(key);
|
|
|
+ String floorplanJson = ossUtil.getFileContent(bucket, key);
|
|
|
if(StrUtil.isEmpty(floorplanJson)){
|
|
|
return ResultData.ok();
|
|
|
}
|
|
@@ -825,7 +827,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
}
|
|
|
item.put("name", name);
|
|
|
}
|
|
|
- ossUtil.uploadFileBytes(key, jsonObject.toJSONString().getBytes(StandardCharsets.UTF_8));
|
|
|
+ ossUtil.uploadFileBytes(bucket, key, jsonObject.toJSONString().getBytes(StandardCharsets.UTF_8));
|
|
|
return ResultData.ok();
|
|
|
}
|
|
|
|
|
@@ -883,7 +885,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
|
|
|
//更新oss scene.json版本号
|
|
|
String sceneJsonPath = String.format(UploadFilePath.DATA_VIEW_PATH, num) + "scene.json";
|
|
|
- sceneJson = ossUtil.getFileContent(sceneJsonPath);
|
|
|
+ sceneJson = ossUtil.getFileContent(bucket, sceneJsonPath);
|
|
|
if(StrUtil.isNotEmpty(sceneJson)){
|
|
|
SceneJsonBean sceneJsonBean = JSON.parseObject(sceneJson, SceneJsonBean.class);
|
|
|
if(Objects.nonNull(version)){
|
|
@@ -892,7 +894,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
if(Objects.nonNull(imgVersion)){
|
|
|
sceneJsonBean.setImgVersion(imgVersion);
|
|
|
}
|
|
|
- ossUtil.uploadFileBytes(sceneJsonPath, JSON.toJSONString(sceneJsonBean).getBytes(StandardCharsets.UTF_8));
|
|
|
+ ossUtil.uploadFileBytes(bucket, sceneJsonPath, JSON.toJSONString(sceneJsonBean).getBytes(StandardCharsets.UTF_8));
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -989,7 +991,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
//比对图片列表,不存在的要返回名称集合
|
|
|
String ossVisionPath = String.format(UploadFilePath.IMG_VIEW_PATH, num) + "vision.txt";
|
|
|
String visionPath = String.format(ConstantFilePath.SCENE_DATA_PATH_V4, num) + "vision.txt";
|
|
|
- ossUtil.downloadFile(ossVisionPath, visionPath);
|
|
|
+ ossUtil.downloadFile(bucket, ossVisionPath, visionPath);
|
|
|
List<String> panoramaImageList = SceneUtil.getPanoramaImageList(visionPath);
|
|
|
List<String> notExistFileList = uploadFileList.stream().filter(filePath -> {
|
|
|
filePath = filePath.substring(filePath.lastIndexOf(File.separator) + 1);
|
|
@@ -1021,13 +1023,13 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
Map<String, String> map = new HashMap<>();
|
|
|
|
|
|
String imgViewPath = String.format(UploadFilePath.IMG_VIEW_PATH, num);
|
|
|
- ossUtil.downloadFile(imgViewPath + "vision.modeldata", target + File.separator + "extras" + File.separator + "vision.modeldata");
|
|
|
+ ossUtil.downloadFile(bucket, imgViewPath + "vision.modeldata", target + File.separator + "extras" + File.separator + "vision.modeldata");
|
|
|
CreateObjUtil.convertVisionmodeldataToTxt(target + File.separator + "extras" + File.separator + "vision.modeldata",
|
|
|
target + File.separator + "extras" + File.separator + "vision.txt");
|
|
|
|
|
|
String ossResultPath = sceneService.getDataSource(num, scenePlus.getSceneSource(), scenePlusExt.getDataSource());
|
|
|
FileUtil.copy(ossResultPath + "data.json", target + File.separator+"data.json", true);
|
|
|
- FileUtil.copy(ossResultPath + "project.json", target + File.separator+"project.json", true);
|
|
|
+ FileUtil.copy(ossResultPath + "project.json",target + File.separator+"project.json", true);
|
|
|
|
|
|
//data.json增加extras为执行重建算法
|
|
|
String data = FileUtils.readFile(target + File.separator+"data.json");
|
|
@@ -1194,7 +1196,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
//用户上传的全景图上传到ossresult目录
|
|
|
String dataSource = sceneService.getDataSource(num, scenePlus.getSceneSource(), scenePlusExt.getDataSource());
|
|
|
String ossCachesImagesPath = dataSource + "caches/images/";
|
|
|
- FileUtil.copy(targetImagesPath, ossCachesImagesPath, true);
|
|
|
+ ossUtil.uploadFileDirCmd(bucket, targetImagesPath, ossCachesImagesPath, false);
|
|
|
|
|
|
//更新数据库版本号
|
|
|
SceneEditInfo sceneEditInfo = this.getByScenePlusId(scenePlus.getId());
|
|
@@ -1236,7 +1238,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
//根据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";
|
|
|
- ossUtil.downloadFile(ossVisionPath, visionPath);
|
|
|
+ ossUtil.downloadFile(bucket, ossVisionPath, visionPath);
|
|
|
List<String> panoramaImageList = SceneUtil.getPanoramaImageList(visionPath);
|
|
|
if(CollUtil.isEmpty(panoramaImageList)){
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5063);
|
|
@@ -1258,7 +1260,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
}
|
|
|
String downloadName = fileName;
|
|
|
String url = String.format(cacheFormat, num) + downloadName;
|
|
|
- ossUtil.uploadFile(String.format(cacheFormat, num) + downloadName, ossResultPath.concat(downloadName), true);
|
|
|
+ FileUtil.copy(ossResultPath.concat(downloadName), FdkkLaserConfig.getProfile(bucket).concat(String.format(cacheFormat, num).concat(downloadName)), true);
|
|
|
map.put("asyn", CommonStatus.NO.code());
|
|
|
map.put("fileUrl", url + "?t=" + System.currentTimeMillis());
|
|
|
map.put("fileName", downloadName);
|
|
@@ -1286,7 +1288,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
|
|
|
//下载到本地目录
|
|
|
FileUtil.del(localImagesPath);
|
|
|
- ossUtil.downloadFile(ossResultPath, localImagesPath);
|
|
|
+ FileUtil.copyContent(new File(ossResultPath), new File(localImagesPath), true);
|
|
|
//移除非必须文件
|
|
|
List<String> fileNames = FileUtil.listFileNames(localImagesPath);
|
|
|
fileNames.stream().forEach(name->{
|
|
@@ -1303,7 +1305,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
long end1 = Calendar.getInstance().getTimeInMillis();
|
|
|
log.info("打包耗时:" + (end1 - start));
|
|
|
//上传压缩包
|
|
|
- ossUtil.uploadFile(String.format(cacheFormat, num) + downloadName, zipPath, true);
|
|
|
+ ossUtil.uploadFile(bucket, String.format(cacheFormat, num) + downloadName, zipPath, true);
|
|
|
String url = String.format(cacheFormat, num) + downloadName;
|
|
|
long end2 = Calendar.getInstance().getTimeInMillis();
|
|
|
log.info("上传耗时:" + (end2 - end1));
|
|
@@ -1525,12 +1527,12 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
|
|
|
for(String videoName : video.list()){
|
|
|
log.info("球幕视频名称:{}", videoName);
|
|
|
- ossUtil.uploadFile(videosViewPath + videoName, target + File.separator + "extras/video/" + videoName, false);
|
|
|
+ ossUtil.uploadFile(bucket,videosViewPath + videoName, target + File.separator + "extras/video/" + videoName, false);
|
|
|
|
|
|
CreateObjUtil.mp4ToFlv(target + File.separator + "extras/video/" + videoName,
|
|
|
target + File.separator + "extras/video/" + videoName.replace("mp4", "flv"));
|
|
|
|
|
|
- ossUtil.uploadFile(videosViewPath + videoName.replace("mp4", "flv"), target + File.separator + "extras/video/" + videoName.replace("mp4", "flv"), false);
|
|
|
+ ossUtil.uploadFile(bucket,videosViewPath + videoName.replace("mp4", "flv"), target + File.separator + "extras/video/" + videoName.replace("mp4", "flv"), false);
|
|
|
|
|
|
//覆盖原始视频资源
|
|
|
// FileUtils.copyFile(target + File.separator + "extras/video/" + videoName,
|
|
@@ -1552,10 +1554,10 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
public void upgradeVersionToSceneJson(String num, String bucket) throws Exception{
|
|
|
String key = String.format(RedisKey.SCENE_JSON, num);
|
|
|
String objectName = String.format(ConstantFilePath.SCENE_VIEW_DATA_DATA_SCENEJSON, num);
|
|
|
- String objectContent = ossUtil.getFileContent(objectName);
|
|
|
+ String objectContent = ossUtil.getFileContent(bucket, objectName);
|
|
|
SceneJsonBean sceneJsonBean = JSON.parseObject(objectContent, SceneJsonBean.class);
|
|
|
sceneJsonBean.setVersion(sceneJsonBean.getVersion() +1);
|
|
|
- ossUtil.uploadFileBytes(objectName, JSON.toJSONString(sceneJsonBean).getBytes(StandardCharsets.UTF_8));
|
|
|
+ ossUtil.uploadFileBytes(bucket, objectName, JSON.toJSONString(sceneJsonBean).getBytes(StandardCharsets.UTF_8));
|
|
|
redisUtil.set(key, JSON.toJSONString(sceneJsonBean));
|
|
|
}
|
|
|
|
|
@@ -1737,7 +1739,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
SceneJsonBean sceneJsonBean = null;
|
|
|
String sceneJson = redisUtil.get(String.format(RedisKey.SCENE_JSON, param.getNum()));
|
|
|
if(StrUtil.isEmpty(sceneJson)){
|
|
|
- sceneJson = ossUtil.getFileContent(String.format(UploadFilePath.DATA_VIEW_PATH, param.getNum()) + "scene.json");
|
|
|
+ sceneJson = ossUtil.getFileContent(bucket,String.format(UploadFilePath.DATA_VIEW_PATH, param.getNum()) + "scene.json");
|
|
|
}
|
|
|
sceneJsonBean = JSON.parseObject(sceneJson, SceneJsonBean.class);
|
|
|
|
|
@@ -1899,8 +1901,8 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
|
|
|
//调用算法切全景图
|
|
|
String ossResultPath = sceneService.getDataSource(num, scenePlus.getSceneSource(), scenePlusExt.getDataSource());
|
|
|
- FileUtil.copy(ossResultPath + "data.json", target + File.separator+"data.json", true);
|
|
|
- FileUtil.copy(ossResultPath + "project.json", target + File.separator+"project.json", true);
|
|
|
+ FileUtil.copy(ossResultPath + "data.json",target + File.separator+"data.json", true);
|
|
|
+ FileUtil.copy(ossResultPath + "project.json",target + File.separator+"project.json", true);
|
|
|
JSONObject visionJson = new JSONObject();
|
|
|
JSONArray visionArray = new JSONArray();
|
|
|
visionJson.put("uuid", sid);
|
|
@@ -1983,7 +1985,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
//上传全景图
|
|
|
map.put(filePath, imgEditPath + "panorama/" + sid + "/high/" + fileName);
|
|
|
|
|
|
- ossUtil.uploadMulFiles(map);
|
|
|
+ ossUtil.uploadMulFiles(bucket, map);
|
|
|
|
|
|
Map<String, String> result = new HashMap<>();
|
|
|
result.put("type", type);
|
|
@@ -2094,7 +2096,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
String imgEditPath = String.format(UploadFilePath.IMG_EDIT_PATH, num);
|
|
|
thumbNameList.stream().forEach(thumbName->{
|
|
|
try{
|
|
|
- ossUtil.deleteObject(imgEditPath + "panorama_edit/" + thumbName);
|
|
|
+ ossUtil.deleteObject(bucket, imgEditPath + "panorama_edit/" + thumbName);
|
|
|
}catch (FileSystemException e){
|
|
|
|
|
|
}
|
|
@@ -2623,14 +2625,14 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
|
|
|
//从用户编辑目录中下载视频到本地
|
|
|
String filePath = userEditPath + fileName;
|
|
|
- ossUtil.downloadFile(filePath, localImagesPath + fileName);
|
|
|
+ ossUtil.downloadFile(bucket, filePath, localImagesPath + fileName);
|
|
|
|
|
|
//视频格式转换
|
|
|
MergeVideoUtil.ffmpegFormatFlv(localFilePath, localFilePath.replace("mp4", "flv"));
|
|
|
|
|
|
//上传
|
|
|
String flvFileName = fileName.replace("mp4", "flv");
|
|
|
- ossUtil.uploadFile(userEditPath+flvFileName, localFilePath.replace("mp4", "flv"), false);
|
|
|
+ ossUtil.uploadFile(bucket,userEditPath+flvFileName, localFilePath.replace("mp4", "flv"), false);
|
|
|
FileUtil.del(localFilePath);
|
|
|
}
|
|
|
|