Ver código fonte

Merge branch 'srx' of yeshijie/im.doctor into srx

yeshijie 7 anos atrás
pai
commit
39e7bdfb1a

+ 23 - 25
src/server/models/client/app.client.js

@ -157,31 +157,29 @@ class AppClient extends RedisModel {
                    ModelUtil.logError("Get user app status failed", err);
                    return;
                }
                AppClient.sendNotice(targetId, message, sessionType,badge,userStatus);
                // var session_type = isNaN(Number(sessionType))?sessionType:Number(sessionType);
                // if(session_type==SESSION_TYPES.SYSTEM||
                //     session_type==SESSION_TYPES.MUC||
                //     session_type==SESSION_TYPES.P2P||
                //     session_type==SESSION_TYPES.GROUP||
                //     session_type==SESSION_TYPES.DISCUSSION||
                //     session_type==SESSION_TYPES.PRESCRIPTION){
                //     //是否发送消息
                //     MessageNoticeSettingRepo.findOne(targetId,'1',function (err,res) {
                //         if(res&&res.length>0){
                //             let master_switch = res[0].master_switch;
                //             let im_switch = res[0].im_switch;
                //             let family_topic_switch = res[0].family_topic_switch;
                //             if(master_switch==0||im_switch==0){
                //                 ModelUtil.logError(targetId+"-关闭im消息,消息id", message.id);
                //             }
                //             else{
                //                 AppClient.sendNotice(targetId, message, sessionType,badge,userStatus);
                //             }
                //         }
                //     });
                // }else{
                //     AppClient.sendNotice(targetId, message, sessionType,badge,userStatus);
                // }
                var session_type = isNaN(Number(sessionType))?sessionType:Number(sessionType);
                if(session_type==SESSION_TYPES.SYSTEM||
                    session_type==SESSION_TYPES.MUC||
                    session_type==SESSION_TYPES.P2P||
                    session_type==SESSION_TYPES.GROUP||
                    session_type==SESSION_TYPES.DISCUSSION||
                    session_type==SESSION_TYPES.PRESCRIPTION){
                    //是否发送消息
                    MessageNoticeSettingRepo.findOne(targetId,'1',function (err,res) {
                        if(res&&res.length>0){
                            let master_switch = res[0].master_switch;
                            let im_switch = res[0].im_switch;
                            if(master_switch==0||im_switch==0){
                                ModelUtil.logError(targetId+"-关闭im消息,消息id", message.id);
                            }
                            else{
                                AppClient.sendNotice(targetId, message, sessionType,badge,userStatus);
                            }
                        }
                    });
                }else{
                    AppClient.sendNotice(targetId, message, sessionType,badge,userStatus);
                }
            });
        }

+ 8 - 8
src/server/repository/mysql/topics.repo.js

