Пример #1
0
        public override void ProcessMessage()
        {
            OutObject = new YUYUEJLCX_OUT();
            string jiuzhenKh = InObject.JIUZHENKH;                               //就诊卡号

            string xingMing    = InObject.XINGMING;                              //姓名
            string zhengjianHm = InObject.ZHENGJIANHM;                           //证件号码
            string lianxiDh    = InObject.LIANXIDH;                              //联系电话
            string yuyuerq     = InObject.YUYUERQ;                               //预约日期
            string quHaoZt     = InObject.QUHAOZT;                               //取号状态

            string yuYueCZFS = ConfigurationManager.AppSettings["GUAHAOYYCZFS"]; //挂号预约处理方式

            if (!string.IsNullOrEmpty(yuYueCZFS) && yuYueCZFS == "1")
            {
                if (string.IsNullOrEmpty(lianxiDh))
                {
                    throw new Exception("联系电话不能为空!");
                }
                string    yyjlcx = @"  select xingming,jiuzhenyyid yuyueid,jiuzhenyyid quhaomm,yishengid yishengdm,(select zhigongxm from gy_zhigongxx where zhigongid = a.yishengid ) yishengxm,keshiid keshidm,(select keshimc from gy_keshi where keshiid = a.keshiid) keshimc,to_char(yuyuesj,'yyyy-mm-dd') riqi,
                            to_Char(yuyuesj,'hh24:mi:ss') jiuzhensj,guahaoyyxh guahaoxh,decode(shangxiawbz,0,1,2) guahaobc,DIANHUA,YUYUEZT,CAOZUORQ,paibanid,beizhu  from v_mz_guahaoyyxh_yshyh  a  where dianhua = '{0}' ";
                DataTable dtYYJL = DBVisitor.ExecuteTable(string.Format(yyjlcx, lianxiDh));

                if (dtYYJL.Rows.Count <= 0)
                {
                    throw new Exception("未找到预约记录!");
                }

                for (int i = 0; i < dtYYJL.Rows.Count; i++)
                {
                    YUYUEXX yuyuexx = new YUYUEXX();
                    yuyuexx.BINGRENXM = dtYYJL.Rows[i]["xingming"].ToString();  //病人姓名
                    yuyuexx.YUYUEID   = dtYYJL.Rows[i]["yuyueid"].ToString();   //预约ID
                    yuyuexx.QUHAOMM   = dtYYJL.Rows[i]["quhaomm"].ToString();   //取号密码
                    yuyuexx.GUAHAOBC  = dtYYJL.Rows[i]["guahaobc"].ToString();  //挂号班次
                    yuyuexx.GUAHAOXH  = dtYYJL.Rows[i]["guahaoxh"].ToString();  //挂号序号
                    yuyuexx.JIUZHENSJ = dtYYJL.Rows[i]["jiuzhensj"].ToString(); //就诊时间
                    yuyuexx.KESHIDM   = dtYYJL.Rows[i]["keshidm"].ToString();   //科室代码
                    yuyuexx.KESHIMC   = dtYYJL.Rows[i]["keshimc"].ToString();   //科室名称
                    yuyuexx.YISHENGDM = dtYYJL.Rows[i]["yishengdm"].ToString(); //医生代码
                    yuyuexx.YISHENGXM = dtYYJL.Rows[i]["yishengxm"].ToString(); //医生姓名
                    yuyuexx.RIQI      = dtYYJL.Rows[i]["riqi"].ToString();      //就诊日期
                    yuyuexx.YUYUESJ   = dtYYJL.Rows[i]["caozuorq"].ToString();
                    yuyuexx.YUYUEZT   = dtYYJL.Rows[i]["yuyuezt"].ToString();
                    yuyuexx.BEIZHU    = dtYYJL.Rows[i]["beizhu"].ToString();
                    if (yuyuexx.YUYUEZT == "0")
                    {
                        yuyuexx.YUYUEZTSM = "未挂号";
                    }
                    else if (yuyuexx.YUYUEZT == "1")
                    {
                        yuyuexx.YUYUEZTSM = "已挂号";
                    }
                    else if (yuyuexx.YUYUEZT == "2")
                    {
                        yuyuexx.YUYUEZTSM = "预约取消";
                    }
                    else if (yuyuexx.YUYUEZT == "3")
                    {
                        yuyuexx.YUYUEZTSM = "预约过期";
                    }

                    string paiBanID = dtYYJL.Rows[i]["paibanid"].ToString();
                    OutObject.YUYUEMX.Add(yuyuexx);
                }
            }
            else
            {
                #region 标准his4业务流程

                #endregion
                #region 入参判断
                if (string.IsNullOrEmpty(jiuzhenKh) && string.IsNullOrEmpty(zhengjianHm))
                {
                    throw new Exception("就诊卡号和证件号码不能同时为空");
                }
                //if (string.IsNullOrEmpty(lianxiDh))
                //{
                //    throw new Exception("联系电话不能为空");
                //}
                #endregion
                StringBuilder sbSql = new StringBuilder("select a.yuyueid, a.yuyuezt,to_char(a.caozuorq,'yyyy-mm-dd hh24:mi:ss') caozuorq, a.yuyuehao quhaomm,decode(a.shangxiawbz,'0','上午','1','下午','其他') guahaobc,a.guahaoxh, ");
                sbSql.Append("to_char(a.yuyuesj,'yyyy-mm-dd hh24:mi:ss') jiuzhensj,a.yuyueks keshidm,a.yuyueksmc keshimc,a.paibanid, ");       //
                sbSql.Append("a.yuyueys yishengdm,a.yuyueysxm yishengxm,to_char(a.yuyuesj,'yyyy-mm-dd') riqi from mz_guahaoyy a  WHERE 1=1 "); //
                if (!string.IsNullOrEmpty(jiuzhenKh))
                {
                    sbSql.Append("and a.jiuzhenkh='" + jiuzhenKh + "' ");
                }
                //if (jiuzhenkLx != string.Empty)
                //    sbSql.Append("and a.jiuzhenkLx='" + jiuzhenkLx + "' ");//?
                if (!string.IsNullOrEmpty(xingMing))
                {
                    sbSql.Append("and a.xingming ='" + xingMing + "' ");
                }
                if (!string.IsNullOrEmpty(zhengjianHm))
                {
                    sbSql.Append("and a.shenfenzh ='" + zhengjianHm + "' ");
                }
                if (!string.IsNullOrEmpty(lianxiDh))
                {
                    sbSql.Append("and a.lianxirdh ='" + lianxiDh + "' ");
                }
                if (!string.IsNullOrEmpty(yuyuerq))
                {
                    sbSql.Append(" and to_char(a.yuyuesj,'yyyy-mm-dd') ='" + yuyuerq + "' ");
                }
                if (quHaoZt != "4")
                {
                    if (!string.IsNullOrEmpty(quHaoZt))
                    {
                        sbSql.Append(" and a.yuyuezt =" + quHaoZt + " ");
                    }
                }
                sbSql.Append(" order by a.caozuorq desc ");
                DataTable dt = DBVisitor.ExecuteTable(sbSql.ToString());
                if (dt.Rows.Count == 0)
                {
                    throw new Exception("未找到预约记录");
                }
                else
                {
                    for (int i = 0; i < dt.Rows.Count; i++)
                    {
                        YUYUEXX yuyuexx = new YUYUEXX();
                        yuyuexx.YUYUEID   = dt.Rows[i]["yuyueid"].ToString();   //预约ID
                        yuyuexx.QUHAOMM   = dt.Rows[i]["quhaomm"].ToString();   //取号密码
                        yuyuexx.GUAHAOBC  = dt.Rows[i]["guahaobc"].ToString();  //挂号班次
                        yuyuexx.GUAHAOXH  = dt.Rows[i]["guahaoxh"].ToString();  //挂号序号
                        yuyuexx.JIUZHENSJ = dt.Rows[i]["jiuzhensj"].ToString(); //就诊时间
                        yuyuexx.KESHIDM   = dt.Rows[i]["keshidm"].ToString();   //科室代码
                        yuyuexx.KESHIMC   = dt.Rows[i]["keshimc"].ToString();   //科室名称
                        yuyuexx.YISHENGDM = dt.Rows[i]["yishengdm"].ToString(); //医生代码
                        yuyuexx.YISHENGXM = dt.Rows[i]["yishengxm"].ToString(); //医生姓名
                        yuyuexx.RIQI      = dt.Rows[i]["riqi"].ToString();      //就诊日期
                        yuyuexx.YUYUESJ   = dt.Rows[i]["caozuorq"].ToString();
                        yuyuexx.YUYUEZT   = dt.Rows[i]["yuyuezt"].ToString();
                        if (yuyuexx.YUYUEZT == "0")
                        {
                            yuyuexx.YUYUEZTSM = "未挂号";
                        }
                        else if (yuyuexx.YUYUEZT == "1")
                        {
                            yuyuexx.YUYUEZTSM = "已挂号";
                        }
                        else if (yuyuexx.YUYUEZT == "2")
                        {
                            yuyuexx.YUYUEZTSM = "预约取消";
                        }
                        else if (yuyuexx.YUYUEZT == "3")
                        {
                            yuyuexx.YUYUEZTSM = "预约过期";
                        }

                        string    paiBanID     = dt.Rows[i]["paibanid"].ToString();
                        string    shouFeiXMSql = "select zhenliaofxm,guahaofxm from mz_v_guahaopb_ex_zzj where paibanid = '{0}' ";
                        DataTable dtShouFeiXM  = DBVisitor.ExecuteTable(string.Format(shouFeiXMSql, paiBanID));
                        if (dtShouFeiXM.Rows.Count > 0)
                        {
                            string zhenLiaoFXM = dtShouFeiXM.Rows[0]["zhenliaofxm"].ToString();
                            string guaHaoFXM   = dtShouFeiXM.Rows[0]["guahaofxm"].ToString();
                            yuyuexx.GUAHAOF   = Unity.GetXiangMuFY(guaHaoFXM);
                            yuyuexx.ZHENLIAOF = Unity.GetXiangMuFY(zhenLiaoFXM);
                        }

                        OutObject.YUYUEMX.Add(yuyuexx);
                    }
                }
            }
        }
