|
@@ -406,9 +406,10 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
String sceneJson = redisUtil.get(key);
|
|
String sceneJson = redisUtil.get(key);
|
|
SceneInfoVO sceneInfoVO = null;
|
|
SceneInfoVO sceneInfoVO = null;
|
|
//先查询redis
|
|
//先查询redis
|
|
- if(StrUtil.isNotEmpty(sceneJson)){
|
|
|
|
|
|
+ if(StrUtil.isNotEmpty(sceneJson)) {
|
|
sceneInfoVO = JSON.parseObject(sceneJson, SceneInfoVO.class);
|
|
sceneInfoVO = JSON.parseObject(sceneJson, SceneInfoVO.class);
|
|
this.setExtData(sceneInfoVO, scenePro.getCameraId());
|
|
this.setExtData(sceneInfoVO, scenePro.getCameraId());
|
|
|
|
+ sceneInfoVO.setScenePassword(null);
|
|
return sceneInfoVO;
|
|
return sceneInfoVO;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -419,6 +420,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
return null;
|
|
return null;
|
|
sceneInfoVO = JSON.parseObject(objectContent, SceneInfoVO.class);
|
|
sceneInfoVO = JSON.parseObject(objectContent, SceneInfoVO.class);
|
|
this.setExtData(sceneInfoVO, scenePro.getCameraId());
|
|
this.setExtData(sceneInfoVO, scenePro.getCameraId());
|
|
|
|
+ sceneInfoVO.setScenePassword(null);
|
|
redisUtil.set(key, JSON.toJSONString(sceneInfoVO));
|
|
redisUtil.set(key, JSON.toJSONString(sceneInfoVO));
|
|
|
|
|
|
return sceneInfoVO;
|
|
return sceneInfoVO;
|
|
@@ -678,8 +680,6 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
uploadFileList.stream().forEach(filePath->{
|
|
uploadFileList.stream().forEach(filePath->{
|
|
map.put(filePath, filePath.replace(targetImagesPath, imgCachePath));
|
|
map.put(filePath, filePath.replace(targetImagesPath, imgCachePath));
|
|
});
|
|
});
|
|
- //上传模型文件到缓存目录
|
|
|
|
- uploadToOssUtil.uploadMulFiles(map);
|
|
|
|
|
|
|
|
String imgViewPath = String.format(UploadFilePath.IMG_VIEW_PATH, num);
|
|
String imgViewPath = String.format(UploadFilePath.IMG_VIEW_PATH, num);
|
|
if(StorageType.AWS.code().equals(this.type)){
|
|
if(StorageType.AWS.code().equals(this.type)){
|
|
@@ -729,7 +729,13 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
}
|
|
}
|
|
CreateObjUtil.ossUtilCp(ConstantFilePath.OSS_PREFIX + path.replace(ConstantFilePath.BUILD_MODEL_PATH, "") + "/data.fdage", target + File.separator + "capture/");
|
|
CreateObjUtil.ossUtilCp(ConstantFilePath.OSS_PREFIX + path.replace(ConstantFilePath.BUILD_MODEL_PATH, "") + "/data.fdage", target + File.separator + "capture/");
|
|
CreateObjUtil.build3dModel(target , "1");
|
|
CreateObjUtil.build3dModel(target , "1");
|
|
- String uploadData = FileUtils.readFile(target + File.separator + "results" +File.separator+"upload.json");
|
|
|
|
|
|
+
|
|
|
|
+ String uploadJsonPath= target + File.separator + "results" +File.separator+"upload.json";
|
|
|
|
+ boolean exist = ComputerUtil.checkComputeCompleted(uploadJsonPath, 3, 5000);
|
|
|
|
+ if(!exist){
|
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_5042);
|
|
|
|
+ }
|
|
|
|
+ String uploadData = FileUtils.readFile(uploadJsonPath);
|
|
JSONObject uploadJson = null;
|
|
JSONObject uploadJson = null;
|
|
JSONArray array = null;
|
|
JSONArray array = null;
|
|
if(uploadData!=null) {
|
|
if(uploadData!=null) {
|
|
@@ -778,6 +784,9 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
+ if(map.size()>0) {
|
|
|
|
+ uploadToOssUtil.uploadMulFiles(map);
|
|
|
|
+ }
|
|
|
|
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
@@ -919,12 +928,13 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public ResultData uploadBallScreenVideo(String num, String fileName, MultipartFile file)
|
|
|
|
- throws Exception {
|
|
|
|
|
|
+ public ResultData uploadBallScreenVideo(String num, String fileName, MultipartFile file) throws Exception {
|
|
|
|
|
|
|
|
+ //校验格式
|
|
if(!fileName.endsWith(".mp4")){
|
|
if(!fileName.endsWith(".mp4")){
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_7007.code(), ErrorCode.FAILURE_CODE_7007.formatMessage("mp4"));
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_7007.code(), ErrorCode.FAILURE_CODE_7007.formatMessage("mp4"));
|
|
}
|
|
}
|
|
|
|
+ String videosViewPath = String.format(UploadFilePath.VIDEOS_VIEW_PATH, num);
|
|
|
|
|
|
ScenePro scenePro = sceneProService.findBySceneNum(num);
|
|
ScenePro scenePro = sceneProService.findBySceneNum(num);
|
|
if(scenePro == null){
|
|
if(scenePro == null){
|
|
@@ -932,6 +942,25 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
}
|
|
}
|
|
SceneProExt sceneProExt = sceneProExtService.findBySceneProId(scenePro.getId());
|
|
SceneProExt sceneProExt = sceneProExtService.findBySceneProId(scenePro.getId());
|
|
|
|
|
|
|
|
+ //校验文件名
|
|
|
|
+ String videos = scenePro.getVideos();
|
|
|
|
+ if(StrUtil.isEmpty(videos)){
|
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_7012);
|
|
|
|
+ }
|
|
|
|
+ JSONObject videosJson = JSON.parseObject(videos);
|
|
|
|
+ JSONArray dataArr = videosJson.getJSONArray("data");
|
|
|
|
+ boolean exists = false;
|
|
|
|
+ for (Object o : dataArr) {
|
|
|
|
+ JSONObject jsonObject = (JSONObject)o;
|
|
|
|
+ if(jsonObject.getString("id").equals(fileName.replace(".mp4", ""))){
|
|
|
|
+ exists = true;
|
|
|
|
+ break;
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ if(!exists){
|
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_7012);
|
|
|
|
+ }
|
|
|
|
+
|
|
String path = sceneProExt.getDataSource();
|
|
String path = sceneProExt.getDataSource();
|
|
|
|
|
|
if(path != null && !"".equals(path) && path.startsWith("http")){
|
|
if(path != null && !"".equals(path) && path.startsWith("http")){
|
|
@@ -956,7 +985,6 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_7009);
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_7009);
|
|
}
|
|
}
|
|
|
|
|
|
- String videosViewPath = String.format(UploadFilePath.VIDEOS_VIEW_PATH, num);
|
|
|
|
for(String videoName : video.list()){
|
|
for(String videoName : video.list()){
|
|
log.info("球幕视频名称:{}", videoName);
|
|
log.info("球幕视频名称:{}", videoName);
|
|
uploadToOssUtil.upload(target + File.separator + "extras/video/" + videoName,videosViewPath + videoName);
|
|
uploadToOssUtil.upload(target + File.separator + "extras/video/" + videoName,videosViewPath + videoName);
|
|
@@ -1155,6 +1183,19 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
return ResultData.ok();
|
|
return ResultData.ok();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public ResultData checkKey(SceneCheckKeyParamVO param) throws Exception {
|
|
|
|
+
|
|
|
|
+ String sceneJson = redisUtil.get(String.format(RedisKey.SCENE_JSON, param.getNum()));
|
|
|
|
+ SceneJsonBean sceneJsonBean = JSON.parseObject(sceneJson, SceneJsonBean.class);
|
|
|
|
+
|
|
|
|
+ if(!param.getPassword().equals(sceneJsonBean.getScenePassword())){
|
|
|
|
+ throw new BusinessException(ErrorCode.FAILURE_CODE_5021);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return ResultData.ok();
|
|
|
|
+ }
|
|
|
|
+
|
|
private void updateBoxVideos(SceneEditInfo sceneEditInfo, Long sceneProId, String boxVideos){
|
|
private void updateBoxVideos(SceneEditInfo sceneEditInfo, Long sceneProId, String boxVideos){
|
|
if(Objects.isNull(sceneEditInfo)){
|
|
if(Objects.isNull(sceneEditInfo)){
|
|
sceneEditInfo = new SceneEditInfo();
|
|
sceneEditInfo = new SceneEditInfo();
|