消费记录 增加 显示 充值总额,可用余额,范围内使用金额

消费数据导出
This commit is contained in:
chfei committed 2026-08-10 18:56:23 +08:00
1 parent 0cad71b5be
commit ec9a856bc5
4 files changed
+341 -206

No files matched your search

+2 -1
View File
@@ -196,7 +196,8 @@ namespace AllBase
/// 店铺充值月费
/// </summary>
public static int ShopPointsPerMonth { get; set; } = 30;
public static decimal Balance { get; set; } = 0;
public static decimal RechargeAmountTotal { get; set; } = 0;
public static decimal Balance { get; set; } = 0;
public static decimal PostagePerOrder { get; set; } = 2.2m;
public static decimal PostagePerOrderDiff { get { return PostagePerOrder - 2.2m; } }
public static int AlimamaPageCount = 0;
@@ -45,6 +45,11 @@ namespace Work._29Tools.Forms.UserForms
this.btnBalanceTopUp = new DevComponents.DotNetBar.PanelEx();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.ucGroupBoxEx1 = new Work.UserComponents.UcGroupBoxEx(this.components);
this.exportRecord = new System.Windows.Forms.LinkLabel();
this.balanceArmt = new System.Windows.Forms.Label();
this.label10 = new System.Windows.Forms.Label();
this.rechargeArmtTotal = new System.Windows.Forms.Label();
this.label8 = new System.Windows.Forms.Label();
this.label7 = new System.Windows.Forms.Label();
this.txtOutOrderId = new System.Windows.Forms.TextBox();
this.label6 = new System.Windows.Forms.Label();
@@ -68,6 +73,8 @@ namespace Work._29Tools.Forms.UserForms
this.textBox1 = new System.Windows.Forms.TextBox();
this.statusBarUserControl1 = new Work.UserControls.StatusBarUserControl();
this.ucSplitPage1 = new Work.UserControls.UcSplitPage();
this.label9 = new System.Windows.Forms.Label();
this.rangeUsedAramt = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.pbCloseBase)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pbQrcode)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pbLoading)).BeginInit();
@@ -93,7 +100,7 @@ namespace Work._29Tools.Forms.UserForms
// pbCloseBase
//
this.pbCloseBase.Font = new System.Drawing.Font("宋体", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.pbCloseBase.Location = new System.Drawing.Point(1189, 0);
this.pbCloseBase.Location = new System.Drawing.Point(1389, 0);
//
// label1
//
@@ -160,7 +167,7 @@ namespace Work._29Tools.Forms.UserForms
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(2, 34);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(1221, 529);
this.panel1.Size = new System.Drawing.Size(1421, 529);
this.panel1.TabIndex = 1140;
//
// splitContainer1
@@ -176,15 +183,15 @@ namespace Work._29Tools.Forms.UserForms
this.splitContainer1.Panel1.Controls.Add(this.pbLoading);
this.splitContainer1.Panel1.Controls.Add(this.label2);
this.splitContainer1.Panel1.Controls.Add(this.numTopUpAmount);
this.splitContainer1.Panel1.Controls.Add(this.btnRefresh);
this.splitContainer1.Panel1.Controls.Add(this.btnBalanceTopUp);
this.splitContainer1.Panel1.Controls.Add(this.label1);
this.splitContainer1.Panel1.Controls.Add(this.pbQrcode);
this.splitContainer1.Panel1.Controls.Add(this.btnRefresh);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.splitContainer2);
this.splitContainer1.Size = new System.Drawing.Size(1221, 529);
this.splitContainer1.Size = new System.Drawing.Size(1421, 529);
this.splitContainer1.SplitterDistance = 253;
this.splitContainer1.TabIndex = 1139;
//
@@ -270,7 +277,7 @@ namespace Work._29Tools.Forms.UserForms
// splitContainer2.Panel2
//
this.splitContainer2.Panel2.Controls.Add(this.splitContainer3);
this.splitContainer2.Size = new System.Drawing.Size(964, 529);
this.splitContainer2.Size = new System.Drawing.Size(1164, 529);
this.splitContainer2.SplitterDistance = 86;
this.splitContainer2.TabIndex = 1163;
//
@@ -281,6 +288,13 @@ namespace Work._29Tools.Forms.UserForms
| System.Windows.Forms.AnchorStyles.Right)));
this.ucGroupBoxEx1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.ucGroupBoxEx1.BorderStyle = Work.UserComponents.UcGroupBoxEx.GroupBoxBorderStyle.ROUND;
this.ucGroupBoxEx1.Controls.Add(this.rangeUsedAramt);
this.ucGroupBoxEx1.Controls.Add(this.label9);
this.ucGroupBoxEx1.Controls.Add(this.exportRecord);
this.ucGroupBoxEx1.Controls.Add(this.balanceArmt);
this.ucGroupBoxEx1.Controls.Add(this.label10);
this.ucGroupBoxEx1.Controls.Add(this.rechargeArmtTotal);
this.ucGroupBoxEx1.Controls.Add(this.label8);
this.ucGroupBoxEx1.Controls.Add(this.label7);
this.ucGroupBoxEx1.Controls.Add(this.txtOutOrderId);
this.ucGroupBoxEx1.Controls.Add(this.label6);
@@ -293,12 +307,57 @@ namespace Work._29Tools.Forms.UserForms
this.ucGroupBoxEx1.Controls.Add(this.cmbType);
this.ucGroupBoxEx1.Location = new System.Drawing.Point(-2, 2);
this.ucGroupBoxEx1.Name = "ucGroupBoxEx1";
this.ucGroupBoxEx1.Size = new System.Drawing.Size(966, 84);
this.ucGroupBoxEx1.Size = new System.Drawing.Size(1166, 84);
this.ucGroupBoxEx1.TabIndex = 0;
this.ucGroupBoxEx1.TabStop = false;
this.ucGroupBoxEx1.Text = "查询条件";
this.ucGroupBoxEx1.Enter += new System.EventHandler(this.ucGroupBoxEx1_Enter);
//
// exportRecord
//
this.exportRecord.AutoSize = true;
this.exportRecord.Location = new System.Drawing.Point(1093, 47);
this.exportRecord.Name = "exportRecord";
this.exportRecord.Size = new System.Drawing.Size(56, 17);
this.exportRecord.TabIndex = 1171;
this.exportRecord.TabStop = true;
this.exportRecord.Text = "导出记录";
this.exportRecord.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.exportRecord_LinkClicked);
//
// balanceArmt
//
this.balanceArmt.Location = new System.Drawing.Point(1020, 36);
this.balanceArmt.Name = "balanceArmt";
this.balanceArmt.Size = new System.Drawing.Size(67, 17);
this.balanceArmt.TabIndex = 1167;
this.balanceArmt.Text = "1000.00";
//
// label10
//
this.label10.AutoSize = true;
this.label10.Location = new System.Drawing.Point(959, 36);
this.label10.Name = "label10";
this.label10.Size = new System.Drawing.Size(68, 17);
this.label10.TabIndex = 1166;
this.label10.Text = "可用余额:";
//
// rechargeArmtTotal
//
this.rechargeArmtTotal.Location = new System.Drawing.Point(1020, 14);
this.rechargeArmtTotal.Name = "rechargeArmtTotal";
this.rechargeArmtTotal.Size = new System.Drawing.Size(67, 17);
this.rechargeArmtTotal.TabIndex = 1165;
this.rechargeArmtTotal.Text = "10000.00";
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(959, 14);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(68, 17);
this.label8.TabIndex = 1164;
this.label8.Text = "充值总额:";
//
// label7
//
this.label7.AutoSize = true;
@@ -421,7 +480,7 @@ namespace Work._29Tools.Forms.UserForms
//
this.splitContainer3.Panel2.Controls.Add(this.statusBarUserControl1);
this.splitContainer3.Panel2.Controls.Add(this.ucSplitPage1);
this.splitContainer3.Size = new System.Drawing.Size(964, 439);
this.splitContainer3.Size = new System.Drawing.Size(1164, 439);
this.splitContainer3.SplitterDistance = 410;
this.splitContainer3.TabIndex = 1163;
//
@@ -469,7 +528,7 @@ namespace Work._29Tools.Forms.UserForms
this.dgvPayment.Name = "dgvPayment";
this.dgvPayment.ReadOnly = true;
this.dgvPayment.RowTemplate.Height = 23;
this.dgvPayment.Size = new System.Drawing.Size(962, 406);
this.dgvPayment.Size = new System.Drawing.Size(1162, 406);
this.dgvPayment.TabIndex = 1162;
this.dgvPayment.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvPayment_CellContentClick);
//
@@ -548,7 +607,7 @@ namespace Work._29Tools.Forms.UserForms
this.ucSplitPage1.CurrentPage = 1;
this.ucSplitPage1.Dock = System.Windows.Forms.DockStyle.Right;
this.ucSplitPage1.IsShowPageSize = true;
this.ucSplitPage1.Location = new System.Drawing.Point(550, 0);
this.ucSplitPage1.Location = new System.Drawing.Point(750, 0);
this.ucSplitPage1.Margin = new System.Windows.Forms.Padding(0);
this.ucSplitPage1.Name = "ucSplitPage1";
this.ucSplitPage1.PageSize = 50;
@@ -558,11 +617,28 @@ namespace Work._29Tools.Forms.UserForms
this.ucSplitPage1.PageChange += new System.Action<object>(this.ucSplitPage1_PageChange);
this.ucSplitPage1.Load += new System.EventHandler(this.ucSplitPage1_Load);
//
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(959, 59);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(68, 17);
this.label9.TabIndex = 1175;
this.label9.Text = "使用余额:";
//
// rangeUsedAramt
//
this.rangeUsedAramt.Location = new System.Drawing.Point(1020, 59);
this.rangeUsedAramt.Name = "rangeUsedAramt";
this.rangeUsedAramt.Size = new System.Drawing.Size(67, 17);
this.rangeUsedAramt.TabIndex = 1176;
this.rangeUsedAramt.Text = "1000.00";
//
// WXGetBalanceQrCodeForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(152)))), ((int)(((byte)(99)))), ((int)(((byte)(143)))));
this.ClientSize = new System.Drawing.Size(1225, 565);
this.ClientSize = new System.Drawing.Size(1425, 565);
this.Controls.Add(this.panel1);
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.KeyPreview = true;
@@ -635,5 +711,12 @@ namespace Work._29Tools.Forms.UserForms
private System.Windows.Forms.Label label7;
private System.Windows.Forms.TextBox txtOutOrderId;
private UserControls.StatusBarUserControl statusBarUserControl1;
}
private System.Windows.Forms.Label rechargeArmtTotal;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.Label balanceArmt;
private System.Windows.Forms.Label label10;
private System.Windows.Forms.LinkLabel exportRecord;
private System.Windows.Forms.Label rangeUsedAramt;
private System.Windows.Forms.Label label9;
}
}
@@ -28,222 +28,264 @@ using Work.Extension;
namespace Work._29Tools.Forms.UserForms
{
public partial class WXGetBalanceQrCodeForm : BaseForms.BaseGeneralForm
{
// (拍单后)回调函数,更新拍单余额
private Action updateBalanceAction = null;
public partial class WXGetBalanceQrCodeForm : BaseForms.BaseGeneralForm
{
// (拍单后)回调函数,更新拍单余额
private Action updateBalanceAction = null;
public WXGetBalanceQrCodeForm(Action updateBalance = null)
{
InitializeComponent();
updateBalanceAction = updateBalance;
}
public WXGetBalanceQrCodeForm(Action updateBalance = null)
{
InitializeComponent();
updateBalanceAction = updateBalance;
}
public void refreshQrcode()
{
return;
Invoke(new Action(() =>
{
pbLoading.Visible = true;
}));
public void refreshQrcode()
{
return;
Invoke(new Action(() =>
{
pbLoading.Visible = true;
}));
var url = BaseClass.Build29WxObjString("user/get_top_up_qrcode");
var data = UserLogin.GetSignaturex();
var url = BaseClass.Build29WxObjString("user/get_top_up_qrcode");
var data = UserLogin.GetSignaturex();
var html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
{
var msg = BaseRegex.GetStringJson(ref html, "msg");
BaseMsgForm.ShowError(msg);
}
else
{
Invoke(new Action(() =>
{
pbLoading.Visible = false;
var base64Str = BaseRegex.GetStringJson(ref html, "qrcode_base64");
if (!string.IsNullOrEmpty(base64Str))
pbQrcode.Image = Base64ChangeImgUrl.Base64ToImage(base64Str);
else
pbQrcode.Image = Properties.Resources.errpic;
}));
}
}
var html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
{
var msg = BaseRegex.GetStringJson(ref html, "msg");
BaseMsgForm.ShowError(msg);
}
else
{
Invoke(new Action(() =>
{
pbLoading.Visible = false;
var base64Str = BaseRegex.GetStringJson(ref html, "qrcode_base64");
if (!string.IsNullOrEmpty(base64Str))
pbQrcode.Image = Base64ChangeImgUrl.Base64ToImage(base64Str);
else
pbQrcode.Image = Properties.Resources.errpic;
}));
}
}
private void btnRefresh_Click(object sender, EventArgs e)
{
Task.Run(() => { refreshQrcode(); });
}
private void btnRefresh_Click(object sender, EventArgs e)
{
Task.Run(() => { refreshQrcode(); });
}
private async void WXGetTopUpQrCode_Load(object sender, EventArgs e)
{
private async void WXGetTopUpQrCode_Load(object sender, EventArgs e)
{
#if DEBUG
if (File.Exists(System.Environment.CurrentDirectory + "\\choice.debug.tools"))
{
this.numTopUpAmount.Minimum = 0.01m;
this.numTopUpAmount.Value = 0.01m;
}
if (File.Exists(System.Environment.CurrentDirectory + "\\choice.debug.tools"))
{
this.numTopUpAmount.Minimum = 0.01m;
this.numTopUpAmount.Value = 0.01m;
}
#endif
this.dgvPayment.AddSelectorColumn("colCheck");
this.dtpTimeBegin.Value = DateTime.Now.Date.AddMonths(-3);
this.dtpTimeEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
this.dgvPayment.AddSelectorColumn("colCheck");
this.dtpTimeBegin.Value = DateTime.Now.Date.AddMonths(-3);
this.dtpTimeEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
ucSplitPage1.cmbPageSize.Items.Remove("5000");
ucSplitPage1.cmbPageSize.Items.Remove("2000");
ucSplitPage1.cmbPageSize.Items.Remove("1000");
ucSplitPage1.cmbPageSize.Items.Remove("5000");
ucSplitPage1.cmbPageSize.Items.Remove("2000");
ucSplitPage1.cmbPageSize.Items.Remove("1000");
pictureBox2.Visible = true;
await Task.Run(() => { refreshQrcode(); });
await Task.Run(() => { GetBalanceList(); });
pictureBox2.Visible = false;
}
pictureBox2.Visible = true;
await Task.Run(() => { refreshQrcode(); });
await Task.Run(() => { GetBalanceList(); });
pictureBox2.Visible = false;
}
private void btnBalanceTopUp_Click(object sender, EventArgs e)
{
string url2 = "https://po.e57.cn/prod-api/api/oms-api/alipay/pay";
var data = new JObject();
data["userId"] = BaseClass.UserId;
data["userName"] = BaseClass.UserName;
data["nickName"] = BaseClass.NickName;
data["totalAmount"] = numTopUpAmount.Value;
data["type"] = 1; // type:1:快递余额,2:账户积分
var dataStr2 = JsonHelper.SerializeObject(data);
var html2 = HttpResponseWXBLL.e57PostResponse(url2, dataStr2, "");
//<AjaxResult><msg>支付订单创建成功</msg><code>200</code><data>&lt;form name="punchout_form" method="post" action="https://openapi.alipay.com/gateway.do?charset=UTF-8&amp;method=alipay.trade.page.pay&amp;sign=Z7%2Bv3UQL3B9Q9nH1iNGimA9FL9XPcG9A2oyjTpLbyExJbw52tHEX1LXifNrdJLtBdSjAQaFNyc3qzKUn3J6algYUlcy9e5DMKIG1NPQGSn3FFoSiKM%2FfSKlx8Jbj3zC2JFQAvUoFVUnk89pen078rh2IL2XKNaD300VDq28WiAAE3fX%2FHdd5Tu%2F3yun4tD90KOXzVQ2PFrcQqwefo2Bm%2BQVFCGXM5zxzE%2FvfkHnCwGwlH%2FfLrdsKrQc3s%2B1Gt1NHlS3iyKEP%2F4F7dKB9Iq0GIsyPJu9RINv9XRlk404S60gDRHBHs3avWdMwjMRkoxIdoe%2BPrXX0zxYEEN9hAX5C%2Fw%3D%3D&amp;return_url=https%3A%2F%2Fpo.e57.cn&amp;notify_url=https%3A%2F%2Fpo.e57.cn%2Fprod-api%2Fapi%2Foms-api%2Falipay%2Fnotify&amp;version=1.0&amp;app_id=2021006172644180&amp;sign_type=RSA2&amp;timestamp=2026-07-20+11%3A59%3A55&amp;alipay_sdk=alipay-sdk-java-4.40.909.ALL&amp;format=JSON">
//&lt;input type="hidden" name="biz_content" value="{&amp;quot;out_trade_no&amp;quot;:&amp;quot;8f6ece19baf14f7ca8b0b5d8d0c03b57&amp;quot;,&amp;quot;total_amount&amp;quot;:&amp;quot;0.01&amp;quot;,&amp;quot;subject&amp;quot;:&amp;quot;店统领余额充值&amp;quot;,&amp;quot;body&amp;quot;:&amp;quot;店统领余额充值&amp;quot;,&amp;quot;product_code&amp;quot;:&amp;quot;FAST_INSTANT_TRADE_PAY&amp;quot;,&amp;quot;timeout_express&amp;quot;:&amp;quot;15m&amp;quot;}">
//&lt;input type="submit" value="立即支付" style="display:none" >
//&lt;/form>
//&lt;script>document.forms[0].submit();&lt;/script></data></AjaxResult>
if (html2.Contains("<code>200</code>") || html2.Contains("<code>0</code>"))
{
var rstData = BaseRegex.GetStringXml(ref html2, "data").ParseToString();
rstData = HttpUtility.HtmlDecode(rstData);
//rstData = HttpUtility.HtmlDecode(rstData);
private void btnBalanceTopUp_Click(object sender, EventArgs e)
{
string url2 = "https://po.e57.cn/prod-api/api/oms-api/alipay/pay";
var data = new JObject();
data["userId"] = BaseClass.UserId;
data["userName"] = BaseClass.UserName;
data["nickName"] = BaseClass.NickName;
data["totalAmount"] = numTopUpAmount.Value;
data["type"] = 1; // type:1:快递余额,2:账户积分
var dataStr2 = JsonHelper.SerializeObject(data);
var html2 = HttpResponseWXBLL.e57PostResponse(url2, dataStr2, "");
//<AjaxResult><msg>支付订单创建成功</msg><code>200</code><data>&lt;form name="punchout_form" method="post" action="https://openapi.alipay.com/gateway.do?charset=UTF-8&amp;method=alipay.trade.page.pay&amp;sign=Z7%2Bv3UQL3B9Q9nH1iNGimA9FL9XPcG9A2oyjTpLbyExJbw52tHEX1LXifNrdJLtBdSjAQaFNyc3qzKUn3J6algYUlcy9e5DMKIG1NPQGSn3FFoSiKM%2FfSKlx8Jbj3zC2JFQAvUoFVUnk89pen078rh2IL2XKNaD300VDq28WiAAE3fX%2FHdd5Tu%2F3yun4tD90KOXzVQ2PFrcQqwefo2Bm%2BQVFCGXM5zxzE%2FvfkHnCwGwlH%2FfLrdsKrQc3s%2B1Gt1NHlS3iyKEP%2F4F7dKB9Iq0GIsyPJu9RINv9XRlk404S60gDRHBHs3avWdMwjMRkoxIdoe%2BPrXX0zxYEEN9hAX5C%2Fw%3D%3D&amp;return_url=https%3A%2F%2Fpo.e57.cn&amp;notify_url=https%3A%2F%2Fpo.e57.cn%2Fprod-api%2Fapi%2Foms-api%2Falipay%2Fnotify&amp;version=1.0&amp;app_id=2021006172644180&amp;sign_type=RSA2&amp;timestamp=2026-07-20+11%3A59%3A55&amp;alipay_sdk=alipay-sdk-java-4.40.909.ALL&amp;format=JSON">
//&lt;input type="hidden" name="biz_content" value="{&amp;quot;out_trade_no&amp;quot;:&amp;quot;8f6ece19baf14f7ca8b0b5d8d0c03b57&amp;quot;,&amp;quot;total_amount&amp;quot;:&amp;quot;0.01&amp;quot;,&amp;quot;subject&amp;quot;:&amp;quot;店统领余额充值&amp;quot;,&amp;quot;body&amp;quot;:&amp;quot;店统领余额充值&amp;quot;,&amp;quot;product_code&amp;quot;:&amp;quot;FAST_INSTANT_TRADE_PAY&amp;quot;,&amp;quot;timeout_express&amp;quot;:&amp;quot;15m&amp;quot;}">
//&lt;input type="submit" value="立即支付" style="display:none" >
//&lt;/form>
//&lt;script>document.forms[0].submit();&lt;/script></data></AjaxResult>
if (html2.Contains("<code>200</code>") || html2.Contains("<code>0</code>"))
{
var rstData = BaseRegex.GetStringXml(ref html2, "data").ParseToString();
rstData = HttpUtility.HtmlDecode(rstData);
//rstData = HttpUtility.HtmlDecode(rstData);
WXShopLoginForm loginForm = new WXShopLoginForm(new AllBase.Model.DBModel.ShopLoginInfo());
loginForm.InitUrl = "";
loginForm.InitHtml = rstData;
loginForm.openType = EnumOpenType.manage;
loginForm.ShowDialog();
if (updateBalanceAction != null)
{
updateBalanceAction();
}
}
}
WXShopLoginForm loginForm = new WXShopLoginForm(new AllBase.Model.DBModel.ShopLoginInfo());
loginForm.InitUrl = "";
loginForm.InitHtml = rstData;
loginForm.openType = EnumOpenType.manage;
loginForm.ShowDialog();
if (updateBalanceAction != null)
{
updateBalanceAction();
}
}
}
public async void GetBalanceList()
{
int pageCount = 1;
int pageSize = 50;
Invoke(new Action(() =>
{
this.dgvPayment.Rows.Clear();
}));
var url3 = BaseClass.Build29WxObjString("user/get_user_balance");
var data3 = UserLogin.GetSignaturex();
Invoke(new Action(() =>
{
data3 += "&user_name_in=" + BaseClass.UserName;
data3 += "&create_time_begin=" + dtpTimeBegin.Value.ToString("yyyy-MM-dd HH:mm:ss");
data3 += "&create_time_end=" + dtpTimeEnd.Value.ToString("yyyy-MM-dd HH:mm:ss");
if (cmbType.Text == "充值")
data3 += "&type_in=1,30";
if (cmbType.Text == "管理员充值")
data3 += "&type_in=1";
if (cmbType.Text == "支付宝充值")
data3 += "&type_in=30";
if (cmbType.Text == "拍单扣除/作废返还")
data3 += "&type_in=20,23";
if (cmbType.Text == "超重扣费")
data3 += "&type_in=24";
if (!string.IsNullOrEmpty(txtOutOrderId.Text.Trim()))
data3 += "&order_id_in=" + txtOutOrderId.Text.Trim();
if (!string.IsNullOrEmpty(txtShopOrderNo.Text.Trim()))
data3 += "&remark_fulltext=" + txtShopOrderNo.Text.Trim();
data3 += "&page=" + ucSplitPage1.CurrentPage;
data3 += "&page_size=" + ucSplitPage1.PageSize;
pageSize = ucSplitPage1.PageSize;
}));
var html3 = GetHtml.PostUtf8(url3, data3);
if (string.IsNullOrEmpty(html3) || !html3.Contains("\"code\":200"))
html3 = GetHtml.PostUtf8(url3, data3);
if (string.IsNullOrEmpty(html3) || !html3.Contains("\"code\":200"))
{
BaseMsgForm.ShowError("查询失败:" + BaseRegex.GetStringJsonByRegs(ref html3, html3, "msg"));
return;
}
List<user_payment_record> paymentList = new List<user_payment_record>();
paymentList = JsonHelper.DeserializeJsonToList<user_payment_record>(JsonHelper.JObjectParse(html3)["data"].ParseToString());
foreach(var payment in paymentList)
{
Invoke(new Action(() =>
{
var rowIndex = this.dgvPayment.Rows.Add(
false,
((EnumOrderPaymentType)payment.type.ParseToInt()).ParseToString(),
payment.order_id,
payment.amount,
payment.balance,
payment.create_time.ToString("yyyy-MM-dd HH:mm:ss"),
payment.remark
);
this.dgvPayment.Rows[rowIndex].Height = 60;
}));
}
int count = BaseRegex.GetIntJson(ref html3, "count");
pageCount = Math.Ceiling(1.0 * count / pageSize).ParseToInt();
pageCount = Math.Max(pageCount, 1);
ucSplitPage1.TotalPage = pageCount;
private List<user_payment_record> paymentList;
public async void GetBalanceList()
{
int pageCount = 1;
int pageSize = 50;
Invoke(new Action(() =>
{
this.dgvPayment.Rows.Clear();
}));
var url3 = BaseClass.Build29WxObjString("user/get_user_balance");
var data3 = UserLogin.GetSignaturex();
Invoke(new Action(() =>
{
data3 += "&user_name_in=" + BaseClass.UserName;
data3 += "&create_time_begin=" + dtpTimeBegin.Value.ToString("yyyy-MM-dd HH:mm:ss");
data3 += "&create_time_end=" + dtpTimeEnd.Value.ToString("yyyy-MM-dd HH:mm:ss");
if (cmbType.Text == "充值")
data3 += "&type_in=1,30";
if (cmbType.Text == "管理员充值")
data3 += "&type_in=1";
if (cmbType.Text == "支付宝充值")
data3 += "&type_in=30";
if (cmbType.Text == "拍单扣除/作废返还")
data3 += "&type_in=20,23";
if (cmbType.Text == "超重扣费")
data3 += "&type_in=24";
if (!string.IsNullOrEmpty(txtOutOrderId.Text.Trim()))
data3 += "&order_id_in=" + txtOutOrderId.Text.Trim();
if (!string.IsNullOrEmpty(txtShopOrderNo.Text.Trim()))
data3 += "&remark_fulltext=" + txtShopOrderNo.Text.Trim();
data3 += "&page=" + ucSplitPage1.CurrentPage;
data3 += "&page_size=" + ucSplitPage1.PageSize;
pageSize = ucSplitPage1.PageSize;
}));
var html3 = GetHtml.PostUtf8(url3, data3);
if (string.IsNullOrEmpty(html3) || !html3.Contains("\"code\":200"))
html3 = GetHtml.PostUtf8(url3, data3);
if (string.IsNullOrEmpty(html3) || !html3.Contains("\"code\":200"))
{
BaseMsgForm.ShowError("查询失败:" + BaseRegex.GetStringJsonByRegs(ref html3, html3, "msg"));
return;
}
paymentList = new List<user_payment_record>();
paymentList = JsonHelper.DeserializeJsonToList<user_payment_record>(JsonHelper.JObjectParse(html3)["data"].ParseToString());
foreach (var payment in paymentList)
{
Invoke(new Action(() =>
{
var rowIndex = this.dgvPayment.Rows.Add(
false,
((EnumOrderPaymentType)payment.type.ParseToInt()).ParseToString(),
payment.order_id,
payment.amount,
payment.balance,
payment.create_time.ToString("yyyy-MM-dd HH:mm:ss"),
payment.remark
);
this.dgvPayment.Rows[rowIndex].Height = 60;
}));
}
int count = BaseRegex.GetIntJson(ref html3, "count");
pageCount = Math.Ceiling(1.0 * count / pageSize).ParseToInt();
pageCount = Math.Max(pageCount, 1);
ucSplitPage1.TotalPage = pageCount;
#if DEBUG
Invoke(new Action(() => { statusBarUserControl1.lblTaskStatus.Text = BaseRegex.GetDecimalJson(ref html3, "seconds") + "秒"; }));
Invoke(new Action(() => { statusBarUserControl1.lblTaskStatus.Text = BaseRegex.GetDecimalJson(ref html3, "seconds") + "秒"; }));
#endif
}
Invoke(new Action(() =>
{
rechargeArmtTotal.Text = BaseClass.RechargeAmountTotal.ToString("N2");
balanceArmt.Text = BaseClass.Balance.ToString("N2");
rangeUsedAramt.Text = paymentList.Sum(a => a.amount).ToString("N2");
}));
}
private async void btnSearch_Click(object sender, EventArgs e)
{
if(this.ucSplitPage1.CurrentPage!=1)
{ this.ucSplitPage1.CurrentPage = 1; }
private async void btnSearch_Click(object sender, EventArgs e)
{
if (this.ucSplitPage1.CurrentPage != 1)
{ this.ucSplitPage1.CurrentPage = 1; }
pictureBox2.Visible = true;
await Task.Run(() => { GetBalanceList(); });
pictureBox2.Visible = false;
}
pictureBox2.Visible = true;
await Task.Run(() => { GetBalanceList(); });
pictureBox2.Visible = false;
}
private void ucSplitPage1_Load(object sender, EventArgs e)
{
private void ucSplitPage1_Load(object sender, EventArgs e)
{
}
}
private async void ucSplitPage1_PageChange(object obj)
{
pictureBox2.Visible = true;
await Task.Run(() => { GetBalanceList(); });
pictureBox2.Visible = false;
}
private async void ucSplitPage1_PageChange(object obj)
{
pictureBox2.Visible = true;
await Task.Run(() => { GetBalanceList(); });
pictureBox2.Visible = false;
}
private void ucGroupBoxEx1_Enter(object sender, EventArgs e)
{
}
private void ucGroupBoxEx1_Enter(object sender, EventArgs e)
{
}
private void dgvPayment_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex < 0 || e.RowIndex < 0)
return;
var row = dgvPayment.Rows[e.RowIndex];
string headerText = dgvPayment.Columns[e.ColumnIndex].HeaderText;
string columnName = dgvPayment.Columns[e.ColumnIndex].Name;
switch (headerText)
{
case "":
dgvPayment.Rows[e.RowIndex].Cells["colCheck"].Value = !(bool)dgvPayment.Rows[e.RowIndex].Cells["colCheck"].Value;
break;
default:
break;
}
}
}
private void dgvPayment_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex < 0 || e.RowIndex < 0)
return;
var row = dgvPayment.Rows[e.RowIndex];
string headerText = dgvPayment.Columns[e.ColumnIndex].HeaderText;
string columnName = dgvPayment.Columns[e.ColumnIndex].Name;
switch (headerText)
{
case "":
dgvPayment.Rows[e.RowIndex].Cells["colCheck"].Value = !(bool)dgvPayment.Rows[e.RowIndex].Cells["colCheck"].Value;
break;
default:
break;
}
}
private void exportRecord_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
if (paymentList != null)
{
using (SaveFileDialog saveFileDialog = new SaveFileDialog())
{
saveFileDialog.Filter = "CSV 文件 (*.csv)|*.csv|Excel 文件 (*.xlsx)|*.xlsx";
saveFileDialog.FilterIndex = 1;
saveFileDialog.FileName = $"消费记录_{dtpTimeBegin.Value:yyyyMMdd}_{dtpTimeEnd.Value:yyyyMMdd}.csv";
saveFileDialog.RestoreDirectory = true;
if (saveFileDialog.ShowDialog() == DialogResult.OK)
{
StringBuilder sb = new StringBuilder();
sb.AppendLine("类型,订单ID,金额,余额,创建时间,备注");
foreach (var item in paymentList)
{
//var rowIndex = this.dgvPayment.Rows.Add(
// false,
// ((EnumOrderPaymentType)payment.type.ParseToInt()).ParseToString(),
// item.order_id,
// item.amount,
// item.balance,
// item.create_time.ToString("yyyy-MM-dd HH:mm:ss"),
// item.remark
//);
sb.AppendLine($"{item.type.ParseToInt()},{item.order_id},{item.amount},{item.balance},{item.create_time.ToString("yyyy-MM-dd HH:mm:ss")},{item.remark}");
}
File.WriteAllText(saveFileDialog.FileName, sb.ToString(), Encoding.UTF8);
MessageBox.Show("导出成功");
}
}
}
}
}
}
@@ -117,6 +117,15 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="btnRefresh.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>289, 17</value>
</metadata>
<metadata name="btnBalanceTopUp.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>130, 17</value>
</metadata>
<metadata name="btnSearch.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
<metadata name="colCheck.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>