@ -64,13 +64,13 @@ class TopicRepo {
        if(status==10){
            args.push(userId,status,page,size);
            sql =  "SELECT t.*, s.avatar,s.sex,s.birthdate, s.`name` AS patient_name,c.doctor FROM "+
                  DB_TABLES.Topics+" t,"+DB_TABLES.Participants+" p,"+DB_TABLES.Doctors+" d,"+DB_TABLES.WlyyConsult+" c,"+DB_TABLES.Patients+" s "+
                  DB_TABLES.Topics+" t,"+DB_TABLES.Participants+" p,"+DB_TABLES.Doctors+" d,"+DB_TABLES.WlyyConsultS+" c,"+DB_TABLES.Patients+" s "+
                  "WHERE d.id = p.participant_id AND c.id = t.id AND c.patient = s.id AND p.session_id = t.session_id "+
                  "AND d.id in (?) AND t. STATUS = ? ORDER BY create_time DESC limit ?,?";
        }else{
            args.push(userId,status,reply,page,size);
            sql =  "SELECT t.*, s.avatar,s.sex,s.birthdate, s.`name` AS patient_name,c.doctor FROM "+
                DB_TABLES.Topics+" t,"+DB_TABLES.Participants+" p,"+DB_TABLES.Doctors+" d,"+DB_TABLES.WlyyConsult+" c,"+DB_TABLES.Patients+" s "+
                DB_TABLES.Topics+" t,"+DB_TABLES.Participants+" p,"+DB_TABLES.Doctors+" d,"+DB_TABLES.WlyyConsultS+" c,"+DB_TABLES.Patients+" s "+
                "WHERE d.id = p.participant_id AND c.id = t.id AND c.patient = s.id AND p.session_id = t.session_id "+
                "AND d.id in (?) AND t. STATUS = ? and t.reply=? ORDER BY create_time DESC limit ?,?";
        }
@ -98,13 +98,13 @@ class TopicRepo {
        if(status==10){
            args.push(userId,status,page,size);
            sql =  "SELECT t.*, s.avatar,s.sex,s.birthdate, s.`name` AS patient_name,c.doctor FROM "+
                DB_TABLES.Topics+" t,"+DB_TABLES.Participants+" p,"+DB_TABLES.Doctors+" d,"+DB_TABLES.WlyyConsult+" c,"+DB_TABLES.Patients+" s "+
                DB_TABLES.Topics+" t,"+DB_TABLES.Participants+" p,"+DB_TABLES.Doctors+" d,"+DB_TABLES.WlyyConsultS+" c,"+DB_TABLES.Patients+" s "+
                "WHERE d.id = p.participant_id AND c.id = t.id AND c.patient = s.id AND p.session_id = t.session_id "+
                "AND d.id in (?) AND t. STATUS = ? AND c.type not in ('6','8') ORDER BY create_time DESC limit ?,?";
        }else{
            args.push(userId,status,reply,page,size);
            sql =  "SELECT t.*, s.avatar,s.sex,s.birthdate, s.`name` AS patient_name,c.doctor FROM "+
                DB_TABLES.Topics+" t,"+DB_TABLES.Participants+" p,"+DB_TABLES.Doctors+" d,"+DB_TABLES.WlyyConsult+" c,"+DB_TABLES.Patients+" s "+
                DB_TABLES.Topics+" t,"+DB_TABLES.Participants+" p,"+DB_TABLES.Doctors+" d,"+DB_TABLES.WlyyConsultS+" c,"+DB_TABLES.Patients+" s "+
                "WHERE d.id = p.participant_id AND c.id = t.id AND c.patient = s.id AND p.session_id = t.session_id "+
                "AND d.id in (?) AND t. STATUS = ? and t.reply=? AND c.type not in ('6','8') ORDER BY create_time DESC limit ?,?";
        }
@ -143,13 +143,13 @@ class TopicRepo {
        if(status==10){
            args.push(userId,status,type,page,size);
            sql =  "SELECT t.*, s.avatar,s.sex,s.birthdate, s.`name` AS patient_name,c.doctor FROM "+
                DB_TABLES.Topics+" t,"+DB_TABLES.Participants+" p,"+DB_TABLES.Doctors+" d,"+DB_TABLES.WlyyConsult+" c,"+DB_TABLES.Patients+" s "+
                DB_TABLES.Topics+" t,"+DB_TABLES.Participants+" p,"+DB_TABLES.Doctors+" d,"+DB_TABLES.WlyyConsultS+" c,"+DB_TABLES.Patients+" s "+
                "WHERE d.id = p.participant_id AND c.id = t.id AND c.patient = s.id AND p.session_id = t.session_id "+
                "AND d.id in (?) AND t. STATUS = ? AND c.type =? "+tempParms+" ORDER BY create_time DESC limit ?,?";
        }else{
            args.push(userId,status,reply,type,page,size);
            sql =  "SELECT t.*, s.avatar,s.sex,s.birthdate, s.`name` AS patient_name,c.doctor FROM "+
                DB_TABLES.Topics+" t,"+DB_TABLES.Participants+" p,"+DB_TABLES.Doctors+" d,"+DB_TABLES.WlyyConsult+" c,"+DB_TABLES.Patients+" s "+
                DB_TABLES.Topics+" t,"+DB_TABLES.Participants+" p,"+DB_TABLES.Doctors+" d,"+DB_TABLES.WlyyConsultS+" c,"+DB_TABLES.Patients+" s "+
                "WHERE d.id = p.participant_id AND c.id = t.id AND c.patient = s.id AND p.session_id = t.session_id "+
                "AND d.id in (?) AND t. STATUS = ? and t.reply=? AND c.type = ? "+tempParms+" ORDER BY create_time DESC limit ?,?";
        }
@ -186,13 +186,13 @@ class TopicRepo {
        if(status==10){
            args.push(userId,status,type);
            sql =  "SELECT count(t.id) count FROM "+
                DB_TABLES.Topics+" t,"+DB_TABLES.Participants+" p,"+DB_TABLES.Doctors+" d,"+DB_TABLES.WlyyConsult+" c,"+DB_TABLES.Patients+" s "+
                DB_TABLES.Topics+" t,"+DB_TABLES.Participants+" p,"+DB_TABLES.Doctors+" d,"+DB_TABLES.WlyyConsultS+" c,"+DB_TABLES.Patients+" s "+
                "WHERE d.id = p.participant_id AND c.id = t.id AND c.patient = s.id AND p.session_id = t.session_id "+
                "AND d.id in (?) AND t. STATUS = ? AND c.type =? "+tempParms;
        }else{
            args.push(userId,status,reply,type);
            sql =  "SELECT count(t.id) count FROM "+
                DB_TABLES.Topics+" t,"+DB_TABLES.Participants+" p,"+DB_TABLES.Doctors+" d,"+DB_TABLES.WlyyConsult+" c,"+DB_TABLES.Patients+" s "+
                DB_TABLES.Topics+" t,"+DB_TABLES.Participants+" p,"+DB_TABLES.Doctors+" d,"+DB_TABLES.WlyyConsultS+" c,"+DB_TABLES.Patients+" s "+
                "WHERE d.id = p.participant_id AND c.id = t.id AND c.patient = s.id AND p.session_id = t.session_id "+
                "AND d.id in (?) AND t. STATUS = ? and t.reply=? AND c.type = ? "+tempParms;
        }

+ 4 - 1
src/server/repository/redis/redis.client.js

@ -26,9 +26,12 @@ class RedisClient {
        var redisConfig = config.redisConfig;
            redisConfig.retry_strategy = function(options){
                log.info("重新连接次数:"+options.times_connected);
                if (options.error.code === 'ECONNREFUSED') {
                if (options.error && options.error.code === 'ECONNREFUSED') {
                    log.error('连接被拒绝');
                }
                if (options.total_retry_time > 1000 * 60 * 60) {
                    log.error('重试时间耗尽');
                }
                if (options.times_connected > 10) {
                    log.error('重试连接超过十次');
                }

+ 4 - 4
src/server/resources/config/config.dev.js

@ -53,13 +53,13 @@ let getTuiConfig = {
// 微信配置
let wechatConfig = {
    appId: 'wxe627ffaee2d05a40',
    appSecret: '7c29f6b28be7e54b742883a47ff39767',
    appId: 'wx0a06b75a40b28f2a',
    appSecret: 'd46ecfb0fc6fc8bc699b77f93b2a1e20',
    token: '27eb3bb24f149a7760cf1bb154b08040',
    accId: 'gh_733f975e0bed',
    accId: 'gh_9386c9ab884f',
    baseUrl: 'srijk.yihu.com/wlyy',
    template: {
        consultTemplate: '-dr4QNyFoRvVsf8uWxXMC1dRyjwnbUuJwJ21vBLhf18'  // 咨询回复模板
        consultTemplate: 'fadxatOcyNG3ihvJg-OZsq8EzQyLDNljogv6V-Hxshc'  // 咨询回复模板
    }
};