lyhzzz 5 ماه پیش
والد
کامیت
f181e1430a
1فایلهای تغییر یافته به همراه10 افزوده شده و 8 حذف شده
  1. 10 8
      src/main/java/com/fdkankan/ucenter/service/impl/SceneCooperationServiceImpl.java

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

@@ -121,18 +121,20 @@ public class SceneCooperationServiceImpl extends ServiceImpl<ISceneCooperationMa
         for (Long userId : userIds) {
             for (String num : numList) {
                 List<User> users = byNumList.get(num);
-                List<Long> collect1 = users.stream().map(User::getId).collect(Collectors.toList());
-                if("scene".equals(type)){
-                    for (Long l : collect1) {
-                        if(!userIds.contains(l)){
-                            delList.add(num + "," +l);
+                if(users != null && !users.isEmpty()){
+                    List<Long> collect1 = users.stream().map(User::getId).collect(Collectors.toList());
+                    if("scene".equals(type)){
+                        for (Long l : collect1) {
+                            if(!userIds.contains(l)){
+                                delList.add(num + "," +l);
+                            }
                         }
                     }
+                    if(collect1.contains(userId)){
+                        continue;
+                    }
                 }
 
-                if(collect1.contains(userId)){
-                    continue;
-                }
                 SceneCooperation sceneCooperationEntity = new SceneCooperation();
                 sceneCooperationEntity.setUserId(userId);
                 sceneCooperationEntity.setSceneNum(num);