public override void ProcessMessage() { var ZHIGONGLX = InObject.ZHIGONGLX; var ZHIGONGGH = InObject.ZHIGONGGH; var ZHIGONGXM = InObject.ZHIGONGXM; #region 参数验证 //职工类型 if (ZHIGONGLX == null || ZHIGONGLX == "") { throw new Exception(string.Format("职工类型不能为空!")); } else if (ZHIGONGLX != "1" && ZHIGONGLX != "2" && ZHIGONGLX != "0") { throw new Exception(string.Format("职工类型不正确,必须是:0.全部,1.医生,2.护士!")); } #endregion #region sql查询 if (ZHIGONGLX != "0") { ZHIGONGLX = string.Format(" and ZGLB='{0}' ", ZHIGONGLX); } else { ZHIGONGLX = ""; } if (!string.IsNullOrEmpty(ZHIGONGGH)) { ZHIGONGGH = string.Format(" and ZGGH='{0}' ", ZHIGONGGH); } if (!string.IsNullOrEmpty(ZHIGONGXM)) { ZHIGONGXM = string.Format(" and ZGXM='{0}' ", ZHIGONGXM); } var listpbxx = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.BASE00001, ZHIGONGLX, ZHIGONGGH, ZHIGONGXM)); if (listpbxx.Count == 0) { throw new Exception(string.Format("无职工信息!")); } else { OutObject = new ZD_ZHIGONGXX_OUT(); foreach (var zgxx in listpbxx) { var zhigonglb = new ZHIGONGXX(); zhigonglb.ZHIGONGGH = zgxx.Get("ZGGH"); //工号 zhigonglb.ZHIGONGXM = zgxx.Get("ZGXM"); //姓名 zhigonglb.ZHIGONGZC = zgxx.Get("ZGZC"); //职称 zhigonglb.ZHIGONGJS = zgxx.Get("ZGJS"); //介绍 zhigonglb.ZHIGONGTC = zgxx.Get("ZGTC"); //特长 OutObject.ZHIGONGLB.Add(zhigonglb); } } #endregion }
public static void sendJCFX() { var JCFXtable = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.AUTO00011)); if (JCFXtable == null || JCFXtable.Count == 0) { } else { var xmlin = "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; xmlin += "<request action=\"sendCheckDirection\" client=\"市二:192.168.1.10\">"; xmlin += "<head>"; xmlin += "<patient>"; xmlin += "<mpiId></mpiId>"; xmlin += "</patient>"; xmlin += "</head>"; xmlin += "<body>"; foreach (var mxxx in JCFXtable) { xmlin += "<item>"; xmlin += "<directionCode>" + mxxx.Get("id") + "</directionCode>"; xmlin += "<directionParentCode>" + mxxx.Get("IDF") + "</directionParentCode>"; xmlin += "<directionName>" + mxxx.Get("fxmc") + "</directionName>"; xmlin += "<inUseFlag>" + mxxx.Get("del_flag") + "</inUseFlag>"; xmlin += "<frequency>" + mxxx.Get("xmcs") + "</frequency>"; xmlin += "<hospitalCode>47011662233010511A1001</hospitalCode>"; xmlin += "</item>"; } xmlin += "</body>"; xmlin += "</request>"; var rtnstr = sendJK(xmlin); } }
public static void sendJCBW() { var JCBWtable = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.AUTO00012)); if (JCBWtable == null || JCBWtable.Count == 0) { } else { var xmlin = "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; xmlin += "<request action=\"sendCheckPart\" client=\"市二:192.168.1.10\">"; xmlin += "<head>"; xmlin += "<patient>"; xmlin += "<mpiId></mpiId>"; xmlin += "</patient>"; xmlin += "</head>"; xmlin += "<body>"; foreach (var mxxx in JCBWtable) { xmlin += "<item>"; xmlin += "<partCode>" + mxxx.Get("id") + "</partCode>"; //检查部位代码 xmlin += "<partName>" + mxxx.Get("bwmc") + "</partName>"; //检查部位名称 xmlin += "<inUseFlag>" + mxxx.Get("del_flag") + "</inUseFlag>"; xmlin += "<classifyCode>" + mxxx.Get("flbm") + "</classifyCode>"; //检查类型代码 xmlin += "<departmentCode>" + mxxx.Get("zxksdm") + "</departmentCode>"; //执行科室代码 xmlin += "<hospitalCode>47011662233010511A1001</hospitalCode>"; xmlin += "</item>"; } xmlin += "</body>"; xmlin += "</request>"; var rtnstr = sendJK(xmlin); } }
public static void sendJCFL() { var JCFLtable = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.AUTO00009)); if (JCFLtable == null || JCFLtable.Count == 0) { } else { var xmlin = "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; xmlin += "<request action=\"sendCheckClassify\" client=\"市二:192.168.1.10\">"; xmlin += "<head>"; xmlin += "<patient>"; xmlin += "<mpiId></mpiId>"; xmlin += "</patient>"; xmlin += "</head>"; xmlin += "<body>"; foreach (var mxxx in JCFLtable) { xmlin += "<item>"; xmlin += "<classifyCode>" + mxxx.Get("id") + "</classifyCode>"; xmlin += "<classifyName>" + mxxx.Get("ylflmc") + "</classifyName>"; xmlin += "<departmentCode>" + mxxx.Get("zxkdm") + "</departmentCode>"; xmlin += "<inUseFlag>" + mxxx.Get("del_flag") + "</inUseFlag>"; xmlin += "<telephone>" + mxxx.Get("lxdh") + "</telephone>"; xmlin += "<departmentLocation>" + mxxx.Get("ksdz") + "</departmentLocation>"; xmlin += "<hospitalCode>47011662233010511A1001</hospitalCode>"; xmlin += "</item>"; } xmlin += "</body>"; xmlin += "</request>"; var rtnstr = sendJK(xmlin); } }
public override void ProcessMessage() { var bqdm = InObject.BINGQUDM; #region sql查询 var listcwxx = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.BASE00004, bqdm)); if (listcwxx.Count == 0) { throw new Exception(string.Format("无床位信息!")); } else { OutObject = new ZD_CHUANGWEIXX_OUT(); foreach (var cwxx in listcwxx) { var chuangweilb = new CHUANGWEIXX(); chuangweilb.CHUANGWEIH = cwxx.Get("CHUANGWEIH").ToString(); chuangweilb.CHUANGWEISM = cwxx.Get("CHUANGWEISM"); OutObject.CHUANGWEIMX.Add(chuangweilb); } } #endregion }
public static void sendRYSJ() { var Brxx = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.AUTO00001, " and brzt in (3,4) and ryfszt = 0 ")); if (Brxx == null || Brxx.Count == 0) { } else { foreach (var mxxx in Brxx) { var str = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + "<request action= \"sendInHospitalFlag\" client=\"市二:192.168.1.10\" >" + "<head><patient><mpiId></mpiId>" + "<personName>" + mxxx.Get("brxm") + "</personName>" + "<sexCode>" + mxxx.Get("brxb") + "</sexCode>" + "<birthday>" + mxxx.Get("brcsrq") + "</birthday>" + "<idCard>" + mxxx.Get("sfzh") + "</idCard>" + "<idType>01</idType>" + "<cardNo>" + mxxx.Get("jzkh") + "</cardNo>" + "<cardType>" + mxxx.Get("jzklx") + "</cardType>" + "</patient></head>" + "<body>" + "<hospitalCode>47011662233010511A1001</hospitalCode>" + "<wardAreaCode>" + mxxx.Get("bqdm") + "</wardAreaCode>" + "<wardArea>" + mxxx.Get("bqmc") + "</wardArea>" + "<departmentCode>" + mxxx.Get("ksdm") + "</departmentCode>" + "<department>" + mxxx.Get("ksmc") + "</department>" + "<bedNo>" + mxxx.Get("curr_bed") + "</bedNo>" + "<inHospitalTime>" + mxxx.Get("admiss_date") + "</inHospitalTime>" + "<inHospitalReason></inHospitalReason>" + "<doctorName>" + mxxx.Get("zzys") + "</doctorName>" + "<doctorPhone>" + mxxx.Get("zzyslxdh") + "</doctorPhone>" + "<reserveNo>" + mxxx.Get("zzsqdh") + "</reserveNo>" + "<submitor>自动转发</submitor>" + "<submitTime>" + System.DateTime.Now.ToString() + "</submitTime>" + "<submitAgency>杭州市二医院</submitAgency></body></request>"; var rtnstr = sendJK(str); var xmldom = new XmlDocument(); var xmlOut = ""; xmlOut = rtnstr; xmldom.LoadXml(xmlOut); var errno = xmldom.GetElementsByTagName("code").Item(0).FirstChild.InnerText; if (errno == "200") { var tran = DBVisitor.Connection.BeginTransaction(); try { DBVisitor.ExecuteNonQuery(SqlLoad.GetFormat(SQ.AUTO00007, mxxx.Get("zzsqdh")), tran); tran.Commit(); } catch (Exception ex) { tran.Rollback(); } } } } }
public override void ProcessMessage() { #region sql查询 if (InObject.XIAZAILX == "1") { var listjcxx = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.BASE00010)); if (listjcxx.Count == 0) { throw new Exception(string.Format("无检查明细信息!")); } else { OutObject = new ZD_JIANCHAJYMX_OUT(); foreach (var jcxx in listjcxx) { var jianchalb = new JIANCHAJYXX(); jianchalb.MOBANDM = jcxx.Get("MBLXDM"); jianchalb.JIANCHAJYDM = jcxx.Get("LBXH"); jianchalb.JIANCHAJYMC = jcxx.Get("LBMC"); jianchalb.FULEIXH = jcxx.Get("FLXH"); jianchalb.MOJIEPB = jcxx.Get("SFMJ"); jianchalb.ZHIXINGKS = jcxx.Get("JCKS"); jianchalb.BEIZHU = jcxx.Get("JCYQ"); OutObject.JIANCHAJYMX.Add(jianchalb); } } } else { var listjyxx = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.BASE00012)); if (listjyxx.Count == 0) { throw new Exception(string.Format("无检验明细信息!")); } else { OutObject = new ZD_JIANCHAJYMX_OUT(); foreach (var jyxx in listjyxx) { var jianyanlb = new JIANCHAJYXX(); jianyanlb.MOBANDM = jyxx.Get("MBLXDM"); jianyanlb.JIANCHAJYDM = jyxx.Get("LBXH"); jianyanlb.JIANCHAJYMC = jyxx.Get("LBMC"); jianyanlb.FULEIXH = ""; jianyanlb.MOJIEPB = "0"; jianyanlb.ZHIXINGKS = ""; jianyanlb.BEIZHU = jyxx.Get("YLXH"); OutObject.JIANCHAJYMX.Add(jianyanlb); } } } #endregion }
public static void sendCFTZ() { var Brxx = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.AUTO00001, " and cftz in = 1 and cftzfszt = 0 ")); if (Brxx == null || Brxx.Count == 0) { } else { foreach (var mxxx in Brxx) { var str = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + "<request action= \"sendInhospitalVisitNotice\" client=\"市二:192.168.1.10\" >" + "<head><patient><mpiId></mpiId>" + "<personName>" + mxxx.Get("brxm") + "</personName>" + "<sexCode>" + mxxx.Get("brxb") + "</sexCode>" + "<birthday>" + mxxx.Get("brcsrq") + "</birthday>" + "<idCard>" + mxxx.Get("sfzh") + "</idCard>" + "<idType>01</idType>" + "<cardNo>" + mxxx.Get("jzkh") + "</cardNo>" + "<cardType>" + mxxx.Get("jzklx") + "</cardType>" + "</patient></head>" + "<body>" + "<reserveNo>" + mxxx.Get("zzsqdh") + "</reserveNo>" + "<visitDate>" + mxxx.Get("ywlx") + "</visitDate>" + "<submitor>自动转发</submitor>" + "<submitTime>" + System.DateTime.Now.ToString() + "</submitTime>" + "<submitAgency>杭州市二医院</submitAgency></body></request>"; var rtnstr = sendJK(str); var xmldom = new XmlDocument(); var xmlOut = ""; xmlOut = rtnstr; xmldom.LoadXml(xmlOut); var errno = xmldom.GetElementsByTagName("code").Item(0).FirstChild.InnerText; if (errno == "200") { var tran = DBVisitor.Connection.BeginTransaction(); try { DBVisitor.ExecuteNonQuery(SqlLoad.GetFormat(SQ.AUTO00007, mxxx.Get("zzsqdh")), tran); tran.Commit(); } catch (Exception ex) { tran.Rollback(); } } } } }
public static void sendDRYSJ() { var Brxx = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.AUTO00001, " and brzt in (1,3,4) and dryfszt = 0 ")); if (Brxx == null || Brxx.Count == 0) { } else { foreach (var mxxx in Brxx) { var str = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + "<request action= \"sendInHospitalAcceptFlag\" client=\"市二:192.168.1.10\" >" + "<head><patient><mpiId></mpiId>" + "<personName>" + mxxx.Get("brxm") + "</personName>" + "<sexCode>" + mxxx.Get("brxb") + "</sexCode>" + "<birthday>" + mxxx.Get("brcsrq") + "</birthday>" + "<idCard>" + mxxx.Get("sfzh") + "</idCard>" + "<idType>01</idType>" + "<cardNo>" + mxxx.Get("jzkh") + "</cardNo>" + "<cardType>" + mxxx.Get("jzklx") + "</cardType>" + "</patient></head>" + "<body>" + "<reserveNo>" + mxxx.Get("zzsqdh") + "</reserveNo>" + "<departmentNo>" + mxxx.Get("ksdm") + "</departmentNo>" + "<department>" + mxxx.Get("ksmc") + "</department>" + "</body></request>"; var rtnstr = sendJK(str); var xmldom = new XmlDocument(); var xmlOut = ""; xmlOut = rtnstr; xmldom.LoadXml(xmlOut); var errno = xmldom.GetElementsByTagName("code").Item(0).FirstChild.InnerText; if (errno == "200") { var tran = DBVisitor.Connection.BeginTransaction(); try { DBVisitor.ExecuteNonQuery(SqlLoad.GetFormat(SQ.AUTO00007, mxxx.Get("zzsqdh")), tran); tran.Commit(); } catch (Exception ex) { tran.Rollback(); } } } } }
public override void ProcessMessage() { #region sql查询 if (InObject.XIAZAILX == "1") { var listjcxx = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.BASE00009)); if (listjcxx.Count == 0) { throw new Exception(string.Format("无检查模版信息!")); } else { OutObject = new ZD_JIANCHAJYMB_OUT(); foreach (var jcxx in listjcxx) { var jianchalb = new MOBANXX(); jianchalb.MOBANDM = jcxx.Get("MBLXDM"); jianchalb.MOBANMC = jcxx.Get("MBMC"); OutObject.MOBANMX.Add(jianchalb); } } } else { var listjyxx = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.BASE00011)); if (listjyxx.Count == 0) { throw new Exception(string.Format("无检验模版信息!")); } else { OutObject = new ZD_JIANCHAJYMB_OUT(); foreach (var jyxx in listjyxx) { var jianyanlb = new MOBANXX(); jianyanlb.MOBANDM = jyxx.Get("MBLXDM"); jianyanlb.MOBANMC = jyxx.Get("MBMC"); OutObject.MOBANMX.Add(jianyanlb); } } } #endregion }
public override void ProcessMessage() { string where = ""; if (!string.IsNullOrEmpty(InObject.YSDM)) { where = " and YSGH='" + InObject.YSDM + "'"; } #region sql查询 var listbqxx = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.BASE00014, where)); if (listbqxx.Count == 0) { throw new Exception(string.Format("无医生排班信息!")); } else { OutObject = new ZD_YISHENGPBXX_OUT(); foreach (var bqxx in listbqxx) { var pbxx = new PAIBANXX(); pbxx.JLXH = bqxx.Get("JLXH"); pbxx.XQ = bqxx.Get("XQ"); pbxx.KSMC = bqxx.Get("KSMC"); pbxx.KSDM = bqxx.Get("KSDM"); pbxx.MZLBMC = bqxx.Get("MZLBMC"); pbxx.SWXH = bqxx.Get("SWJSH"); pbxx.SWZGH = bqxx.Get("SWZGXH"); pbxx.XWXH = bqxx.Get("XWJSH"); pbxx.XWZGH = bqxx.Get("XWZGXH"); pbxx.YSGH = bqxx.Get("YSGH"); pbxx.YSXM = bqxx.Get("YSXM"); pbxx.SWYYXH = bqxx.Get("SWYYXH"); pbxx.XWYYXH = bqxx.Get("XWYYXH"); pbxx.YYF = bqxx.Get("YYF"); pbxx.YSMS = bqxx.Get("YSMS"); OutObject.PAIBANXX.Add(pbxx); } } #endregion }
public override void ProcessMessage() { #region sql查询 var listbqxx = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.BASE00003)); if (listbqxx.Count == 0) { throw new Exception(string.Format("无病区信息!")); } else { OutObject = new ZD_BINGQUXX_OUT(); foreach (var bqxx in listbqxx) { var bingqulb = new BINGQUXX(); bingqulb.BINGQUDM = bqxx.Get("BINGQUDM"); bingqulb.BINGQUMC = bqxx.Get("BINGQUMC"); OutObject.BINGQUMX.Add(bingqulb); } } #endregion }
public override void ProcessMessage() { #region sql查询 var listpbxx = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.BASE00002)); if (listpbxx.Count == 0) { throw new Exception(string.Format("无诊室信息!")); } else { OutObject = new ZD_ZHENSHIXX_OUT(); foreach (var zsxx in listpbxx) { var zhenshilb = new ZHENSHIXX(); zhenshilb.ZHENSHIDM = zsxx.Get("ZSDM"); zhenshilb.ZHENSHIMC = zsxx.Get("ZSMC"); OutObject.ZHENSHILB.Add(zhenshilb); } } #endregion }
public override void ProcessMessage() { #region sql查询 var listfyglxx = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.BASE00005)); if (listfyglxx.Count == 0) { throw new Exception(string.Format("无项目归类信息!")); } else { OutObject = new ZD_XIANGMUGLXX_OUT(); foreach (var fyglxx in listfyglxx) { var fygllb = new XIANGMUGLXX(); fygllb.XIANGMUGL = fyglxx.Get("XIANGMUGL"); fygllb.XIANGMUGLMC = fyglxx.Get("XIANGMUGLMC"); OutObject.XIANGMUGLMX.Add(fygllb); } } #endregion }
public override void ProcessMessage() { var fygl = InObject.XIANGMUGL; var srmlx = InObject.SHURUMLX; var srm = InObject.SHURUM; #region sql查询 var listypxx = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.BASE00006, fygl, srmlx, srm)); if (listypxx.Count == 0) { throw new Exception(string.Format("无药品信息!")); } else { OutObject = new ZD_YAOPINXX_OUT(); foreach (var ypxx in listypxx) { var yaopinlb = new YAOPINXX(); yaopinlb.XIANGMUGL = ypxx.Get("XIANGMUGL").ToString(); yaopinlb.XIANGMUXH = ypxx.Get("XIANGMUXH").ToString(); yaopinlb.XIANGMUCDDM = ypxx.Get("XIANGMUCDDM").ToString(); yaopinlb.XIANGMUMC = ypxx.Get("XIANGMUMC"); yaopinlb.XIANGMUGLMC = ypxx.Get("XIANGMUGLMC"); yaopinlb.XIANGMUGG = ypxx.Get("XIANGMUGG"); yaopinlb.XIANGMUJX = ypxx.Get("XIANGMUJX").ToString(); yaopinlb.XIANGMUDW = ypxx.Get("XIANGMUDW"); yaopinlb.XIANGMUCDMC = ypxx.Get("XIANGMUCDMC"); yaopinlb.DANJIA = ypxx.Get("DANJIA").ToString(); yaopinlb.YIBAODJ = ypxx.Get("YIBAODJ"); OutObject.YAOPINMX.Add(yaopinlb); } } #endregion }
public static void sendJCXM() { var JCXMtable = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.AUTO00010)); if (JCXMtable == null || JCXMtable.Count == 0) { } else { var xmlin = "<?xml version=\"1.0\" encoding=\"utf-8\"?>"; xmlin += "<request action=\"sendCheckItem\" client=\"市二:192.168.1.10\">"; xmlin += "<head>"; xmlin += "<patient>"; xmlin += "<mpiId></mpiId>"; xmlin += "</patient>"; xmlin += "</head>"; xmlin += "<body>"; foreach (var mxxx in JCXMtable) { xmlin += "<item>"; xmlin += "<itemCode>" + mxxx.Get("jcxmdm") + "</itemCode>"; xmlin += "<itemName>" + mxxx.Get("jcxmmc") + "</itemName>"; xmlin += "<needReserve>1</needReserve>"; xmlin += "<classifyCode>" + mxxx.Get("JCXMLX") + "</classifyCode>"; xmlin += "<partCode>" + mxxx.Get("JCXMBWDM") + "</partCode>"; xmlin += "<directionCode>" + mxxx.Get("JCXMFX") + "</directionCode>"; xmlin += "<hospitalCode>47011662233010511A1001</hospitalCode>"; xmlin += "<announcements>" + mxxx.Get("JCXMBZ") + "</announcements>"; xmlin += "</item>"; } xmlin += "</body>"; xmlin += "</request>"; var rtnstr = sendJK(xmlin); } }
public override void ProcessMessage() { //取得预约信息 OutObject = new SHEBEIYYQX_OUT(); if (InObject.YUYUESQDBH == null || InObject.YUYUESQDBH == "") { throw new Exception(string.Format("预约申请单编号为空!")); } var listyyxx = DBVisitor.ExecuteModel(SqlLoad.GetFormat(SQ.FSD00004, InObject.YUYUESQDBH.ToString())); if (listyyxx == null) { OutObject.OUTMSG.ERRNO = "-2"; OutObject.OUTMSG.ERRMSG = string.Format("找不到预约信息:申请单编号[{0}]", InObject.YUYUESQDBH.ToString()); return; //throw new Exception(string.Format("找不到预约信息:申请单编号[{0}]", InObject.YUYUESQDBH.ToString())); } if (listyyxx.Items.Count == 0) { OutObject.OUTMSG.ERRNO = "-2"; OutObject.OUTMSG.ERRMSG = string.Format("找不到预约信息:申请单编号[{0}]", InObject.YUYUESQDBH.ToString()); return; //throw new Exception(string.Format("找不到预约信息:申请单编号[{0}]", InObject.YUYUESQDBH.ToString())); } if (System.Configuration.ConfigurationManager.AppSettings["JianChaJKMS"] == "1") { var resource = new HISYY_Cancel(); resource.RequestNo = listyyxx.Items["YYH"].ToString(); resource.YYH = ""; resource.JCH = ""; string url = System.Configuration.ConfigurationManager.AppSettings["LAIDAURL"]; string xml = XMLHandle.EntitytoXML <HISYY_Cancel>(resource); HISYY_Cancel_Result result = XMLHandle.XMLtoEntity <HISYY_Cancel_Result>(WSServer.Call <HISYY_GetResource>(url, xml).ToString()); if (result.Success == "False") { throw new Exception("取消预约失败,错误原因:" + result.Message); } var tran = DBVisitor.Connection.BeginTransaction(); try { DBVisitor.ExecuteNonQuery(SqlLoad.GetFormat(SQ.FSD00005, InObject.YUYUESQDBH.ToString(), 9), tran); tran.Commit(); } catch (Exception ex) { tran.Rollback(); throw ex; } } else { var listyyhxx = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.FSD00014, listyyxx.Items["JCSBDM"].ToString(), listyyxx.Items["JCRQ"].ToString(), listyyxx.Items["JCSJ"].ToString())); foreach (var item in listyyhxx) { var listyyh = DBVisitor.ExecuteModel(SqlLoad.GetFormat(SQ.FSD00010, item.Get("yyhxx").ToString(), listyyxx.Items["YYH"].ToString())); var zyyyys = int.Parse(item.Get("zyyyys")); var mzyyys = int.Parse(item.Get("mzyyys")); var sqyyys = int.Parse(item.Get("sqyyys")); var yyys = int.Parse(item.Get("yyys")); var yyly = listyyxx.Items["YYLY"].ToString(); if (yyly == "3") { --sqyyys; } else if (yyly == "2") { --zyyyys; } else if (yyly == "1") { --mzyyys; } else { if (listyyxx.Items["BRLX"].ToString() == "2") { --zyyyys; } } //if (listyyxx.Items["BRLX"].ToString() == "2") //{ // --zyyyys; //} if (listyyh == null) { continue; } if (listyyh.Items.Count > 0) { var tran = DBVisitor.Connection.BeginTransaction(); try { //更新预约信息状态为取消 DBVisitor.ExecuteNonQuery(SqlLoad.GetFormat(SQ.FSD00005, InObject.YUYUESQDBH.ToString(), 9), tran); //更新预约号状态 DBVisitor.ExecuteNonQuery(SqlLoad.GetFormat(SQ.FSD00009, item.Get("yyhxx").ToString(), listyyxx.Items["YYH"], 0), tran); //更新预约排班表 if (yyly == "3") { DBVisitor.ExecuteNonQuery(SqlLoad.GetFormat(SQ.FSD00021, item.Get("yyhxx").ToString(), int.Parse(item.Get("yyys")) - 1, sqyyys), tran); } else if (yyly == "2") { DBVisitor.ExecuteNonQuery(SqlLoad.GetFormat(SQ.FSD00008, item.Get("yyhxx").ToString(), int.Parse(item.Get("yyys")) - 1, zyyyys), tran); } else if (yyly == "1") { DBVisitor.ExecuteNonQuery(SqlLoad.GetFormat(SQ.FSD00020, item.Get("yyhxx").ToString(), int.Parse(item.Get("yyys")) - 1, mzyyys), tran); } else { DBVisitor.ExecuteNonQuery(SqlLoad.GetFormat(SQ.FSD00008, item.Get("yyhxx").ToString(), int.Parse(item.Get("yyys")) - 1, zyyyys), tran); } tran.Commit(); } catch (Exception ex) { tran.Rollback(); throw ex; } } } } }
public override void ProcessMessage() { if (InObject.YUYUERQ == null) { throw new Exception(string.Format("预约日期不能为空!")); } if (InObject.YUYUESJ == null) { throw new Exception(string.Format("预约时间不能为空!")); } //if (InObject.JIANCHAXMDM == null || InObject.JIANCHAXMDM == "") //{ // throw new Exception(string.Format("检查项目不能为空!")); //} if (InObject.BINGRENLX == null || InObject.BINGRENLX < 1 || InObject.BINGRENLX > 3) { throw new Exception(string.Format("病人类型代码不对!")); } if (InObject.YEWULY == null) { InObject.YEWULY = InObject.BINGRENLX.ToString(); } var jcsbdm = InObject.JIANCHASBDM.ToString(); var yyrq = InObject.YUYUERQ.ToString(); var yysj = InObject.YUYUESJ.ToString(); var yyh = ""; //不能预约以前的日期 if (string.Compare(yyrq, DateTime.Now.ToString("yyyy-MM-dd")) < 0) { throw new Exception(string.Format("预约日期必须大于等于今天!")); } if (System.Configuration.ConfigurationManager.AppSettings["JianChaJKMS"] == "1") { HISYY_Submit resource = new HISYY_Submit(); var yysqdbh = DBVisitor.ExecuteModel(SqlLoad.GetFormat(SQ.FSD00018)).Items["YYSQDBH"].ToString(); //检查 if (InObject.YEWULY == "1") { #region 调用包,判断入参是否正确 var jyjcdxx = ""; var jyjcmx = ""; var zdmx = ""; var jcxmdm = ""; int i = 0; if (InObject.JIANCHALB.Count < 1) { throw new Exception(string.Format("检查项目不能为空!")); } #region 检查单信息 jyjcdxx += InObject.JIUZHENKLX + "|"; // 就诊卡类型 jyjcdxx += InObject.JIUZHENKH + "|"; // 就诊卡号 jyjcdxx += InObject.SHENQINGYSGH + "|"; // 送检医生 jyjcdxx += InObject.SHENQINGYYDM + "|"; // 送检科室 jyjcdxx += InObject.YUYUESF + "|"; // 收费识别 jyjcdxx += InObject.BINGQINGMS + "|"; // 病情描述 jyjcdxx += InObject.ZHENDUAN + "|"; // 诊断 jyjcdxx += InObject.BINGRENTZ + "|"; // 病人体征 jyjcdxx += InObject.QITAJC + "|"; // 其它检查 jyjcdxx += InObject.BINGRENZS + "|"; // 病人主诉 jyjcdxx += InObject.YEWULY + "|"; // 检查来源 jyjcdxx += InObject.BINGRENXM + "|"; // 病人姓名 jyjcdxx += InObject.SHENFENZH + "|"; // 病人身份证号 jyjcdxx += "0" + "|"; // 接收方式 jyjcdxx += "|"; // 检查申请单号 jyjcdxx += InObject.YUYUERQ + " " + InObject.YUYUESJ + "|"; // 检查日期 jyjcdxx += InObject.BINGRENXB + "|"; // 病人性别 jyjcdxx += InObject.BINGRENNL; // 病人年龄 #endregion #region 检验检查明细 foreach (var item in InObject.JIANCHALB) { if (i == 0) { jcxmdm = item.JIANCHAXMBH; } else { jcxmdm += "," + item.JIANCHAXMBH; } ++i; jyjcmx += item.JIANCHAXMBH + "|"; // 检查项目编号 jyjcmx += item.JIANCHAXMMC + "|"; // 检查项目名称 jyjcmx += item.JIANCHAFLBM + "|"; // 检查分类编码 jyjcmx += item.JIANCHASTBW + "|"; // 检查身体部位 jyjcmx += item.JIANCHAFXDM + "|"; // 检查方向代码 jyjcmx += item.JIANCHAZYDM + "|"; // 检查肢位代码 jyjcmx += item.JIANCHATS + "^"; // 检查提示 } #endregion #region 疾病明细 foreach (var item in InObject.ZHENDUANLB) { zdmx += item.ICD10 + "|"; // ICD10 zdmx += item.ZHENDUANMC + "^"; // 诊断名称 } #endregion #region 调用包 var jianchakd = SqlLoad.GetProcedure(SQ.P_FSD00030); jianchakd["ywlx"] = 1; jianchakd["jyjcdxx"] = jyjcdxx; jianchakd["jyjcmx"] = jyjcmx; jianchakd["zdmx"] = zdmx; jianchakd["jylx"] = 1; jianchakd["errno"] = -1; jianchakd["errmsg"] = string.Empty.PadRight(1024); jianchakd["outdata"] = string.Empty.PadRight(1024); DBVisitor.ExecuteProcedure(jianchakd); if (jianchakd["errno"].ToString() != "0") { throw new Exception("更新库存失败:" + jianchakd["errmsg"]); } #endregion #endregion if (InObject.YEWULX == "2") { resource.AdmissionSource = "10"; } else { resource.AdmissionSource = "50"; } resource.HospitalCode = InObject.BASEINFO.JIGOUDM; resource.HospitalName = "余杭三院"; resource.PatientName = InObject.BINGRENXM; resource.IdNumber = InObject.SHENFENZH; resource.RequestNo = yysqdbh; if (InObject.YEWULY == "2") { resource.AdmissionID = InObject.BINGRENZYH; } else { resource.AdmissionID = InObject.BINGRENMZH; } resource.ExaminePartTime = InObject.XIANGMUHS; resource.PatientSex = InObject.BINGRENXB.ToString(); resource.PatientBorn = InObject.BINGRENCSRQ; resource.PatientAge = InObject.BINGRENNL; resource.PatientTel = InObject.BINGRENLXDH; resource.PatientAddress = InObject.BINGRENLXDZ; resource.PatientCard = InObject.BINGRENKH; resource.InPatientAreaName = InObject.BINGRENBQMC; resource.InPatientAreaCode = InObject.BINGRENBQDM; resource.BedNum = InObject.BINGRENCWH; resource.DeviceCode = InObject.JIANCHASBDM.ToString(); resource.DeviceName = InObject.JIANCHASBMC; var codes = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.FSD00027, jcxmdm)); foreach (var code in codes) { resource.StudiesExamine.Add(new StudiesExamine() { ExamineCode = code["LBXH"].ToString(), ExamineName = Unity.encodeString(code["LBMC"].ToString()), Numbers = "1", ExaminePrice = DBVisitor.ExecuteScalar(SqlLoad.GetFormat(SQ.FSD00029, code["LBXH"].ToString())).ToString() }); } resource.ExamineFY = resource.StudiesExamine.Sum <StudiesExamine>(group => { return(Convert.ToDecimal(group.ExaminePrice)); }).ToString(); resource.ReceiptNum = InObject.BINGRENFPH; codes = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.FSD00027, jcxmdm)); resource.ZxDepartmentId = codes[0]["JCKS"].ToString(); resource.ZxDepartmentName = codes[0]["KSMC"].ToString(); resource.Sqrq = InObject.BASEINFO.CAOZUORQ; resource.BespeakDateTime = InObject.YUYUERQ + " " + InObject.YUYUESJ; resource.JZ = "0"; // InObject.JIZHEN; resource.ZQ = "0"; //InObject.ZENGQIANG; resource.LS = "0"; //InObject.LINSHI; resource.PF = "1"; ///调用WEBSERVICE string url = System.Configuration.ConfigurationManager.AppSettings["LAIDAURL"]; string xml = XMLHandle.EntitytoXML <HISYY_Submit>(resource); HISYY_Submit_Result result = XMLHandle.XMLtoEntity <HISYY_Submit_Result>(WSServer.Call <HISYY_Submit>(url, xml).ToString()); if (result.Success == "False") { throw new Exception("预约失败,错误原因:" + result.Message); } var tran = DBVisitor.Connection.BeginTransaction(); try { #region 先插入到临时表 var ID = DBVisitor.ExecuteModel(SqlLoad.GetFormat(SQ.FSD00024, " seq_sxzz_jianchad.nextval ")); var xh = ""; var JCSQDH = result.JCH; int k = 0; if (ID == null) { throw new Exception(string.Format("检查单序列获取失败!")); } else { xh = ID.Items["MAXID"].ToString(); } //var SQDH = DBVisitor.ExecuteModel(SqlLoad.GetFormat(SQ.FSD00023, " SEQ_GY_YXSQD_SQDH.NEXTVAL ")); //if (SQDH == null) //{ // throw new Exception(string.Format("申请单号获取失败!")); //} //else //{ // JCSQDH = SQDH.Items["MAXID"].ToString(); //} //插入检查单信息 DBVisitor.ExecuteNonQuery(SqlLoad.GetFormat(SQ.FSD00022, xh, "", InObject.BINGRENMZH, InObject.BINGRENXM, InObject.SHENFENZH, InObject.SHENQINGYSGH, InObject.JIANCHAKSDM, 0, InObject.BINGQINGMS, InObject.ZHENDUAN, InObject.BINGRENTZ, InObject.QITAJC, InObject.BINGRENZS, InObject.YEWULX, 0, JCSQDH, InObject.YUYUERQ, InObject.BINGRENXB, InObject.BINGRENNL), tran); //插入检查明细 foreach (var item in InObject.JIANCHALB) { ++k; DBVisitor.ExecuteNonQuery(SqlLoad.GetFormat(SQ.FSD00023, xh, k, item.JIANCHAXMBH, item.JIANCHAXMMC, item.JIANCHAFLBM, item.JIANCHASTBW, item.JIANCHAFXDM, item.JIANCHAZYDM, item.JIANCHATS), tran); } k = 0; //插入诊断明细 foreach (var item in InObject.ZHENDUANLB) { ++k; DBVisitor.ExecuteNonQuery(SqlLoad.GetFormat(SQ.FSD00025, xh, k, item.ICD10, item.ZHENDUANMC), tran); } #endregion var listyylsh = DBVisitor.ExecuteModel(SqlLoad.GetFormat(SQ.FSD00017)); var yysqlsh = listyylsh.Items["YYSQLSH"].ToString(); //插入预约申请信息fdsyy_sq DBVisitor.ExecuteNonQuery(SqlLoad.GetFormat(SQ.FSD00011, "申请单", //预约申请单名称 InObject.YUYUEZT, //预约申请单状态(0未确认,1已确认,9作废) InObject.JIANCHAKSDM, //检查科室代码 InObject.JIANCHAKSMC, //检查科室名称 InObject.BINGRENFPH, //病人发票号 InObject.BINGRENLX, //病人类型 InObject.BINGRENLXMC, //病人类型名称 InObject.BINGRENKH, //病人卡号 InObject.BINGRENMZH, //病人门诊号 InObject.BINGRENZYH, //病人住院号 InObject.BINGRENBQDM, //病人病区代码 InObject.BINGRENBQMC, //病人病区名称 InObject.BINGRENCWH, //病人床位号 InObject.BINGRENXM, //病人姓名 InObject.BINGRENXB, //病人性别 InObject.BINGRENNL, //病人年龄 InObject.BINGRENCSRQ, //病人出生日期 InObject.BINGRENLXDZ, //病人联系地址 InObject.BINGRENLXDH, //病人联系电话 InObject.SHENQINGYSGH, //申请医生工号 InObject.SHENQINGYSMC, //申请医生姓名 "", //申请科室代码 "", //申请科室名称 InObject.SHENQINGYYDM, //申请医院代码 InObject.SHENQINGYYMC, //申请医院名称 result.JCH, //检查号 InObject.YUYUERQ, //检查日期 InObject.YUYUESJ, //检查时间 jcxmdm, //InObject.JIANCHAXMDM,//检查项目代码 InObject.JIANCHAXMMC, //检查项目名称 InObject.JIANCHAXMLX, //检查项目类型 InObject.JIANCHABWDM, //检查部位代码 InObject.JIANCHABWMC, //检查部位名称 InObject.JIANCHASBDM, //检查设备代码 InObject.JIANCHASBMC, //检查设备名称 InObject.JIANCHASBDD, //检查设备地点 result.YYH, //预约号 InObject.SHENFENZH, //身份证号 InObject.YUYUESF, //预约收费(0未收费,1已收费) InObject.JIANCHASQDBH, //检查申请单编号 InObject.YINGXIANGFX, "", //影像方向 yysqlsh, //预约申请流水号 yysqdbh, //预约申请单编号 InObject.XIANGMUHS, //详细安排时间 InObject.YEWULY, InObject.YEWULX, InObject.ZENGQIANG, InObject.JIZHEN, InObject.LINSHI ), tran);//业务来源 tran.Commit(); OutObject = new SHEBEIYY_OUT(); OutObject.YUYUERQ = InObject.YUYUERQ; OutObject.YUYUESJ = InObject.YUYUESJ; OutObject.YUYUEH = result.YYH; OutObject.JIANCHAH = result.JCH; OutObject.YUYUESQDBH = yysqdbh; } catch (Exception ex) { tran.Rollback(); throw ex; } } //检验 else { } } else { #region 市二 if (InObject.JIANCHAXMDM == null || InObject.JIANCHAXMDM == "") { throw new Exception(string.Format("检查项目不能为空!")); } var listjcsb = DBVisitor.ExecuteModel(SqlLoad.GetFormat(SQ.FSD00007, jcsbdm)); if (listjcsb == null) { throw new Exception(string.Format("未找到预约设备:设备编号[{0}]", jcsbdm)); } if (listjcsb.Items.Count == 0)//判断有无该设备 { throw new Exception(string.Format("未找到预约设备:设备编号[{0}]", jcsbdm)); } else { if (listjcsb.Items["JCSBZT"].ToString() != "0")//设备是否可用 { throw new Exception(string.Format("预约设备故障或者已停用:设备编号[{0}]", jcsbdm)); } else { if (listjcsb.Items["SBYYBZ"].ToString() != "0")//设备是否可预约 { throw new Exception(string.Format("预约设备为不可预约状态:设备编号[{0}]", jcsbdm)); } else { //获取设备某天预约排班信息 var listsbyyxx = DBVisitor.ExecuteModel(SqlLoad.GetFormat(SQ.FSD00002, jcsbdm, yyrq, yysj, 0)); if (listsbyyxx == null) { throw new Exception(string.Format("未找到预约号信息!")); } //取得预约类型,再去取预约号及状态 var jcyylx = int.Parse(listsbyyxx.Items["JCYYLX"].ToString()); var yyhxx = int.Parse(listsbyyxx.Items["YYHXX"].ToString()); var yyzs = int.Parse(listsbyyxx.Items["YYZS"].ToString()); var kyys = int.Parse(listsbyyxx.Items["KYYS"].ToString()); var xcyls = int.Parse(listsbyyxx.Items["XCYLS"].ToString()); var yyys = int.Parse(listsbyyxx.Items["YYYS"].ToString()); int xcyy = 0;//现场预约值为2,则检索所有数据 var zykyys = int.Parse(listsbyyxx.Items["ZYKYYS"].ToString()); var zyyyys = int.Parse(listsbyyxx.Items["ZYYYYS"].ToString()); var mzkyys = int.Parse(listsbyyxx.Items["MZKYYS"].ToString()); var mzyyys = int.Parse(listsbyyxx.Items["MZYYYS"].ToString()); var sqkyys = int.Parse(listsbyyxx.Items["SQKYYS"].ToString()); var sqyyys = int.Parse(listsbyyxx.Items["SQYYYS"].ToString()); var tran = DBVisitor.Connection.BeginTransaction(); var yysjd = listsbyyxx.Items["KSSJ"].ToString() + "-" + listsbyyxx.Items["JSSJ"].ToString(); if (string.Compare(listsbyyxx.Items["PBRQ"].ToString(), DateTime.Now.ToString("yyyy-MM-dd")) == 0) { xcyy = 2; } if (xcyy == 0)//非现场预约,则判断门诊住院预约的比例值 { if (InObject.BINGRENLX == 2) { if (InObject.YEWULY == "3") { if (sqkyys <= sqyyys) { throw new Exception(string.Format("当前社区可预约数已预约完,不能再预约!")); } ++sqyyys; } else { if (zykyys <= zyyyys) { throw new Exception(string.Format("当前住院可预约数已预约完,不能再预约!")); } ++zyyyys; } } else { if (InObject.YEWULY == "3") { if (sqkyys <= sqyyys) { throw new Exception(string.Format("当前社区可预约数已预约完,不能再预约!")); } ++sqyyys; } else { if (mzkyys <= mzyyys) { throw new Exception(string.Format("当前门诊可预约数已预约完,不能再预约!")); } ++mzyyys; } } } if (jcyylx == 1)//有预约号模式 { if (InObject.YUYUEH == null || InObject.YUYUEH == "") { throw new Exception(string.Format("预约号不能为空!")); } yyh = InObject.YUYUEH.ToString(); var listsbyyhxx = DBVisitor.ExecuteModel(SqlLoad.GetFormat(SQ.FSD00010, yyhxx, yyh)); if (listsbyyhxx == null) { throw new Exception(string.Format("未找到预约号:预约号:[{0}]!", yyh)); } if (listsbyyhxx.Items["YYZT"].ToString() == "1") { throw new Exception(string.Format("该预约号已被预约:预约号:[{0}]!", yyh)); } else { try { if (InObject.YEWULY == "3") { //更新预约排班表 社区 DBVisitor.ExecuteNonQuery(SqlLoad.GetFormat(SQ.FSD00021, yyhxx, yyys + 1, sqyyys), tran); } else if (InObject.BINGRENLX == 2) { //更新预约排班表 住院 DBVisitor.ExecuteNonQuery(SqlLoad.GetFormat(SQ.FSD00008, yyhxx, yyys + 1, zyyyys), tran); } else { //更新预约排班表 门诊 DBVisitor.ExecuteNonQuery(SqlLoad.GetFormat(SQ.FSD00020, yyhxx, yyys + 1, mzyyys), tran); } //更新预约排班表 //DBVisitor.ExecuteNonQuery(SqlLoad.GetFormat(SQ.FSD00008, yyhxx, yyys + 1, zyyyys), tran); //更新预约号状态 DBVisitor.ExecuteNonQuery(SqlLoad.GetFormat(SQ.FSD00009, yyhxx, yyh, 1), tran); //tran.Commit(); } catch (Exception ex) { tran.Rollback(); throw ex; } } } else//无预约号模式 { try { //取得当前预约信息未预约的最小号码 var listsbyyhxx = DBVisitor.ExecuteModel(SqlLoad.GetFormat(SQ.FSD00013, yyhxx, xcyy)); if (listsbyyhxx == null) { throw new Exception(string.Format("预约已满!")); } yyh = listsbyyhxx.Items["YYH"].ToString(); if (InObject.YEWULY == "3") { //更新预约排班表 社区 DBVisitor.ExecuteNonQuery(SqlLoad.GetFormat(SQ.FSD00021, yyhxx, yyys + 1, sqyyys), tran); } else if (InObject.BINGRENLX == 2) { //更新预约排班表 住院 DBVisitor.ExecuteNonQuery(SqlLoad.GetFormat(SQ.FSD00008, yyhxx, yyys + 1, zyyyys), tran); } else { //更新预约排班表 门诊 DBVisitor.ExecuteNonQuery(SqlLoad.GetFormat(SQ.FSD00020, yyhxx, yyys + 1, mzyyys), tran); } //更新预约排班表 //DBVisitor.ExecuteNonQuery(SqlLoad.GetFormat(SQ.FSD00008, yyhxx, yyys + 1, zyyyys), tran); //更新预约号状态 DBVisitor.ExecuteNonQuery(SqlLoad.GetFormat(SQ.FSD00009, yyhxx, yyh, 1), tran); //tran.Commit(); } catch (Exception ex) { tran.Rollback(); throw ex; } } try { var listyylsh = DBVisitor.ExecuteModel(SqlLoad.GetFormat(SQ.FSD00017)); var yysqlsh = listyylsh.Items["YYSQLSH"].ToString(); var listyysqdbh = DBVisitor.ExecuteModel(SqlLoad.GetFormat(SQ.FSD00018)); var yysqdbh = listyysqdbh.Items["YYSQDBH"].ToString(); //插入预约申请信息fdsyy_sq DBVisitor.ExecuteNonQuery(SqlLoad.GetFormat(SQ.FSD00011, "申请单", //预约申请单名称 InObject.YUYUEZT, //预约申请单状态(0未确认,1已确认,9作废) InObject.JIANCHAKSDM, //检查科室代码 InObject.JIANCHAKSMC, //检查科室名称 InObject.BINGRENFPH, //病人发票号 InObject.BINGRENLX, //病人类型 InObject.BINGRENLXMC, //病人类型名称 InObject.BINGRENKH, //病人卡号 InObject.BINGRENMZH, //病人门诊号 InObject.BINGRENZYH, //病人住院号 InObject.BINGRENBQDM, //病人病区代码 InObject.BINGRENBQMC, //病人病区名称 InObject.BINGRENCWH, //病人床位号 InObject.BINGRENXM, //病人姓名 InObject.BINGRENXB, //病人性别 InObject.BINGRENNL, //病人年龄 InObject.BINGRENCSRQ, //病人出生日期 InObject.BINGRENLXDZ, //病人联系地址 InObject.BINGRENLXDH, //病人联系电话 InObject.SHENQINGYSGH, //申请医生工号 InObject.SHENQINGYSMC, //申请医生姓名 "", //申请科室代码 "", //申请科室名称 InObject.SHENQINGYYDM, //申请医院代码 InObject.SHENQINGYYMC, //申请医院名称 "", //检查号 InObject.YUYUERQ, //检查日期 InObject.YUYUESJ, //检查时间 InObject.JIANCHAXMDM, //检查项目代码 InObject.JIANCHAXMMC, //检查项目名称 InObject.JIANCHAXMLX, //检查项目类型 InObject.JIANCHABWDM, //检查部位代码 InObject.JIANCHABWMC, //检查部位名称 InObject.JIANCHASBDM, //检查设备代码 InObject.JIANCHASBMC, //检查设备名称 InObject.JIANCHASBDD, //检查设备地点 yyh, //预约号 InObject.SHENFENZH, //身份证号 InObject.YUYUESF, //预约收费(0未收费,1已收费) InObject.JIANCHASQDBH, //检查申请单编号 InObject.YINGXIANGFX, yysjd, //影像方向 yysqlsh, //预约申请流水号 yysqdbh, //预约申请单编号 InObject.XIANGXIAPSJ, //详细安排时间 InObject.YEWULY, 1, 0, 0, 0), tran);//业务来源 tran.Commit(); OutObject = new SHEBEIYY_OUT(); OutObject.YUYUERQ = yyrq; OutObject.YUYUESJ = yysj; OutObject.YUYUEH = yyh; OutObject.YUYUESQDBH = yysqdbh; } catch (Exception ex) { tran.Rollback(); throw ex; } } } } #endregion } }
public static void sendXZSQSJ() { var Brxx = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.AUTO00001, " and xzzt = 1 and xzsqfszt = 0 ")); if (Brxx == null || Brxx.Count == 0) { } else { foreach (var mxxx in Brxx) { var str = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + "<request action= \"sendExchangeReport\" client=\"市二:192.168.1.10\" >" + "<head><patient><mpiId></mpiId>" + "<personName>" + mxxx.Get("brxm") + "</personName>" + "<sexCode>" + mxxx.Get("brxb") + "</sexCode>" + "<birthday>" + mxxx.Get("brcsrq") + "</birthday>" + "<idCard>" + mxxx.Get("sfzh") + "</idCard>" + "<idType>01</idType>" + "<cardNo>" + mxxx.Get("jzkh") + "</cardNo>" + "<cardType>" + mxxx.Get("jzklx") + "</cardType>" + "</patient></head>" + "<body>" + "<yybm>47011662233010511A1001</yybm>" + "<zzdh>" + mxxx.Get("zzsqdh") + "</zzdh>" + "<zzdh>" + mxxx.Get("zzsqdh") + "</zzdh>" + "<zljg>" + mxxx.Get("cyzt") + "</zljg>" + "<xzrq>" + mxxx.Get("xzsqrq") + "</xzrq>" + "<kfnr>" + mxxx.Get("cyzt") + "</kfnr>" + "<zzys>" + mxxx.Get("zzys") + "</zzys>" + "<cyxj>" + mxxx.Get("xzzzyy") + "</cyxj>" + "<tjys>自动转发</tjys>" + "<tjsj>" + System.DateTime.Now.ToString() + "</tjsj>" + "<tjjg>杭州市二医院</tjjg>"; var cfxx = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.AUTO00014, mxxx.Get("jzxh"))); if (cfxx == null || cfxx.Count == 0) { } else { foreach (var item in cfxx) { str += "<chufangxx>" + "<cfid>" + item.Get("cfid") + "</cfid>" + "<brxm>" + mxxx.Get("brxm") + "</brxm>" + "<cflx>" + item.Get("cflx") + "</cflx>" + "<cfks>" + item.Get("cfks") + "</cfks>" + "<cfys>" + item.Get("cfys") + "</cfys>" + "<cfrq>" + item.Get("cfrq") + "</cfrq>" + "<bzxx>" + item.Get("bzxx") + "</bzxx>"; var cfmxxx = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.AUTO00015, item.Get("cfid"))); if (cfmxxx == null || cfmxxx.Count == 0) { } else { foreach (var itemmx in cfmxxx) { str += "<chufangxxxx>" + "<cfid>" + item.Get("cfid") + "</cfid>" + "<yplx>" + itemmx.Get("yplx") + "</yplx>" + "<ypmc>" + itemmx.Get("ypmc") + "</ypmc>" + "<ypgg>" + itemmx.Get("ypgg") + "</ypgg>" + "<ycjl>" + itemmx.Get("ycjl") + "</ycjl>" + "<jldw>" + itemmx.Get("jldw") + "</jldw>" + "<yyts>" + itemmx.Get("yyts") + "</yyts>" + "<yypl>" + itemmx.Get("yypl") + "</yypl>" + "<ypcd>" + itemmx.Get("ypcd") + "</ypcd>" + "<yysl>" + itemmx.Get("ypsl") + "</yysl>" + "<ypyf>" + itemmx.Get("ypyf") + "</ypyf>" + "<kssj>" + itemmx.Get("kssj") + "</kssj>" + "<tzsj>" + itemmx.Get("tzsj") + "</tzsj>" + "<psjg>" + itemmx.Get("psjg") + "</psjg>" + "<zyts>" + itemmx.Get("zyts") + "</zyts>" + "<fyrq>" + itemmx.Get("fyrq") + "</fyrq>" + "</chufangxxxx>"; } } str += "</chufangxx>"; } } var jyxx = DBVisitor1.ExecuteModels(SqlLoad.GetFormat(SQ.AUTO00016, mxxx.Get("jzxh"))); if (jyxx == null || jyxx.Count == 0) { } else { foreach (var item in jyxx) { str += "<jianyanxx>" + "<jydh>" + item.Get("jydh") + "</jydh>" + "<jylb>" + item.Get("jylb") + "</jylb>" + "<jyxm>" + item.Get("jyxm") + "</jyxm>" + "<kdrq>" + item.Get("kdrq") + "</kdrq>" + "<kdys>" + item.Get("kdys") + "</kdys>" + "<kdks>" + item.Get("kdks") + "</kdks>" + "<jyff>" + item.Get("jyff") + "</jyff>" + "<jyjg>" + item.Get("jyjg") + "</jyjg>" + "<bzxx>" + item.Get("bzxx") + "</bzxx>"; var jymxxx = DBVisitor1.ExecuteModels(SqlLoad.GetFormat(SQ.AUTO00017, item.Get("jydh"))); if (jymxxx == null || jymxxx.Count == 0) { } else { foreach (var itemmx in jymxxx) { str += "<jianyanmxxx>" + "<jyxm>" + item.Get("jyxm") + "</jyxm>" + "<jyjgdx>" + item.Get("jyjgdx") + "</jyjgdx>" + "<jydh>" + item.Get("jydh") + "</jydh>" + "<jyjgsz>" + item.Get("jyjg") + "</jyjgsz>" + "<jldw>" + item.Get("jldw") + "</jldw>" + "<ckgz>" + item.Get("ckgz") + "</ckgz>" + "<ckdz>" + item.Get("ckdz") + "</ckdz>" + "<jyzb>" + item.Get("jyzb") + "</jyzb>" + "<bzxx>" + item.Get("bzxx") + "</bzxx>" + "</jianyanmxx>"; } } str += "</jianyanxx>"; } } var jcxx = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.AUTO00020, mxxx.Get("jzxh"))); if (jcxx == null || jcxx.Count == 0) { } else { foreach (var item in jcxx) { str += "<jianchaxx>" + "<jcdh>" + item.Get("jcdh") + "</jcdh>" + "<yxbh>" + item.Get("yxbh") + "</yxbh>" + "<jclb>" + item.Get("jclb") + "</jclb>" + "<jcxm>" + item.Get("jcxm") + "</jcxm>" + "<jcbw>" + item.Get("jcbw") + "</jcbw>" + "<jcsqd>" + item.Get("jcsqd") + "</jcsqd>" + "<jcbg>" + item.Get("jcbg") + "</jcbg>" + "<yxxx>" + item.Get("yxxx") + "</yxxx>" + "<jcjg>" + item.Get("jcjg") + "</jcjg>" + "<bzxx>" + item.Get("bzxx") + "</bzxx>" + "</jianchaxx>"; } } var zyyzxx = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.AUTO00019, mxxx.Get("jzxh"))); if (zyyzxx == null || zyyzxx.Count == 0) { } else { str += "<zyyzjl>"; foreach (var item in zyyzxx) { str += "<zyyzmx>" + "<yzxm>" + item.Get("yzxh") + "</yzxm>" + "<zyh>" + mxxx.Get("bah") + "</zyh>" + "<ypmc>" + item.Get("ypmc") + "</ypmc>" + "<ypcd>" + item.Get("ypcd") + "</ypcd>" + "<yfgg>" + item.Get("yfgg") + "</yfgg>" + "<yfdw>" + item.Get("yfdw") + "</yfdw>" + "<kssj>" + item.Get("kssj") + "</kssj>" + "<ycsl>" + item.Get("ycsl") + "</ycsl>" + "<ytcs>" + item.Get("ytcs") + "</ytcs>" + "<fysl>" + item.Get("fysl") + "</fysl>" + "<sypc>" + item.Get("sypc") + "</sypc>" + "<yzlx>" + item.Get("yzlx") + "</yzlx>" + "<yyts>" + item.Get("yyts") + "</yyts>" + "</zyyzmx>"; } str += "</zyyzjl>"; } str += "</body></request>"; var rtnstr = sendJK(str); var xmldom = new XmlDocument(); var xmlOut = ""; xmlOut = rtnstr; xmldom.LoadXml(xmlOut); var errno = xmldom.GetElementsByTagName("code").Item(0).FirstChild.InnerText; if (errno == "200") { var tran = DBVisitor.Connection.BeginTransaction(); try { DBVisitor.ExecuteNonQuery(SqlLoad.GetFormat(SQ.AUTO00007, mxxx.Get("zzsqdh")), tran); tran.Commit(); } catch (Exception ex) { tran.Rollback(); } } } } }
public override void ProcessMessage() { var sqlsb = ""; OutObject = new SHEBEIYYZTCX_OUT(); OutObject.SHEBEIYYXXXX = new List <SHEBEIYYXX>(); var xmlIn = ""; //var ldweb = new LaiDaWebService.WebServiceSoapClient(); //var xmlOut = ldweb.HISYY_GetResource(xmlIn); if (string.Compare(InObject.YUYUERQ.ToString(), DateTime.Now.ToString("yyyy-MM-dd")) < 0) { throw new Exception(string.Format("预约日期必须大于等于今天!")); } if (InObject.JIANCHAXMDM == null || InObject.JIANCHAXMDM == "") { throw new Exception(string.Format("预约项目不能为空!")); } if (System.Configuration.ConfigurationManager.AppSettings["JianChaJKMS"] == "1") { var resource = new HISYY_GetResource(); //var result = new HISYY_GetResource_Result(); resource.HospitalCode = InObject.BASEINFO.JIGOUDM; resource.HospitalName = "杭州市第一人民医院"; var codes = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.FSD00027, InObject.JIANCHAXMDM)); foreach (var code in codes) { resource.BespeakExamine.Add(new BespeakExamine() { ExamineCode = code["LBXH"].ToString(), ExamineName = Unity.encodeString(code["LBMC"].ToString()) }); } resource.BespeakDate = InObject.YUYUERQ.Replace("-", string.Empty); if (InObject.YEWULX == "2") { resource.AdmissionSource = "10"; } else { resource.AdmissionSource = "50"; } codes = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.FSD00027, InObject.JIANCHAXMDM)); resource.StudiesDepartMentCode = codes[0]["JCKS"].ToString(); resource.StudiesDepartMentName = codes[0]["KSMC"].ToString(); resource.IsJZ = InObject.JIZHEN; resource.IsZQ = InObject.ZENGQIANG; resource.IsLS = InObject.LINSHI; ///调用WEBSERVICE string url = System.Configuration.ConfigurationManager.AppSettings["LAIDAURL"]; string xml = XMLHandle.EntitytoXML <HISYY_GetResource>(resource); HISYY_GetResource_Result result = XMLHandle.XMLtoEntity <HISYY_GetResource_Result>(WSServer.Call <HISYY_GetResource>(url, xml).ToString()); if (result.Success == "False") { throw new Exception("取号源信息失败,错误原因:" + result.Message); } string[] separators = { ",", " " }; foreach (var time in result.BespeakDatePart.Split(separators, StringSplitOptions.RemoveEmptyEntries)) { var pbxx = new SHEBEIYYXX(); pbxx.JIANCHASBDM = result.DeviceCode; pbxx.JIANCHASBMC = result.DeviceName; pbxx.JIANCHASBDD = result.DeviceLocation; pbxx.YUYUERQ = InObject.YUYUERQ; pbxx.YUYUEKSSJ = time.Split('-')[0]; pbxx.YUYUEJSSJ = time.Split('-')[1]; pbxx.JIANCHAYYLX = 1; pbxx.XIANGMUHS = Convert.ToInt16(result.ExaminePartTime); OutObject.SHEBEIYYXXXX.Add(pbxx); } } else { #region 市2模式 InObject.JIANCHAXMDM = InObject.JIANCHAXMDM.ToString().Replace(",", ","); if (InObject.JIANCHAXMDM.IndexOf(',') >= 0) { sqlsb += " having( count(distinct a.jcxmdm) >= " + InObject.JIANCHAXMDM.Split(',').Length.ToString() + ") group by a.jcsbdm "; } //取得对应设备 var listdysb = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.FSD00001, InObject.JIANCHAXMDM, sqlsb)); if (listdysb.Count == 0) { throw new Exception(string.Format("找不到项目对应的检查设备信息:项目代码[{0}]", InObject.JIANCHAXMDM)); } else { foreach (var item in listdysb) { var jcsbdm = item.Get("jcsbdm"); var sypb = 0; //取得设备当前日期和时间的排班信息-- //若查询类型为空或0,则查询当前日期当前时间之后的所有排班信息 if (InObject.CHAXUNLX == null || InObject.CHAXUNLX == "0") { sypb = 1; } var listsbpbxx = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.FSD00002, jcsbdm, InObject.YUYUERQ, InObject.YUYUESJ, sypb)); if (listsbpbxx.Count == 0) { //throw new Exception(string.Format("未找到排班信息!")); } else { foreach (var item_sb in listsbpbxx) { var pbxx = new SHEBEIYYXX(); pbxx.JIANCHASBDM = item_sb.Get("jcsbdm"); pbxx.JIANCHASBMC = item_sb.Get("jcsbmc"); pbxx.JIANCHASBDD = item_sb.Get("jcsbdd"); pbxx.YUYUERQ = item_sb.Get("pbrq"); pbxx.YUYUEKSSJ = item_sb.Get("kssj"); pbxx.YUYUEJSSJ = item_sb.Get("jssj"); pbxx.YUYUEJCBW = item_sb.Get("yyjcbw"); pbxx.JIANCHAYYLX = Convert.ToInt16(item_sb.Get("jcyylx")); int xcyy = 0;//现场预约值为2,检索所有数据 if (InObject.YEWULY == "3") { pbxx.YUYUEHZS = int.Parse(item_sb.Get("sqkyys")); pbxx.YIYUYUES = int.Parse(item_sb.Get("sqyyys")); } else if (InObject.YEWULY == "2") { pbxx.YUYUEHZS = int.Parse(item_sb.Get("zykyys")); pbxx.YIYUYUES = int.Parse(item_sb.Get("zyyyys")); } else if (InObject.YEWULY == "1") { pbxx.YUYUEHZS = int.Parse(item_sb.Get("mzkyys")); pbxx.YIYUYUES = int.Parse(item_sb.Get("mzyyys")); } else { if (item_sb.Get("pbrq") == DateTime.Now.ToString("yyyy-MM-dd")) { pbxx.YUYUEHZS = int.Parse(item_sb.Get("yyzs")); xcyy = 2; } else { pbxx.YUYUEHZS = int.Parse(item_sb.Get("kyys")); } pbxx.YIYUYUES = int.Parse(item_sb.Get("yyys")); } //当天预约,查询所有预约号 //非当天预约,查询可预约号(去除预留号) if (pbxx.YUYUEHZS > pbxx.YIYUYUES) { var listyyhxx = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.FSD00003, item_sb.Get("yyhxx"), xcyy)); var yyhxx_list = new List <YUYUEHXX>(); foreach (var item_yyh in listyyhxx) { var yyhxx = new YUYUEHXX(); yyhxx.YUYUEH = item_yyh.Get("yyh"); yyhxx.YUYUEZT = int.Parse(item_yyh.Get("yyzt")); yyhxx_list.Add(yyhxx); } pbxx.YUYUEHXXXX = yyhxx_list; //OutObject.SHEBEIYYXXXX.Add(pbxx); } else { var yyhxx_list = new List <YUYUEHXX>(); pbxx.YUYUEHXXXX = yyhxx_list; } OutObject.SHEBEIYYXXXX.Add(pbxx); } } } } #endregion } }
public override void ProcessMessage() { var sql = ""; var yyrq = ""; int jl = 0; OutObject = new YUYUEXXCX_OUT(); OutObject.YUYUEXXXX = new List <YUYUEXX>(); if (InObject.YUYUESQDBH.ToString() != "") { sql = " and a.yysqdbh = '" + InObject.YUYUESQDBH.ToString() + "'"; } if (InObject.BINGRENKH.ToString() != "") { sql = sql + " and a.brkh = '" + InObject.BINGRENKH.ToString() + "'"; } if (InObject.BINGRENMZH.ToString() != "") { sql = sql + " and a.brmzh = '" + InObject.BINGRENMZH.ToString() + "'"; } if (InObject.BINGRENZYH.ToString() != "") { sql = sql + " and a.brzyh = '" + InObject.BINGRENZYH.ToString() + "'"; } if (InObject.SHENFENZH.ToString() != "") { sql = sql + " and a.sfzh = '" + InObject.SHENFENZH.ToString() + "'"; } if (InObject.JIANCHASQDBH.ToString() != "") { sql = sql + " and a.jcsqdbh = '" + InObject.JIANCHASQDBH.ToString() + "'"; } int dtrq = 0;//如果是当天则为0,非当天为1 if (InObject.YUYUEKSRQ.ToString() == "") { dtrq = 1; yyrq = DateTime.Now.ToString("yyyy-MM-dd"); } else { if (InObject.YUYUEKSRQ == DateTime.Now.ToString("yyyy-MM-dd")) { dtrq = 0; } else { dtrq = 1; } yyrq = InObject.YUYUEKSRQ.ToString(); } if (string.IsNullOrEmpty(InObject.CHAXUNLX))//0是所有,1是已预约,2未预约 { InObject.CHAXUNLX = "0"; } if (InObject.CHAXUNLX == "0" || InObject.CHAXUNLX == "1") { var listyyxx = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.FSD00006, sql, yyrq, dtrq)); if (listyyxx.Count == 0) { jl = 2; //OutObject = new YUYUEXXCX_OUT(); //OutObject.OUTMSG.ERRNO = "-2"; //OutObject.OUTMSG.ERRMSG = "找不到预约信息"; //return; //throw new Exception(string.Format("找不到预约信息")); } else { jl = 1; foreach (var item in listyyxx) { var yyxx = new YUYUEXX(); var csrq = ""; if (string.IsNullOrEmpty(item.Get("brcsrq"))) { csrq = "1901-01-01"; } else { csrq = item.Get("brcsrq").ToString(); } yyxx.JIANCHAKSDM = string.Empty;// (item.Get("jcksdm") == "" ? string.Empty : item.Get("jcksdm")); yyxx.JIANCHAKSMC = item.Get("jcksmc"); yyxx.BINGRENFPH = item.Get("brfph"); yyxx.BINGRENLX = int.Parse(item.Get("brlx")); yyxx.BINGRENLXMC = item.Get("brlxmc"); yyxx.BINGRENKH = item.Get("brkh"); yyxx.BINGRENMZH = item.Get("brmzh"); yyxx.BINGRENZYH = item.Get("brzyh"); yyxx.BINGRENBQDM = item.Get("brbqdm"); yyxx.BINGRENBQMC = item.Get("brbqmc"); yyxx.BINGRENCWH = item.Get("brcwh"); yyxx.BINGRENXM = item.Get("brxm"); yyxx.BINGRENXB = int.Parse(item.Get("brxb")); yyxx.BINGRENNL = item.Get("brnl").ToString(); yyxx.BINGRENCSRQ = Convert.ToDateTime(csrq).ToString("yyyy-MM-dd HH:mm:ss"); yyxx.BINGRENLXDZ = item.Get("brlxdz"); yyxx.BINGRENLXDH = item.Get("brlxdh"); yyxx.SHENQINGYSGH = item.Get("sqysgh"); yyxx.SHENQINGYSMC = item.Get("sqysmc"); yyxx.SHENQINGYYDM = item.Get("sqyydm"); yyxx.SHENQINGYYMC = item.Get("sqyymc"); yyxx.JIANCHAXMDM = item.Get("jcxmdm"); yyxx.JIANCHAXMMC = item.Get("jcxmmc"); yyxx.JIANCHAXMLX = item.Get("jcxmlx"); yyxx.JIANCHABWDM = item.Get("jcbwdm"); yyxx.JIANCHABWMC = item.Get("jcbwmc"); yyxx.JIANCHASBDM = int.Parse(item.Get("jcsbdm")); yyxx.JIANCHASBMC = item.Get("jcsbmc"); yyxx.JIANCHASBDD = item.Get("jcsbdd"); yyxx.YUYUEH = item.Get("yyh"); yyxx.SHENFENZH = item.Get("sfzh"); yyxx.YUYUESF = int.Parse(item.Get("yysf")); yyxx.YUYUESQDBH = item.Get("yysqdbh"); yyxx.YUYUESQDZT = int.Parse(item.Get("yysqdzt")); yyxx.SHENQINGSJ = item.Get("sqsj"); yyxx.JIANCHAH = item.Get("jch"); yyxx.YUYUERQ = item.Get("jcrq"); yyxx.YUYUESJ = item.Get("jcsj"); yyxx.JIANCHASQDBH = item.Get("jcsqdbh"); yyxx.YINGXIANGFX = item.Get("yxfx"); yyxx.YUYUSJD = item.Get("yysjd"); OutObject.YUYUEXXXX.Add(yyxx); } } } if (InObject.CHAXUNLX == "0" || InObject.CHAXUNLX == "2") { //查询未预约信息 var listwyyxx = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.FSD00019, sql)); if (listwyyxx.Count == 0) { if (jl != 1) { jl = 2; } //OutObject = new YUYUEXXCX_OUT(); //OutObject.OUTMSG.ERRNO = "-2"; //OutObject.OUTMSG.ERRMSG = "找不到预约信息"; //return; //throw new Exception(string.Format("找不到预约信息")); } else { jl = 1; //OutObject = new YUYUEXXCX_OUT(); //OutObject.YUYUEXXXX = new List<YUYUEXX>(); foreach (var item in listwyyxx) { var yyxx = new YUYUEXX(); var csrq = ""; if (string.IsNullOrEmpty(item.Get("brcsrq"))) { csrq = "1901-01-01"; } else { csrq = item.Get("brcsrq").ToString(); } yyxx.JIANCHAKSDM = item.Get("jcksdm"); yyxx.JIANCHAKSMC = item.Get("jcksmc"); yyxx.BINGRENFPH = item.Get("brfph"); yyxx.BINGRENLX = int.Parse(item.Get("brlx")); yyxx.BINGRENLXMC = item.Get("brlxmc"); yyxx.BINGRENKH = item.Get("brkh"); yyxx.BINGRENMZH = item.Get("brmzh"); yyxx.BINGRENZYH = item.Get("brzyh"); yyxx.BINGRENBQDM = item.Get("brbqdm"); yyxx.BINGRENBQMC = item.Get("brbqmc"); yyxx.BINGRENCWH = item.Get("brcwh"); yyxx.BINGRENXM = item.Get("brxm"); yyxx.BINGRENXB = int.Parse(item.Get("brxb")); yyxx.BINGRENNL = item.Get("brnl").ToString(); yyxx.BINGRENCSRQ = Convert.ToDateTime(csrq).ToString("yyyy-MM-dd HH:mm:ss"); yyxx.BINGRENLXDZ = item.Get("brlxdz"); yyxx.BINGRENLXDH = item.Get("brlxdh"); yyxx.SHENQINGYSGH = item.Get("sqysgh"); yyxx.SHENQINGYSMC = item.Get("sqysmc"); yyxx.SHENQINGYYDM = item.Get("sqyydm"); yyxx.SHENQINGYYMC = item.Get("sqyymc"); yyxx.JIANCHAXMDM = item.Get("jcxmdm"); yyxx.JIANCHAXMMC = item.Get("jcxmmc"); yyxx.JIANCHAXMLX = item.Get("jcxmlx"); yyxx.JIANCHABWDM = item.Get("jcbwdm"); yyxx.JIANCHABWMC = item.Get("jcbwmc"); //yyxx.JIANCHASBDM = int.Parse(item.Get("jcsbdm")); yyxx.JIANCHASBMC = ""; yyxx.JIANCHASBDD = ""; yyxx.YUYUEH = ""; yyxx.SHENFENZH = item.Get("sfzh"); //yyxx.YUYUESF = int.Parse(item.Get("yysf")); yyxx.YUYUESQDBH = ""; //yyxx.YUYUESQDZT = int.Parse(item.Get("yysqdzt")); yyxx.SHENQINGSJ = item.Get("jcsqrq"); yyxx.JIANCHAH = ""; yyxx.YUYUERQ = ""; yyxx.YUYUESJ = ""; yyxx.JIANCHASQDBH = item.Get("jcsqdbh"); yyxx.YINGXIANGFX = item.Get("yxfx"); yyxx.YUYUSJD = ""; OutObject.YUYUEXXXX.Add(yyxx); } } } if (jl != 1) { OutObject.OUTMSG.ERRNO = "-2"; OutObject.OUTMSG.ERRMSG = "找不到预约信息"; } }
protected void Page_Load(object sender, EventArgs e) { SortedDictionary <string, string> sPara = GetRequestPost(); if (sPara.Count > 0)//判断是否有带返回参数 { Notify aliNotify = new Notify(); HIS4.Biz.LogUnit.Write("notify_id:" + Request.Form["notify_id"], "NotifyUrl"); HIS4.Biz.LogUnit.Write("sign" + Request.Form["sign"], "NotifyUrl"); bool verifyResult = aliNotify.Verify(sPara, Request.Form["notify_id"], Request.Form["sign"]); // if (verifyResult)//验证成功 if (true) { ///////////////////////////////////////////////////////////////////////////////////////////////////////////// //请在这里加上商户的业务逻辑程序代码 //——请根据您的业务逻辑来编写程序(以下代码仅作参考)—— //获取支付宝的通知返回参数,可参考技术文档中服务器异步通知参数列表 //商户订单号 string out_trade_no = Request.Form["out_trade_no"]; HIS4.Biz.LogUnit.Write("out_trade_no:" + Request.Form["out_trade_no"], "NotifyUrl"); //支付宝交易号 string trade_no = Request.Form["trade_no"]; HIS4.Biz.LogUnit.Write("trade_no:" + Request.Form["trade_no"], "NotifyUrl"); //交易状态 string trade_status = Request.Form["trade_status"]; HIS4.Biz.LogUnit.Write("trade_status:" + Request.Form["trade_status"], "NotifyUrl"); //WAIT_BUYER_PAY 交易创建,等待买家付款。 //TRADE_CLOSED 在指定时间段内未支付时关闭的交易; //在交易完成全额退款成功时关闭的交易。 //TRADE_SUCCESS 交易成功,且可对该交易做操作,如:多级分润、退款等。 //TRADE_PENDING 等待卖家收款(买家付款后,如果卖家账号被冻结)。 //TRADE_FINISHED 交易成功且结束,即不可再做任何操作 if (trade_status == "TRADE_SUCCESS") { //更新状态 未入账 DBVisitor.ExecuteNonQuery(string.Format("update JR_ZHIFUBAOJSXX set JIESUANZT='2',IBUYERID='{1}',IBUYEREMAIL='{2}' where IOUTTRADENO='{0}' ", out_trade_no, sPara["buyer_id"], sPara["buyer_email"])); } else { //更新状态 结算失败 DBVisitor.ExecuteNonQuery(string.Format("update JR_ZHIFUBAOJSXX set FAILERR='{0}',JIESUANZT='-1' ,IBUYERID='{1}',IBUYEREMAIL='{2}' where IOUTTRADENO='{3}' ", trade_status, sPara["buyer_id"], sPara["buyer_email"], Request.Form["trade_no"])); } //如果没有数据 修改返回状态 var listpbxx = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.HIS00002, out_trade_no)); if (listpbxx.Count <= 0) { trade_status = "NODATA"; return; } string HttpIndata = "notify_id=" + Request.Form["notify_id"] + "&" + "sign=" + Request.Form["sign"] + "&" + "out_trade_no=" + out_trade_no + "&" + "trade_no=" + trade_no + "&" + "trade_status=" + trade_status + "&" + "total_fee=" + Request.Form["total_fee"]; HIS4.Biz.LogUnit.Write("POSE入参:" + HttpIndata, "NotifyUrl"); //POST提交给请求断 string ret = PostWebRequest(listpbxx[0]["INOTIFYURL"].ToString(), HttpIndata); HIS4.Biz.LogUnit.Write("POSE出参:" + ret, "NotifyUrl"); if (ret.ToLower() == "success") //处理成功 { //结算成功 DateTime dt = string.IsNullOrEmpty(Request.Form["gmt_payment"]) ? DateTime.Now : DateTime.Parse(Request.Form["gmt_payment"]); DBVisitor.ExecuteNonQuery( "update JR_ZHIFUBAOJSXX set JIESUANSJ=To_Date('{dt}','yyyy-mm-dd hh24:mi:ss'),JIESUANZT='1',TRADENO='{trade_no}' where IOUTTRADENO='{out_trade_no}' "); Response.Write("success"); //请不要修改或删除 } else { //更新状态 结算失败 DBVisitor.ExecuteNonQuery(string.Format("update JR_ZHIFUBAOJSXX set FAILERR='{0}' where IOUTTRADENO='{1}' ", ret, out_trade_no)); Response.Write("success");//处理失败 } } else//验证失败 { DBVisitor.ExecuteNonQuery(string.Format("update JR_ZHIFUBAOJSXX set FAILERR='{0}',JIESUANZT='-1' where IOUTTRADENO='{1}' ", "验证失败", Request.Form["out_trade_no"])); Response.Write("success"); } } else { Response.Write("无通知参数"); } }
public override void ProcessMessage() { var fygl = InObject.XIANGMUGL; var xiangMuLX = InObject.XIANGMULX.ToString(); var srmlx = InObject.SHURUMLX; var srm = InObject.SHURUM.ToUpper(); #region 查询套餐 套餐明细 if (!(string.IsNullOrEmpty(fygl)) && fygl.Trim() == "1" && (xiangMuLX == "8" || xiangMuLX == "9")) { if (xiangMuLX == "8") { string xmgl = " and sfxm=99"; if (srmlx == "0") { xmgl += " and SRM1 like '" + srm + "%'"; }//拼音码 else if (srmlx == "1") { xmgl += " and SRM2 like '" + srm + "%'"; }//五笔码 else if (srmlx == "2") { xmgl += " and YLMC like '" + srm + "%'"; }//汉字 var xmmclist = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.BASE00013, xmgl)); if (xmmclist.Count == 0) { throw new Exception(string.Format("无套餐信息!")); } else { OutObject = new ZD_ZHENLIAOXX_OUT(); foreach (var zlxx in xmmclist) { var zhenliaolb = new ZHENLIAOXX(); zhenliaolb.XIANGMUGL = zlxx.Get("SFXM").ToString(); zhenliaolb.XIANGMUXH = zlxx.Get("YLXH").ToString(); zhenliaolb.XIANGMUMC = zlxx.Get("YLMC"); zhenliaolb.XIANGMUGLMC = "诊疗套餐"; zhenliaolb.XIANGMUDW = zlxx.Get("DW"); zhenliaolb.DANJIA = zlxx.Get("DJ").ToString(); zhenliaolb.YIBAODJ = "0"; OutObject.ZHENLIAOMX.Add(zhenliaolb); } } } else if (xiangMuLX == "9") { if (string.IsNullOrEmpty(InObject.XIANGMUXH)) { throw new Exception("查询项目明细时,项目序号不能为空!"); } string xmgl = ""; if (srmlx == "0") { xmgl += " and SRM1 like '" + srm + "%'"; }//拼音码 else if (srmlx == "1") { xmgl += " and SRM2 like '" + srm + "%'"; }//五笔码 else if (srmlx == "2") { xmgl += " and YLMC like '" + srm + "%'"; }//汉字 var xmmclist = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.BASE00015, InObject.XIANGMUXH, xmgl)); if (xmmclist.Count == 0) { throw new Exception(string.Format("无套餐明细信息!")); } else { OutObject = new ZD_ZHENLIAOXX_OUT(); foreach (var zlxx in xmmclist) { var zhenliaolb = new ZHENLIAOXX(); zhenliaolb.XIANGMUGL = zlxx.Get("XIANGMUGL").ToString(); zhenliaolb.XIANGMUXH = zlxx.Get("XIANGMUXH").ToString(); zhenliaolb.XIANGMUMC = zlxx.Get("XIANGMUMC"); zhenliaolb.XIANGMUGLMC = zlxx.Get("XIANGMUGLMC"); zhenliaolb.XIANGMUDW = zlxx.Get("XIANGMUDW"); zhenliaolb.DANJIA = zlxx.Get("DANJIA").ToString(); zhenliaolb.YIBAODJ = zlxx.Get("YIBAODJ"); OutObject.ZHENLIAOMX.Add(zhenliaolb); } } } else { throw new Exception(string.Format("诊疗项目类型错误,请参见数据字典!")); } } #endregion #region sql查询 else { string xmgl = ""; if (!(string.IsNullOrEmpty(fygl)) && fygl.Trim() == "1") { fygl = "0"; switch (xiangMuLX) { case "1": xmgl = " and ylmc = '检查费' and ylxh < 100 "; break; case "2": xmgl = " and ylmc = '治疗费' and ylxh < 100 "; break; case "3": xmgl = " and ylmc = '放射费' and ylxh < 100 "; break; case "4": xmgl = " and ylmc = '手术费' and ylxh < 100 "; break; case "5": xmgl = " and ylmc = '化验费' and ylxh < 100 "; break; case "6": xmgl = " and ylmc = '输血费' and ylxh < 100 "; break; case "7": xmgl = " and ylmc = '输氧费' and ylxh < 100 "; break; case "99": xmgl = " and ylmc not in('检查费','治疗费','放射费','手术费','化验费','输血费','输氧费' ) and ylxh < 100 "; break; default: xmgl = " and ylxh < 100 "; break; } var xmmclist = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.BASE00013, xmgl)); if (xmmclist.Count == 0) { xmgl = ""; } else { var temp = ""; foreach (var item in xmmclist) { temp += "'" + item.Get("ylmc") + "',"; } xmgl = " and XIANGMUGLMC in ( " + temp.Trim(',').ToString() + " )"; } } var listzlxx = DBVisitor.ExecuteModels(SqlLoad.GetFormat(SQ.BASE00007, fygl, srmlx, srm, xmgl)); if (listzlxx.Count == 0) { throw new Exception(string.Format("无诊疗信息!")); } else { OutObject = new ZD_ZHENLIAOXX_OUT(); foreach (var zlxx in listzlxx) { var zhenliaolb = new ZHENLIAOXX(); zhenliaolb.XIANGMUGL = zlxx.Get("XIANGMUGL").ToString(); zhenliaolb.XIANGMUXH = zlxx.Get("XIANGMUXH").ToString(); zhenliaolb.XIANGMUMC = zlxx.Get("XIANGMUMC"); zhenliaolb.XIANGMUGLMC = zlxx.Get("XIANGMUGLMC"); zhenliaolb.XIANGMUDW = zlxx.Get("XIANGMUDW"); zhenliaolb.DANJIA = zlxx.Get("DANJIA").ToString(); zhenliaolb.YIBAODJ = zlxx.Get("YIBAODJ"); OutObject.ZHENLIAOMX.Add(zhenliaolb); } } } #endregion }