|
@@ -336,7 +336,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
}
|
|
|
}
|
|
|
@Override
|
|
|
- public synchronized void move(SceneParam param) {
|
|
|
+ public synchronized Integer move(SceneParam param) {
|
|
|
Camera camera = cameraService.getBySnCode(param.getSnCode());
|
|
|
if(camera == null){
|
|
|
throw new BusinessException(ResultCode.CAMERA_SN_NOT_EXIST);
|
|
@@ -348,15 +348,20 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
if(StringUtils.isNotBlank(param.getNum())){
|
|
|
param.getNumList().add(param.getNum());
|
|
|
}
|
|
|
+ Integer successNum = param.getNumList().size();
|
|
|
for (String num : param.getNumList()) {
|
|
|
ScenePro scenePro = this.getByNum(num);
|
|
|
ScenePlus scenePlus = scenePlusService.getByNum(num);
|
|
|
if((scenePro == null || scenePro.getCameraId() == null ) && (scenePlus== null || scenePlus.getCameraId() == null)){
|
|
|
- throw new BusinessException(SceneConstant.FAILURE_CODE_5005, SceneConstant.FAILURE_MSG_5005);
|
|
|
+ successNum --;
|
|
|
+ continue;
|
|
|
+ //throw new BusinessException(SceneConstant.FAILURE_CODE_5005, SceneConstant.FAILURE_MSG_5005);
|
|
|
}
|
|
|
Integer status = scenePro == null ? scenePlus.getSceneStatus() : scenePro.getStatus();
|
|
|
if(status == 0){
|
|
|
- throw new BusinessException(SceneConstant.FAILURE_CODE_5037, SceneConstant.FAILURE_MSG_5037);
|
|
|
+ successNum --;
|
|
|
+ continue;
|
|
|
+ //throw new BusinessException(SceneConstant.FAILURE_CODE_5037, SceneConstant.FAILURE_MSG_5037);
|
|
|
}
|
|
|
|
|
|
Long sceneCameraId = scenePro == null ? scenePlus.getCameraId() : scenePro.getCameraId();
|
|
@@ -372,22 +377,32 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
Boolean checkSpace = cameraDetailService.checkSpace(cameraDetail, space);
|
|
|
//深时场景无限容量
|
|
|
if( !checkSpace){
|
|
|
- throw new BusinessException(ResultCode.CAMERA_SPACE_ERROR);
|
|
|
+ successNum --;
|
|
|
+ continue;
|
|
|
+ //throw new BusinessException(ResultCode.CAMERA_SPACE_ERROR);
|
|
|
}
|
|
|
|
|
|
Camera oldCamera = cameraService.getById(sceneCameraId);
|
|
|
if(oldCamera == null){
|
|
|
- throw new BusinessException(ResultCode.CAMERA_NOT_EXIST);
|
|
|
+ successNum --;
|
|
|
+ continue;
|
|
|
+ //throw new BusinessException(ResultCode.CAMERA_NOT_EXIST);
|
|
|
}
|
|
|
CameraDetail oldCameraDetail = cameraDetailService.getByCameraId(oldCamera.getId());
|
|
|
if(oldCameraDetail == null){
|
|
|
- throw new BusinessException(ResultCode.CAMERA_NOT_EXIST);
|
|
|
+ successNum --;
|
|
|
+ continue;
|
|
|
+ //throw new BusinessException(ResultCode.CAMERA_NOT_EXIST);
|
|
|
}
|
|
|
if(oldCameraDetail.getCameraId().equals(cameraDetail.getCameraId())){
|
|
|
- throw new BusinessException(ResultCode.CAMERA_NOT_MOVE);
|
|
|
+ successNum --;
|
|
|
+ continue;
|
|
|
+ //throw new BusinessException(ResultCode.CAMERA_NOT_MOVE);
|
|
|
}
|
|
|
if(!oldCameraDetail.getType().equals(cameraDetail.getType())){
|
|
|
- throw new BusinessException(ResultCode.CAMERA_TYPE_NOT_ERROR);
|
|
|
+ successNum --;
|
|
|
+ continue;
|
|
|
+ //throw new BusinessException(ResultCode.CAMERA_TYPE_NOT_ERROR);
|
|
|
}
|
|
|
|
|
|
Long oldUseSpace = oldCameraDetail.getUsedSpace() - space < 0 ? 0 : oldCameraDetail.getUsedSpace() - space;
|