|
@@ -585,6 +585,26 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
if(sceneStatus != -2){
|
|
|
throw new BusinessException(ResultCode.SCENE_IS_BUILDING);
|
|
|
}
|
|
|
+ Long totalSpace = detailEntity.getTotalSpace();
|
|
|
+ UserIncrement userIncrement = userIncrementService.getByCameraId(cameraId);
|
|
|
+ if(userIncrement != null && userIncrement.getIsExpired() ==0){
|
|
|
+ IncrementType incrementType = incrementTypeService.getById(userIncrement.getIncrementTypeId());
|
|
|
+ totalSpace = incrementType.getCameraCapacity() * 1024 * 1024 * 1024L;
|
|
|
+ }
|
|
|
+ Long needSpace = 0L;
|
|
|
+ if(scenePro != null){
|
|
|
+ needSpace = scenePro.getSpace();
|
|
|
+ }
|
|
|
+ if(scenePlus != null){
|
|
|
+ ScenePlusExt scenePlusExt = scenePlusExtService.getByPlusId(scenePlus.getId());
|
|
|
+ if(scenePlusExt != null && scenePlusExt.getSpace() != null){
|
|
|
+ needSpace = scenePlusExt.getSpace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if( totalSpace > 0 && detailEntity.getUsedSpace() + needSpace > totalSpace){
|
|
|
+ throw new BusinessException(ResultCode.CAMERA_SPACE_ERROR);
|
|
|
+ }
|
|
|
+
|
|
|
// if(detailEntity.getType() == 10 ){
|
|
|
// throw new BusinessException(ResultCode.SS_NO_COPY);
|
|
|
// }
|