ソースを参照

服务端发送消息,增加判断医生及PCIM是否在线,在线的话推送SOCKET消息

huangwenjie 5 年 前
コミット
cffee6a90e
1 ファイル変更11 行追加0 行削除
  1. 11 0
      src/server/models/client/wechat.client.js

+ 11 - 0
src/server/models/client/wechat.client.js

@ -103,6 +103,17 @@ class WechatClient extends RedisModel {
                }
            } else {
                if(doctorClient){
                    log.warn("doctor is online, sending via web socket. User id: ", targetUserId);
                    WechatClient.sendViaWebSocket(doctorClient.socket, message);
                }
                if(pc_doctorClient){
                    log.warn("pc_doctor is online, sending via web socket. User id: ", targetUserId);
                    WechatClient.sendViaWebSocket(pc_doctorClient.socket, message);
                }
                log.info("User's wechat endpoint is not online, sending via wechat template message. User id: ", targetUserId);
                var isSendWXTem = true;//是否发送微信模板
                if(message.content_type == CONTENT_TYPES.PrescriptionBloodStatus||message.content_type == CONTENT_TYPES.PrescriptionFollowupContent){