|
@@ -92,7 +92,7 @@ public class ImMsgReceivedServiceImpl implements IImMsgReceivedService {
|
|
|
//判断医生是否在线
|
|
//判断医生是否在线
|
|
|
if (self.doctorIsOnline(loginInfo.getClinicId())) {
|
|
if (self.doctorIsOnline(loginInfo.getClinicId())) {
|
|
|
try{
|
|
try{
|
|
|
- sendMsg(MsgDTO.onlineMsg(loginInfo.getClinicId(),loginInfo.getUserId()));
|
|
|
|
|
|
|
+ sendMsg(MsgDTO.onlineMsg(loginInfo.getClinicId(),loginInfo.getUserId()),Boolean.FALSE);
|
|
|
}catch (Exception e){
|
|
}catch (Exception e){
|
|
|
log.warn("发送消息失败:{%s}",e.getMessage());
|
|
log.warn("发送消息失败:{%s}",e.getMessage());
|
|
|
}
|
|
}
|
|
@@ -102,8 +102,10 @@ public class ImMsgReceivedServiceImpl implements IImMsgReceivedService {
|
|
|
ServerEventCallbackHandler.onGetGroupUserIds=clinicId->baseRepository.selectAllUserId(clinicId);
|
|
ServerEventCallbackHandler.onGetGroupUserIds=clinicId->baseRepository.selectAllUserId(clinicId);
|
|
|
;
|
|
;
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- public void sendMsg(MsgDTO msg) throws Exception {
|
|
|
|
|
|
|
+ public void sendMsg(MsgDTO msg) throws Exception{
|
|
|
|
|
+ sendMsg(msg,Boolean.TRUE);
|
|
|
|
|
+ }
|
|
|
|
|
+ public void sendMsg(MsgDTO msg,Boolean offlineSave) throws Exception {
|
|
|
String toUser = UserUtils.formatUserId(msg);
|
|
String toUser = UserUtils.formatUserId(msg);
|
|
|
if(OnlineProcessor.isOnline(toUser)) {
|
|
if(OnlineProcessor.isOnline(toUser)) {
|
|
|
final Protocal p = ProtocalFactory.createCommonData(JSONUtil.toJsonStr(msg), "0", toUser, true, msg.getMsgId(), -1);
|
|
final Protocal p = ProtocalFactory.createCommonData(JSONUtil.toJsonStr(msg), "0", toUser, true, msg.getMsgId(), -1);
|
|
@@ -116,7 +118,7 @@ public class ImMsgReceivedServiceImpl implements IImMsgReceivedService {
|
|
|
}
|
|
}
|
|
|
};
|
|
};
|
|
|
LocalSendHelper.sendData(p, resultObserver);
|
|
LocalSendHelper.sendData(p, resultObserver);
|
|
|
- }else {
|
|
|
|
|
|
|
+ }else if(Boolean.TRUE.equals(offlineSave)) {
|
|
|
//不在线的时候更新未读
|
|
//不在线的时候更新未读
|
|
|
ImGroupUserPO groupUserPO = groupUserRepository.selectOne(new LambdaQueryWrapper<ImGroupUserPO>()
|
|
ImGroupUserPO groupUserPO = groupUserRepository.selectOne(new LambdaQueryWrapper<ImGroupUserPO>()
|
|
|
.eq(ImGroupUserPO::getUserId, msg.getToUserId())
|
|
.eq(ImGroupUserPO::getUserId, msg.getToUserId())
|