lyhzzz 5 月之前
父節點
當前提交
978ed1f29d
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2 2
      src/main/java/com/fdkankan/ucenter/service/impl/SceneCooperationServiceImpl.java

+ 2 - 2
src/main/java/com/fdkankan/ucenter/service/impl/SceneCooperationServiceImpl.java

@@ -412,9 +412,9 @@ public class SceneCooperationServiceImpl extends ServiceImpl<ISceneCooperationMa
             List<User> dbUserList = map.get(num);
             if(dbUserList != null && !dbUserList.isEmpty()){
                 if(cameraId != null){
-                    freeCount = freeCount - dbUserList.size();
+                    freeCount = dbUserList.size() > freeCount ? dbUserList.size() :  freeCount - dbUserList.size() ;
                 }else {
-                    freeCount +=  dbUserList.size() > freeCount ? dbUserList.size() : freeCount ;
+                    freeCount = dbUserList.size() > freeCount ? dbUserList.size() : freeCount ;
                 }
             }