fix(notify): 修复铃铛红点不消失(已忽略公告误计为未读)

unreadCount 的已读集合改用 findAllByUser(含已忽略), 与 list() 已读判定对齐, 避免已忽略公告被反复计为未读导致红点常亮
This commit is contained in:
DaxPay Dev
2026-06-24 18:48:14 +08:00
parent 4d619e4c28
commit 15ce168f45

View File

@@ -47,8 +47,8 @@ public class NotifyUserNoticeService {
Long userId = SecurityUtil.getUserId();
// 可见公告
List<NotifyNotice> visibleNotices = findVisibleNotices();
// 用户已读(且未忽略)的公告id集合
Set<Long> readNoticeIds = readManager.findAllByUserAndNotIgnored(userId).stream()
// 用户已读的公告id集合(含被忽略的, 忽略视同已读, 与 list() 判定一致, 避免已忽略公告被反复计为未读)
Set<Long> readNoticeIds = readManager.findAllByUser(userId).stream()
.map(NotifyNoticeRead::getNoticeId)
.collect(Collectors.toSet());
int noticeUnread = (int) visibleNotices.stream()