lyhzzz vor 5 Monaten
Ursprung
Commit
e4a9365a1e

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

@@ -422,13 +422,7 @@ public class SceneCooperationServiceImpl extends ServiceImpl<ISceneCooperationMa
     private Integer getTotalCount(List<String> numList, List<User> users,String sceneType,Long cameraId){
         List<SceneCooperationCount> freeCountList = sceneCooperationCountService.getByNumList(numList,sceneType);
         HashMap<String,Integer> freeMap = new HashMap<>();
-        for (SceneCooperationCount count : freeCountList) {
-            if(freeMap.get(count.getNum()) != null){
-                freeMap.put(count.getNum(),count.getCount());
-            }else {
-                freeMap.put(count.getNum(),freeMap.get(count.getNum() + count.getCount()));
-            }
-        }
+        freeCountList.forEach(e -> freeMap.put(e.getNum(),e.getCount()));
 
         HashMap<String, List<User>> map = this.getByNumList(numList,sceneType);
         Integer totalCount = 0;