/// <summary> /// 更新HIS充值记录 /// </summary> /// <param name="yhlsh">银行流水号</param> /// <param name="je">金额</param> /// <param name="brlx">病人类型 1-门诊 2-住院</param> /// <param name="msg">成功、错处或异常信息</param> /// <returns>0-成功 大于0-失败 小于0-异常</returns> private int DB_AlipayUpdateHisCharge(OracleConnection connection, OracleTransaction tx, string yhlsh, double je, string brid, string brlx, DateTime jysj, out string msg) { int ret = -1; msg = ""; OracleDataReader dataReader = null; int result = -99; if (brlx.Equals("1")) { UserJFInfo jfinfo; ret = DB_GetMZCZInfo(brid, out jfinfo, out msg); if (ret == 0) { //账户状态不为1未开通缴费,进行开通 if (jfinfo.zhanghuzt != "1") { IDataParameter[] parameters1 = { new OracleParameter("prm_msg", OracleType.VarChar), new OracleParameter("prm_appcode", OracleType.Number), new OracleParameter("prm_outbuffer", OracleType.VarChar, 400) }; //就诊卡号|就诊卡类型|操作日期|操作员工号 00102009070801114983|L|2016-3-21 10:02:44|ZFB parameters1[0].Value = jfinfo.cardno + "|" + jfinfo.cardtype + "|" + jysj.ToString(AppUtils.DateTime_Format_All) + "|ZFB"; parameters1[0].Direction = ParameterDirection.Input; parameters1[1].Direction = ParameterDirection.Output; parameters1[2].Direction = ParameterDirection.Output; //pkg_gy_yinyijk.PRC_ZZSF_DIANZIZHCZ dataReader = DbHelperOra.ExeProcedureUseTran(connection, tx, WebConfigParameter.KTChongzhiProcedureName, parameters1, out result); if (result != 0) { msg = "开通账户出错。"; ret = 34; return(ret); } tx.Commit(); } string s_jiaoyirc = "<?xml version='1.0' encoding='utf-8'?><CHONGZHI_IN><JIUZHENKLX>1</JIUZHENKLX><JIUZHENKH>" + jfinfo.cardno + "</JIUZHENKH><XINGMING>" + jfinfo.brxm + "</XINGMING><ZHENGJIANHM>" + jfinfo.sfzh + "</ZHENGJIANHM>" + "<LIANXIDH>" + jfinfo.lxdh + "</LIANXIDH><CHONGZHIJE>" + je + "</CHONGZHIJE><ZHIFUFS>20</ZHIFUFS><BASEINFO>" + "<CAOZUOYDM>ZFB</CAOZUOYDM><CAOZUOYXM>ZFB</CAOZUOYXM><CAOZUORQ>" + jysj.ToString(AppUtils.DateTime_Format_All) + "</CAOZUORQ></BASEINFO></CHONGZHI_IN>"; string postData = "<x:Envelope xmlns:x=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:tem=\"http://tempuri.org/\"><x:Header/><x:Body><tem:RunService>" + "<tem:TradeType>HIS4.CHONGZHI</tem:TradeType>" + "<tem:TradeMsg><![CDATA[" + s_jiaoyirc + "]]></tem:TradeMsg><tem:TradeOut>string.Empty</tem:TradeOut></tem:RunService></x:Body></x:Envelope>"; string postResult = HttpPost(WebConfigParameter.WebserviceUrl, postData); XmlDocument doc = XmlHelper.CreateXmlDocument(postResult); string tagname = "TradeOut"; XmlNodeList tradeOuts = doc.DocumentElement.GetElementsByTagName(tagname); string tradeOutContent = ""; if (tradeOuts.Count > 0) { tradeOutContent = tradeOuts[0].InnerText; } XmlDocument tradeOutDoc = XmlHelper.CreateXmlDocument(tradeOutContent); tagname = "ERRNO"; string tagname1 = "ERRMSG"; string tradeOutContent1 = ""; tradeOuts = tradeOutDoc.DocumentElement.GetElementsByTagName(tagname); XmlNodeList tradeOuts1 = tradeOutDoc.DocumentElement.GetElementsByTagName(tagname1); if (tradeOuts.Count > 0) { tradeOutContent = tradeOuts[0].InnerText; } if (tradeOuts1.Count > 0) { tradeOutContent1 = tradeOuts1[0].InnerText; } if (tradeOutContent == "0") { msg = tradeOutContent1; ret = 0; } else if (tradeOutContent == "-1") { msg = tradeOutContent1; ret = -1; } //IDataParameter[] parameters ={ // new OracleParameter("prm_msg", OracleType.VarChar), // new OracleParameter("prm_appcode", OracleType.Number), // new OracleParameter("prm_outbuffer", OracleType.VarChar, 400) // }; ////就诊卡号|就诊卡类型|病人姓名|证件号码|联系电话|充值金额|支付方式|交款日期|操作员工号|校验码|银行卡扣款信息 ////00102009070801114983|L|孙遥|9879|8678|100.00|20|2016-3-21 15:16:40|ZFB|ZXCV|没有信息 //parameters[0].Value = cardno + "|L|" + name + "|9879|8678|" + Convert.ToString(je) + "|20|" + jysj.ToString(AppUtils.DateTime_Format_All) + "|ZFB|ZXCV||"; //parameters[0].Direction = ParameterDirection.Input; //parameters[1].Direction = ParameterDirection.Output; //parameters[2].Direction = ParameterDirection.Output; ////pkg_gy_yinyijk.PRC_ZZSF_DIANZIZHCZ //dataReader = DbHelperOra.ExeProcedureUseTran(connection, tx, // "his3.pkg_gy_yinyijk.PRC_ZZSF_DIANZIZHCZ", // parameters, out result); //if (result != 0) //{ // msg = "插入医院HIS表数据出错。"; // ret = 35; //} //else //{ // msg = "插入医院HIS成功。"; // ret = 00; //} } } else if (brlx.Equals("2")) { //TODO 更新数据表里面的住院病人的充值记录 IDataParameter[] parameters = { new OracleParameter("prm_msg", OracleType.VarChar), new OracleParameter("prm_appcode", OracleType.Number), new OracleParameter("prm_databuffer", OracleType.VarChar, 400) }; //病人id|工号|费用|充值方式统一为10|交款日期||||0|| parameters[0].Value = brid + "|ZFB|" + Convert.ToString(je) + "|20|" + jysj.ToString(AppUtils.DateTime_Format_All) + "||||0||"; parameters[0].Direction = ParameterDirection.Input; parameters[1].Direction = ParameterDirection.Output; parameters[2].Direction = ParameterDirection.Output; //PKG_GY_YINYIJK.PRC_ZY_YUJIAOKUAN dataReader = DbHelperOra.ExeProcedureUseTran(connection, tx, WebConfigParameter.ProcedureName, parameters, out result); if (result != 0) { msg = "插入医院HIS表数据出错。"; ret = 35; } else { msg = "插入医院HIS成功。"; ret = 00; } } return(ret); }