Commit 45dbff0f by sunxiwang

客户群成员同步修改

1 parent b8b3abbe
...@@ -204,21 +204,12 @@ public class WeGroupServiceImpl extends ServiceImpl<WeGroupMapper, WeGroup> impl ...@@ -204,21 +204,12 @@ public class WeGroupServiceImpl extends ServiceImpl<WeGroupMapper, WeGroup> impl
this.saveOrUpdateBatch(weGroups); this.saveOrUpdateBatch(weGroups);
List<WeGroupMember> weGroupMemberList = iWeGroupMemberService.list(new LambdaQueryWrapper<WeGroupMember>().in(WeGroupMember::getChatId, List<WeGroupMember> weGroupMemberList = iWeGroupMemberService.list(new LambdaQueryWrapper<WeGroupMember>().in(WeGroupMember::getChatId,
weGroups.stream().map(WeGroup::getChatId).collect(Collectors.toList()))); weGroups.stream().map(WeGroup::getChatId).collect(Collectors.toList())));
//存量去重
if (CollectionUtil.isNotEmpty(weGroupMemberList)) { if (CollectionUtil.isNotEmpty(weGroupMemberList)) {
List<WeGroupMember> groupMemberList = weGroupMembers.stream().filter(e -> { iWeGroupMemberService.removeByIds(weGroupMemberList.stream().map(WeGroupMember::getId).collect(Collectors.toList()));
for (WeGroupMember weGroupMember : weGroupMemberList) {
if (e.getUserId().equals(weGroupMember.getUserId())) {
return false;
}
} }
return true;
}).collect(Collectors.toList());
iWeGroupMemberService.saveBatch(groupMemberList);
} else {
iWeGroupMemberService.saveBatch(weGroupMembers); iWeGroupMemberService.saveBatch(weGroupMembers);
} }
}
} }
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!