Browse Source

复制限制

lyhzzz 1 year ago
parent
commit
c318f9e6cf

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

@@ -286,7 +286,9 @@ public class CameraDetailServiceImpl extends ServiceImpl<ICameraDetailMapper, Ca
                 return true;
             }
             totalSpace = incrementType != null ?incrementType.getCameraSpace() : detailEntity.getTotalSpace();
-            return detailEntity.getUsedSpace() + 1 <= totalSpace;
+            Long proCount = sceneProService.getCountByCameraId(detailEntity.getCameraId());
+            Long plusCount = scenePlusService.getCountByCameraId(detailEntity.getCameraId());
+            return proCount + plusCount + 1 <= totalSpace;
         }
         if("GB".equals(detailEntity.getUnit())){
             if(incrementType!=null && incrementType.getCameraCapacity() == -1){

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

@@ -95,7 +95,7 @@ public class ScenePlusServiceImpl extends ServiceImpl<IScenePlusMapper, ScenePlu
     public Long getCountByCameraId(Long cameraId) {
         LambdaQueryWrapper<ScenePlus> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(ScenePlus::getCameraId,cameraId);
-        wrapper.eq(ScenePlus::getSceneStatus,-2);
+        wrapper.in(ScenePlus::getSceneStatus,0,-2);
         return this.count(wrapper);
     }
 

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

@@ -833,7 +833,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
         LambdaQueryWrapper<ScenePro> wrapper = new LambdaQueryWrapper<>();
         wrapper.eq(ScenePro::getIsUpgrade,0);
         wrapper.eq(ScenePro::getCameraId,cameraId);
-        wrapper.eq(ScenePro::getStatus,-2);
+        wrapper.in(ScenePro::getStatus,0,-2);
         return this.count(wrapper);
     }
 }