| 
					
				 | 
			
			
				@ -104,6 +104,25 @@ class Patient extends BaseModel { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        }); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 推送群组消息给居民 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * @param message 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    pushGroupMessage(message) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        let self = this; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        // 通过Web Socket推送给患者 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        let patientClient = clientCache.findById(message.to); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        if (!patientClient) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            log.warn("User is not online, user id: ", message.to); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            //发送微信模板消息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            self.sendConsultWechatReplyTempMsg(message); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            return; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        patientClient.socketServer.sockets.emit('message', message); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    }; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				    /** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 发送微信模板消息给居民 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				     * 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -113,10 +132,10 @@ class Patient extends BaseModel { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        let selt = this; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        // 发送微信消息 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        function sendWxMessage(openid, name, consult){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				        function sendWxMessage(openid, name, consult) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            var replyContent = message.content; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            switch(Number.parseInt(message.contentType)){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				            switch (Number.parseInt(message.contentType)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                case CONTENT_TYPES.Image: 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    replyContent = "[图片]"; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                    break; 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@ -178,7 +197,7 @@ class Patient extends BaseModel { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        var name = result[0].name; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                        if (message.group) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            groupRepo.getGroupConsultInfo(message.group, function(err, result){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                            groupRepo.getGroupConsultInfo(message.group, function (err, result) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                if (err) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    modelUtil.emitDbError(self.eventEmitter, "get patient and doctor consult info failed", err); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				                                    return; 
			 |