Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
zt
2025-09-25 18:39:10 +08:00
2 changed files with 14 additions and 11 deletions

View File

@ -127,18 +127,15 @@ public class ChatGroupController {
for (ChatGroup chatGroup : list){ for (ChatGroup chatGroup : list){
setValue(chatGroup,userId); setValue(chatGroup,userId);
} }
if (searchObject != null && searchObject.getName() != null && !searchObject.getName().isEmpty()){ if (searchObject != null && searchObject.getName() != null && !searchObject.getName().isEmpty()){
return R.ok( return R.ok(
list.stream() list.stream()
.filter(chatGroup -> chatGroup.getName().contains(searchObject.getName())) .filter(chatGroup -> chatGroup.getName().contains(searchObject.getName()))
.toList()); .toList());
}else {
return R.ok(list);
} }
}else {
return R.fail("没有数据");
} }
return R.ok(list);
} }
/** /**

View File

@ -66,13 +66,19 @@ public class ChatFriendshipServiceImpl extends ServiceImpl<ChatFriendshipMapper,
.list(); .list();
Map<Long, List<SysUserFile>> userFileMap = userFileList.stream().collect(Collectors.groupingBy(SysUserFile::getUserId)); Map<Long, List<SysUserFile>> userFileMap = userFileList.stream().collect(Collectors.groupingBy(SysUserFile::getUserId));
userVoList.forEach(userVo -> { userVoList.forEach(userVo -> {
Long userId = userVo.getUserId(); Long userId = userVo.getUserId();
if (userFileMap.containsKey(userId)) {
List<SysUserFile> fileList = userFileMap.get(userId); if (userId.equals(LoginHelper.getUserId())){
String fileIdStr = fileList.stream() userVoList.remove(userVo);
.map(file -> String.valueOf(file.getFileId())) }else {
.collect(Collectors.joining(",")); if (userFileMap.containsKey(userId)) {
userVo.setFilePath(fileIdStr); List<SysUserFile> fileList = userFileMap.get(userId);
String fileIdStr = fileList.stream()
.map(file -> String.valueOf(file.getFileId()))
.collect(Collectors.joining(","));
userVo.setFilePath(fileIdStr);
}
} }
}); });
page.setRecords(userVoList); page.setRecords(userVoList);