|
@@ -3,6 +3,7 @@ package com.fdkankan.contro.service.impl;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.bean.BeanUtil;
|
|
import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.collection.CollUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
|
+import cn.hutool.core.util.BooleanUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
@@ -959,7 +960,7 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
}
|
|
}
|
|
|
|
|
|
@Override
|
|
@Override
|
|
- public ResultData rebuildScene(String num) {
|
|
|
|
|
|
+ public ResultData rebuildScene(String num,Boolean force) {
|
|
|
|
|
|
ScenePro scenePro = sceneProService.getByNum(num);
|
|
ScenePro scenePro = sceneProService.getByNum(num);
|
|
//如果是v3场景,不允许重算,需要升级v4后再调此接口进行重算
|
|
//如果是v3场景,不允许重算,需要升级v4后再调此接口进行重算
|
|
@@ -969,12 +970,11 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5064);
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5064);
|
|
}
|
|
}
|
|
|
|
|
|
- ScenePlusVO scenePlusVO = null;
|
|
|
|
ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
|
|
ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
|
|
if(Objects.isNull(scenePlus)){
|
|
if(Objects.isNull(scenePlus)){
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
}
|
|
}
|
|
- if(scenePlus.getSceneStatus() == 0){
|
|
|
|
|
|
+ if (scenePlus.getSceneStatus() == 0 && (ObjectUtils.isEmpty(force) || !force)) {
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5033);
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_5033);
|
|
}
|
|
}
|
|
ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
@@ -988,9 +988,6 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
String thumb = scenePlusExt.getThumb();
|
|
String thumb = scenePlusExt.getThumb();
|
|
Integer payStatus = scenePlus.getPayStatus();
|
|
Integer payStatus = scenePlus.getPayStatus();
|
|
Integer sceneScheme = scenePlusExt.getSceneScheme();
|
|
Integer sceneScheme = scenePlusExt.getSceneScheme();
|
|
- Long sceneId = scenePlus.getId();
|
|
|
|
- String sceneName = scenePlus.getTitle();
|
|
|
|
- Date createTime = scenePlus.getCreateTime();
|
|
|
|
String bucket = scenePlusExt.getYunFileBucket();
|
|
String bucket = scenePlusExt.getYunFileBucket();
|
|
|
|
|
|
//重新计算时需要删除文件夹,否知使用缓存
|
|
//重新计算时需要删除文件夹,否知使用缓存
|
|
@@ -1014,8 +1011,6 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
return ResultData.error(CameraConstant.FAILURE_6009.code(), CameraConstant.FAILURE_6009.message());
|
|
return ResultData.error(CameraConstant.FAILURE_6009.code(), CameraConstant.FAILURE_6009.message());
|
|
}
|
|
}
|
|
|
|
|
|
- String sceneUrl = mainUrl +"/"+sceneProNewUrl;
|
|
|
|
-
|
|
|
|
//有points字段的是八目
|
|
//有points字段的是八目
|
|
String cameraName = jsonObject.getJSONObject("cam").getString("uuid");
|
|
String cameraName = jsonObject.getJSONObject("cam").getString("uuid");
|
|
String userName = null;
|
|
String userName = null;
|
|
@@ -1037,7 +1032,6 @@ public class SceneFileBuildServiceImpl extends ServiceImpl<ISceneFileBuildMapper
|
|
String statusJsonOssPath = String.format(UploadFilePath.DATA_VIEW_PATH, num) + "status.json";
|
|
String statusJsonOssPath = String.format(UploadFilePath.DATA_VIEW_PATH, num) + "status.json";
|
|
FileUtils.writeFile(statusJsonLocalPath, statusJson.toString());
|
|
FileUtils.writeFile(statusJsonLocalPath, statusJson.toString());
|
|
fYunFileService.uploadFile(bucket, statusJsonLocalPath, statusJsonOssPath);
|
|
fYunFileService.uploadFile(bucket, statusJsonLocalPath, statusJsonOssPath);
|
|
- String unicode = jsonObject.getString("creator") + "_" + jsonObject.getString("uuidtime");
|
|
|
|
|
|
|
|
Long cameraType = (long)sceneScheme == 3 ? 12 : (long)sceneScheme;
|
|
Long cameraType = (long)sceneScheme == 3 ? 12 : (long)sceneScheme;
|
|
//判断是否转台相机
|
|
//判断是否转台相机
|