From 2dfec55b5f2f975ac35199f8919e9b73f8faa2e8 Mon Sep 17 00:00:00 2001 From: wule Date: Tue, 1 Sep 2026 16:28:12 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8Doem=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E8=BF=9B=E8=A1=8C=E7=A4=BC=E7=89=A9=E5=8D=95=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../WXAdminAccountBalanceForm.Designer.cs | 57 +++++---- .../AdminForms/WXAdminAccountBalanceForm.cs | 111 ++-------------- .../AdminForms/WXAdminAccountBalanceForm.resx | 3 + .../WXOemAccountBalanceForm.Designer.cs | 1 + .../ShopForms/WXOemAccountBalanceForm.cs | 118 +++++++++++++++++- 5 files changed, 161 insertions(+), 129 deletions(-) diff --git a/TEMUKJD/WXForms/AdminForms/WXAdminAccountBalanceForm.Designer.cs b/TEMUKJD/WXForms/AdminForms/WXAdminAccountBalanceForm.Designer.cs index 85aae18..52d6110 100644 --- a/TEMUKJD/WXForms/AdminForms/WXAdminAccountBalanceForm.Designer.cs +++ b/TEMUKJD/WXForms/AdminForms/WXAdminAccountBalanceForm.Designer.cs @@ -109,15 +109,16 @@ namespace TemuKJD.WXForms.AdminForms this.txtSearch = new System.Windows.Forms.TextBox(); this.pictureBox2 = new System.Windows.Forms.PictureBox(); this.dgvPayment = new TemuKJD.UserComponent.DataGridViewEx(); + this.ucSplitPage1 = new TemuKJD.UserControls.UcSplitPage(); this.colCheck = new System.Windows.Forms.DataGridViewCheckBoxColumn(); this.colType = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colUserName = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colOrderId = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colAmount = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colOemAmount = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colBalance = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colCreateTime = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colRemark = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.ucSplitPage1 = new TemuKJD.UserControls.UcSplitPage(); this.panel1.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit(); this.splitContainer2.Panel1.SuspendLayout(); @@ -454,6 +455,7 @@ namespace TemuKJD.WXForms.AdminForms "充值", "管理员充值", "支付宝充值", + "礼物单支出", "拍单扣除/作废返还", "超重扣费支出", "退货包裹扣费支出", @@ -967,6 +969,7 @@ namespace TemuKJD.WXForms.AdminForms this.colUserName, this.colOrderId, this.colAmount, + this.colOemAmount, this.colBalance, this.colCreateTime, this.colRemark}); @@ -981,6 +984,20 @@ namespace TemuKJD.WXForms.AdminForms this.dgvPayment.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvPayment_CellContentClick); this.dgvPayment.CellValueChanged += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvPayment_CellValueChanged); // + // ucSplitPage1 + // + this.ucSplitPage1.CurrentPage = 1; + this.ucSplitPage1.Dock = System.Windows.Forms.DockStyle.Right; + this.ucSplitPage1.IsShowPageSize = true; + this.ucSplitPage1.Location = new System.Drawing.Point(903, 0); + this.ucSplitPage1.Margin = new System.Windows.Forms.Padding(0); + this.ucSplitPage1.Name = "ucSplitPage1"; + this.ucSplitPage1.PageSize = 50; + this.ucSplitPage1.Size = new System.Drawing.Size(459, 25); + this.ucSplitPage1.TabIndex = 1163; + this.ucSplitPage1.TotalPage = 1; + this.ucSplitPage1.PageChange += new System.Action(this.ucSplitPage1_PageChange); + // // colCheck // this.colCheck.FillWeight = 20F; @@ -1018,6 +1035,13 @@ namespace TemuKJD.WXForms.AdminForms this.colAmount.Name = "colAmount"; this.colAmount.ReadOnly = true; // + // colOemAmount + // + this.colOemAmount.FillWeight = 60F; + this.colOemAmount.HeaderText = "归属Oem的金额"; + this.colOemAmount.Name = "colOemAmount"; + this.colOemAmount.ReadOnly = true; + // // colBalance // this.colBalance.FillWeight = 60F; @@ -1040,20 +1064,6 @@ namespace TemuKJD.WXForms.AdminForms this.colRemark.Resizable = System.Windows.Forms.DataGridViewTriState.True; this.colRemark.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.NotSortable; // - // ucSplitPage1 - // - this.ucSplitPage1.CurrentPage = 1; - this.ucSplitPage1.Dock = System.Windows.Forms.DockStyle.Right; - this.ucSplitPage1.IsShowPageSize = true; - this.ucSplitPage1.Location = new System.Drawing.Point(903, 0); - this.ucSplitPage1.Margin = new System.Windows.Forms.Padding(0); - this.ucSplitPage1.Name = "ucSplitPage1"; - this.ucSplitPage1.PageSize = 50; - this.ucSplitPage1.Size = new System.Drawing.Size(459, 25); - this.ucSplitPage1.TabIndex = 1163; - this.ucSplitPage1.TotalPage = 1; - this.ucSplitPage1.PageChange += new System.Action(this.ucSplitPage1_PageChange); - // // WXAdminAccountBalanceForm // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; @@ -1104,14 +1114,6 @@ namespace TemuKJD.WXForms.AdminForms private System.Windows.Forms.DateTimePicker dtpTimeEnd; private System.Windows.Forms.DateTimePicker dtpTimeBegin; private DevComponents.DotNetBar.PanelEx btnSearch; - private System.Windows.Forms.DataGridViewCheckBoxColumn colCheck; - private System.Windows.Forms.DataGridViewTextBoxColumn colType; - private System.Windows.Forms.DataGridViewTextBoxColumn colUserName; - private System.Windows.Forms.DataGridViewTextBoxColumn colOrderId; - private System.Windows.Forms.DataGridViewTextBoxColumn colAmount; - private System.Windows.Forms.DataGridViewTextBoxColumn colBalance; - private System.Windows.Forms.DataGridViewTextBoxColumn colCreateTime; - private System.Windows.Forms.DataGridViewTextBoxColumn colRemark; private System.Windows.Forms.Label label1; private System.Windows.Forms.TextBox txtUserName; private DevComponents.DotNetBar.PanelEx btnSearchShop; @@ -1166,5 +1168,14 @@ namespace TemuKJD.WXForms.AdminForms private System.Windows.Forms.TextBox txtOutOrderId; private System.Windows.Forms.TextBox txtShopOrderNo; private System.Windows.Forms.Label label9; + private System.Windows.Forms.DataGridViewCheckBoxColumn colCheck; + private System.Windows.Forms.DataGridViewTextBoxColumn colType; + private System.Windows.Forms.DataGridViewTextBoxColumn colUserName; + private System.Windows.Forms.DataGridViewTextBoxColumn colOrderId; + private System.Windows.Forms.DataGridViewTextBoxColumn colAmount; + private System.Windows.Forms.DataGridViewTextBoxColumn colOemAmount; + private System.Windows.Forms.DataGridViewTextBoxColumn colBalance; + private System.Windows.Forms.DataGridViewTextBoxColumn colCreateTime; + private System.Windows.Forms.DataGridViewTextBoxColumn colRemark; } } \ No newline at end of file diff --git a/TEMUKJD/WXForms/AdminForms/WXAdminAccountBalanceForm.cs b/TEMUKJD/WXForms/AdminForms/WXAdminAccountBalanceForm.cs index b62c420..d58b11c 100644 --- a/TEMUKJD/WXForms/AdminForms/WXAdminAccountBalanceForm.cs +++ b/TEMUKJD/WXForms/AdminForms/WXAdminAccountBalanceForm.cs @@ -94,18 +94,22 @@ namespace TemuKJD.WXForms.AdminForms data3 += "&create_time_end=" + dtpTimeEnd.Value.ToString("yyyy-MM-dd HH:mm:ss"); if (cmbType.Text == "充值") data3 += "&type_in=1,30"; - if (cmbType.Text == "管理员充值") + else if (cmbType.Text == "管理员充值") data3 += "&type_in=1"; - if (cmbType.Text == "支付宝充值") + else if (cmbType.Text == "支付宝充值") data3 += "&type_in=30"; - if (cmbType.Text == "拍单扣除/作废返还") + else if (cmbType.Text == "礼物单支出") + data3 += "&type_in=16"; + else if (cmbType.Text == "拍单扣除/作废返还") data3 += "&type_in=20,23"; - if (cmbType.Text == "超重扣费支出") + else if (cmbType.Text == "超重扣费支出") data3 += "&type_in=24"; - if (cmbType.Text == "退货包裹扣费支出") + else if (cmbType.Text == "退货包裹扣费支出") data3 += "&type_in=26"; - if (cmbType.Text == "云仓退货扣费支出") + else if (cmbType.Text == "云仓退货扣费支出") data3 += "&type_in=31"; + else if (!string.IsNullOrEmpty(cmbType.Text)) + data3 += "&type_in=" + cmbType.Text; if (!string.IsNullOrEmpty(txtOutOrderId.Text.Trim())) data3 += "&order_id_in=" + txtOutOrderId.Text.Trim(); if (!string.IsNullOrEmpty(txtShopOrderNo.Text.Trim())) @@ -135,6 +139,7 @@ namespace TemuKJD.WXForms.AdminForms payment.user_name, payment.order_id, payment.amount, + payment.oem_amount, payment.balance, payment.create_time.ToString("yyyy-MM-dd HH:mm:ss"), payment.remark @@ -176,100 +181,6 @@ namespace TemuKJD.WXForms.AdminForms pictureBox2.Visible = false; } - public async Task GetAllBalanceList() - { - Invoke(new Action(() => - { - this.dgvPayment.Rows.Clear(); - dgvPayment.CellValueChanged -= dgvPayment_CellValueChanged; - })); - - await Task.Run(() => - { - int pageCount = 1; - int pageSize = 50; - var url3 = BaseClass.BuildWXObjString("user/get_user_balance"); - var data3 = UserLogin.GetSignaturex(); - Invoke(new Action(() => - { - if (!string.IsNullOrEmpty(txtUserName.Text.Trim())) - data3 += "&user_name_in=" + txtUserName.Text.Trim(); - 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 (cmbType.Text == "退货包裹扣费支出") - data3 += "&type_in=26"; - if (cmbType.Text == "云仓退货扣费支出") - data3 += "&type_in=31"; - 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 paymentList = new List(); - paymentList = JsonHelper.DeserializeJsonToList(JsonHelper.JObjectParse(html3)["data"].ParseToString()); - foreach (var payment in paymentList) - { - Invoke(new Action(() => - { - var rowIndex = this.dgvPayment.Rows.Add( - true, - ((EnumOrderPaymentType)payment.type.ParseToInt()).ParseToString(), - payment.user_name, - payment.order_id, - payment.amount, - payment.balance, - payment.create_time.ToString("yyyy-MM-dd HH:mm:ss"), - payment.remark - ); - var row = this.dgvPayment.Rows[rowIndex]; - row.Height = 60; - - var rowExists = dgvPayment.Rows.Cast() - .Where(r => r.Cells["colOrderId"].Value.ParseToString() == payment.order_id && r.Cells["colType"].Value.ParseToString() == "中转仓作废返还收入").ToList(); - if (rowExists.Count > 1) - { - var c = Color.FromArgb(Randomx.GetId(127, 200), Randomx.GetId(127, 200), Randomx.GetId(127, 200)); - foreach (var rowExist in rowExists) - { - rowExist.Cells["colOrderId"].Style.BackColor = c; - } - } - })); - } - int count = BaseRegex.GetIntJson(ref html3, "count"); - pageCount = Math.Ceiling(1.0 * count / pageSize).ParseToInt(); - pageCount = Math.Max(pageCount, 1); - ucSplitPage1.TotalPage = pageCount; - }); - Invoke(new Action(() => - { - GetProfit(); - dgvPayment.CellValueChanged += dgvPayment_CellValueChanged; - })); - } - private async void ucSplitPage1_PageChange(object obj) { pictureBox2.Visible = true; diff --git a/TEMUKJD/WXForms/AdminForms/WXAdminAccountBalanceForm.resx b/TEMUKJD/WXForms/AdminForms/WXAdminAccountBalanceForm.resx index c6ad200..aaee83f 100644 --- a/TEMUKJD/WXForms/AdminForms/WXAdminAccountBalanceForm.resx +++ b/TEMUKJD/WXForms/AdminForms/WXAdminAccountBalanceForm.resx @@ -204,6 +204,9 @@ True + + True + True diff --git a/TEMUKJD/WXForms/ShopForms/WXOemAccountBalanceForm.Designer.cs b/TEMUKJD/WXForms/ShopForms/WXOemAccountBalanceForm.Designer.cs index 8fed6f6..e30aed6 100644 --- a/TEMUKJD/WXForms/ShopForms/WXOemAccountBalanceForm.Designer.cs +++ b/TEMUKJD/WXForms/ShopForms/WXOemAccountBalanceForm.Designer.cs @@ -399,6 +399,7 @@ namespace Work._29Tools.Forms.UserForms "充值", "管理员充值", "支付宝充值", + "礼物单支出", "拍单扣除/作废返还", "超重扣费支出", "退货包裹扣费支出", diff --git a/TEMUKJD/WXForms/ShopForms/WXOemAccountBalanceForm.cs b/TEMUKJD/WXForms/ShopForms/WXOemAccountBalanceForm.cs index b93557a..5731a33 100644 --- a/TEMUKJD/WXForms/ShopForms/WXOemAccountBalanceForm.cs +++ b/TEMUKJD/WXForms/ShopForms/WXOemAccountBalanceForm.cs @@ -137,18 +137,22 @@ namespace Work._29Tools.Forms.UserForms data3 += "&create_time_end=" + dtpTimeEnd.Value.ToString("yyyy-MM-dd HH:mm:ss"); if (cmbType.Text == "充值") data3 += "&type_in=1,30"; - if (cmbType.Text == "管理员充值") + else if (cmbType.Text == "管理员充值") data3 += "&type_in=1"; - if (cmbType.Text == "支付宝充值") + else if (cmbType.Text == "支付宝充值") data3 += "&type_in=30"; - if (cmbType.Text == "拍单扣除/作废返还") + else if (cmbType.Text == "礼物单支出") + data3 += "&type_in=16"; + else if (cmbType.Text == "拍单扣除/作废返还") data3 += "&type_in=20,23"; - if (cmbType.Text == "超重扣费支出") + else if (cmbType.Text == "超重扣费支出") data3 += "&type_in=24"; - if (cmbType.Text == "退货包裹扣费支出") + else if(cmbType.Text == "退货包裹扣费支出") data3 += "&type_in=26"; - if (cmbType.Text == "云仓退货扣费支出") + else if (cmbType.Text == "云仓退货扣费支出") data3 += "&type_in=31"; + else if (!string.IsNullOrEmpty(cmbType.Text)) + data3 += "&type_in=" + cmbType.Text; data3 += "&page=" + ucSplitPage1.CurrentPage; data3 += "&page_size=" + ucSplitPage1.PageSize; pageSize = ucSplitPage1.PageSize; @@ -201,6 +205,108 @@ namespace Work._29Tools.Forms.UserForms })); } + + + public async Task GetAllBalanceList() + { + Invoke(new Action(() => + { + this.dgvPayment.Rows.Clear(); + dgvPayment.CellValueChanged -= dgvPayment_CellValueChanged; + })); + + await Task.Run(() => + { + int pageCount = 1; + int pageSize = 50; + var url3 = BaseClass.BuildWXObjString("user/get_user_balance"); + var data3 = UserLogin.GetSignaturex(); + Invoke(new Action(() => + { + if (!string.IsNullOrEmpty(txtUserName.Text.Trim())) + data3 += "&user_name_in=" + txtUserName.Text.Trim(); + 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"; + else if (cmbType.Text == "管理员充值") + data3 += "&type_in=1"; + else if (cmbType.Text == "支付宝充值") + data3 += "&type_in=30"; + else if (cmbType.Text == "礼物单支出") + data3 += "&type_in=16"; + else if (cmbType.Text == "拍单扣除/作废返还") + data3 += "&type_in=20,23"; + else if (cmbType.Text == "超重扣费支出") + data3 += "&type_in=24"; + else if (cmbType.Text == "退货包裹扣费支出") + data3 += "&type_in=26"; + else if (cmbType.Text == "云仓退货扣费支出") + data3 += "&type_in=31"; + else if (!string.IsNullOrEmpty(cmbType.Text)) + data3 += "&type_in=" + cmbType.Text; + //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 paymentList = new List(); + paymentList = JsonHelper.DeserializeJsonToList(JsonHelper.JObjectParse(html3)["data"].ParseToString()); + foreach (var payment in paymentList) + { + Invoke(new Action(() => + { + var rowIndex = this.dgvPayment.Rows.Add( + true, + ((EnumOrderPaymentType)payment.type.ParseToInt()).ParseToString(), + payment.user_name, + payment.order_id, + payment.amount, + payment.oem_amount, + payment.balance, + payment.create_time.ToString("yyyy-MM-dd HH:mm:ss"), + payment.remark + ); + var row = this.dgvPayment.Rows[rowIndex]; + row.Height = 60; + + var rowExists = dgvPayment.Rows.Cast() + .Where(r => r.Cells["colOrderId"].Value.ParseToString() == payment.order_id && r.Cells["colType"].Value.ParseToString() == "中转仓作废返还收入").ToList(); + if (rowExists.Count > 1) + { + var c = Color.FromArgb(Randomx.GetId(127, 200), Randomx.GetId(127, 200), Randomx.GetId(127, 200)); + foreach (var rowExist in rowExists) + { + rowExist.Cells["colOrderId"].Style.BackColor = c; + } + } + })); + } + int count = BaseRegex.GetIntJson(ref html3, "count"); + pageCount = Math.Ceiling(1.0 * count / pageSize).ParseToInt(); + pageCount = Math.Max(pageCount, 1); + ucSplitPage1.TotalPage = pageCount; + }); + Invoke(new Action(() => + { + GetProfit(); + dgvPayment.CellValueChanged += dgvPayment_CellValueChanged; + })); + } + + private async void btnSearch_Click(object sender, EventArgs e) { if (cancellationTokenSource != null)