|
@@ -50,26 +50,26 @@ public class ScenePlusServiceImpl extends ServiceImpl<IScenePlusMapper, ScenePlu
|
|
|
public ResultData resetSpace(String num){
|
|
public ResultData resetSpace(String num){
|
|
|
ScenePlus scenePlus = this.getScenePlusByNum(num);
|
|
ScenePlus scenePlus = this.getScenePlusByNum(num);
|
|
|
ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
ScenePlusExt scenePlusExt = scenePlusExtService.getScenePlusExtByPlusId(scenePlus.getId());
|
|
|
- if(Objects.isNull(scenePlus)){
|
|
|
|
|
- log.info("该场景不存在无法重置容量,场景码为:" + num);
|
|
|
|
|
- return ResultData.error(ErrorCode.FAILURE_CODE_5058);
|
|
|
|
|
- }
|
|
|
|
|
- if(scenePlus.getSceneStatus() == SceneStatus.EXCEED_SPACE.code()){//超出容量的场景不需要更新容量
|
|
|
|
|
- return ResultData.ok();
|
|
|
|
|
- }
|
|
|
|
|
- if(!ObjectUtils.isEmpty(scenePlusExt) && !ObjectUtils.isEmpty(scenePlusExt.getSpace())){
|
|
|
|
|
- Long space = -scenePlusExt.getSpace();
|
|
|
|
|
- CameraDetail cameraDetail = cameraDetailService.getByCameraId(scenePlus.getCameraId());
|
|
|
|
|
- String spaceType = cameraDetail.getUnit();
|
|
|
|
|
- if(spaceType.equals(SpaceType.SP.code())){
|
|
|
|
|
- space = -1L;
|
|
|
|
|
- }
|
|
|
|
|
- if(scenePlus.getSceneSource() == SceneSource.BM.code()
|
|
|
|
|
- || scenePlus.getSceneSource() == SceneSource.ZT.code()
|
|
|
|
|
- || (spaceType.equals(SpaceType.SP.code()))){
|
|
|
|
|
- cameraDetailService.updateCameraDetailByCameraIdAndSpace(scenePlus.getCameraId(), space);
|
|
|
|
|
- }
|
|
|
|
|
- }
|
|
|
|
|
|
|
+// if(Objects.isNull(scenePlus)){
|
|
|
|
|
+// log.info("该场景不存在无法重置容量,场景码为:" + num);
|
|
|
|
|
+// return ResultData.error(ErrorCode.FAILURE_CODE_5058);
|
|
|
|
|
+// }
|
|
|
|
|
+// if(scenePlus.getSceneStatus() == SceneStatus.EXCEED_SPACE.code()){//超出容量的场景不需要更新容量
|
|
|
|
|
+// return ResultData.ok();
|
|
|
|
|
+// }
|
|
|
|
|
+// if(!ObjectUtils.isEmpty(scenePlusExt) && !ObjectUtils.isEmpty(scenePlusExt.getSpace())){
|
|
|
|
|
+// Long space = -scenePlusExt.getSpace();
|
|
|
|
|
+// CameraDetail cameraDetail = cameraDetailService.getByCameraId(scenePlus.getCameraId());
|
|
|
|
|
+// String spaceType = cameraDetail.getUnit();
|
|
|
|
|
+// if(spaceType.equals(SpaceType.SP.code())){
|
|
|
|
|
+// space = -1L;
|
|
|
|
|
+// }
|
|
|
|
|
+// if(scenePlus.getSceneSource() == SceneSource.BM.code()
|
|
|
|
|
+// || scenePlus.getSceneSource() == SceneSource.ZT.code()
|
|
|
|
|
+// || (spaceType.equals(SpaceType.SP.code()))){
|
|
|
|
|
+// cameraDetailService.updateCameraDetailByCameraIdAndSpace(scenePlus.getCameraId(), space);
|
|
|
|
|
+// }
|
|
|
|
|
+// }
|
|
|
|
|
|
|
|
scenePlusExt.setSpace(Long.parseLong("0"));
|
|
scenePlusExt.setSpace(Long.parseLong("0"));
|
|
|
scenePlusExtService.updateById(scenePlusExt);
|
|
scenePlusExtService.updateById(scenePlusExt);
|