|
@@ -17,13 +17,10 @@ import com.fdkankan.common.constant.ConstantFilePath;
|
|
|
import com.fdkankan.common.constant.ErrorCode;
|
|
import com.fdkankan.common.constant.ErrorCode;
|
|
|
import com.fdkankan.common.constant.FileBizType;
|
|
import com.fdkankan.common.constant.FileBizType;
|
|
|
import com.fdkankan.common.constant.OperationType;
|
|
import com.fdkankan.common.constant.OperationType;
|
|
|
-import com.fdkankan.common.constant.PayStatus;
|
|
|
|
|
import com.fdkankan.common.constant.SceneInfoReqType;
|
|
import com.fdkankan.common.constant.SceneInfoReqType;
|
|
|
-import com.fdkankan.common.constant.SceneStatus;
|
|
|
|
|
import com.fdkankan.common.constant.ServerCode;
|
|
import com.fdkankan.common.constant.ServerCode;
|
|
|
import com.fdkankan.common.constant.UploadFilePath;
|
|
import com.fdkankan.common.constant.UploadFilePath;
|
|
|
import com.fdkankan.common.exception.BusinessException;
|
|
import com.fdkankan.common.exception.BusinessException;
|
|
|
-import com.fdkankan.common.response.Result;
|
|
|
|
|
import com.fdkankan.common.response.ResultData;
|
|
import com.fdkankan.common.response.ResultData;
|
|
|
import com.fdkankan.common.util.ComputerUtil;
|
|
import com.fdkankan.common.util.ComputerUtil;
|
|
|
import com.fdkankan.common.util.CreateObjUtil;
|
|
import com.fdkankan.common.util.CreateObjUtil;
|
|
@@ -33,8 +30,6 @@ import com.fdkankan.common.util.FileUtils;
|
|
|
import com.fdkankan.common.util.SceneUtil;
|
|
import com.fdkankan.common.util.SceneUtil;
|
|
|
import com.fdkankan.fyun.constant.StorageType;
|
|
import com.fdkankan.fyun.constant.StorageType;
|
|
|
import com.fdkankan.fyun.oss.UploadToOssUtil;
|
|
import com.fdkankan.fyun.oss.UploadToOssUtil;
|
|
|
-import com.fdkankan.platform.api.dto.CameraDetail;
|
|
|
|
|
-import com.fdkankan.platform.api.dto.Company;
|
|
|
|
|
import com.fdkankan.platform.api.feign.PlatformGoodsClient;
|
|
import com.fdkankan.platform.api.feign.PlatformGoodsClient;
|
|
|
import com.fdkankan.platform.api.feign.PlatformUserClient;
|
|
import com.fdkankan.platform.api.feign.PlatformUserClient;
|
|
|
import com.fdkankan.redis.constant.RedisKey;
|
|
import com.fdkankan.redis.constant.RedisKey;
|
|
@@ -47,15 +42,18 @@ import com.fdkankan.scene.bean.RequestSceneProV4;
|
|
|
import com.fdkankan.scene.bean.SceneJsonBean;
|
|
import com.fdkankan.scene.bean.SceneJsonBean;
|
|
|
import com.fdkankan.scene.callback.FdkkMiniReqErrorCallback;
|
|
import com.fdkankan.scene.callback.FdkkMiniReqErrorCallback;
|
|
|
import com.fdkankan.scene.callback.FdkkMiniReqSuccessCallback;
|
|
import com.fdkankan.scene.callback.FdkkMiniReqSuccessCallback;
|
|
|
|
|
+import com.fdkankan.scene.entity.CameraDetail;
|
|
|
|
|
+import com.fdkankan.scene.entity.Company;
|
|
|
import com.fdkankan.scene.entity.SceneDataDownload;
|
|
import com.fdkankan.scene.entity.SceneDataDownload;
|
|
|
import com.fdkankan.scene.entity.SceneEditControls;
|
|
import com.fdkankan.scene.entity.SceneEditControls;
|
|
|
import com.fdkankan.scene.entity.SceneEditInfo;
|
|
import com.fdkankan.scene.entity.SceneEditInfo;
|
|
|
import com.fdkankan.scene.entity.SceneEditInfoExt;
|
|
import com.fdkankan.scene.entity.SceneEditInfoExt;
|
|
|
import com.fdkankan.scene.entity.ScenePlus;
|
|
import com.fdkankan.scene.entity.ScenePlus;
|
|
|
import com.fdkankan.scene.entity.ScenePlusExt;
|
|
import com.fdkankan.scene.entity.ScenePlusExt;
|
|
|
-import com.fdkankan.scene.entity.SceneProV3;
|
|
|
|
|
import com.fdkankan.scene.httpclient.FdkankanMiniClient;
|
|
import com.fdkankan.scene.httpclient.FdkankanMiniClient;
|
|
|
import com.fdkankan.scene.mapper.ISceneEditInfoMapper;
|
|
import com.fdkankan.scene.mapper.ISceneEditInfoMapper;
|
|
|
|
|
+import com.fdkankan.scene.service.ICameraDetailService;
|
|
|
|
|
+import com.fdkankan.scene.service.ICompanyService;
|
|
|
import com.fdkankan.scene.service.ISceneDataDownloadService;
|
|
import com.fdkankan.scene.service.ISceneDataDownloadService;
|
|
|
import com.fdkankan.scene.service.ISceneEditControlsService;
|
|
import com.fdkankan.scene.service.ISceneEditControlsService;
|
|
|
import com.fdkankan.scene.service.ISceneEditInfoExtService;
|
|
import com.fdkankan.scene.service.ISceneEditInfoExtService;
|
|
@@ -166,6 +164,10 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
private FdkankanMiniClient fdkankanMiniClient;
|
|
private FdkankanMiniClient fdkankanMiniClient;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private ISceneUploadService sceneUploadService;
|
|
private ISceneUploadService sceneUploadService;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private ICameraDetailService cameraDetailService;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private ICompanyService companyService;
|
|
|
|
|
|
|
|
@Transactional
|
|
@Transactional
|
|
|
@Override
|
|
@Override
|
|
@@ -312,18 +314,18 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
// sceneEditControlsService.updateById(sceneEditControls);
|
|
// sceneEditControlsService.updateById(sceneEditControls);
|
|
|
// }
|
|
// }
|
|
|
|
|
|
|
|
- // todo 调用v3接口同步场景缩略图url---------------------------------start
|
|
|
|
|
- String url = fkankanMiniHost + URL_UPGRADE_TO_V4_RESULT_SYNC;
|
|
|
|
|
- fdkankanMiniClient.upgradeToV4ResultSync(url,
|
|
|
|
|
- RequestSceneProV4.builder()
|
|
|
|
|
- .id(scenePlus.getId())
|
|
|
|
|
- .thumb(scenePlusExt.getThumb())
|
|
|
|
|
- .sceneName(sceneEditInfo.getTitle())
|
|
|
|
|
- .sceneDec(sceneEditInfo.getDescription())
|
|
|
|
|
- .build(),
|
|
|
|
|
- new FdkkMiniReqSuccessCallback(), new FdkkMiniReqErrorCallback()
|
|
|
|
|
- );
|
|
|
|
|
- // todo 调用v3接口同步场景缩略图url---------------------------------end
|
|
|
|
|
|
|
+// // todo 调用v3接口同步场景缩略图url---------------------------------start
|
|
|
|
|
+// String url = fkankanMiniHost + URL_UPGRADE_TO_V4_RESULT_SYNC;
|
|
|
|
|
+// fdkankanMiniClient.upgradeToV4ResultSync(url,
|
|
|
|
|
+// RequestSceneProV4.builder()
|
|
|
|
|
+// .id(scenePlus.getId())
|
|
|
|
|
+// .thumb(scenePlusExt.getThumb())
|
|
|
|
|
+// .sceneName(sceneEditInfo.getTitle())
|
|
|
|
|
+// .sceneDec(sceneEditInfo.getDescription())
|
|
|
|
|
+// .build(),
|
|
|
|
|
+// new FdkkMiniReqSuccessCallback(), new FdkkMiniReqErrorCallback()
|
|
|
|
|
+// );
|
|
|
|
|
+// // todo 调用v3接口同步场景缩略图url---------------------------------end
|
|
|
|
|
|
|
|
return ResultData.ok();
|
|
return ResultData.ok();
|
|
|
}
|
|
}
|
|
@@ -459,30 +461,27 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
sceneInfoVO.setSceneFrom(scenePlusExt.getSceneFrom());
|
|
sceneInfoVO.setSceneFrom(scenePlusExt.getSceneFrom());
|
|
|
sceneInfoVO.setVideos(scenePlusExt.getVideos());
|
|
sceneInfoVO.setVideos(scenePlusExt.getVideos());
|
|
|
|
|
|
|
|
- // TODO: 2022/4/24 v3版本停机要切换---------------------------start
|
|
|
|
|
-// this.setExtData(sceneInfoVO, scenePlus.getCameraId());
|
|
|
|
|
- this.setExtDataFromV3(sceneInfoVO, scenePlus.getCameraId());
|
|
|
|
|
- // TODO: 2022/4/24 v3版本停机要切换---------------------------end
|
|
|
|
|
|
|
+ this.setExtData(sceneInfoVO, scenePlus.getCameraId());
|
|
|
|
|
|
|
|
return sceneInfoVO;
|
|
return sceneInfoVO;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- /**
|
|
|
|
|
- * <p>
|
|
|
|
|
- getInfo接口返回字段扩展
|
|
|
|
|
- * </p>
|
|
|
|
|
- * @author dengsixing
|
|
|
|
|
- * @date 2022/3/9
|
|
|
|
|
- **/
|
|
|
|
|
- private void setExtDataFromV3(SceneInfoVO sceneInfoVO, Long cameraId) throws Exception{
|
|
|
|
|
- if(Objects.isNull(cameraId)){
|
|
|
|
|
- return;
|
|
|
|
|
- }
|
|
|
|
|
- String url = fkankanMiniHost + URL_GET_DATASYNC_BY_CAMERAID + cameraId;
|
|
|
|
|
- Result<String> dataSyncResult = fdkankanMiniClient
|
|
|
|
|
- .getDataSyncType(url, new FdkkMiniReqSuccessCallback(), new FdkkMiniReqErrorCallback());
|
|
|
|
|
- sceneInfoVO.setDataSync(dataSyncResult.getMsg());
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// /**
|
|
|
|
|
+// * <p>
|
|
|
|
|
+// getInfo接口返回字段扩展
|
|
|
|
|
+// * </p>
|
|
|
|
|
+// * @author dengsixing
|
|
|
|
|
+// * @date 2022/3/9
|
|
|
|
|
+// **/
|
|
|
|
|
+// private void setExtDataFromV3(SceneInfoVO sceneInfoVO, Long cameraId) throws Exception{
|
|
|
|
|
+// if(Objects.isNull(cameraId)){
|
|
|
|
|
+// return;
|
|
|
|
|
+// }
|
|
|
|
|
+// String url = fkankanMiniHost + URL_GET_DATASYNC_BY_CAMERAID + cameraId;
|
|
|
|
|
+// Result<String> dataSyncResult = fdkankanMiniClient
|
|
|
|
|
+// .getDataSyncType(url, new FdkkMiniReqSuccessCallback(), new FdkkMiniReqErrorCallback());
|
|
|
|
|
+// sceneInfoVO.setDataSync(dataSyncResult.getMsg());
|
|
|
|
|
+// }
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* <p>
|
|
* <p>
|
|
@@ -492,23 +491,18 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
* @date 2022/3/9
|
|
* @date 2022/3/9
|
|
|
**/
|
|
**/
|
|
|
private void setExtData(SceneInfoVO sceneInfoVO, Long cameraId) throws Exception{
|
|
private void setExtData(SceneInfoVO sceneInfoVO, Long cameraId) throws Exception{
|
|
|
-
|
|
|
|
|
- ResultData<CameraDetail> cameraResultData = platformGoodsClient.getCameraDetailByCameraId(cameraId);
|
|
|
|
|
- if(!cameraResultData.getSuccess()){
|
|
|
|
|
- throw new Exception(ServerCode.FEIGN_REQUEST_FAILD.message());
|
|
|
|
|
|
|
+ if(Objects.isNull(cameraId)){
|
|
|
|
|
+ return;
|
|
|
}
|
|
}
|
|
|
- CameraDetail camera = cameraResultData.getData();
|
|
|
|
|
- if(Objects.isNull(camera)){
|
|
|
|
|
|
|
+
|
|
|
|
|
+ CameraDetail cameraDetail = cameraDetailService.getByCameraId(cameraId);
|
|
|
|
|
+ if(Objects.isNull(cameraDetail)){
|
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_7010);
|
|
throw new BusinessException(ErrorCode.FAILURE_CODE_7010);
|
|
|
}
|
|
}
|
|
|
- if(Objects.isNull(camera.getCompanyId())){
|
|
|
|
|
|
|
+ if(Objects.isNull(cameraDetail.getCompanyId())){
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
- ResultData<Company> companyResultData = platformUserClient.getCompanyById(camera.getCompanyId());
|
|
|
|
|
- if(!companyResultData.getSuccess()){
|
|
|
|
|
- throw new Exception(ServerCode.FEIGN_REQUEST_FAILD.message());
|
|
|
|
|
- }
|
|
|
|
|
- Company company = companyResultData.getData();
|
|
|
|
|
|
|
+ Company company = companyService.getById(cameraDetail.getCompanyId());
|
|
|
if(Objects.isNull(company)){
|
|
if(Objects.isNull(company)){
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
@@ -526,32 +520,11 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
**/
|
|
**/
|
|
|
private SceneInfoVO getSceneInfo4View(String num) throws Exception{
|
|
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()){
|
|
|
|
|
- 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
|
|
|
|
|
|
|
+ //校验场景是否为空、封存、计算中
|
|
|
|
|
+ ScenePlus scenePlus = scenePlusService.checkSceneAvail(num);
|
|
|
|
|
|
|
|
-// ScenePro scenePro = sceneProService.findBySceneNum(num);
|
|
|
|
|
- ScenePlus scenePlus = scenePlusService.getScenePlusByNum(num);
|
|
|
|
|
- if(Objects.isNull(scenePlus)){
|
|
|
|
|
- throw new BusinessException(ErrorCode.FAILURE_CODE_5005);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ //访问量+1
|
|
|
|
|
+ scenePlusService.updateViewCount(num);
|
|
|
|
|
|
|
|
String key = String.format(RedisKey.SCENE_JSON, num);
|
|
String key = String.format(RedisKey.SCENE_JSON, num);
|
|
|
String sceneJson = redisUtil.get(key);
|
|
String sceneJson = redisUtil.get(key);
|
|
@@ -559,10 +532,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
//先查询redis
|
|
//先查询redis
|
|
|
if(StrUtil.isNotEmpty(sceneJson)) {
|
|
if(StrUtil.isNotEmpty(sceneJson)) {
|
|
|
sceneInfoVO = JSON.parseObject(sceneJson, SceneInfoVO.class);
|
|
sceneInfoVO = JSON.parseObject(sceneJson, SceneInfoVO.class);
|
|
|
- // TODO: 2022/4/24 v3版本停机要切换---------------------------start
|
|
|
|
|
-// this.setExtData(sceneInfoVO, scenePlus.getCameraId());
|
|
|
|
|
- this.setExtDataFromV3(sceneInfoVO, scenePlus.getCameraId());
|
|
|
|
|
- // TODO: 2022/4/24 v3版本停机要切换---------------------------end
|
|
|
|
|
|
|
+ this.setExtData(sceneInfoVO, scenePlus.getCameraId());
|
|
|
sceneInfoVO.setScenePassword(null);
|
|
sceneInfoVO.setScenePassword(null);
|
|
|
if(Objects.isNull(sceneInfoVO.getFloorPlanAngle())){
|
|
if(Objects.isNull(sceneInfoVO.getFloorPlanAngle())){
|
|
|
sceneInfoVO.setFloorPlanAngle(0f);
|
|
sceneInfoVO.setFloorPlanAngle(0f);
|
|
@@ -579,10 +549,7 @@ public class SceneEditInfoServiceImpl extends ServiceImpl<ISceneEditInfoMapper,
|
|
|
if(StrUtil.isEmpty(objectContent))
|
|
if(StrUtil.isEmpty(objectContent))
|
|
|
return null;
|
|
return null;
|
|
|
sceneInfoVO = JSON.parseObject(objectContent, SceneInfoVO.class);
|
|
sceneInfoVO = JSON.parseObject(objectContent, SceneInfoVO.class);
|
|
|
- // TODO: 2022/4/24 v3版本停机要切换---------------------------start
|
|
|
|
|
-// this.setExtData(sceneInfoVO, scenePlus.getCameraId());
|
|
|
|
|
- this.setExtDataFromV3(sceneInfoVO, scenePlus.getCameraId());
|
|
|
|
|
- // TODO: 2022/4/24 v3版本停机要切换---------------------------end
|
|
|
|
|
|
|
+ this.setExtData(sceneInfoVO, scenePlus.getCameraId());
|
|
|
if(Objects.isNull(sceneInfoVO.getFloorPlanAngle())){
|
|
if(Objects.isNull(sceneInfoVO.getFloorPlanAngle())){
|
|
|
sceneInfoVO.setFloorPlanAngle(0f);
|
|
sceneInfoVO.setFloorPlanAngle(0f);
|
|
|
}
|
|
}
|