lyhzzz 5 月之前
父节点
当前提交
522e401afd
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      src/main/java/com/fdkankan/ucenter/service/impl/SceneCooperationServiceImpl.java

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

@@ -527,7 +527,9 @@ public class SceneCooperationServiceImpl extends ServiceImpl<ISceneCooperationMa
         }
         LambdaQueryWrapper<SceneCooperation> wrapper = new LambdaQueryWrapper<>();
         wrapper.in(SceneCooperation::getSceneNum,numList);
-        wrapper.eq(SceneCooperation::getSceneType,sceneType);
+        if(StringUtils.isNotBlank(sceneType)){
+            wrapper.eq(SceneCooperation::getSceneType,sceneType);
+        }
         List<SceneCooperation> list = this.list(wrapper);
         HashMap<String,List<User>> cooMap = new HashMap<>();
         if(list.size() >0){
@@ -537,7 +539,9 @@ public class SceneCooperationServiceImpl extends ServiceImpl<ISceneCooperationMa
                 for (SceneCooperation entity : list) {
                     User user = userMap.get(entity.getUserId());
                     cooMap.computeIfAbsent(entity.getSceneNum(), k -> new ArrayList<>());
-                    cooMap.get(entity.getSceneNum()).add(user);
+                    if(!cooMap.get(entity.getSceneNum()).contains(user)){
+                        cooMap.get(entity.getSceneNum()).add(user);
+                    }
                 }
             }
         }