|
@@ -691,7 +691,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
if(!canSpace){
|
|
|
throw new BusinessException(CameraConstant.FAILURE_CODE_6008, CameraConstant.FAILURE_MSG_6008);
|
|
|
}
|
|
|
- this.copySceneNoCheck(sceneNum);
|
|
|
+ copyScene(sceneNum,detailEntity,scenePro,scenePlus);
|
|
|
|
|
|
}
|
|
|
|
|
@@ -704,7 +704,31 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
if(detailEntity == null){
|
|
|
throw new BusinessException(CameraConstant.FAILURE_CODE_6029, CameraConstant.FAILURE_MSG_6029);
|
|
|
}
|
|
|
+ IncrementType incrementType = null;
|
|
|
+ UserIncrement userIncrement = userIncrementService.getByCameraId(cameraId);
|
|
|
+ if(userIncrement != null && userIncrement.getIsExpired() != 1){
|
|
|
+ incrementType = incrementTypeService.getById(userIncrement.getIncrementTypeId());
|
|
|
+ }
|
|
|
+ Long space = null;
|
|
|
+ if( scenePro != null ){
|
|
|
+ space = scenePro.getSpace();
|
|
|
+ }
|
|
|
+ if( scenePlus != null ){
|
|
|
+ ScenePlusExt ext = scenePlusExtService.getByPlusId(scenePlus.getId());
|
|
|
+ space = ext.getSpace();
|
|
|
+ }
|
|
|
+ CameraType cameraType = cameraTypeService.getByCameraType(detailEntity.getType());
|
|
|
+
|
|
|
+ Boolean canSpace = cameraDetailService.checkSpace(detailEntity,incrementType,space,cameraType);
|
|
|
+
|
|
|
+ if(!canSpace){
|
|
|
+ throw new BusinessException(CameraConstant.FAILURE_CODE_6008, CameraConstant.FAILURE_MSG_6008);
|
|
|
+ }
|
|
|
+
|
|
|
+ copyScene(sceneNum,detailEntity,scenePro,scenePlus);
|
|
|
+ }
|
|
|
|
|
|
+ private void copyScene(String sceneNum,CameraDetail detailEntity,ScenePro scenePro,ScenePlus scenePlus) throws Exception {
|
|
|
String newNum = scene3dNumService.generateSceneNum(detailEntity.getType());
|
|
|
|
|
|
Long sceneId = scenePro == null ? scenePlus.getId() :scenePro.getId();
|