|
@@ -409,7 +409,8 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
**/
|
|
|
private SceneInfoVO getSceneInfo4View(String num) throws Exception{
|
|
|
|
|
|
- ScenePro scenePro = sceneProService.findBySceneNum(num);
|
|
|
+// ScenePro scenePro = sceneProService.findBySceneNum(num);
|
|
|
+ ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
|
|
|
|
|
|
String key = String.format(RedisKey.SCENE_JSON, num);
|
|
|
String sceneJson = redisUtil.get(key);
|
|
@@ -417,7 +418,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
//先查询redis
|
|
|
if(StrUtil.isNotEmpty(sceneJson)){
|
|
|
sceneInfoVO = JSON.parseObject(sceneJson, SceneInfoVO.class);
|
|
|
- this.setExtData(sceneInfoVO, scenePro.getCameraId());
|
|
|
+ this.setExtData(sceneInfoVO, scenePlus.getCameraId());
|
|
|
return sceneInfoVO;
|
|
|
}
|
|
|
|
|
@@ -427,7 +428,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
if(StrUtil.isEmpty(objectContent))
|
|
|
return null;
|
|
|
sceneInfoVO = JSON.parseObject(objectContent, SceneInfoVO.class);
|
|
|
- this.setExtData(sceneInfoVO, scenePro.getCameraId());
|
|
|
+ this.setExtData(sceneInfoVO, scenePlus.getCameraId());
|
|
|
redisUtil.set(key, JSON.toJSONString(sceneInfoVO));
|
|
|
|
|
|
return sceneInfoVO;
|
|
@@ -570,11 +571,12 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
@Override
|
|
|
public ResultData resetCad(String num){
|
|
|
|
|
|
- ScenePro scenePro = sceneProService.findBySceneNum(num);
|
|
|
- if(Objects.isNull(scenePro))
|
|
|
+// ScenePro scenePro = sceneProService.findBySceneNum(num);
|
|
|
+ ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
|
|
|
+ if(Objects.isNull(scenePlus))
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
|
|
|
|
- SceneEditInfo sceneEditInfoDb = this.getBySceneProId(scenePro.getId());
|
|
|
+ SceneEditInfo sceneEditInfoDb = this.getByScenePlusId(scenePlus.getId());
|
|
|
if(Objects.nonNull(sceneEditInfoDb)){
|
|
|
LambdaUpdateWrapper<SceneEditInfo> updateWrapper = new LambdaUpdateWrapper<SceneEditInfo>()
|
|
|
.setSql("version=version+" + 1)
|
|
@@ -583,7 +585,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
this.update(updateWrapper);
|
|
|
}else{
|
|
|
sceneEditInfoDb = new SceneEditInfo();
|
|
|
- sceneEditInfoDb.setSceneProId(scenePro.getId());
|
|
|
+ sceneEditInfoDb.setScenePlusId(scenePlus.getId());
|
|
|
sceneEditInfoDb.setFloorPlanUser(CommonStatus.NO.code());
|
|
|
this.save(sceneEditInfoDb);
|
|
|
}
|
|
@@ -773,11 +775,12 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
if(StrUtil.isEmpty(sid)){
|
|
|
throw new BusinessException(ErrorCode.PARAM_REQUIRED);
|
|
|
}
|
|
|
- ScenePro scenePro = sceneProService.findBySceneNum(param.getNum());
|
|
|
- if(Objects.isNull(scenePro))
|
|
|
+// ScenePro scenePro = sceneProService.findBySceneNum(param.getNum());
|
|
|
+ ScenePlus scenePlus = scenePlusService.getScenePlusByNum(param.getNum());
|
|
|
+ if(Objects.isNull(scenePlus))
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
|
|
|
|
- SceneEditInfo sceneEditInfo = this.getBySceneProId(scenePro.getId());
|
|
|
+ SceneEditInfo sceneEditInfo = this.getByScenePlusId(scenePlus.getId());
|
|
|
|
|
|
//转换视频格式
|
|
|
this.transferToFlv(param.getNum(), param.getFileName());
|
|
@@ -786,7 +789,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
String boxVideos = this.createBoxVideos(sid, boxVideo, sceneEditInfo, OperationType.ADDORUPDATE.code());
|
|
|
|
|
|
//更新数据库
|
|
|
- this.updateBoxVideos(sceneEditInfo, scenePro.getId(), boxVideos);
|
|
|
+ this.updateBoxVideos(sceneEditInfo, scenePlus.getId(), boxVideos);
|
|
|
|
|
|
return ResultData.ok();
|
|
|
}
|
|
@@ -794,17 +797,18 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
@Override
|
|
|
public ResultData deleteVideoBox(DeleteVidoeBoxParamVO param) throws Exception {
|
|
|
|
|
|
- ScenePro scenePro = sceneProService.findBySceneNum(param.getNum());
|
|
|
- if(Objects.isNull(scenePro))
|
|
|
+// ScenePro scenePro = sceneProService.findBySceneNum(param.getNum());
|
|
|
+ ScenePlus scenePlus = scenePlusService.getScenePlusByNum(param.getNum());
|
|
|
+ if(Objects.isNull(scenePlus))
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
|
|
|
|
- SceneEditInfo sceneEditInfo = this.getBySceneProId(scenePro.getId());
|
|
|
+ SceneEditInfo sceneEditInfo = this.getByScenePlusId(scenePlus.getId());
|
|
|
|
|
|
//根据sid移除json
|
|
|
String boxVideos = this.createBoxVideos(param.getSid(), null, sceneEditInfo, OperationType.DELETE.code());
|
|
|
|
|
|
//写数据库
|
|
|
- this.updateBoxVideos(sceneEditInfo,scenePro.getId(),boxVideos);
|
|
|
+ this.updateBoxVideos(sceneEditInfo,scenePlus.getId(),boxVideos);
|
|
|
|
|
|
return ResultData.ok();
|
|
|
}
|
|
@@ -820,20 +824,21 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
}
|
|
|
|
|
|
@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")){
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_7007.code(), ErrorCode.FAILURE_CODE_7007.formatMessage("mp4"));
|
|
|
}
|
|
|
|
|
|
- ScenePro scenePro = sceneProService.findBySceneNum(num);
|
|
|
- if(scenePro == null){
|
|
|
+// ScenePro scenePro = sceneProService.findBySceneNum(num);
|
|
|
+ ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
|
|
|
+ if(scenePlus == null){
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
|
}
|
|
|
- SceneProExt sceneProExt = sceneProExtService.findBySceneProId(scenePro.getId());
|
|
|
+// SceneProExt sceneProExt = sceneProExtService.findBySceneProId(scenePro.getId());
|
|
|
+ ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
|
|
|
|
- String path = sceneProExt.getDataSource();
|
|
|
+ String path = scenePlusExt.getDataSource();
|
|
|
|
|
|
if(path != null && !"".equals(path) && path.startsWith("http")){
|
|
|
path = ConstantFilePath.BUILD_MODEL_PATH + File.separator + path.split("/")[path.split("/").length - 2];
|
|
@@ -900,18 +905,20 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
}
|
|
|
try {
|
|
|
|
|
|
- ScenePro scenePro = sceneProService.findBySceneNum(num);
|
|
|
- if(scenePro == null){
|
|
|
+// ScenePro scenePro = sceneProService.findBySceneNum(num);
|
|
|
+ ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
|
|
|
+ if(scenePlus == null){
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
|
}
|
|
|
- SceneProExt sceneProExt = sceneProExtService.findBySceneProId(scenePro.getId());
|
|
|
+// SceneProExt sceneProExt = sceneProExtService.findBySceneProId(scenePro.getId());
|
|
|
+ ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
|
|
|
|
//更新scene.json文件
|
|
|
String strsceneInfos = FileUtils.readFile(ConstantFilePath.SCENE_PATH + "data" + File.separator + "data" + num + File.separator + "scene.json");
|
|
|
if(strsceneInfos == null)
|
|
|
new File(ConstantFilePath.SCENE_PATH + "data" + File.separator + "data" + num + File.separator + "scene.json").createNewFile();
|
|
|
|
|
|
- String path = sceneProExt.getDataSource();// /mnt/data/0662c5389/831989883441512448/4898cab04f8c_202104141602356060/
|
|
|
+ String path = scenePlusExt.getDataSource();// /mnt/data/0662c5389/831989883441512448/4898cab04f8c_202104141602356060/
|
|
|
if(path != null && !"".equals(path) && path.startsWith("http")){
|
|
|
path = ConstantFilePath.BUILD_MODEL_PATH + File.separator + path.split("/")[path.split("/").length - 2];
|
|
|
}
|
|
@@ -1001,7 +1008,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
files[i].transferTo(cadImg);
|
|
|
}
|
|
|
//下载封面图
|
|
|
- FileUtils.downLoadFromUrl(scenePro.getThumb() + "?t=" + System.currentTimeMillis(),
|
|
|
+ FileUtils.downLoadFromUrl(scenePlusExt.getThumb() + "?t=" + System.currentTimeMillis(),
|
|
|
"Cover.png", target + File.separator + "extras" + File.separator + "CoverImage");
|
|
|
//转换成jpg
|
|
|
FileUtils.pngToJpg(target + File.separator + "extras" + File.separator + "CoverImage/Cover.png",
|
|
@@ -1065,10 +1072,10 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
return ResultData.ok();
|
|
|
}
|
|
|
|
|
|
- private void updateBoxVideos(SceneEditInfo sceneEditInfo, Long sceneProId, String boxVideos){
|
|
|
+ private void updateBoxVideos(SceneEditInfo sceneEditInfo, Long scenePlusId, String boxVideos){
|
|
|
if(Objects.isNull(sceneEditInfo)){
|
|
|
sceneEditInfo = new SceneEditInfo();
|
|
|
- sceneEditInfo.setSceneProId(sceneProId);
|
|
|
+ sceneEditInfo.setScenePlusId(scenePlusId);
|
|
|
sceneEditInfo.setBoxVideos(boxVideos);
|
|
|
this.save(sceneEditInfo);
|
|
|
}else{
|