/// <summary> /// 刷新数据明细数据 /// </summary> public void RefreshCheckData() { #region 查询明细数据 //initJavascript(); tLoadHISRequest tloadhisRequest = new tLoadHISRequest(gethisReq); IAsyncResult result_his = tloadhisRequest.BeginInvoke(txt_startDate.Text.Trim(), txt_endDate.Text.Trim(), null, null); tLoadWYRequest tLoadwyRequest = new tLoadWYRequest(getReq); IAsyncResult result2 = tLoadwyRequest.BeginInvoke(txt_startDate.Text.Trim(), txt_endDate.Text.Trim(), null, null); string _requesthis = tloadhisRequest.EndInvoke(result_his); string _request = tLoadwyRequest.EndInvoke(result2); tLoadHISData tloadhis = new tLoadHISData(gethisXml); IAsyncResult result = tloadhis.BeginInvoke(_requesthis, null, null); tLoadWYData tloadwy = new tLoadWYData(getXml); IAsyncResult result_WY = tloadwy.BeginInvoke(_request, null, null); string strhisxml = tloadhis.EndInvoke(result); string strxml = tloadwy.EndInvoke(result_WY); dt_his = GetDBdata.XmlToDataTable(strhisxml); dt_wy = GetDBdata.XmlToDataTable(strxml); if (dt_wy != null && dt_his != null) { try { //this.GridView.DataSource = dt_wy.DefaultView; //this.GridView.DataBind(); //for (int i = dt_his.Rows.Count-1;i>=0; i--) //{ // for (int k =0; k < dt_wy.Rows.Count; k++) // { // if (dt_his.Rows[i][3].ToString() == dt_wy.Rows[k][11].ToString() && dt_his.Rows[i][13].ToString() == dt_wy.Rows[k][1].ToString() && dt_his.Rows[i][1].ToString() == dt_wy.Rows[k][2].ToString()) // { // GridView.Rows[k].BackColor = System.Drawing.Color.Green; // } // } //} #region 统计所有数据 dt_his_Result = GetDBdata.GetResult(dt_his); dt_wy_Result = GetDBdata.GetResult(dt_wy); DtAll = GetDBdata.UniteDataTable(dt_his_Result, dt_wy_Result, "合并Dt"); DtAll.Columns.AddRange(new DataColumn[] { new DataColumn("different", typeof(double)) }); DataRow drw = DtAll.NewRow(); double different_money = 0.00; for (int i = 0; i < DtAll.Rows.Count; i++) { foreach (DataRow dr in DtAll.Rows) { different_money = different_money + (Convert.ToDouble(DtAll.Rows[i]["Amounthis"]) - Convert.ToDouble(DtAll.Rows[i]["wxAmount"])); DtAll.Rows[i]["different"] = different_money.ToString("f2"); different_money = 0; } } this.GridView.Visible = false; this.GridView_Count.DataSource = DtAll.DefaultView; this.GridView_Count.DataBind(); #endregion #region 账不平的变红色 for (int k = 0; k < DtAll.Rows.Count; k++) { if (DtAll.Rows[k][6].ToString() != "0") { GridView_Count.Rows[k].BackColor = System.Drawing.Color.Red; //Logging.WriteHISlog("记录日志:","HIS的CARD_NO="+dt_his.Rows[i][3].ToString()+ "\r\n"+"微医的HOSP_PATIENT_ID="+ dt_wy.Rows[k][11].ToString() + "\r\n" + "HIS的TRANS_NO="+dt_his.Rows[i][13].ToString()+"微医的HOSP_ORDER_ID = "+ dt_wy.Rows[k][1].ToString() + "\r\n" + "HIS的TRANS_TYPE=" + dt_his.Rows[i][1].ToString() + "\r\n" + "微医的ORDER_TYPE=" + dt_wy.Rows[k][2].ToString() + ""); } } #endregion } catch (Exception Exc) { Logging.WriteBuglog(Exc); } finally { Logging.WriteWYlog(txt_startDate.Text + "至" + txt_endDate.Text + "的日志", strxml); Logging.WriteHISlog(txt_startDate.Text + "至" + txt_endDate.Text + "的日志", strhisxml); } } else { this.GridView.DataSource = ""; this.GridView.DataBind(); } #endregion }
protected void GridView_Count_RowCommand(object sender, GridViewCommandEventArgs e) { GridView.Visible = false; if (e.CommandName == "Check") { initJavascript(); int id = Convert.ToInt32(e.CommandArgument); GridViewRow row = GridView_Count.Rows[id]; string CheckDate = row.Cells[0].Text.ToString();//Convert.ToString(this.GridView_Count.Rows[id].Cells[0].ToString()); if (dt_wy != null && dt_his != null) { try { tLoadHISRequest tloadhisRequest = new tLoadHISRequest(gethisReq); IAsyncResult result = tloadhisRequest.BeginInvoke(CheckDate, CheckDate, null, null); tLoadWYRequest tLoadwyRequest = new tLoadWYRequest(getReq); IAsyncResult result2 = tLoadwyRequest.BeginInvoke(CheckDate, CheckDate, null, null); string _requesthis = tloadhisRequest.EndInvoke(result); string _request = tLoadwyRequest.EndInvoke(result2); tLoadHISData tloadhis = new tLoadHISData(gethisXml); IAsyncResult resulthis = tloadhis.BeginInvoke(_requesthis, null, null); tLoadWYData tloadwy = new tLoadWYData(getXml); IAsyncResult result_WY = tloadwy.BeginInvoke(_request, null, null); string strhisxml = tloadhis.EndInvoke(resulthis); string strxml = tloadwy.EndInvoke(result_WY); dt_his = GetDBdata.XmlToDataTable(strhisxml); dt_wy = GetDBdata.XmlToDataTable(strxml); this.GridView.DataSource = dt_wy.DefaultView; this.GridView.DataBind(); for (int i = dt_his.Rows.Count - 1; i >= 0; i--) { for (int k = 0; k < dt_wy.Rows.Count; k++) { if (dt_his.Rows[i][3].ToString() == dt_wy.Rows[k][11].ToString() && dt_his.Rows[i][13].ToString() == dt_wy.Rows[k][1].ToString() && dt_his.Rows[i][1].ToString() == dt_wy.Rows[k][2].ToString()) { GridView.Rows[k].BackColor = System.Drawing.Color.Green; } } } DetailsListTitle.Visible = true; DetailsListTitle.Text = CheckDate + "的明细单。 备注:绿色是匹配成功的订单,白色是HIS没有的订单"; } catch (Exception ex) { Logging.WriteBuglog(ex); } finally { this.GridView.Visible = true; } } else { //this.GridView.Visible = true; } } }
/// <summary> /// 刷新数据明细数据 /// </summary> public void RefreshCheckData(List <string> request, string request_his) { #region 计算耗时方法,可删 //Stopwatch sw = new Stopwatch(); //sw.Start(); #endregion initJavascript(); #region datatable创建 dt_wy.Columns.Add("交易时间", typeof(string)); dt_wy.Columns.Add("业务平台流水", typeof(string)); dt_wy.Columns.Add("平台交易流水", typeof(string)); dt_wy.Columns.Add("业务退款流水", typeof(string)); dt_wy.Columns.Add("平台退款流水", typeof(string)); dt_wy.Columns.Add("交易金额", typeof(decimal)); dt_wy.Columns.Add("退款金额", typeof(decimal)); dt_wy.Columns.Add("补贴金额", typeof(decimal)); dt_wy.Columns.Add("实付金额", typeof(decimal)); dt_wy.Columns.Add("实退金额", typeof(decimal)); dt_wy.Columns.Add("第三方支付交易流水号", typeof(string)); dt_wy.Columns.Add("第三方支付退款流水号", typeof(string)); dt_wy.Columns.Add("支付类型", typeof(string)); dt_wy.Columns.Add("交易状态", typeof(string)); dt_wy.Columns.Add("退款状态", typeof(string)); dt_wy.Columns.Add("商户名称", typeof(string)); dt_wy.Columns.Add("商品名称", typeof(string)); dt_wy.Columns.Add("商户号", typeof(string)); dt_wy.Columns.Add("接入应用ID", typeof(string)); dt_wy.Columns.Add("第三方商户号", typeof(string)); #endregion dt_wy.TableName = "ACCOUNT_LIST"; System.Data.DataTable dt_his = new System.Data.DataTable(); DataTable dtResulthis = new DataTable(); tLoadHISData tloadhis = new tLoadHISData(gethisXml); IAsyncResult result = tloadhis.BeginInvoke(request_his, null, null); tLoadWYData tloadwy = new tLoadWYData(getDataList); IAsyncResult result_WY = tloadwy.BeginInvoke(request, null, null); string strxmlhis = tloadhis.EndInvoke(result); List <string[]> response2 = tloadwy.EndInvoke(result_WY);// gethisXml(request_his); //string strxmlhis = gethisXml(request_his); //tLoadWYData tloadwy = new tLoadWYData(getDataList); //IAsyncResult result_WY = tloadwy.BeginInvoke(request, null, null); dt_his = GetDBdata.XmlToDataTable(strxmlhis); dtResulthis = GetDBdata.GetResult(dt_his); // HIS_RowsCount = dt_his.Rows.Count; foreach (DataRow dr in dtResulthis.Rows) { Counthis += double.Parse(dr["Counthis"].ToString()); Amounthis += double.Parse(dr["Amounthis"].ToString()); } HIS_TotalFeeCount.Text = Convert.ToDecimal(Amounthis).ToString("f2") + "元"; // HIS_TotalDealCount.Text = Convert.ToString(Counthis) + "笔"; HIS_TotalFeeCount.Visible = false; HIS_TotalDealCount.Visible = false; try { //List<string[]> response = tloadwy.EndInvoke(result_WY);// getDataList(request); ;// getDataList(request); // List<string[]> response = response2;//getDataList(request); // List<string> result = new List<string>(); //int _count = response.Count; sum_totalCount = response2.Count; //_count; for (int k = 0; k < sum_totalCount; k++) { dt_wy.Rows.Add(response2[k]); } this.GridView.DataSource = dt_wy.DefaultView; this.GridView.DataBind(); for (int i = dt_his.Rows.Count - 1; i >= 0; i--) { for (int k = 0; k < dt_wy.Rows.Count; k++) { if (dt_his.Rows[i][1].ToString() == dt_wy.Rows[k][1].ToString()) { GridView.Rows[k].BackColor = System.Drawing.Color.Green; //Logging.WriteHISlog("记录日志:","HIS的ORDER_ID="+dt_his.Rows[i][3].ToString()+ "\r\n"+"微医的平台订单号="+ dt_wy.Rows[k][11].ToString() + "\r\n" + "HIS的TRANS_NO="+dt_his.Rows[i][13].ToString()+"微医的HOSP_ORDER_ID = "+ dt_wy.Rows[k][1].ToString() + "\r\n" + "HIS的TRANS_TYPE=" + dt_his.Rows[i][1].ToString() + "\r\n" + "微医的ORDER_TYPE=" + dt_wy.Rows[k][2].ToString() + ""); } } } #region 统计所有数据 dtResulthis = GetDBdata.GetResult(dt_his); dtWYResulthis = GetDBdata.GetResult(dt_wy); DtAll = GetDBdata.UniteDataTable(dtResulthis, dtWYResulthis, "合并Dt"); DtAll.Columns.AddRange(new DataColumn[] { new DataColumn("different", typeof(double)) }); DataRow drw = DtAll.NewRow(); double different_money = 0.00; for (int i = 0; i < DtAll.Rows.Count; i++) { foreach (DataRow dr in DtAll.Rows) { different_money = different_money + (Convert.ToDouble(DtAll.Rows[i]["Amounthis"]) - Convert.ToDouble(DtAll.Rows[i]["wxAmount"])); DtAll.Rows[i]["different"] = different_money.ToString("f2"); different_money = 0; } } this.GridView_Count.DataSource = DtAll.DefaultView; this.GridView_Count.DataBind(); #endregion #region 账不平的变红色 for (int k = 0; k < DtAll.Rows.Count; k++) { if (DtAll.Rows[k][6].ToString() != "0") { GridView_Count.Rows[k].BackColor = System.Drawing.Color.Red; } } #endregion } catch (Exception Exc) { Logging.WriteBuglog(Exc); return; } finally { string LogXml = GetDBdata.DataTable2Xml(dt_wy); Logging.WriteWYlog(txt_startDate.Text.Trim() + "至" + txt_endDate.Text.Trim() + "的明细日志", LogXml); Logging.WriteHISlog(txt_startDate.Text + "至" + txt_endDate.Text + "的日志", strxmlhis); //sw.Stop(); //TimeSpan ts2 = sw.Elapsed; //Console.WriteLine("Stopwatch总共花费{0}ms.", ts2.TotalMilliseconds); //结束耗时显示多久 //Logging.WriteKeylog("Stopwatch总共花费",Convert.ToString(ts2.TotalMilliseconds)); } }