mirror of
https://github.com/zongzibinbin/MallChat.git
synced 2026-03-14 06:03:42 +08:00
fix:
1.已读未读数排除自己
This commit is contained in:
@@ -33,6 +33,7 @@ public class ContactDao extends ServiceImpl<ContactMapper, Contact> {
|
|||||||
public Integer getReadCount(Message message) {
|
public Integer getReadCount(Message message) {
|
||||||
return lambdaQuery()
|
return lambdaQuery()
|
||||||
.eq(Contact::getRoomId, message.getRoomId())
|
.eq(Contact::getRoomId, message.getRoomId())
|
||||||
|
.ne(Contact::getUid, message.getFromUid())//不需要查询出自己
|
||||||
.ge(Contact::getReadTime, message.getCreateTime())
|
.ge(Contact::getReadTime, message.getCreateTime())
|
||||||
.count();
|
.count();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ public class ContactServiceImpl implements ContactService {
|
|||||||
Integer readCount = contactDao.getReadCount(message);
|
Integer readCount = contactDao.getReadCount(message);
|
||||||
readInfoDTO.setReadCount(readCount);
|
readInfoDTO.setReadCount(readCount);
|
||||||
if (needUnread) {
|
if (needUnread) {
|
||||||
readInfoDTO.setUnReadCount(finalTotalCount - readCount);
|
readInfoDTO.setUnReadCount(finalTotalCount - readCount - 1);
|
||||||
}
|
}
|
||||||
return readInfoDTO;
|
return readInfoDTO;
|
||||||
}).collect(Collectors.toMap(MsgReadInfoDTO::getMsgId, Function.identity()));
|
}).collect(Collectors.toMap(MsgReadInfoDTO::getMsgId, Function.identity()));
|
||||||
|
|||||||
Reference in New Issue
Block a user