huangwenjie vor 4 Jahren
Ursprung
Commit
f88a037d81

+ 6 - 0
src/server/include/commons.js

@ -101,6 +101,12 @@ const CONTENT_TYPES = {
    PrescriptionFollowupContent:17,//续方咨询随访问卷消息
    Rehabilitation: 20, //康复计划发送
    VideoAnswerStatus: 29, //视屏请求
    HospiatlForward: 30, //互联网医院转发
    PrescriptionSuggest: 31, //会诊建议
    Screening: 32, //疾病筛查卡片消息
    PrescriptionReject: 33, //处方驳回消息
    ConsultSuggest: 34, //咨询建议
    PayMessage: 35, //支付消息
    ReservationDoorCardInfo: 2101,//上门服务-预约工单卡片信息
    ChangeDoorCardInfo: 2102,//上门服务-修改工单卡片信息
    ChangeDoorDoctor: 2103,//上门服务-变更工单医生信息

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

@ -72,7 +72,12 @@ class WechatClient extends RedisModel {
            message.content_type == CONTENT_TYPES.ChangeDoorCardInfo ||
            message.content_type == CONTENT_TYPES.ChangeDoorDoctor ||
            message.content_type == CONTENT_TYPES.ChangeDoorPackageItems ||
            message.content_type == CONTENT_TYPES.VideoAnswerStatus
            message.content_type == CONTENT_TYPES.VideoAnswerStatus ||
            message.content_type == CONTENT_TYPES.Screening ||
            message.content_type == CONTENT_TYPES.PrescriptionReject ||
            message.content_type == CONTENT_TYPES.PrescriptionSuggest ||
            message.content_type == CONTENT_TYPES.ConsultSuggest ||
            message.content_type == CONTENT_TYPES.PayMessage
            )) {
            let patientClient = clientCache.findById(targetUserId);
            let pc_patientClient = clientCache.findById("pcpatient_"+targetUserId);

+ 26 - 4
src/server/models/sessions/sessions.js

@ -508,6 +508,7 @@ class Sessions extends RedisModel {
                                let userRoles = res[5];
                                let participantsTime = [];
                                let isInvite = true;
                                let backTopid = null;
                                //处理session未加入redis的bug
@ -604,15 +605,19 @@ class Sessions extends RedisModel {
                                                    // cache topics for MUC
                                                    let topicsKey = RedisModel.makeRedisKey(REDIS_KEYS.Topics, sessionId);
                                                    log.info("gettopicid====")
                                                    TopicRepo.findAllBySessionId(sessionId, function (err, topics) {
                                                        log.info("gettopicid====1")
                                                        if (err) {
                                                            ModelUtil.emitError(self.eventEmitter, err.message);
                                                            return;
                                                        }
                                                        topics.forEach(function (topic) {
                                                            log.info("gettopicid====2")
                                                            let topicKey = RedisModel.makeRedisKey(REDIS_KEYS.Topic, topic.id);
                                                            let topicId = topic.id;
                                                            backTopid = topicId;
                                                            let name = topic.name == null ? "" : topic.name;
                                                            let createTime = ObjectUtil.timestampToLong(topic.create_time);
                                                            let endBy = topic.end_by == null ? "" : topic.end_by;
@ -632,6 +637,7 @@ class Sessions extends RedisModel {
                                                                    'start_message_id', startMessageId,
                                                                    'end_message_id', endMessageId,
                                                                    'description', description,
                                                                    'topic_id', topicId,
                                                                    'status', status)
                                                                .execAsync()
                                                                .catch(function (ex) {
@ -697,6 +703,20 @@ class Sessions extends RedisModel {
                                            log.info("2.session.name:" + sessionName);
                                            log.info("2.session.business_type:" + session.business_type);
                                            TopicRepo.findAllBySessionId(sessionId, function (err, topics) {
                                                log.info("gettopicid====1")
                                                if (err) {
                                                    ModelUtil.emitError(self.eventEmitter, err.message);
                                                    return;
                                                }
                                                topics.forEach(function (topic) {
                                                    log.info("gettopicid====2")
                                                    let topicKey = RedisModel.makeRedisKey(REDIS_KEYS.Topic, topic.id);
                                                    let topicId = topic.id;
                                                });
                                            });
                                            sessionList.push({
                                                id: sessionId,
                                                name: sessionName,
@ -714,7 +734,8 @@ class Sessions extends RedisModel {
                                                sender_birthday: bir,
                                                participantsTimeArray:participantsTime,
                                                status:session.status,
                                                is_invite:isInvite
                                                is_invite:isInvite,
                                                backTopid:backTopid
                                            });
                                            index = (parseInt(index) + 1);
@ -1654,10 +1675,11 @@ class Sessions extends RedisModel {
        });
        function callPush(participants,message){
            participants.forEach(function (participant) {
                if (participant.id !== message.sender_id &&
                    participant.participant_role == PARTICIPANT_ROLES.HOST) {
                // if (
                //     // participant.id !== message.sender_id &&
                //     participant.participant_role == PARTICIPANT_ROLES.HOST) {
                    Sessions.pushNotification(participant.id, participant.name, message,sessionType);
                }
                // }
            });
        }
    }