|
|
@@ -71,6 +71,7 @@ import com.fdkankan.scene.service.IScenePlusService;
|
|
|
import com.fdkankan.scene.service.ISceneProExtService;
|
|
|
import com.fdkankan.scene.service.ISceneProService;
|
|
|
import com.fdkankan.scene.service.ISceneUploadService;
|
|
|
+import com.fdkankan.scene.util.ObsUtil;
|
|
|
import com.fdkankan.scene.vo.BallScreenVideoParamVO;
|
|
|
import com.fdkankan.scene.vo.BaseDataParamVO;
|
|
|
import com.fdkankan.scene.vo.BaseFileParamVO;
|
|
|
@@ -157,6 +158,8 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
private String URL_GET_SCENEPRO_BY_NUM;
|
|
|
@Value("${http.api-v4.upgradeToV4ResultSync}")
|
|
|
private String URL_UPGRADE_TO_V4_RESULT_SYNC;
|
|
|
+ @Value("${obs.use}")
|
|
|
+ private boolean obs;
|
|
|
|
|
|
@Autowired
|
|
|
private ISceneEditControlsService sceneEditControlsService;
|
|
|
@@ -182,6 +185,8 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
private FdkankanMiniClient fdkankanMiniClient;
|
|
|
@Autowired
|
|
|
private ISceneUploadService sceneUploadService;
|
|
|
+ @Autowired
|
|
|
+ private ObsUtil obsUtil;
|
|
|
|
|
|
@Transactional
|
|
|
@Override
|
|
|
@@ -499,26 +504,26 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
**/
|
|
|
private SceneInfoVO getSceneInfo4View(String num) throws Exception{
|
|
|
|
|
|
- // TODO: 2022/5/19 请求v3的接口,获取场景的状态 待v3停机后要换成v4d的逻辑-------------------------start
|
|
|
- String url = fkankanMiniHost + URL_GET_SCENEPRO_BY_NUM + num + "&addViewCount=yes";
|
|
|
- Result<SceneProV3> result = fdkankanMiniClient
|
|
|
- .getSceneProByNum(url, new FdkkMiniReqSuccessCallback(),
|
|
|
- new FdkkMiniReqErrorCallback());
|
|
|
- SceneProV3 sceneProV3 = result.getData();
|
|
|
- if(sceneProV3 == null || sceneProV3.getId() == null){
|
|
|
- throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
|
- }
|
|
|
- if(sceneProV3.getRecStatus().equals("I")){
|
|
|
- throw new BusinessException(ErrorCode.FAILURE_CODE_5009);
|
|
|
- }
|
|
|
- if((SceneStatus.SUCCESS.code() != sceneProV3.getStatus() && SceneStatus.NO_DISPLAY.code() != sceneProV3.getStatus())
|
|
|
- || (sceneProV3.getIsUpgrade() != null && sceneProV3.getIsUpgrade()== 2)){
|
|
|
- throw new BusinessException(ErrorCode.FAILURE_CODE_5033);
|
|
|
- }
|
|
|
- if(PayStatus.PAY.code() != sceneProV3.getPayStatus()){
|
|
|
- throw new BusinessException(ErrorCode.FAILURE_CODE_5034);
|
|
|
- }
|
|
|
- // TODO: 2022/5/19 请求v3的接口,获取场景的状态 待v3停机后要换成v4d的逻辑-------------------------send
|
|
|
+// TODO: 2022/5/19 请求v3的接口,获取场景的状态 待v3停机后要换成v4d的逻辑-------------------------start
|
|
|
+// String url = fkankanMiniHost + URL_GET_SCENEPRO_BY_NUM + num + "&addViewCount=yes";
|
|
|
+// Result<SceneProV3> result = fdkankanMiniClient
|
|
|
+// .getSceneProByNum(url, new FdkkMiniReqSuccessCallback(),
|
|
|
+// new FdkkMiniReqErrorCallback());
|
|
|
+// SceneProV3 sceneProV3 = result.getData();
|
|
|
+// if(sceneProV3 == null || sceneProV3.getId() == null){
|
|
|
+// throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
|
+// }
|
|
|
+// if(sceneProV3.getRecStatus().equals("I")){
|
|
|
+// throw new BusinessException(ErrorCode.FAILURE_CODE_5009);
|
|
|
+// }
|
|
|
+// if((SceneStatus.SUCCESS.code() != sceneProV3.getStatus() && SceneStatus.NO_DISPLAY.code() != sceneProV3.getStatus())
|
|
|
+// || (sceneProV3.getIsUpgrade() != null && sceneProV3.getIsUpgrade()== 2)){
|
|
|
+// throw new BusinessException(ErrorCode.FAILURE_CODE_5033);
|
|
|
+// }
|
|
|
+// if(PayStatus.PAY.code() != sceneProV3.getPayStatus()){
|
|
|
+// throw new BusinessException(ErrorCode.FAILURE_CODE_5034);
|
|
|
+// }
|
|
|
+// TODO: 2022/5/19 请求v3的接口,获取场景的状态 待v3停机后要换成v4d的逻辑-------------------------send
|
|
|
|
|
|
// ScenePro scenePro = sceneProService.findBySceneNum(num);
|
|
|
ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
|
|
|
@@ -536,7 +541,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
sceneInfoVO = JSON.parseObject(sceneJson, SceneInfoVO.class);
|
|
|
// TODO: 2022/4/24 v3版本停机要切换---------------------------start
|
|
|
// this.setExtData(sceneInfoVO, scenePlus.getCameraId());
|
|
|
- this.setExtDataFromV3(sceneInfoVO, scenePlus.getCameraId());
|
|
|
+// this.setExtDataFromV3(sceneInfoVO, scenePlus.getCameraId());
|
|
|
// TODO: 2022/4/24 v3版本停机要切换---------------------------end
|
|
|
sceneInfoVO.setScenePassword(null);
|
|
|
if(Objects.isNull(sceneInfoVO.getFloorPlanAngle())){
|
|
|
@@ -551,13 +556,18 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
|
|
|
//如果redis没找到,从scene.json中获取
|
|
|
String objectName = String.format(ConstantFilePath.SCENE_VIEW_DATA_DATA_SCENEJSON, num);
|
|
|
- String objectContent = uploadToOssUtil.getObjectContent(bucket, objectName);
|
|
|
+ String objectContent = null;
|
|
|
+ if(obs){
|
|
|
+ objectContent = obsUtil.getFileContent(bucket, objectName);
|
|
|
+ }else{
|
|
|
+ objectContent = uploadToOssUtil.getObjectContent(bucket, objectName);
|
|
|
+ }
|
|
|
if(StrUtil.isEmpty(objectContent))
|
|
|
return null;
|
|
|
sceneInfoVO = JSON.parseObject(objectContent, SceneInfoVO.class);
|
|
|
// TODO: 2022/4/24 v3版本停机要切换---------------------------start
|
|
|
// this.setExtData(sceneInfoVO, scenePlus.getCameraId());
|
|
|
- this.setExtDataFromV3(sceneInfoVO, scenePlus.getCameraId());
|
|
|
+// this.setExtDataFromV3(sceneInfoVO, scenePlus.getCameraId());
|
|
|
// TODO: 2022/4/24 v3版本停机要切换---------------------------end
|
|
|
if(Objects.isNull(sceneInfoVO.getFloorPlanAngle())){
|
|
|
sceneInfoVO.setFloorPlanAngle(0f);
|