|
@@ -573,39 +573,14 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
|
|
|
public void copy(String sceneNum) {
|
|
|
ScenePro scenePro = this.getByNum(sceneNum);
|
|
|
ScenePlus scenePlus = scenePlusService.getByNum(sceneNum);
|
|
|
- if((scenePro == null || scenePro.getCameraId() == null ) && (scenePlus== null || scenePlus.getCameraId() == null)){
|
|
|
+ if((scenePro == null ) && (scenePlus== null )){
|
|
|
throw new BusinessException(SceneConstant.FAILURE_CODE_5005, SceneConstant.FAILURE_MSG_5005);
|
|
|
}
|
|
|
- Long cameraId = scenePro == null ? scenePlus.getCameraId() : scenePro.getCameraId();
|
|
|
- Camera camera = cameraService.getById(cameraId);
|
|
|
- if(camera == null){
|
|
|
- throw new BusinessException(CameraConstant.FAILURE_CODE_6029, CameraConstant.FAILURE_MSG_6029);
|
|
|
- }
|
|
|
- CameraDetail detailEntity = cameraDetailService.getByCameraId(cameraId);
|
|
|
- if(detailEntity == null){
|
|
|
- throw new BusinessException(CameraConstant.FAILURE_CODE_6029, CameraConstant.FAILURE_MSG_6029);
|
|
|
- }
|
|
|
Integer sceneStatus = scenePro == null ? scenePlus.getSceneStatus() : scenePro.getStatus();
|
|
|
if(sceneStatus != -2){
|
|
|
throw new BusinessException(ResultCode.SCENE_IS_BUILDING);
|
|
|
}
|
|
|
|
|
|
- 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();
|
|
|
- }
|
|
|
- }
|
|
|
- Boolean checkSpace = cameraDetailService.checkSpace(detailEntity, needSpace);
|
|
|
-
|
|
|
- if(!checkSpace){
|
|
|
- throw new BusinessException(ResultCode.CAMERA_SPACE_ERROR);
|
|
|
- }
|
|
|
-
|
|
|
HashMap<String, Object> param = new HashMap<>();
|
|
|
param.put("num",sceneNum);
|
|
|
JSONObject jsonObject = fdKKClient.copyScene(param, "m_a_n_a_g_e");
|