Bläddra i källkod

Merge branch 'test'

lyhzzz 1 år sedan
förälder
incheckning
1f626802bb

+ 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);
     }
 

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

@@ -546,7 +546,7 @@ public class SceneProServiceImpl extends ServiceImpl<ISceneProMapper, ScenePro>
         JSONObject jsonObject = fdKKClient.copyScene(param, "m_a_n_a_g_e");
         Integer code = jsonObject.getInteger("code");
         if(code != 0){
-            throw new BusinessException(jsonObject.getInteger("code"),jsonObject.getString("message"));
+            throw new BusinessException(ResultCode.CAMERA_SPACE_ERROR);
         }
     }
 
@@ -834,7 +834,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);
     }
 }