Пример #2
0
        public override void ProcessMessage()
        {
            OutObject = new YIYUANPAIBANXX_OUT();
            string guaHaoFS  = InObject.GUAHAOFS;  //1 挂号 2 预约
            string riQi      = InObject.RIQI;      //日期
            string guaHaoBC  = InObject.GUAHAOBC;  //挂号班次 0 全天 1上午 2下午
            string keShiDM   = InObject.KESHIDM;   //科室代码
            string yiShengDM = InObject.YISHENGDM; //医生代码
            string guaHaoLB  = InObject.GUAHAOLB;  //挂号类别
            string yuYueLX   = InObject.YUYUELX;   //预约类型

            #region 基本入参判断
            if (string.IsNullOrEmpty(guaHaoFS))
            {
                throw new Exception("挂号方式不能为空!");
            }
            else if (guaHaoFS != "1" && guaHaoFS != "2")
            {
                throw new Exception("请传入正确的挂号方式,1 当天挂号 2 挂号预约!");
            }

            if (string.IsNullOrEmpty(guaHaoBC))
            {
                throw new Exception("挂号班次不能为空!");
            }
            else if (guaHaoBC != "0" && guaHaoBC != "1" && guaHaoBC != "2")
            {
                throw new Exception("请传入正确的挂号班次,0 全天 1 上午 2 下午");
            }

            if (guaHaoFS == "2" && string.IsNullOrEmpty(yuYueLX))
            {
                yuYueLX = ConfigurationManager.AppSettings["GuaHaoYYLX"];
            }

            if (guaHaoFS == "1" && string.IsNullOrEmpty(riQi))
            {
                riQi = DateTime.Now.ToString("yyyy-MM-dd");
            }
            #endregion
            StringBuilder sqlPaiBanXX = new StringBuilder();
            if (guaHaoFS == "1")
            {
                #region 当天挂号
                if (guaHaoBC == "0")
                {
                    sqlPaiBanXX.Append(" select * from ( ");
                }
                if (guaHaoBC == "1" || guaHaoBC == "0")
                {
                    sqlPaiBanXX.Append(" select A.PAIBANID,to_Char(A.RIQI,'yyyy-mm-dd') as PAIBANRQ,a.GUAHAOLB,1 as GUAHAOBC,A.KESHIID,C.keshimc,NVL(A.WEIZHI,C.weizhism) as JIUZHENDD, ");
                    sqlPaiBanXX.Append(" c.keshizl as KESHIJS,nvl(a.YISHENGID,'*') as YISHENGDM,nvl(d.zhigongxm,'普通') as YISHENGXM , e.daimamc as YISHENGZC,a.ZHENLIAOFXM,a.GUAHAOFXM, ");
                    sqlPaiBanXX.Append(" NVL(a.SHANGWUXH,0) AS HAOYUANZS,NVL(a.SHANGWUXH,0)-NVL(a.SHANGWUYGH,0) AS SHENGYUHY ,'' as YUYUELX ");
                    sqlPaiBanXX.Append(" from mz_v_guahaopb_ex_zzj a ,v_gy_keshi c,v_gy_zhigongxx d , ");
                    sqlPaiBanXX.Append(" (select * from gy_daima where daimalb='0072') e  ");
                    sqlPaiBanXX.Append(" where a.keshiid=c.keshiid and d.zhigongid(+) = a.YISHENGID and e.daimaid(+) = d.zhicheng  ");

                    sqlPaiBanXX.Append(" and to_char(a.riqi,'yyyy-mm-dd')='" + riQi + "' ");
                    sqlPaiBanXX.Append("  and a.shangwuxh > 0 ");
                    if (!string.IsNullOrEmpty(keShiDM))
                    {
                        sqlPaiBanXX.Append(" and nvl(a.keshiid,'*') = '" + keShiDM + "' ");
                    }
                    if (!string.IsNullOrEmpty(yiShengDM))
                    {
                        sqlPaiBanXX.Append(" and nvl(a.yishengid,'*') = '" + yiShengDM + "' ");
                    }
                    if (!string.IsNullOrEmpty(guaHaoLB) && guaHaoLB != "0")
                    {
                        sqlPaiBanXX.Append(" and a.guahaolb = " + guaHaoLB + " ");
                    }
                }
                if (guaHaoBC == "0")
                {
                    sqlPaiBanXX.Append(" union all ");
                }
                if (guaHaoBC == "2" || guaHaoBC == "0")
                {
                    sqlPaiBanXX.Append(" select A.PAIBANID,to_Char(A.RIQI,'yyyy-mm-dd') as PAIBANRQ,a.GUAHAOLB,2 as GUAHAOBC,A.KESHIID,C.keshimc,NVL(A.WEIZHI,C.weizhism) as JIUZHENDD, ");
                    sqlPaiBanXX.Append(" c.keshizl as KESHIJS,nvl(a.YISHENGID,'*') as YISHENGDM,nvl(d.zhigongxm,'普通') as YISHENGXM , e.daimamc as YISHENGZC,a.ZHENLIAOFXM,a.GUAHAOFXM, ");
                    sqlPaiBanXX.Append(" NVL(a.XIAWUXH,0) AS HAOYUANZS,NVL(a.XIAWUXH,0)-NVL(a.XIAWUYGH,0) AS SHENGYUHY, '' as YUYUELX ");
                    sqlPaiBanXX.Append(" from mz_v_guahaopb_ex_zzj a ,v_gy_keshi c,v_gy_zhigongxx d , ");
                    sqlPaiBanXX.Append(" (select * from gy_daima where daimalb='0072') e  ");
                    sqlPaiBanXX.Append(" where a.keshiid=c.keshiid and d.zhigongid(+) = a.YISHENGID and e.daimaid(+) = d.zhicheng  ");

                    sqlPaiBanXX.Append(" and to_char(a.riqi,'yyyy-mm-dd')='" + riQi + "' ");
                    sqlPaiBanXX.Append("  and a.xiawuxh > 0 ");

                    if (!string.IsNullOrEmpty(keShiDM))
                    {
                        sqlPaiBanXX.Append(" and nvl(a.keshiid,'*') = '" + keShiDM + "' ");
                    }
                    if (!string.IsNullOrEmpty(yiShengDM))
                    {
                        sqlPaiBanXX.Append(" and nvl(a.yishengid,'*') = '" + yiShengDM + "' ");
                    }
                    if (!string.IsNullOrEmpty(guaHaoLB) && guaHaoLB != "0")
                    {
                        sqlPaiBanXX.Append(" and a.guahaolb = " + guaHaoLB + " ");
                    }
                }
                if (guaHaoBC == "0")
                {
                    sqlPaiBanXX.Append(" ) ");
                }
                #endregion
            }

            if (guaHaoFS == "2")
            {
                #region 预约挂号
                if (guaHaoBC == "0")
                {
                    sqlPaiBanXX.Append(" select * from ( ");
                }
                if (guaHaoBC == "1" || guaHaoBC == "0")
                {
                    sqlPaiBanXX.Append(" select A.PAIBANID,to_Char(A.RIQI,'yyyy-mm-dd') as PAIBANRQ,a.GUAHAOLB,1 as GUAHAOBC,A.KESHIID,C.keshimc,NVL(A.WEIZHI,C.weizhism) as JIUZHENDD, ");
                    sqlPaiBanXX.Append(" c.keshizl as KESHIJS,nvl(a.YISHENGID,'*') as YISHENGDM,nvl(d.zhigongxm,'普通') as YISHENGXM , e.daimamc as YISHENGZC,a.ZHENLIAOFXM,a.GUAHAOFXM, ");
                    sqlPaiBanXX.Append(" NVL(f.shangwuyyxh,0) AS HAOYUANZS,NVL(f.shangwuyyxh,0)-NVL(f.shangwuyyyh,0) AS SHENGYUHY ,f.yuyuelx as YUYUELX ");
                    sqlPaiBanXX.Append(" from mz_v_guahaopb_ex_zzj a ,v_gy_keshi c,v_gy_zhigongxx d , ");
                    sqlPaiBanXX.Append(" (select * from gy_daima where daimalb='0072') e ,v_mz_guahaoyyxh f  ");
                    sqlPaiBanXX.Append(" where a.keshiid=c.keshiid and d.zhigongid(+) = a.YISHENGID and e.daimaid(+) = d.zhicheng and a.PAIBANID = f.paibanid  ");

                    if (string.IsNullOrEmpty(riQi))
                    {
                        //挂号预约可预约当天号源 0 不启用 1 启用
                        if (ConfigurationManager.AppSettings["GuaHaoYYDTHY"] == "1")
                        {
                            sqlPaiBanXX.Append(" and a.riqi >= trunc(sysdate) ");
                        }
                        else
                        {
                            sqlPaiBanXX.Append(" and a.riqi > trunc(sysdate) ");
                        }
                    }
                    else
                    {
                        sqlPaiBanXX.Append(" and to_char(a.riqi,'yyyy-mm-dd')='" + riQi + "' ");
                    }
                    sqlPaiBanXX.Append(" and f.yuyuelx in (" + yuYueLX + ") ");
                    sqlPaiBanXX.Append("  and a.shangwuxh > 0 and f.shangwuyyxh > 0 ");
                    if (!string.IsNullOrEmpty(keShiDM))
                    {
                        sqlPaiBanXX.Append(" and nvl(a.keshiid,'*') = '" + keShiDM + "' ");
                    }
                    if (!string.IsNullOrEmpty(yiShengDM))
                    {
                        sqlPaiBanXX.Append(" and nvl(a.yishengid,'*') = '" + yiShengDM + "' ");
                    }
                    if (!string.IsNullOrEmpty(guaHaoLB) && guaHaoLB != "0")
                    {
                        sqlPaiBanXX.Append(" and a.guahaolb = " + guaHaoLB + " ");
                    }
                }
                if (guaHaoBC == "0")
                {
                    sqlPaiBanXX.Append(" union all ");
                }
                if (guaHaoBC == "2" || guaHaoBC == "0")
                {
                    sqlPaiBanXX.Append(" select A.PAIBANID,to_Char(A.RIQI,'yyyy-mm-dd') as PAIBANRQ,a.GUAHAOLB,2 as GUAHAOBC,A.KESHIID,C.keshimc,NVL(A.WEIZHI,C.weizhism) as JIUZHENDD, ");
                    sqlPaiBanXX.Append(" c.keshizl as KESHIJS,nvl(a.YISHENGID,'*') as YISHENGDM,nvl(d.zhigongxm,'普通') as YISHENGXM , e.daimamc as YISHENGZC,a.ZHENLIAOFXM,a.GUAHAOFXM, ");
                    sqlPaiBanXX.Append(" NVL(f.xiawuyyxh,0) AS HAOYUANZS,NVL(f.xiawuyyxh,0)-NVL(f.xiawuyyyh,0) AS SHENGYUHY ,f.yuyuelx as YUYUELX ");
                    sqlPaiBanXX.Append(" from mz_v_guahaopb_ex_zzj a ,v_gy_keshi c,v_gy_zhigongxx d , ");
                    sqlPaiBanXX.Append(" (select * from gy_daima where daimalb='0072') e ,v_mz_guahaoyyxh f  ");
                    sqlPaiBanXX.Append(" where a.keshiid=c.keshiid and d.zhigongid(+) = a.YISHENGID and e.daimaid(+) = d.zhicheng and a.PAIBANID = f.paibanid  ");

                    if (string.IsNullOrEmpty(riQi))
                    {
                        sqlPaiBanXX.Append(" and a.riqi > sysdate ");
                    }
                    else
                    {
                        sqlPaiBanXX.Append(" and to_char(a.riqi,'yyyy-mm-dd')='" + riQi + "' ");
                    }
                    sqlPaiBanXX.Append(" and f.yuyuelx in (" + yuYueLX + ") ");
                    sqlPaiBanXX.Append("  and a.xiawuxh > 0  and f.xiawuyyxh > 0 ");
                    if (!string.IsNullOrEmpty(keShiDM))
                    {
                        sqlPaiBanXX.Append(" and nvl(a.keshiid,'*') = '" + keShiDM + "' ");
                    }
                    if (!string.IsNullOrEmpty(yiShengDM))
                    {
                        sqlPaiBanXX.Append(" and nvl(a.yishengid,'*') = '" + yiShengDM + "' ");
                    }
                    if (!string.IsNullOrEmpty(guaHaoLB) && guaHaoLB != "0")
                    {
                        sqlPaiBanXX.Append(" and a.guahaolb = " + guaHaoLB + " ");
                    }
                }
                if (guaHaoBC == "0")
                {
                    sqlPaiBanXX.Append(" ) ");
                }
                sqlPaiBanXX.Append(" order by paibanrq,paibanid,guahaobc ");
                #endregion
            }

            DataTable dtPaiBanXX = DBVisitor.ExecuteTable(sqlPaiBanXX.ToString());

            for (int i = 0; i < dtPaiBanXX.Rows.Count; i++)
            {
                PAIBANXX pbxx = new PAIBANXX();
                pbxx.PAIBANID  = dtPaiBanXX.Rows[i]["PAIBANID"].ToString();  //排班ID
                pbxx.PAIBANRQ  = dtPaiBanXX.Rows[i]["PAIBANRQ"].ToString();  //排班日期
                pbxx.GUAHAOLB  = dtPaiBanXX.Rows[i]["GUAHAOLB"].ToString();  //挂号类别
                pbxx.GUAHAOBC  = dtPaiBanXX.Rows[i]["GUAHAOBC"].ToString();  //挂号班次
                pbxx.KESHIDM   = dtPaiBanXX.Rows[i]["KESHIID"].ToString();   //科室代码
                pbxx.KESHIMC   = dtPaiBanXX.Rows[i]["keshimc"].ToString();   //科室名称
                pbxx.JIUZHENDD = dtPaiBanXX.Rows[i]["JIUZHENDD"].ToString(); //就诊地点(科室位置)
                pbxx.KESHIJS   = dtPaiBanXX.Rows[i]["KESHIJS"].ToString();   //科室介绍
                pbxx.YISHENGDM = dtPaiBanXX.Rows[i]["YISHENGDM"].ToString(); //医生代码
                pbxx.YISHENGXM = dtPaiBanXX.Rows[i]["YISHENGXM"].ToString(); //医生姓名
                pbxx.YISHENGZC = dtPaiBanXX.Rows[i]["YISHENGZC"].ToString(); //医生职称
                string zlfxm = dtPaiBanXX.Rows[i]["ZHENLIAOFXM"].ToString(); //诊疗费
                pbxx.ZHENLIAOF = Unity.GetXiangMuFY(zlfxm);
                string ghfxm = dtPaiBanXX.Rows[i]["GUAHAOFXM"].ToString();   //挂号费
                pbxx.GUAHAOF   = Unity.GetXiangMuFY(ghfxm);
                pbxx.HAOYUANZS = dtPaiBanXX.Rows[i]["HAOYUANZS"].ToString(); //号源总数
                pbxx.SHENGYUHY = dtPaiBanXX.Rows[i]["SHENGYUHY"].ToString(); //剩余号源
                if (Convert.ToInt32(pbxx.HAOYUANZS) <= 0)
                {
                    pbxx.SHENGYUHY = "-1";
                }

                pbxx.HAOYUANZS = Convert.ToInt32(pbxx.HAOYUANZS) < 0 ? "0" : pbxx.HAOYUANZS;
                pbxx.SHENGYUHY = Convert.ToInt32(pbxx.SHENGYUHY) < 0 ? "0" : pbxx.SHENGYUHY;
                pbxx.GUAHAOFS  = guaHaoFS;
                pbxx.YUYUELX   = dtPaiBanXX.Rows[i]["YUYUELX"].ToString();//预约类型
                OutObject.PAIBANMX.Add(pbxx);
            }

            if (OutObject.PAIBANMX.Count <= 0)
            {
                throw new Exception("未找到排班信息!");
            }
        }