Browse Source

发起和结束咨询的消息由系统发出,发送者ID记录操作人!

8 years ago
parent
commit
b83866d025

+ 5 - 1
src/server/models/client/wechat.client.js

@ -65,15 +65,19 @@ class WechatClient extends RedisModel {
            if (patientClient) {
                log.warn("User's wechat endpoint is online, sending via web socket. User id: ", targetUserId);
                WechatClient.sendViaWebSocket(patientClient.socket, message);
                if(doctorClient){
                    log.error("doctor sessionid "+doctorClient.sessionId);
                    log.error("patient sessionid "+patientClient.sessionId);
                    if(patientClient.sessionId==doctorClient.sessionId){
                    //用户socket在线,推送给用户后,告知医生此消息已读
                        WechatClient.sendReadDoctor(doctorClient.socket, message);
                    }
                }else{
                    log.error("doctor client not found");
                }
            } else {
                log.info("User's wechat endpoint is not online, sending via wechat template message. User id: ", targetUserId);
                WechatClient.sendViaMessageTemplate(targetUserId, targetUserName, message);
            }
        }

+ 1 - 1
src/server/models/sessions/sessions.js

@ -70,7 +70,7 @@ class Sessions extends RedisModel {
                        ModelUtil.emitError(self.eventEmitter, {message: err, status: -1}, null);
                    } else {
                        //更新成为进行中的会话
                        self.updateSessionStatus(sessionId,0);
                       // self.updateSessionStatus(sessionId,0);
                        if (handler) {
                            handler(null, res);
                            return;

+ 1 - 1
src/server/models/sessions/topics.js

@ -172,7 +172,7 @@ class Topics extends RedisModel {
                }
                //返回给前端
                ModelUtil.emitOK(self.eventEmitter, {status: 200, message: "议题创建成功!", start_msg_id: res});
                sessions.updateSessionStatus(sessionId,0);
                //执行数据库操作
                self.saveTopicToMySQL(topicName, topicId, sessionId, res, date, messages.description, TOPIC_STATUS.NEW, function (err, res) {
                    if (err) {