Sfoglia il codice sorgente

眼科通医生端推送代码提交

huangwenjie 4 anni fa
parent
commit
7ef2040da8

+ 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,//上门服务-变更工单医生信息

+ 14 - 9
src/server/models/client/wechat.client.js

@ -64,15 +64,20 @@ class WechatClient extends RedisModel {
     */
    static sendMessage(targetUserId, targetUserName, message) {
        if (message&&(message.content_type == CONTENT_TYPES.PlainText ||
            message.content_type == CONTENT_TYPES.Image ||
            message.content_type == CONTENT_TYPES.Audio||
            message.content_type == CONTENT_TYPES.PrescriptionBloodStatus ||
            message.content_type == CONTENT_TYPES.PrescriptionFollowupContent ||
            message.content_type == CONTENT_TYPES.ReservationDoorCardInfo ||
            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.Image ||
                message.content_type == CONTENT_TYPES.Audio||
                message.content_type == CONTENT_TYPES.PrescriptionBloodStatus ||
                message.content_type == CONTENT_TYPES.PrescriptionFollowupContent ||
                message.content_type == CONTENT_TYPES.ReservationDoorCardInfo ||
                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.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);

+ 21 - 5
src/server/models/sessions/sessions.js

@ -710,6 +710,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,
@ -727,7 +741,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);
@ -1704,10 +1719,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) {
                    Sessions.pushNotification(participant.id, participant.name, message,sessionType);
                }
                // if (
                //     // participant.id !== message.sender_id &&
                //     participant.participant_role == PARTICIPANT_ROLES.HOST) {
                Sessions.pushNotification(participant.id, participant.name, message,sessionType);
                // }
            });
        }
    }