|  | @ -18,6 +18,7 @@ let Users = require('../models/user/users');
 | 
												
													
														
															|  | let ModelUtil = require('../util/model.util.js');
 |  | let ModelUtil = require('../util/model.util.js');
 | 
												
													
														
															|  | let pusher = require('../models/push/pusher.js');
 |  | let pusher = require('../models/push/pusher.js');
 | 
												
													
														
															|  | let AppClient = require('../models/client/app.client.js');
 |  | let AppClient = require('../models/client/app.client.js');
 | 
												
													
														
															|  | 
 |  | let Participants = require('../models/sessions/participants');
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | let sessions = new Sessions();
 |  | let sessions = new Sessions();
 | 
												
													
														
															|  | let users = new Users();
 |  | let users = new Users();
 | 
												
											
												
													
														
															|  | @ -101,7 +102,8 @@ class SocketHandler {
 | 
												
													
														
															|  |                             clientCache.addClient(patientClient);
 |  |                             clientCache.addClient(patientClient);
 | 
												
													
														
															|  |                             users.login(data.userId, 10, '', '');
 |  |                             users.login(data.userId, 10, '', '');
 | 
												
													
														
															|  |                             //修改居民在线状态
 |  |                             //修改居民在线状态
 | 
												
													
														
															|  |                             users.changUserRedisLoginStatus(original_login_userid,data.clientType,1);
 |  | 
 | 
												
													
														
															|  | 
 |  |                             let participants = new Participants();
 | 
												
													
														
															|  | 
 |  |                             participants.changUserRedisLoginStatus(original_login_userid,data.clientType,1,patientClient.sessionId);
 | 
												
													
														
															|  |                             socket.emit('ack', {});
 |  |                             socket.emit('ack', {});
 | 
												
													
														
															|  |                         }else if("pc_patient"===data.clientType || "pc_patient_system"===data.clientType){////新增居民PC外层-登陆类型-20191012-huangnwenjie
 |  |                         }else if("pc_patient"===data.clientType || "pc_patient_system"===data.clientType){////新增居民PC外层-登陆类型-20191012-huangnwenjie
 | 
												
													
														
															|  |                             //用于pcpatient 消息通知
 |  |                             //用于pcpatient 消息通知
 | 
												
											
												
													
														
															|  | @ -113,7 +115,8 @@ class SocketHandler {
 | 
												
													
														
															|  |                             clientCache.addClient(pcpatientClient);
 |  |                             clientCache.addClient(pcpatientClient);
 | 
												
													
														
															|  |                             users.login(data.userId, 10, '', '');
 |  |                             users.login(data.userId, 10, '', '');
 | 
												
													
														
															|  |                             //修改居民在线状态
 |  |                             //修改居民在线状态
 | 
												
													
														
															|  |                             users.changUserRedisLoginStatus(original_login_userid,data.clientType,1);
 |  | 
 | 
												
													
														
															|  | 
 |  |                             let participants = new Participants();
 | 
												
													
														
															|  | 
 |  |                             participants.changUserRedisLoginStatus(original_login_userid,data.clientType,1,pcpatientClient.sessionId);
 | 
												
													
														
															|  |                             socket.emit('ack', {});
 |  |                             socket.emit('ack', {});
 | 
												
													
														
															|  |                         //MDT 登陆类型已迁移到上面的分支-20191012-huangnwenjie
 |  |                         //MDT 登陆类型已迁移到上面的分支-20191012-huangnwenjie
 | 
												
													
														
															|  |                         // }else if("pcim_doctor"===data.clientType){   登
 |  |                         // }else if("pcim_doctor"===data.clientType){   登
 | 
												
											
												
													
														
															|  | @ -133,7 +136,8 @@ class SocketHandler {
 | 
												
													
														
															|  |                             doctorClient.sessionId =  data.sessionId||"";
 |  |                             doctorClient.sessionId =  data.sessionId||"";
 | 
												
													
														
															|  |                             clientCache.addClient(doctorClient);
 |  |                             clientCache.addClient(doctorClient);
 | 
												
													
														
															|  |                             //修改医生在线状态
 |  |                             //修改医生在线状态
 | 
												
													
														
															|  |                             users.changUserRedisLoginStatus(original_login_userid,data.clientType,1);
 |  | 
 | 
												
													
														
															|  | 
 |  |                             let participants = new Participants();
 | 
												
													
														
															|  | 
 |  |                             participants.changUserRedisLoginStatus(original_login_userid,data.clientType,1,doctorClient.sessionId);
 | 
												
													
														
															|  |                             socket.emit('ack', {});
 |  |                             socket.emit('ack', {});
 | 
												
													
														
															|  |                         }
 |  |                         }
 | 
												
													
														
															|  |                     }
 |  |                     }
 | 
												
											
												
													
														
															|  | @ -310,6 +314,12 @@ class SocketHandler {
 | 
												
													
														
															|  |                 if (client) {
 |  |                 if (client) {
 | 
												
													
														
															|  |                     //修改居民在线状态
 |  |                     //修改居民在线状态
 | 
												
													
														
															|  |                     // users.changUserRedisLoginStatus(original_login_userid,client.clientType,0);
 |  |                     // users.changUserRedisLoginStatus(original_login_userid,client.clientType,0);
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |                     //通知会话的其他成员离线消息
 | 
												
													
														
															|  | 
 |  |                     if(client.sessionId !=  "system"){
 | 
												
													
														
															|  | 
 |  |                         let participants = new Participants();
 | 
												
													
														
															|  | 
 |  |                         participants.emitSessionUsers(client.sessionId,client.userId,"offline");
 | 
												
													
														
															|  | 
 |  |                     }
 | 
												
													
														
															|  |                 }
 |  |                 }
 | 
												
													
														
															|  |                 log.info(JSON.stringify(errMsg));
 |  |                 log.info(JSON.stringify(errMsg));
 | 
												
													
														
															|  |                 socket.emit(errMsg);
 |  |                 socket.emit(errMsg);
 | 
												
											
												
													
														
															|  | @ -321,6 +331,12 @@ class SocketHandler {
 | 
												
													
														
															|  |                 if (client) {
 |  |                 if (client) {
 | 
												
													
														
															|  |                     //修改居民在线状态
 |  |                     //修改居民在线状态
 | 
												
													
														
															|  |                     // users.changUserRedisLoginStatus(original_login_userid,client.clientType,0);
 |  |                     // users.changUserRedisLoginStatus(original_login_userid,client.clientType,0);
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |                     //通知会话的其他成员离线消息
 | 
												
													
														
															|  | 
 |  |                     if(client.sessionId !=  "system"){
 | 
												
													
														
															|  | 
 |  |                         let participants = new Participants();
 | 
												
													
														
															|  | 
 |  |                         participants.emitSessionUsers(client.sessionId,client.userId,"offline");
 | 
												
													
														
															|  | 
 |  |                     }
 | 
												
													
														
															|  |                     log.info('User logout: ' + client.userId);
 |  |                     log.info('User logout: ' + client.userId);
 | 
												
													
														
															|  |                     clientCache.removeByUserId(client.userId);
 |  |                     clientCache.removeByUserId(client.userId);
 | 
												
													
														
															|  |                 }
 |  |                 }
 | 
												
											
												
													
														
															|  | @ -332,6 +348,12 @@ class SocketHandler {
 | 
												
													
														
															|  |                 if (patientClient) {
 |  |                 if (patientClient) {
 | 
												
													
														
															|  |                     //修改居民在线状态
 |  |                     //修改居民在线状态
 | 
												
													
														
															|  |                     // users.changUserRedisLoginStatus(original_login_userid,client.clientType,0);
 |  |                     // users.changUserRedisLoginStatus(original_login_userid,client.clientType,0);
 | 
												
													
														
															|  | 
 |  | 
 | 
												
													
														
															|  | 
 |  |                     //通知会话的其他成员离线消息
 | 
												
													
														
															|  | 
 |  |                     if(patientClient.sessionId !=  "system"){
 | 
												
													
														
															|  | 
 |  |                         let participants = new Participants();
 | 
												
													
														
															|  | 
 |  |                         participants.emitSessionUsers(patientClient.sessionId,patientClient.userId,"offline");
 | 
												
													
														
															|  | 
 |  |                     }
 | 
												
													
														
															|  |                     log.info("User disconnect: ", patientClient.userId);
 |  |                     log.info("User disconnect: ", patientClient.userId);
 | 
												
													
														
															|  |                     clientCache.removeByUserSocket(socket);
 |  |                     clientCache.removeByUserSocket(socket);
 | 
												
													
														
															|  |                 }
 |  |                 }
 |