Browse Source

Merge branch 'feature-refactor' of huangwenjie/im.doctor into feature-refactor

huangwenjie 5 years ago
parent
commit
42f429ec10
2 changed files with 13 additions and 0 deletions
  1. 1 0
      src/server/include/commons.js
  2. 12 0
      src/server/models/client/wechat.client.js

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

@ -95,6 +95,7 @@ const CONTENT_TYPES = {
    PrescriptionBloodStatus:16,//续方咨询血糖血压咨询消息
    PrescriptionFollowupContent:17,//续方咨询随访问卷消息
    Rehabilitation: 20, //康复计划发送
    ReservationDoorCardInfo: 2101,//上门服务-预约工单卡片信息
    ChangeDoorCardInfo: 2102,//上门服务-修改工单卡片信息
    ChangeDoorDoctor: 2103,//上门服务-变更工单医生信息
    ChangeDoorPackageItems:2104, //上门服务-变更工单服务项信息

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

@ -63,6 +63,7 @@ class WechatClient extends RedisModel {
            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)) {
@ -102,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){