update 游客和用户未读数新增
This commit is contained in:
parent
099e973f64
commit
340f81a513
|
@ -22,8 +22,7 @@ import javax.annotation.Resource;
|
|||
import java.time.LocalDateTime;
|
||||
import java.util.Date;
|
||||
|
||||
import static com.m2pool.chat.constant.UserType.CUSTOMER;
|
||||
import static com.m2pool.chat.constant.UserType.TOURIST;
|
||||
import static com.m2pool.chat.constant.UserType.*;
|
||||
|
||||
@Service
|
||||
public class StompServiceImpl implements StompService {
|
||||
|
@ -63,9 +62,16 @@ public class StompServiceImpl implements StompService {
|
|||
//获取当前聊天室对象
|
||||
ChatRoom chatRoom = chatRoomMapper.selectById(userMessageVo.getRoomId());
|
||||
|
||||
if (chatRoom != null){
|
||||
build.setClientReadNum(chatRoom.getClientReadNum() + 1);
|
||||
if (chatRoom != null ){
|
||||
if(LOGIN_USER.equals(principal.getType())){
|
||||
build.setClientReadNum(chatRoom.getServiceReadNum() + 1);
|
||||
}else {
|
||||
build.setClientReadNum(chatRoom.getClientReadNum() + 1);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
//当前用户发送其他人, 发送给指定用户. 否则默认发送给当前发送者
|
||||
if (bool){
|
||||
messagingTemplate.convertAndSendToUser(userMessageVo.getEmail(), Destination.QUEUE + "/" + userMessageVo.getEmail(),build);
|
||||
|
|
Loading…
Reference in New Issue