|
@ -123,9 +123,13 @@ class Sessions extends RedisModel {
|
|
|
}
|
|
|
|
|
|
function callBusinessType(sessionId) {
|
|
|
ParticipantRepo.getBusinessType(participantIdArray, function (err, businessType) {
|
|
|
callCreate(sessionId, businessType);
|
|
|
});
|
|
|
if(type == SESSION_TYPES.MUC){
|
|
|
callCreate(sessionId, SESSION_BUSINESS_TYPE.PATIENT);
|
|
|
}else {
|
|
|
ParticipantRepo.getBusinessType(participantIdArray, function (err, businessType) {
|
|
|
callCreate(sessionId, businessType);
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
|
|
|
function callCreate(sessionId, businessType) {
|
|
@ -186,13 +190,17 @@ class Sessions extends RedisModel {
|
|
|
|
|
|
//流程2-判断session的业务类型;
|
|
|
function callBusinessType() {
|
|
|
ParticipantRepo.getBusinessType(participantIdArray, function (err, businessType) {
|
|
|
if (err) {
|
|
|
handler(err, null);
|
|
|
return;
|
|
|
}
|
|
|
callCreateSession(businessType);
|
|
|
});
|
|
|
if(type==SESSION_TYPES.MUC){
|
|
|
callCreateSession(SESSION_BUSINESS_TYPE.PATIENT);
|
|
|
}else{
|
|
|
ParticipantRepo.getBusinessType(participantIdArray, function (err, businessType) {
|
|
|
if (err) {
|
|
|
handler(err, null);
|
|
|
return;
|
|
|
}
|
|
|
callCreateSession(businessType);
|
|
|
});
|
|
|
}
|
|
|
}
|
|
|
|
|
|
//流程3-发起session创建 返回session实例
|
|
@ -1313,15 +1321,20 @@ class Sessions extends RedisModel {
|
|
|
* 针对MUC模式更新会话的当前状态
|
|
|
* @param sessionId
|
|
|
*/
|
|
|
updateSessionStatus(sessionId,status){
|
|
|
updateSessionStatus(sessionId,status,handler){
|
|
|
let self = this;
|
|
|
let sessionKey = RedisModel.makeRedisKey(REDIS_KEYS.Session,sessionId);
|
|
|
redis.hsetAsync(sessionKey,"status",status).then(function(res){
|
|
|
SessionRepo.updateSessionStatus(sessionId,status,function(err,sqlResult){
|
|
|
if(handler){
|
|
|
handler(err,sqlResult);
|
|
|
return;
|
|
|
}
|
|
|
if(err){
|
|
|
logger.error("set session status to mysql is error !");
|
|
|
}else{
|
|
|
logger.info("set session status is success");
|
|
|
ModelUtil.emitOK(self.eventEmitter, []);
|
|
|
}
|
|
|
});
|
|
|
});
|