|
@@ -237,7 +237,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * @param payStatus -2 封存,为 1 解封
|
|
|
+ * @param -2 封存,为 1 解封
|
|
|
*/
|
|
|
@Override
|
|
|
public void lockOrUnLockBySpace(CameraDetail cameraDetail, Long cameraId) {
|
|
@@ -636,47 +636,47 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
if((scenePro == null || scenePro.getCameraId() == null ) && (scenePlus== null || scenePlus.getCameraId() == null)){
|
|
|
throw new BusinessException(SceneConstant.FAILURE_CODE_5005, SceneConstant.FAILURE_MSG_5005);
|
|
|
}
|
|
|
- Long cameraId = scenePro == null ? scenePlus.getCameraId() : scenePro.getCameraId();
|
|
|
- Long userId = scenePro == null ? scenePlus.getUserId() :scenePro.getUserId();
|
|
|
- // 判断是否有绑定会员权益
|
|
|
- Long count = userIncrementService.getValidCountByCameraId(cameraId);
|
|
|
- if(count <= 0){
|
|
|
- throw new BusinessException(LoginConstant.FAILURE_CODE_3030, LoginConstant.FAILURE_MSG_3030);
|
|
|
- }
|
|
|
- if(userId == null){
|
|
|
- throw new BusinessException(SceneConstant.FAILURE_CODE_5013, SceneConstant.FAILURE_MSG_5013);
|
|
|
- }
|
|
|
- //只能复制自己的场景
|
|
|
- User user = userService.getByUserName(userName);
|
|
|
- if(user == null || !user.getId().equals(userId) ){
|
|
|
- throw new BusinessException(SceneConstant.FAILURE_CODE_5013, SceneConstant.FAILURE_MSG_5013);
|
|
|
- }
|
|
|
- CameraDetail detailEntity = cameraDetailService.getByCameraId(cameraId);
|
|
|
- if(detailEntity == null){
|
|
|
- throw new BusinessException(CameraConstant.FAILURE_CODE_6029, CameraConstant.FAILURE_MSG_6029);
|
|
|
- }
|
|
|
- UserIncrement userIncrement = userIncrementService.getByCameraId(cameraId);
|
|
|
- if(userIncrement == null || userIncrement.getIsExpired() == 1){
|
|
|
- throw new BusinessException(LoginConstant.FAILURE_CODE_3030, LoginConstant.FAILURE_MSG_3030);
|
|
|
- }
|
|
|
- IncrementType incrementType = incrementTypeService.getById(userIncrement.getIncrementTypeId());
|
|
|
- if(incrementType == null){
|
|
|
- throw new BusinessException(LoginConstant.FAILURE_CODE_3030, LoginConstant.FAILURE_MSG_3030);
|
|
|
- }
|
|
|
- Long space = null;
|
|
|
- if( scenePro != null ){
|
|
|
- space = scenePro.getSpace();
|
|
|
- }
|
|
|
- if( scenePlus != null ){
|
|
|
- ScenePlusExt ext = scenePlusExtService.getByPlusId(scenePlus.getId());
|
|
|
- space = ext.getSpace();
|
|
|
- }
|
|
|
-
|
|
|
- Boolean canSpace = cameraDetailService.checkSpace(detailEntity,incrementType,space);
|
|
|
-
|
|
|
- if(!canSpace){
|
|
|
- throw new BusinessException(CameraConstant.FAILURE_CODE_6008, CameraConstant.FAILURE_MSG_6008);
|
|
|
- }
|
|
|
+// Long cameraId = scenePro == null ? scenePlus.getCameraId() : scenePro.getCameraId();
|
|
|
+// Long userId = scenePro == null ? scenePlus.getUserId() :scenePro.getUserId();
|
|
|
+// // 判断是否有绑定会员权益
|
|
|
+// Long count = userIncrementService.getValidCountByCameraId(cameraId);
|
|
|
+// if(count <= 0){
|
|
|
+// throw new BusinessException(LoginConstant.FAILURE_CODE_3030, LoginConstant.FAILURE_MSG_3030);
|
|
|
+// }
|
|
|
+// if(userId == null){
|
|
|
+// throw new BusinessException(SceneConstant.FAILURE_CODE_5013, SceneConstant.FAILURE_MSG_5013);
|
|
|
+// }
|
|
|
+// //只能复制自己的场景
|
|
|
+// User user = userService.getByUserName(userName);
|
|
|
+// if(user == null || !user.getId().equals(userId) ){
|
|
|
+// throw new BusinessException(SceneConstant.FAILURE_CODE_5013, SceneConstant.FAILURE_MSG_5013);
|
|
|
+// }
|
|
|
+// CameraDetail detailEntity = cameraDetailService.getByCameraId(cameraId);
|
|
|
+// if(detailEntity == null){
|
|
|
+// throw new BusinessException(CameraConstant.FAILURE_CODE_6029, CameraConstant.FAILURE_MSG_6029);
|
|
|
+// }
|
|
|
+// UserIncrement userIncrement = userIncrementService.getByCameraId(cameraId);
|
|
|
+// if(userIncrement == null || userIncrement.getIsExpired() == 1){
|
|
|
+// throw new BusinessException(LoginConstant.FAILURE_CODE_3030, LoginConstant.FAILURE_MSG_3030);
|
|
|
+// }
|
|
|
+// IncrementType incrementType = incrementTypeService.getById(userIncrement.getIncrementTypeId());
|
|
|
+// if(incrementType == null){
|
|
|
+// throw new BusinessException(LoginConstant.FAILURE_CODE_3030, LoginConstant.FAILURE_MSG_3030);
|
|
|
+// }
|
|
|
+// Long space = null;
|
|
|
+// if( scenePro != null ){
|
|
|
+// space = scenePro.getSpace();
|
|
|
+// }
|
|
|
+// if( scenePlus != null ){
|
|
|
+// ScenePlusExt ext = scenePlusExtService.getByPlusId(scenePlus.getId());
|
|
|
+// space = ext.getSpace();
|
|
|
+// }
|
|
|
+//
|
|
|
+// Boolean canSpace = cameraDetailService.checkSpace(detailEntity,incrementType,space);
|
|
|
+//
|
|
|
+// if(!canSpace){
|
|
|
+// throw new BusinessException(CameraConstant.FAILURE_CODE_6008, CameraConstant.FAILURE_MSG_6008);
|
|
|
+// }
|
|
|
this.copySceneNoCheck(sceneNum);
|
|
|
|
|
|
}
|
|
@@ -685,13 +685,14 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
public synchronized void copySceneNoCheck(String sceneNum) throws Exception {
|
|
|
ScenePro scenePro = this.getByNum(sceneNum);
|
|
|
ScenePlus scenePlus = scenePlusService.getByNum(sceneNum);
|
|
|
- Long cameraId = scenePro == null ? scenePlus.getCameraId() : scenePro.getCameraId();
|
|
|
- CameraDetail detailEntity = cameraDetailService.getByCameraId(cameraId);
|
|
|
- if(detailEntity == null){
|
|
|
- throw new BusinessException(CameraConstant.FAILURE_CODE_6029, CameraConstant.FAILURE_MSG_6029);
|
|
|
- }
|
|
|
-
|
|
|
- String newNum = scene3dNumService.generateSceneNum(detailEntity.getType());
|
|
|
+// Long cameraId = scenePro == null ? scenePlus.getCameraId() : scenePro.getCameraId();
|
|
|
+// CameraDetail detailEntity = cameraDetailService.getByCameraId(cameraId);
|
|
|
+// if(detailEntity == null){
|
|
|
+// throw new BusinessException(CameraConstant.FAILURE_CODE_6029, CameraConstant.FAILURE_MSG_6029);
|
|
|
+// }
|
|
|
+ Integer sceneSource = scenePro == null ? scenePlus.getSceneSource() : scenePro.getSceneSource();
|
|
|
+ Integer cameraType = scene3dNumService.getCameraTypeBySceneSource(sceneSource);
|
|
|
+ String newNum = scene3dNumService.generateSceneNum(cameraType);
|
|
|
|
|
|
Long sceneId = scenePro == null ? scenePlus.getId() :scenePro.getId();
|
|
|
Long newSceneId = null;
|
|
@@ -700,12 +701,12 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
if(scenePro !=null){ //v3场景复制
|
|
|
log.info("场景复制--V3--OldNum:{},oldTitle:{},newNum:{},", scenePro.getNum(),scenePro.getSceneName(),newNum);
|
|
|
|
|
|
- newSceneId = this.copyV3Scene(scenePro, newNum, detailEntity);
|
|
|
+ newSceneId = this.copyV3Scene(scenePro, newNum);
|
|
|
}
|
|
|
if(scenePlus != null){ //v4场景复制
|
|
|
log.info("场景复制--V4--OldNum:{},oldTitle:{},newNum:{}", scenePlus.getNum(),scenePlus.getTitle(),newNum);
|
|
|
|
|
|
- newSceneId = scenePlusService.copyV4Scene(scenePlus,newNum,detailEntity);
|
|
|
+ newSceneId = scenePlusService.copyV4Scene(scenePlus,newNum);
|
|
|
}
|
|
|
log.info("场景复制--完成--sceneId:{}",newSceneId);
|
|
|
|
|
@@ -730,7 +731,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public Long copyV3Scene(ScenePro scenePro,String newNum,CameraDetail cameraDetail) throws Exception {
|
|
|
+ public Long copyV3Scene(ScenePro scenePro,String newNum) throws Exception {
|
|
|
|
|
|
String oldNum = scenePro.getNum();
|
|
|
Long sceneProId = scenePro.getId();
|
|
@@ -812,11 +813,11 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
|
|
|
sceneCopyLogService.saveByNum(oldNum,newNum,scenePro.getUserId());
|
|
|
|
|
|
- Boolean checkSpace = cameraDetailService.checkSpace(cameraDetail.getCameraId(), scenePro.getSpace());
|
|
|
- if(!checkSpace){
|
|
|
- this.lockOrUnLockScenes(Arrays.asList(scenePro.getId()),-2);
|
|
|
- }
|
|
|
- cameraDetailService.addUsedSpace(cameraDetail,scenePro.getSpace());
|
|
|
+// Boolean checkSpace = cameraDetailService.checkSpace(cameraDetail.getCameraId(), scenePro.getSpace());
|
|
|
+// if(!checkSpace){
|
|
|
+// this.lockOrUnLockScenes(Arrays.asList(scenePro.getId()),-2);
|
|
|
+// }
|
|
|
+// cameraDetailService.addUsedSpace(cameraDetail,scenePro.getSpace());
|
|
|
|
|
|
}catch ( Exception e){
|
|
|
log.error("复制场景失败-sceneNum:{},error:{}",oldNum,e);
|