lyhzzz 5 bulan lalu
induk
melakukan
978ed1f29d

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