Procházet zdrojové kódy

迁移判断相机权益

lyhzzz před 2 roky
rodič
revize
0a7f438e6e

+ 3 - 1
src/main/java/com/fdkankan/manage/service/impl/SceneProServiceImpl.java

@@ -328,9 +328,11 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
         }
         }
         space = space == null ? 0 :space;
         space = space == null ? 0 :space;
         Long newUseSpace = space + cameraDetail.getUsedSpace();
         Long newUseSpace = space + cameraDetail.getUsedSpace();
-        if(newUseSpace  > cameraDetail.getTotalSpace()){
+        Long count = userIncrementService.getValidCountByCameraId(cameraId);
+        if(count<=0 && newUseSpace  > cameraDetail.getTotalSpace()){
             throw new BusinessException(ResultCode.CAMERA_SPACE_ERROR);
             throw new BusinessException(ResultCode.CAMERA_SPACE_ERROR);
         }
         }
+
         Camera oldCamera = cameraService.getById(cameraId);
         Camera oldCamera = cameraService.getById(cameraId);
         if(oldCamera == null){
         if(oldCamera == null){
             throw new BusinessException(ResultCode.CAMERA_NOT_EXIST);
             throw new BusinessException(ResultCode.CAMERA_NOT_EXIST);