1代理改名字 2代理管理功能 3订单流水统计功能(方便报税) 4 商品预售界面-商品改价支持加减乘除四种模式

This commit is contained in:
wule committed 2026-07-18 18:29:06 +08:00
1 parent 457a8acee6
commit ba502650ab
69 files changed
+27720 -720

No files matched your search

+148 -6
View File
@@ -33,25 +33,34 @@ namespace TemuKJD.WXForms.ShopForms
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.btnRefresh = new DevComponents.DotNetBar.PanelEx();
this.pbLoading = new System.Windows.Forms.PictureBox();
this.numAddTopUp = new System.Windows.Forms.NumericUpDown();
this.label8 = new System.Windows.Forms.Label();
this.btnAddPoints = new DevComponents.DotNetBar.PanelEx();
this.btnAddBalance = new DevComponents.DotNetBar.PanelEx();
this.numericUpDown1 = new System.Windows.Forms.NumericUpDown();
this.label2 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pbLoading)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numAddTopUp)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).BeginInit();
this.SuspendLayout();
//
// label1
//
this.label1.Font = new System.Drawing.Font("微软雅黑", 11F);
this.label1.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(192)))), ((int)(((byte)(64)))), ((int)(((byte)(0)))));
this.label1.Location = new System.Drawing.Point(30, 420);
this.label1.Location = new System.Drawing.Point(27, 283);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(384, 44);
this.label1.Size = new System.Drawing.Size(228, 72);
this.label1.TabIndex = 1;
this.label1.Text = "支付宝扫码充值,备注软件登录账户。如忘记备注,请联系购买方充值。";
//
// pictureBox1
//
this.pictureBox1.Location = new System.Drawing.Point(30, 30);
this.pictureBox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.pictureBox1.Location = new System.Drawing.Point(30, 31);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(384, 384);
this.pictureBox1.Size = new System.Drawing.Size(212, 212);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom;
this.pictureBox1.TabIndex = 3;
this.pictureBox1.TabStop = false;
@@ -62,7 +71,7 @@ namespace TemuKJD.WXForms.ShopForms
this.btnRefresh.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnRefresh.DisabledBackColor = System.Drawing.Color.Empty;
this.btnRefresh.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnRefresh.Location = new System.Drawing.Point(330, 467);
this.btnRefresh.Location = new System.Drawing.Point(158, 358);
this.btnRefresh.Name = "btnRefresh";
this.btnRefresh.Size = new System.Drawing.Size(84, 23);
this.btnRefresh.Style.Alignment = System.Drawing.StringAlignment.Center;
@@ -83,7 +92,7 @@ namespace TemuKJD.WXForms.ShopForms
// pbLoading
//
this.pbLoading.Image = global::TemuKJD.Properties.Resources.loading_blue;
this.pbLoading.Location = new System.Drawing.Point(197, 197);
this.pbLoading.Location = new System.Drawing.Point(111, 112);
this.pbLoading.Name = "pbLoading";
this.pbLoading.Size = new System.Drawing.Size(50, 50);
this.pbLoading.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
@@ -91,11 +100,135 @@ namespace TemuKJD.WXForms.ShopForms
this.pbLoading.TabStop = false;
this.pbLoading.Visible = false;
//
// numAddTopUp
//
this.numAddTopUp.DecimalPlaces = 2;
this.numAddTopUp.Location = new System.Drawing.Point(116, 418);
this.numAddTopUp.Maximum = new decimal(new int[] {
100000,
0,
0,
0});
this.numAddTopUp.Minimum = new decimal(new int[] {
1,
0,
0,
131072});
this.numAddTopUp.Name = "numAddTopUp";
this.numAddTopUp.Size = new System.Drawing.Size(66, 23);
this.numAddTopUp.TabIndex = 1140;
this.numAddTopUp.Value = new decimal(new int[] {
1,
0,
0,
131072});
this.numAddTopUp.Visible = false;
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(33, 421);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(92, 17);
this.label8.TabIndex = 1141;
this.label8.Text = "积分充值金额:";
this.label8.Visible = false;
//
// btnAddPoints
//
this.btnAddPoints.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnAddPoints.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnAddPoints.DisabledBackColor = System.Drawing.Color.Empty;
this.btnAddPoints.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnAddPoints.Location = new System.Drawing.Point(186, 418);
this.btnAddPoints.Name = "btnAddPoints";
this.btnAddPoints.Size = new System.Drawing.Size(56, 23);
this.btnAddPoints.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnAddPoints.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnAddPoints.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnAddPoints.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnAddPoints.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnAddPoints.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnAddPoints.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnAddPoints.Style.GradientAngle = 90;
this.btnAddPoints.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnAddPoints.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnAddPoints.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnAddPoints.TabIndex = 1145;
this.btnAddPoints.Text = "充值";
this.btnAddPoints.Visible = false;
this.btnAddPoints.Click += new System.EventHandler(this.btnAddPoints_Click);
//
// btnAddBalance
//
this.btnAddBalance.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnAddBalance.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnAddBalance.DisabledBackColor = System.Drawing.Color.Empty;
this.btnAddBalance.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnAddBalance.Location = new System.Drawing.Point(186, 452);
this.btnAddBalance.Name = "btnAddBalance";
this.btnAddBalance.Size = new System.Drawing.Size(56, 23);
this.btnAddBalance.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnAddBalance.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnAddBalance.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnAddBalance.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnAddBalance.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnAddBalance.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnAddBalance.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnAddBalance.Style.GradientAngle = 90;
this.btnAddBalance.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnAddBalance.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnAddBalance.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnAddBalance.TabIndex = 1151;
this.btnAddBalance.Text = "充值";
this.btnAddBalance.Visible = false;
this.btnAddBalance.Click += new System.EventHandler(this.btnAddBalance_Click);
//
// numericUpDown1
//
this.numericUpDown1.DecimalPlaces = 2;
this.numericUpDown1.Location = new System.Drawing.Point(116, 452);
this.numericUpDown1.Maximum = new decimal(new int[] {
100000,
0,
0,
0});
this.numericUpDown1.Minimum = new decimal(new int[] {
1,
0,
0,
131072});
this.numericUpDown1.Name = "numericUpDown1";
this.numericUpDown1.Size = new System.Drawing.Size(66, 23);
this.numericUpDown1.TabIndex = 1149;
this.numericUpDown1.Value = new decimal(new int[] {
1,
0,
0,
131072});
this.numericUpDown1.Visible = false;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(33, 455);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(92, 17);
this.label2.TabIndex = 1150;
this.label2.Text = "余额充值金额:";
this.label2.Visible = false;
//
// WXGetTopUpQrCode
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
this.BackColor = System.Drawing.Color.White;
this.ClientSize = new System.Drawing.Size(800, 522);
this.Controls.Add(this.btnAddBalance);
this.Controls.Add(this.numericUpDown1);
this.Controls.Add(this.label2);
this.Controls.Add(this.btnAddPoints);
this.Controls.Add(this.numAddTopUp);
this.Controls.Add(this.label8);
this.Controls.Add(this.pbLoading);
this.Controls.Add(this.btnRefresh);
this.Controls.Add(this.pictureBox1);
@@ -106,7 +239,10 @@ namespace TemuKJD.WXForms.ShopForms
this.Load += new System.EventHandler(this.WXGetTopUpQrCode_Load);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pbLoading)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numAddTopUp)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.numericUpDown1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
@@ -115,5 +251,11 @@ namespace TemuKJD.WXForms.ShopForms
private System.Windows.Forms.PictureBox pictureBox1;
private DevComponents.DotNetBar.PanelEx btnRefresh;
private System.Windows.Forms.PictureBox pbLoading;
private System.Windows.Forms.NumericUpDown numAddTopUp;
private System.Windows.Forms.Label label8;
private DevComponents.DotNetBar.PanelEx btnAddPoints;
private DevComponents.DotNetBar.PanelEx btnAddBalance;
private System.Windows.Forms.NumericUpDown numericUpDown1;
private System.Windows.Forms.Label label2;
}
}
@@ -3,12 +3,15 @@ using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Security.Policy;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using TemuKJD.BaseForms;
using TemuKJD.KJDForms.ShopForms;
using Work;
using Work.BLL.Tools;
@@ -60,6 +63,27 @@ namespace TemuKJD.WXForms.ShopForms
{
Task.Run(() => { refreshQrcode(); });
}
private void btnAddPoints_Click(object sender, EventArgs e)
{
try
{
Process.Start(new ProcessStartInfo("https://excashier.alipay.com/standard/auth.htm?payOrderId=5afc56d40af64001ad2a486cce1ca579.25") { UseShellExecute = true });
}
catch (Exception ex)
{
// 处理可能出现的异常,例如找不到浏览器等
MessageBox.Show("无法打开浏览器: " + ex.Message);
}
}
private void btnAddBalance_Click(object sender, EventArgs e)
{
ShopLoginForm loginForm = new ShopLoginForm(new AllBase.Model.Result.ShopLoginInfo());
loginForm.InitUrl = "https://excashier.alipay.com/standard/auth.htm?payOrderId=5afc56d40af64001ad2a486cce1ca579.25";
loginForm.openType = KJDForms.ShopForms.EnumOpenType.manage;
loginForm.ShowDialog();
}
}
}
File diff suppressed because it is too large. Load diff
@@ -0,0 +1,508 @@
using AllBase;
using AllBase.Helper;
using AllBase.Model.Result;
using NaiBa.Util.Extension;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using TemuKJD.BaseForms;
using TemuKJD.BLL;
using TemuKJD.Extension;
using Work;
namespace TemuKJD.WXForms.ShopForms
{
public partial class WXOemAccountForm
: BaseForm
{
public static List<UserSubAccountInfo> AllUsers { get; set; } = new List<UserSubAccountInfo>();
public MainForm Mf { get; set; } = null;
public string Uid { get; set; } = "";
public WXOemAccountForm()
{
InitializeComponent();
}
private void btnOpUser_Click(object sender, EventArgs e)
{
if (txtPassword.Text != txtRePass.Text)
{
BaseMsgForm.ShowInfo("两次密码不正确", "提示");
return;
}
if (btnOpUser.Text == "添加用户" && txtPassword.Text.Length < 6)
{
BaseMsgForm.ShowInfo("密码最少6位", "提示");
return;
}
if (string.IsNullOrEmpty(txtNickName.Text) || string.IsNullOrEmpty(txtMobile.Text) ||
txtMobile.Text.Length != 11)
{
BaseMsgForm.ShowInfo("信息不正确", "提示");
return;
}
StringBuilder data = new StringBuilder();
data.Append(UserLogin.GetSignaturex());
data.Append("&add_nick_name=" + GetHtml.UrlEncodeUtf8(txtNickName.Text));
data.Append("&add_user_name=" + GetHtml.UrlEncodeUtf8(txtMobile.Text));
data.Append("&add_mobile=" + GetHtml.UrlEncodeUtf8(txtMobile.Text));
data.Append("&add_company=" + GetHtml.UrlEncodeUtf8(txtCompany.Text));
data.Append("&oem_id=" + GetHtml.UrlEncodeUtf8(BaseClass.OemId.Trim()));
if (!string.IsNullOrEmpty(txtPassword.Text))
data.Append("&add_password=" + Md5Base.GetMd5(txtPassword.Text).ToLower());
// 主账户
data.Append("&group_id=3");
string url = BaseClass.BuildObjString("user/add_user");
if (btnOpUser.Text != "添加用户" && !string.IsNullOrEmpty(Uid))
{
data.Append("&id=" + Uid);
url = BaseClass.BuildObjString("user/update_user");
}
string html = GetHtml.PostUtf8(url, data.ToString()).Trim();
if (!string.IsNullOrEmpty(html))
{
if (html.Contains("\"code\":200"))
{
btnOpUser.Text = "添加用户";
EmptyInput();
btnCancel.Visible = false;
GetUser();
return;
}
var msg = BaseRegex.GetStringJson(ref html, "msg");
if (string.IsNullOrEmpty(msg))
msg = html;
BaseMsgForm.ShowError(msg, "错误");
return;
}
BaseMsgForm.ShowError("出现异常,添加失败", "错误");
}
private void GetUser()
{
dgvUser.Rows.Clear();
AllUsers.Clear();
if (BaseClass.OemId.IsNullOrEmpty() || BaseClass.IsOemOwner == false)
return;
string url = BaseClass.BuildObjString("user/get_all_user");
StringBuilder data = new StringBuilder();
data.Append(UserLogin.GetSignaturex());
// 主账户
data.Append("&group_id=3");
data.Append("&oem_id=" + BaseClass.OemId);
if (!string.IsNullOrWhiteSpace(txtSearch.Text))
data.Append("&search=" + txtSearch.Text.Replace("'","'"));
string html = GetHtml.PostUtf8(url, data.ToString());
if (string.IsNullOrEmpty(html))
return;
if (html.Contains("\"data\""))
{
var userObj = Newtonsoft.Json.Linq.JObject.Parse(html);
foreach (Newtonsoft.Json.Linq.JObject obj in userObj["data"])
{
string oStr = JsonHelper.SerializeObject(obj);
UserSubAccountInfo user = new UserSubAccountInfo();
user.id = BaseRegex.GetIntJson(ref oStr, "id");
user.user_name = BaseRegex.GetStringJson(ref oStr, "user_name");
user.nick_name = BaseRegex.GetStringJson(ref oStr, "nick_name");
user.mobile = BaseRegex.GetStringJson(ref oStr, "mobile");
user.group_id = BaseRegex.GetStringJson(ref oStr, "group_id");
user.shop_count = BaseRegex.GetIntJson(ref oStr, "shop_count");
user.company_name = BaseRegex.GetStringJson(ref oStr, "company_name");
user.sa_level = BaseRegex.GetIntJson(ref oStr, "sa_level");
user.authority = BaseRegex.GetStringJson(ref oStr, "authority");
user.points = BaseRegex.GetIntJson(ref oStr, "points");
user.balance = BaseRegex.GetDecimalJson(ref oStr, "balance");
user.shop_points_per_month = BaseRegex.GetIntJson(ref oStr, "shop_points_per_month");
user.postage_per_order = BaseRegex.GetDecimalJson(ref oStr, "postage_per_order");
user.oem_id = BaseRegex.GetStringJson(ref oStr, "oem_id");
user.oem_name = BaseRegex.GetStringJson(ref oStr, "oem_name");
var parent_user_name = BaseRegex.GetStringJson(ref oStr, "parent_user_name");
AllUsers.Add(user);
dgvUser.Rows.Add(
false,
user.id,
user.nick_name,
user.user_name,
parent_user_name,
user.group_id,
user.group_name,
user.company_name,
user.shop_count,
user.sa_level,
user.sa_level_name /*+ (user.group_id == "4" ? "(客服)" : "")*/,
user.authority,
user.oem_id,
user.oem_name,
(user.authority.Contains("充值用户") && user.group_id == "3") ? (int?)user.points : null,
(user.authority.Contains("充值用户") && user.group_id == "3") ? "+" : null,
(user.authority.Contains("充值用户") && user.group_id == "3") ? (int?)user.shop_points_per_month : null,
(user.authority.Contains("充值用户") && user.group_id == "3") ? "改" : null,
user.balance.ParseToDecimal(),
"+",
Math.Max(2.2m, user.postage_per_order.ParseToDecimal()),
(user.group_id == "3") ? "改" : null,
user.group_id == "3" ? "添加店铺" : "",
"编辑",
"删除");
}
}
}
private void btnCancel_Click(object sender, EventArgs e)
{
btnOpUser.Text = "添加用户";
Uid = "";
EmptyInput();
btnCancel.Visible = false;
}
private void EmptyInput()
{
txtNickName.Clear();
txtPassword.Clear();
txtRePass.Clear();
txtMobile.Clear();
txtCompany.Clear();
}
private void btnRefresh_Click(object sender, EventArgs e)
{
GetUser();
}
private void dgvUser_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex < 0 || e.RowIndex < 0)
return;
string columText = dgvUser.Columns[e.ColumnIndex].HeaderText;
string columName = dgvUser.Columns[e.ColumnIndex].Name;
string uid = dgvUser.Rows[e.RowIndex].Cells["UseridColumn"].Value.ToString();
string nickName = dgvUser.Rows[e.RowIndex].Cells["UserNickNameColumn"].Value.ToString();
string mobile = dgvUser.Rows[e.RowIndex].Cells["mobileColumn"].Value.ToString();
string groupName = dgvUser.Rows[e.RowIndex].Cells["groupNameColumn"].Value.ToString();
string company = dgvUser.Rows[e.RowIndex].Cells["colCompany"].Value.ToString();
string saLevelName = dgvUser.Rows[e.RowIndex].Cells["colSaLevelName"].Value.ToString();
string authority = dgvUser.Rows[e.RowIndex].Cells["colAuthority"].Value.ParseToString();
int shopPointsPerMonth = dgvUser.Rows[e.RowIndex].Cells["colShopPointsPerMonth"].Value.ParseToInt();
decimal postagePerOrder = dgvUser.Rows[e.RowIndex].Cells["colPostagePerOrder"].Value.ParseToDecimal();
var row = dgvUser.Rows[e.RowIndex];
if (columText == "编辑")
{
Uid = uid;
txtNickName.Text = nickName;
txtMobile.Text = mobile;
txtPassword.Text = "";
txtRePass.Text = "";
txtCompany.Text = company;
btnOpUser.Text = "保存用户";
btnCancel.Visible = true;
}
if (columText == "删除")
{
if (BaseMsgForm.ShowConfirm("是否删除,删除后无法再次添加", "提示").DialogResult == DialogResult.OK)
{
Delete(uid);
}
}
if (columText == "+")
{
if (columName == "colPlus")
{
this.lblUserInfo.Text = mobile + " - " + nickName;
this.numAddTopUp.Value = 0;
this.pnlTopUp.Tag = row;
this.pnlTopUp.Visible = true;
this.pnlTopUp.BringToFront();
}
if (columName == "colBalancePlus")
{
this.lblUserBalanceInfo.Text = mobile + " - " + nickName;
this.numAddBalance.Value = 0;
this.pnlBalance.Tag = row;
this.pnlBalance.Visible = true;
this.pnlBalance.BringToFront();
}
}
if (columText == "改")
{
if (columName == "colChangePointsPerMonth")
{
this.lblShopPointsPerMonthUserInfo.Text = mobile + " - " + nickName;
this.numShopPointsPerMonth.Value = shopPointsPerMonth;
this.pnlShopPointsPerMonth.Tag = row;
this.pnlShopPointsPerMonth.Visible = true;
this.pnlShopPointsPerMonth.BringToFront();
this.lblShopPointsPerMonthUserId.Text = uid;
}
if (columName == "colChangePostagePerOrder")
{
this.lblPostagePerOrderUserInfo.Text = mobile + " - " + nickName;
this.numPostagePerOrder.Value = postagePerOrder;
this.pnlPostagePerOrder.Tag = row;
this.pnlPostagePerOrder.Visible = true;
this.pnlPostagePerOrder.BringToFront();
this.lblPostagePerOrderUserId.Text = uid;
}
}
if (columText == "")
row.Cells["colSelect"].Value = !row.Cells["colSelect"].Value.ParseToBool();
}
public void Delete(string uid)
{
StringBuilder data = new StringBuilder();
data.Append(UserLogin.GetSignaturex());
data.Append("&id=" + uid);
string url = BaseClass.BuildObjString("user/delete_user");
string html = GetHtml.PostUtf8(url, data.ToString());
if (!string.IsNullOrEmpty(html))
{
if (html.Contains("\"code\":200"))
{
BaseMsgForm.ShowInfo("删除成功", "提示");
GetUser();
return;
}
var msg = BaseRegex.GetStringJson(ref html, "msg");
if (string.IsNullOrEmpty(msg))
msg = html;
BaseMsgForm.ShowError(msg, "错误");
return;
}
BaseMsgForm.ShowError("返回异常", "错误");
}
private void MainAccountForm_VisibleChanged(object sender, EventArgs e)
{
if (this.Visible)
{
GetUser();
}
}
private void MainAccountForm_Load(object sender, EventArgs e)
{
this.dgvUser.AddSelectorColumn("colCheck");
pnlShopPointsPerMonth.Location = new Point(pnlTopUp.Location.X, pnlTopUp.Location.Y);
pnlBalance.Location = new Point(pnlTopUp.Location.X, pnlTopUp.Location.Y);
pnlPostagePerOrder.Location = new Point(pnlTopUp.Location.X, pnlTopUp.Location.Y);
this.txtSearch.GotFocus += TxtSearch_GotFocus;
this.txtSearch.LostFocus += TxtSearch_LostFocus;
this.dgvUser.AddMergeColumn(new List<string> { "colPoints", "colPlus" });
this.dgvUser.AddMergeColumnHeader(new List<string> { "colPoints", "colPlus" }, "积分点数");
this.dgvUser.AddMergeColumn(new List<string> { "colShopPointsPerMonth", "colChangePointsPerMonth" });
this.dgvUser.AddMergeColumnHeader(new List<string> { "colShopPointsPerMonth", "colChangePointsPerMonth" }, "月费耗点");
this.dgvUser.AddMergeColumn(new List<string> { "colBalance", "colBalancePlus" });
this.dgvUser.AddMergeColumnHeader(new List<string> { "colBalance", "colBalancePlus" }, "快递余额");
this.dgvUser.AddMergeColumn(new List<string> { "colPostagePerOrder", "colChangePostagePerOrder" });
this.dgvUser.AddMergeColumnHeader(new List<string> { "colPostagePerOrder", "colChangePostagePerOrder" }, "每单快递费");
}
private void TxtSearch_LostFocus(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(this.txtSearch.Text))
lblWatermark.Visible = true;
}
private void TxtSearch_GotFocus(object sender, EventArgs e)
{
lblWatermark.Visible = false;
}
private void lblWatermark_Click(object sender, EventArgs e)
{
this.txtSearch.Focus();
this.lblWatermark.Visible = false;
}
private void btnExportShopErp_Click(object sender, EventArgs e)
{
foreach (var user in AllUsers)
{
//if (user.group_id != "3")
// continue;
//string prodDataStr = "{\"userName\":\"15288888888\",\"password\":\"Andy@1984\",\"phonenumber\":\"15288888888\",\"status\": \"0\",\"remark\":\"a15288888888.\",\"roleIds\":[\"5\"]}";
//prodDataStr = "{\"userName\":\"" + user.user_name + "\",\"password\":\"" + user.user_name + "\",\"phonenumber\":\"" + user.mobile +
// "\",\"status\": \"0\",\"nickName\":\"" + user.nick_name + "\",\"roleIds\":[\"5\"]}";
//string url = "https://po.e57.cn/prod-api/api/sys-api/system/user";
//var exportRst = WXHttpResponseBLL.e57PostResponse(url, prodDataStr, "", "Bearer eyJhbGciOiJIUzUxMiJ9.eyJsb2dpbl91c2VyX2tleSI6IjFlODI2ZjNiLTFhMzItNDEwOS04ODlmLTIzYmEwOTUyMDYxYiJ9.L68qzzZZxaQoxrUeB8pBt4TWB7UbTwHkxlmQduzy-VEFkBI4oxtj4VrH-2yJpSD--ZdM-5Wm3VtTvy57nMaFMQ");
//Thread.Sleep(500);
//if (!exportRst.Contains("\"code\":200"))
//{
//}
}
}
private void pnlCancel_Click(object sender, EventArgs e)
{
pnlTopUp.Visible = false;
}
private void btnTopUpOK_Click(object sender, EventArgs e)
{
var userName = lblUserInfo.Text.Split('-')[0].Trim();
var userNick = lblUserInfo.Text.Split('-')[1].Trim();
string url = BaseClass.BuildObjString("user/update_user_points");
string data = UserLogin.GetSignaturex();
data += "&update_user_name=" + userName;
data += "&update_user_nick=" + userNick;
data += "&option_type=转移";
data += "&operator_type=代理商";
data += "&operator_name=" + BaseClass.UserName;
data += "&operator_nick=" + BaseClass.NickName;
data += "&delta_points=" + numAddTopUp.Value;
string html = GetHtml.PostUtf8(url, data.ToString()).Trim();
if (!html.Contains("\"code\":200"))
{
var msg = BaseRegex.GetStringJsonByRegs(ref html, html, "msg");
BaseMsgForm.ShowError(msg);
return;
}
BaseClass.Points = BaseRegex.GetIntJson(ref html, "newOperatorPoints");
MainForm.instance.lblPoints.Text = "账户积分:" + BaseClass.Points;
var operatorRow = this.dgvUser.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["mobileColumn"].Value.ParseToString() == BaseClass.UserName);
if (operatorRow != null)
operatorRow.Cells["colPoints"].Value = BaseClass.Points;
var newUserPoints = BaseRegex.GetIntJson(ref html, "newUserPoints");
var row = this.dgvUser.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["mobileColumn"].Value.ParseToString() == userName);
if (row != null)
{
row.Cells["colPoints"].Value = newUserPoints;
}
pnlTopUp.Visible = false;
BaseMsgForm.ShowInfo("充值成功");
}
private void btnShopPointsPerMonth_Click(object sender, EventArgs e)
{
if (updateShopPointsPerMonth(lblShopPointsPerMonthUserId.Text))
{
pnlShopPointsPerMonth.Visible = false;
BaseMsgForm.ShowInfo("修改充值用户店铺月费金额成功");
}
}
public bool updateShopPointsPerMonth(string userDbId, bool showFailBox = true)
{
string url = BaseClass.BuildObjString("user/update_user");
string data = UserLogin.GetSignaturex();
data += "&id=" + userDbId;
data += "&shop_points_per_month=" + numShopPointsPerMonth.Value;
string html = GetHtml.PostUtf8(url, data.ToString()).Trim();
if (!html.Contains("\"code\":200"))
{
var msg = BaseRegex.GetStringJsonByRegs(ref html, html, "msg");
if (showFailBox)
{
Invoke(new Action(() => { BaseMsgForm.ShowError(msg); }));
}
return false;
}
var row = dgvUser.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["UserIdColumn"].Value.ParseToString() == userDbId);
if (row != null)
{
Invoke(new Action(() => { row.Cells["colShopPointsPerMonth"].Value = numShopPointsPerMonth.Value; }));
}
return true;
}
private void btnShopPointsPerMonthCancel_Click(object sender, EventArgs e)
{
pnlShopPointsPerMonth.Visible = false;
}
private void btnChangeBalanceOK_Click(object sender, EventArgs e)
{
string url = BaseClass.BuildObjString("user/update_user_balance");
string data = UserLogin.GetSignaturex();
data += "&update_user_name=" + lblUserBalanceInfo.Text.Split('-')[0].Trim();
data += "&update_user_nick=" + lblUserBalanceInfo.Text.Split('-')[1].Trim();
data += "&option_type=" + "充值";
data += "&operator_name=" + BaseClass.UserName;
data += "&delta_balance=" + numAddBalance.Value;
string html = GetHtml.PostUtf8(url, data.ToString()).Trim();
if (!html.Contains("\"code\":200"))
{
var msg = BaseRegex.GetStringJsonByRegs(ref html, html, "msg");
BaseMsgForm.ShowError(msg);
return;
}
var row = pnlBalance.Tag as DataGridViewRow;
if (row != null)
{
row.Cells["colBalance"].Value = row.Cells["colBalance"].Value.ParseToDecimal() + numAddBalance.Value;
}
pnlBalance.Visible = false;
BaseMsgForm.ShowInfo("充值成功");
}
private void btnChangeBalanceCancel_Click(object sender, EventArgs e)
{
pnlBalance.Visible = false;
}
private void btnPostagePerOrder_Click(object sender, EventArgs e)
{
if (updatePostagePerOrder(lblPostagePerOrderUserId.Text))
{
pnlPostagePerOrder.Visible = false;
BaseMsgForm.ShowInfo("修改充值用户店铺月费金额成功");
}
}
public bool updatePostagePerOrder(string userDbId, bool showFailBox = true)
{
string url = BaseClass.BuildObjString("user/update_user");
string data = UserLogin.GetSignaturex();
data += "&id=" + userDbId;
data += "&postage_per_order=" + numPostagePerOrder.Value;
string html = GetHtml.PostUtf8(url, data.ToString()).Trim();
if (!html.Contains("\"code\":200"))
{
var msg = BaseRegex.GetStringJsonByRegs(ref html, html, "msg");
if (showFailBox)
{
Invoke(new Action(() => { BaseMsgForm.ShowError(msg); }));
}
return false;
}
var row = dgvUser.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["UserIdColumn"].Value.ParseToString() == userDbId);
if (row != null)
{
Invoke(new Action(() => { row.Cells["colPostagePerOrder"].Value = numPostagePerOrder.Value; }));
}
return true;
}
private void btnPostagePerOrderCancel_Click(object sender, EventArgs e)
{
pnlPostagePerOrder.Visible = false;
}
}
}
@@ -0,0 +1,192 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="colCheck.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="UserIdColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="UserNickNameColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="mobileColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colParentUserName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="groupIdColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="groupNameColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colCompany.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="shopCountColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colSaLevel.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colSaLevelName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colAuthority.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colOemId.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colOemName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colPoints.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colPlus.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colShopPointsPerMonth.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colChangePointsPerMonth.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colBalance.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colBalancePlus.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colPostagePerOrder.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colChangePostagePerOrder.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="editColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="deleteColumn.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>
+25 -17
View File
@@ -30,17 +30,21 @@
{
System.Windows.Forms.TreeNode treeNode1 = new System.Windows.Forms.TreeNode("店铺列表");
System.Windows.Forms.TreeNode treeNode2 = new System.Windows.Forms.TreeNode("子账号管理");
System.Windows.Forms.TreeNode treeNode3 = new System.Windows.Forms.TreeNode("店铺地址管理");
System.Windows.Forms.TreeNode treeNode4 = new System.Windows.Forms.TreeNode("店铺经营统计");
System.Windows.Forms.TreeNode treeNode5 = new System.Windows.Forms.TreeNode("评分考核");
System.Windows.Forms.TreeNode treeNode6 = new System.Windows.Forms.TreeNode("充值二维码");
System.Windows.Forms.TreeNode treeNode7 = new System.Windows.Forms.TreeNode("店铺管理", new System.Windows.Forms.TreeNode[] {
System.Windows.Forms.TreeNode treeNode3 = new System.Windows.Forms.TreeNode("OEM账号管理");
System.Windows.Forms.TreeNode treeNode4 = new System.Windows.Forms.TreeNode("店铺地址管理");
System.Windows.Forms.TreeNode treeNode5 = new System.Windows.Forms.TreeNode("店铺经营统计");
System.Windows.Forms.TreeNode treeNode6 = new System.Windows.Forms.TreeNode("评分考核");
System.Windows.Forms.TreeNode treeNode7 = new System.Windows.Forms.TreeNode("税务申报");
System.Windows.Forms.TreeNode treeNode8 = new System.Windows.Forms.TreeNode("充值二维码");
System.Windows.Forms.TreeNode treeNode9 = new System.Windows.Forms.TreeNode("店铺管理", new System.Windows.Forms.TreeNode[] {
treeNode1,
treeNode2,
treeNode3,
treeNode4,
treeNode5,
treeNode6});
treeNode6,
treeNode7,
treeNode8});
this.panel1 = new System.Windows.Forms.Panel();
this.panel3 = new System.Windows.Forms.Panel();
this.panel2 = new System.Windows.Forms.Panel();
@@ -136,18 +140,22 @@
treeNode1.Text = "店铺列表";
treeNode2.Name = "子账号管理";
treeNode2.Text = "子账号管理";
treeNode3.Name = "店铺地址管理";
treeNode3.Text = "店铺地址管理";
treeNode4.Name = "店铺经营统计";
treeNode4.Text = "店铺经营统计";
treeNode5.Name = "评分考核";
treeNode5.Text = "评分考核";
treeNode6.Name = "充值二维码";
treeNode6.Text = "充值二维码";
treeNode7.Name = "店铺管理";
treeNode7.Text = "店铺管理";
treeNode3.Name = "OEM账号管理";
treeNode3.Text = "OEM账号管理";
treeNode4.Name = "店铺地址管理";
treeNode4.Text = "店铺地址管理";
treeNode5.Name = "店铺经营统计";
treeNode5.Text = "店铺经营统计";
treeNode6.Name = "评分考核";
treeNode6.Text = "评分考核";
treeNode7.Name = "税务申报";
treeNode7.Text = "税务申报";
treeNode8.Name = "充值二维码";
treeNode8.Text = "充值二维码";
treeNode9.Name = "店铺管理";
treeNode9.Text = "店铺管理";
this.tv.Nodes.AddRange(new System.Windows.Forms.TreeNode[] {
treeNode7});
treeNode9});
this.tv.OverForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(235)))), ((int)(((byte)(235)))), ((int)(((byte)(235)))));
this.tv.Size = new System.Drawing.Size(140, 461);
this.tv.TabIndex = 1;
+14 -1
View File
@@ -14,6 +14,7 @@ using TemuKJD.BaseForms;
using TemuKJD.KJDForms.ProductSelectForms;
using TemuKJD.KJDForms.ProductThirdSelectForms;
using TemuKJD.KJDForms.ShopForms.Statistics;
using NaiBa.Util.Extension;
namespace TemuKJD.WXForms.ShopForms
{
@@ -24,9 +25,11 @@ namespace TemuKJD.WXForms.ShopForms
public Lazy<WXShopListForm> shopListForm = new Lazy<WXShopListForm>();
public Lazy<WXSubAccountListForm> sbuAccountForm = new Lazy<WXSubAccountListForm>();
public Lazy<WxShopStatisticsForm> shopStatisticsForm = new Lazy<WxShopStatisticsForm>();
public Lazy<WXTaxManage> taxManageForm = new Lazy<WXTaxManage>();
public Lazy<WXShopOptimizeForm> shopOptimizeForm = new Lazy<WXShopOptimizeForm>();
public Lazy<WXShopDefaultAddressListForm> shopAfterSaleAddressListForm = new Lazy<WXShopDefaultAddressListForm>();
public Lazy<WXGetTopUpQrCode> getTopUpQrCode = new Lazy<WXGetTopUpQrCode>();
public Lazy<WXOemAccountForm> oemAccountForm = new Lazy<WXOemAccountForm>();
public WXShopForm()
@@ -54,7 +57,7 @@ namespace TemuKJD.WXForms.ShopForms
public List<string> getHideTreeNodes()
{
List<string> hideNames = new List<string>() { "充值二维码", "店铺地址管理", "评分考核", "子账号管理", "高级运费模板", "运费模板", "素材库管理", "订单金额统计", "工作明细统计", "店铺经营统计1" };
List<string> hideNames = new List<string>() { "OEM账号管理", "充值二维码", "店铺地址管理", "评分考核", "子账号管理", "高级运费模板", "运费模板", "素材库管理", "订单金额统计", "工作明细统计", "店铺经营统计1" };
if (BaseClass.SaLevel == 1)
{
@@ -74,6 +77,10 @@ namespace TemuKJD.WXForms.ShopForms
{
hideNames.Remove("充值二维码");
}
if (!BaseClass.OemId.IsNullOrEmpty() && BaseClass.IsOemOwner)
{
hideNames.Remove("OEM账号管理");
}
foreach (var forbiddenPage in BaseClass.ForbiddenPage.Split(','))
{
@@ -112,6 +119,9 @@ namespace TemuKJD.WXForms.ShopForms
case "店铺经营统计":
SetForm(shopStatisticsForm.Value);
break;
case "税务申报":
SetForm(taxManageForm.Value);
break;
case "店铺地址管理":
SetForm(shopAfterSaleAddressListForm.Value);
break;
@@ -121,6 +131,9 @@ namespace TemuKJD.WXForms.ShopForms
case "充值二维码":
SetForm(getTopUpQrCode.Value);
break;
case "OEM账号管理":
SetForm(oemAccountForm.Value);
break;
}
}));
}).Start();
File diff suppressed because it is too large. Load diff
+850
View File
@@ -0,0 +1,850 @@
using AllBase;
using AllBase.Helper;
using AllBase.Model.Config;
using AllBase.Model.Param.WXParam;
using AllBase.Model.Result;
using AllBase.Model.Result.PDDResult;
using AllBase.Model.Result.WXResult;
using CefSharp;
using CefSharp.WinForms;
using NaiBa.CefHelper;
using NaiBa.CefHelper.Handler;
using NaiBa.Util;
using NaiBa.Util.Extension;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using TemuKJD.BaseForms;
using TemuKJD.BLL;
using TemuKJD.Extension;
using TemuKJD.Helper;
using TemuKJD.PDDForms.ProductSelectForms;
using TemuKJD.ToolForms;
using TemuKJD.WXForms.ShopForms;
using Work;
using static TemuKJD.WXForms.ShopForms.WXTaxManage;
namespace TemuKJD.WXForms.ShopForms
{
public partial class WXTaxManage : BaseForm
{
public CancellationTokenSource cancellationTokenSource { get; set; } = null;
public bool IsLoadComplate { get; set; } = false;
CheckBox chkSelectAll = null;
ConcurrentList<WxTaxMoneyInfo> lstWxTaxMoneyInfo = new ConcurrentList<WxTaxMoneyInfo>();
public WXTaxManage()
{
InitializeComponent();
}
private void UserSelectDbProductForm_Load(object sender, EventArgs e)
{
this.splitContainer1.Dock = DockStyle.Fill;
chkSelectAll = dgvShop.Columns["colSelect"].AddHeaderCheckBox(HorizontalAlignment.Center, 0, 0, null, null, false);
dgvShop.Columns["colSelect"].HeaderText = "";
chkSelectAll.CheckedChanged += chkSelectAll_CheckedChanged;
this.dgvTaxMoney.AddSelectorColumn("colCheck");
//dgvTaxMoney.AddImgColumn("colLiveObjectImg", "colLiveObjectImgUrl");
//dgvTaxMoney.AddImgColumn("colDgvProdImg", "colDgvProdImgUrl");
dtpTimeBegin.Value = DateTime.Now.Date.AddDays(-7);
dtpTimeEnd.Value = DateTime.Now.Date.AddDays(1).AddSeconds(-1);
IsLoadComplate = true;
}
private void chkSelectAll_CheckedChanged(object sender, EventArgs e)
{
if (!chkSelectAll.Checked)
{
foreach (DataGridViewRow row in dgvShop.Rows)
{
row.Cells["colSelect"].Value = false;
}
}
else
{
//var list = GlobalConfig.ValidShopLoginList.Where(s => s.LoginStatus == "登录成功").Select(ss => ss.ShopId);
foreach (DataGridViewRow row in dgvShop.Rows)
{
//if (list.Any(l => l == row.Cells["colShopId"]?.Value?.ToString()))
if (row.Visible == true)
row.Cells["colSelect"].Value = true;
}
}
}
private void btnRefreshShop_Click(object sender, EventArgs e)
{
pbLoadingShop.Visible = true;
RefreshShopLogin();
}
private void UserSelectDbProductForm_VisibleChanged(object sender, EventArgs e)
{
if (Visible == true)
{
RefreshShopLogin();
}
}
private void RefreshShopLogin()
{
// 店铺Id
var selectIds = dgvShop.Rows.Cast<DataGridViewRow>().Where(row
=> row.Cells["colSelect"]?.Value.ParseToBool() == true).Select(r => r.Cells["colShopId"]?.Value.ToString()).ToList();
// 获取被删除的店铺
List<DataGridViewRow> dgvRowList = dgvShop.Rows.Cast<DataGridViewRow>().Where(row
=> !GlobalConfig.ValidShopLoginList.Any(s => s.ShopId == row.Cells["colShopId"]?.Value?.ToString())).ToList();
// 更新被删除的店铺列表
foreach (var row in dgvRowList)
{
dgvShop.Rows.Remove(row);
}
// 绑定其他店铺(含新导入的店铺)
foreach (ShopLoginInfo shopEntity in GlobalConfig.ValidShopLoginList)
{
if (!string.IsNullOrEmpty(shopEntity.ShopId))
BindShop(shopEntity, selectIds);
}
cmbFilterShopNotes.Items.Clear();
foreach (var note in GlobalConfig.ValidShopLoginList.Select(s => s.Notes).Where(s => !s.IsNullOrEmpty()).Distinct())
{
cmbFilterShopNotes.Items.Add(note);
}
cmbFilterShopGroup.Items.Clear();
foreach (var group in GlobalConfig.ValidShopLoginList.Select(s => s.GroupName).Where(s => !s.IsNullOrEmpty()).Distinct())
{
cmbFilterShopGroup.Items.Add(group);
}
pbLoadingShop.Visible = false;
}
private void BindShop(ShopLoginInfo shopEntity, List<string> selectShopId = null, string msg = "")
{
if (shopEntity == null)
return;
if (shopEntity.is_point_shop_expire)
return;
if (selectShopId == null)
selectShopId = new List<string>();
bool canUse = shopEntity.LoginStatus == "登录成功";
//canUse = true; // 内部库不需要校验登录状态
var row = dgvShop.Rows.Cast<DataGridViewRow>().FirstOrDefault(p => p.Cells.GetCellValueFromColumnName("colShopId").ParseToString() == shopEntity.ShopId);
var day = DateTime.Now.ToString("yyyyMMdd").ParseToInt();
if (row == null)
{
this.dgvShop.Rows.Add(
false, //dgvShop.Rows.Count == 0 ? true : (selectShopId.Contains(shopEntity.ShopId) && canUse),
shopEntity.LoginName,
shopEntity.ShopId,
shopEntity.ShopAccount,
shopEntity.Notes,
shopEntity.GroupName,
"选择商品",
canUse ? "在线" : "掉线",
GlobalConfig.lstWxShopAuthInfo.FirstOrDefault(sa => sa.ShopId == shopEntity.ShopId)?.ExpiresTime > DateTime.Now.AddMinutes(5) ? "可用" : "过期",
canUse,
GlobalConfig.dicWxShopUploadInfo.ContainsKey(shopEntity.ShopId) ? GlobalConfig.dicWxShopUploadInfo[shopEntity.ShopId].DicDayUploadCount[day] : 0,
GlobalConfig.dicWxShopUploadInfo.ContainsKey(shopEntity.ShopId) ? GlobalConfig.dicWxShopUploadInfo[shopEntity.ShopId].OnSaleCount : 0,
shopEntity.AddProductRemaining,
msg
);
}
else
{
row.Cells["colSelect"].Value = selectShopId.Contains(shopEntity.ShopId) && canUse;
row.Cells["colShopLoginName"].Value = shopEntity.LoginName;
row.Cells["colShopName"].Value = shopEntity.ShopAccount;
row.Cells["colShopNotes"].Value = shopEntity.Notes;
row.Cells["colLoginStatus"].Value = canUse ? "在线" : "掉线";
row.Cells["colLoginStatus"].Style.ForeColor = canUse ? Color.Green : Color.Red;
row.Cells["colCanUse"].Value = canUse;
row.Cells["colApi"].Value = GlobalConfig.lstWxShopAuthInfo.FirstOrDefault(sa => sa.ShopId == shopEntity.ShopId)?.ExpiresTime > DateTime.Now.AddMinutes(5) ? "可用" : "过期";
row.Cells["colRemaining"].Value = shopEntity.AddProductRemaining;
row.Cells["colUploadCount"].Value = GlobalConfig.dicWxShopUploadInfo.ContainsKey(shopEntity.ShopId) ? GlobalConfig.dicWxShopUploadInfo[shopEntity.ShopId].DicDayUploadCount[day] : 0;
row.Cells["colOnSaleNum"].Value = GlobalConfig.dicWxShopUploadInfo.ContainsKey(shopEntity.ShopId) ? GlobalConfig.dicWxShopUploadInfo[shopEntity.ShopId].OnSaleCount : 0;
row.Cells["colMessage"].Value = msg;
}
displayAuthStatus(shopEntity);
}
void displayAuthStatus(ShopLoginInfo shop)
{
var rows = this.dgvShop.Rows.Cast<DataGridViewRow>().Where(r => r.Cells["colShopId"].Value.ParseToString() == shop?.ShopId);
foreach (var row in rows)
{
bool canUse = row.Cells["colLoginStatus"].Value.ParseToString() == "在线";
(row.Cells["colLoginStatus"] as DataGridViewLinkCell).Style.ForeColor = canUse ? Color.Blue : Color.Red;
(row.Cells["colLoginStatus"] as DataGridViewLinkCell).LinkColor = canUse ? Color.Blue : Color.Red;
(row.Cells["colLoginStatus"] as DataGridViewLinkCell).ActiveLinkColor = canUse ? Color.LightBlue : Color.OrangeRed;
(row.Cells["colLoginStatus"] as DataGridViewLinkCell).VisitedLinkColor = canUse ? Color.DarkBlue : Color.DarkRed;
canUse = row.Cells["colApi"].Value.ParseToString() == "可用";
(row.Cells["colApi"] as DataGridViewLinkCell).Style.ForeColor = canUse ? Color.Blue : Color.Red;
(row.Cells["colApi"] as DataGridViewLinkCell).LinkColor = canUse ? Color.Blue : Color.Red;
(row.Cells["colApi"] as DataGridViewLinkCell).ActiveLinkColor = canUse ? Color.LightBlue : Color.OrangeRed;
(row.Cells["colApi"] as DataGridViewLinkCell).VisitedLinkColor = canUse ? Color.DarkBlue : Color.DarkRed;
}
}
private void dgvShop_CellClick(object sender, DataGridViewCellEventArgs e)
{
//if (e.ColumnIndex < 0 || e.RowIndex < 0)
// return;
//string headerText = dgvShop.Columns[e.ColumnIndex].HeaderText;
//string columnName = dgvShop.Columns[e.ColumnIndex].Name;
//string shopId = dgvShop.Rows[e.RowIndex].Cells["colShopId"].Value.ParseToString();
//string shopAccount = dgvShop.Rows[e.RowIndex].Cells["colShopName"].Value.ToString();
//var shop = GlobalConfig.ValidShopLoginList.FirstOrDefault(s => s.ShopId == shopId.ToString());
//var row = dgvShop.Rows[e.RowIndex];
//foreach(DataGridViewRow r in dgvShop.Rows)
//{
// if (r == row)
// continue;
// if (r.Cells["colSelect"].Value.ParseToBool() == true)
// r.Cells["colSelect"].Value = false;
//}
//row.Cells["colSelect"].Value = true;
}
private void dgvShop_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex < 0 || e.RowIndex < 0)
return;
string headerText = dgvShop.Columns[e.ColumnIndex].HeaderText;
string columnName = dgvShop.Columns[e.ColumnIndex].Name;
string shopId = dgvShop.Rows[e.RowIndex].Cells["colShopId"].Value.ParseToString();
string shopAccount = dgvShop.Rows[e.RowIndex].Cells["colShopName"].Value.ToString();
var shop = GlobalConfig.ValidShopLoginList.FirstOrDefault(s => s.ShopId == shopId.ToString());
var row = dgvShop.Rows[e.RowIndex];
switch (columnName)
{
case "colSelect":
////if (row.Cells["colCanUse"].Value.ParseToBool())
//{
// row.Cells["colSelect"].Value = !row.Cells["colSelect"].Value.ParseToBool();
// chkSelectAll.CheckedChanged -= chkSelectAll_CheckedChanged;
// if (dgvShop.Rows.Cast<DataGridViewRow>().All(r => r.Cells["colSelect"].Value.ParseToBool()))
// chkSelectAll.Checked = true;
// else
// chkSelectAll.Checked = false;
// chkSelectAll.CheckedChanged += chkSelectAll_CheckedChanged;
//}
////else
////{
//// //BaseMsgForm.ShowInfo("店铺未登录!");
////}
//dicCheckedShopId[row.Cells["colShopId"].Value.ParseToString()] = row.Cells["colSelect"].Value.ParseToBool();
row.Cells["colSelect"].Value = !row.Cells["colSelect"].Value.ParseToBool();
break;
case "colLoginStatus":
{
if (WXShopListForm.Instance == null)
WXShopListForm.Instance = new WXShopListForm();
WXShopListForm.Instance.CheckShopLogin(new string[] { shop.LoginName }, false);
WXShopLoginForm shopLoginForm = new WXShopLoginForm(shop);
//shopLoginForm.prodUserSelectForm = this;
if (shop.LoginStatus != "登录成功")
{
shopLoginForm.openType = EnumOpenType.login;
shopLoginForm.ShowDialog();
RefreshShopLogin();
}
else
{
shopLoginForm.openType = EnumOpenType.manage;
shopLoginForm.WindowState = FormWindowState.Maximized;
shopLoginForm.Show();
}
}
break;
case "colApi":
{
WXShopLoginForm shopLoginForm = new WXShopLoginForm(shop);
shopLoginForm.openType = EnumOpenType.manage;
shopLoginForm.WindowState = FormWindowState.Maximized;
shopLoginForm.InitUrl = "https://store.weixin.qq.com/shop/servicemarket/detail?serviceId=3984039898079707139";
shopLoginForm.Show();
}
break;
}
}
private void btnStop_Click(object sender, EventArgs e)
{
if (this.cancellationTokenSource != null)
this.cancellationTokenSource.Cancel();
}
private void btnSearchOrderLst_Click(object sender, EventArgs e)
{
var selectRows = dgvShop.Rows.Cast<DataGridViewRow>().Where(r => r.Cells["colSelect"].Value.ParseToBool() == true).ToList();
if (selectRows.Count == 0)
{
BaseMsgForm.ShowError("请选择店铺");
return;
}
pictureBox1.Visible = true;
this.btnExport.Enabled = false;
this.btnSearch.Enabled = false;
Task.Run(() => {
Thread.Sleep(5000);
Invoke(new Action(() =>
{
this.btnExport.Enabled = true;
this.btnSearch.Enabled = true;
}));
});
dgvTaxMoney.Rows.Clear();
lstWxTaxMoneyInfo.Clear();
var createTimeBegin = 0;
if (chkTimeBegin.Checked)
createTimeBegin = BaseClass.DateTimeToTimestampSeconds(dtpTimeBegin.Value.Date);
var createTimeEnd = BaseClass.DateTimeToTimestampSeconds(DateTime.Now.Date.AddDays(1).AddSeconds(-1));
if (chkTimeEnd.Checked)
createTimeEnd = BaseClass.DateTimeToTimestampSeconds(dtpTimeEnd.Value.Date.AddDays(1).AddSeconds(-1));
enumOrderSettleState orderSettleState = enumOrderSettleState.全部;
if (cmbOrderSettleState.Text == "无需结算")
orderSettleState = enumOrderSettleState.无需结算;
if (cmbOrderSettleState.Text == "已结算")
orderSettleState = enumOrderSettleState.已结算;
if (cmbOrderSettleState.Text == "待结算")
orderSettleState = enumOrderSettleState.待结算;
if (cmbOrderSettleState.Text == "部分结算")
orderSettleState = enumOrderSettleState.部分结算;
enumSearchOrderState orderState = enumSearchOrderState.全部;
if (cmbOrderState.Text == "已完成")
orderState = enumSearchOrderState.已完成;
if (cmbOrderState.Text == "已取消")
orderState = enumSearchOrderState.已取消;
if (cmbOrderState.Text == "已发货")
orderState = enumSearchOrderState.已发货;
if (cmbOrderState.Text == "待发货")
orderState = enumSearchOrderState.待发货;
enumOrderPayMethod orderPayMethod = enumOrderPayMethod.全部;
if (cmbOrderPayMethod.Text == "微信支付")
orderPayMethod = enumOrderPayMethod.微信支付;
if (cmbOrderPayMethod.Text == "先付后用")
orderPayMethod = enumOrderPayMethod.先付后用;
if (cancellationTokenSource != null)
cancellationTokenSource.Cancel();
cancellationTokenSource = new CancellationTokenSource();
Task.Run(() =>
{
int num = 0;
foreach (var row in selectRows)
{
num++;
Invoke(new Action(() =>
{
this.statusBar.lblTaskStatus.Text = "店铺订单流水查询 第 " + num + " 个店铺,共 " + selectRows.Count + " 个店铺";
row.Cells["colMessage"].Value = "";
}));
if (this.cancellationTokenSource.IsCancellationRequested)
break;
var shopId = row.Cells["colShopId"].Value.ParseToString();
var shop = GlobalConfig.ValidShopLoginList.FirstOrDefault(s => s.ShopId == shopId);
if (shop != null)
{
// 短视频带货
//if (chkFeed.Checked)
{
int page = 0;
int pageSize = 20;
while (true)
{
if (this.cancellationTokenSource.IsCancellationRequested)
break;
page++;
var getTaxMoneyRst = WXTaxBLL.getListOrderFlow(shop, page, orderSettleState.ParseToInt(), orderState.ParseToInt(), orderPayMethod.ParseToInt(), createTimeBegin, createTimeEnd);
Thread.Sleep(Randomx.GetId(300, 600));
if (!getTaxMoneyRst.ParseToString().Contains("\"code\":0"))
{
var error = BaseRegex.GetStringJsonByRegs(ref getTaxMoneyRst, getTaxMoneyRst, "errmsg");
if (error.ParseToString().Contains("biz magic invalid"))
{
shop.LoginStatus = "未登录";
var selectIds = dgvShop.Rows.Cast<DataGridViewRow>().Where(r
=> r.Cells["colSelect"]?.Value.ParseToBool() == true).Select(r => r.Cells["colShopId"]?.Value.ToString()).ToList();
Invoke(new Action(() => { BindShop(shop, selectIds, "店铺掉线"); }));
error = "店铺掉线";
}
Invoke(new Action(() =>
{
row.Cells["colMessage"].Value = "店铺流水查询失败 " + error;
}));
break;
}
var wxTaxMoneyList = JsonHelper.DeserializeJsonToList<WxTaxMoneyInfo>(JsonHelper.JObjectParse(getTaxMoneyRst)["dataList"].ParseToString());
if (wxTaxMoneyList == null)
wxTaxMoneyList = new List<WxTaxMoneyInfo>();
this.lstWxTaxMoneyInfo.AddRange(wxTaxMoneyList);
foreach (var tax in wxTaxMoneyList)
{
Invoke(new Action(() =>
{
//if (prod.spuMonthSales.ParseToInt() >= txtSaleCount.Text.Trim().ParseToInt() &&
// !dgvDaRenProd.Rows.Cast<DataGridViewRow>().Any(r => r.Cells["colTalentSpuId"].Value.ParseToString() == prod.spuId))
{
var rowIndex = dgvTaxMoney.Rows.Add(
true,
shop.ShopId,
shop.ShopAccount,
"登录",
"进店",
tax.orderId, // 订单号
BaseClass.StampToDateTime(tax.orderCreateTime.ParseToInt()).ToString("yyyy年MM月dd日 HH:mm:ss"),
(enumRstOrderState)tax.orderState,
(enumOrderSettleState)tax.orderSettleState,
tax.buyerPaidAmount.IsNullOrZero() ? "-" : "¥" + (tax.buyerPaidAmount * 0.01m).ParseToDecimal().ToString("0.00"),
tax.mchReceivedAmount.IsNullOrZero() ? "-" : "¥" + (tax.mchReceivedAmount * 0.01m).ParseToDecimal().ToString("0.00"),
tax.platformCommissionAmount.IsNullOrZero() ? "-" : "-¥" + (tax.platformCommissionAmount * 0.01m).ParseToDecimal().ToString("0.00"),
tax.buyerRefundAmount.IsNullOrZero() ? "-" : "-¥" + (tax.buyerRefundAmount * 0.01m).ParseToDecimal().ToString("0.00"),
tax.otherExpenseAmount.IsNullOrZero() ? "-" : "-¥" + (tax.otherExpenseAmount * 0.01m).ParseToDecimal().ToString("0.00"),
tax.mchSettleAmount.IsNullOrZero() ? "-" : "¥" + (tax.mchSettleAmount * 0.01m).ParseToDecimal().ToString("0.00"),
shop.ShopAccount
);
dgvTaxMoney.Rows[rowIndex].Height = 60;
}
}));
}
var total = BaseRegex.GetIntJson(ref getTaxMoneyRst, "totalCount").ParseToInt();
var totalPage = Math.Ceiling(total * 1m / pageSize).ParseToInt();
if (page >= totalPage)
break;
}
}
}
}
Invoke(new Action(() =>
{
pictureBox1.Visible = false;
if (cancellationTokenSource.IsCancellationRequested)
{
this.statusBar.lblTaskStatus.Text += " 查询操作中断";
BaseMsgForm.ShowInfo("查询操作中断");
}
else
{
this.statusBar.lblTaskStatus.Text += " 查询操作结束";
BaseMsgForm.ShowInfo("查询操作结束");
}
}));
}, cancellationTokenSource.Token);
}
private void btnClearFilter_Click(object sender, EventArgs e)
{
}
private void btnFilterShop_Click(object sender, EventArgs e)
{
string notes = cmbFilterShopNotes.Text.Trim().Trim(';');
if (notes == "全部")
notes = "";
List<string> notesLst = notes.Split(new string[] { ";", ";", ",", "," }, StringSplitOptions.RemoveEmptyEntries).ToList();
string group = cmbFilterShopGroup.Text.Trim().Trim(';');
if (group == "全部")
group = "";
List<string> groupLst = group.Split(new string[] { ";", ";", ",", "," }, StringSplitOptions.RemoveEmptyEntries).ToList();
foreach (DataGridViewRow row in dgvShop.Rows)
{
if (!row.Cells["colShopName"].Value.ParseToString().Contains(txtFilterShopName.Text.Trim()))
{
row.Visible = false;
row.Cells["colSelect"].Value = false;
continue;
}
if (!string.IsNullOrWhiteSpace(notes) && !notesLst.Contains(row.Cells["colShopNotes"].Value.ParseToString()))
{
row.Visible = false;
row.Cells["colSelect"].Value = false;
continue;
}
if (!string.IsNullOrWhiteSpace(group) && !groupLst.Contains(row.Cells["colGroup"].Value.ParseToString()))
{
row.Visible = false;
row.Cells["colSelect"].Value = false;
continue;
}
row.Visible = true;
}
}
private void btnEmptyShop_Click(object sender, EventArgs e)
{
txtFilterShopName.Text = "";
cmbFilterShopNotes.Text = "全部";
cmbFilterShopGroup.Text = "全部";
btnFilterShop_Click(null, null);
}
private void btnReverse_Click(object sender, EventArgs e)
{
foreach (DataGridViewRow row in dgvShop.Rows)
{
if (row.Visible == true)
row.Cells["colSelect"].Value = !row.Cells["colSelect"].Value.ParseToBool();
}
}
private void btnAddSelect_Click(object sender, EventArgs e)
{
string notes = cmbFilterShopNotes.Text.Trim().Trim(';');
if (notes == "全部")
notes = "";
List<string> notesLst = notes.Split(new string[] { ";", ";", ",", "," }, StringSplitOptions.RemoveEmptyEntries).ToList();
string group = cmbFilterShopGroup.Text.Trim().Trim(';');
if (group == "全部")
group = "";
List<string> groupLst = group.Split(new string[] { ";", ";", ",", "," }, StringSplitOptions.RemoveEmptyEntries).ToList();
foreach (DataGridViewRow row in dgvShop.Rows)
{
if (row.Visible == false)
continue;
if (!row.Cells["colShopName"].Value.ParseToString().Contains(txtFilterShopName.Text.Trim()))
continue;
if (!string.IsNullOrWhiteSpace(notes) && !notesLst.Contains(row.Cells["colShopNotes"].Value.ParseToString()))
continue;
if (!string.IsNullOrWhiteSpace(group) && !groupLst.Contains(row.Cells["colGroup"].Value.ParseToString()))
continue;
row.Cells["colSelect"].Value = true;
}
}
private void btnAddUnSelect_Click(object sender, EventArgs e)
{
string notes = cmbFilterShopNotes.Text.Trim().Trim(';');
if (notes == "全部")
notes = "";
List<string> notesLst = notes.Split(new string[] { ";", ";", ",", "," }, StringSplitOptions.RemoveEmptyEntries).ToList();
string group = cmbFilterShopGroup.Text.Trim().Trim(';');
if (group == "全部")
group = "";
List<string> groupLst = group.Split(new string[] { ";", ";", ",", "," }, StringSplitOptions.RemoveEmptyEntries).ToList();
foreach (DataGridViewRow row in dgvShop.Rows)
{
if (row.Visible == false)
continue;
if (!row.Cells["colShopName"].Value.ParseToString().Contains(txtFilterShopName.Text.Trim()))
continue;
if (!string.IsNullOrWhiteSpace(notes) && !notesLst.Contains(row.Cells["colShopNotes"].Value.ParseToString()))
continue;
if (!string.IsNullOrWhiteSpace(group) && !groupLst.Contains(row.Cells["colGroup"].Value.ParseToString()))
continue;
row.Cells["colSelect"].Value = false;
}
}
private void btnSelectOnline_Click(object sender, EventArgs e)
{
foreach (DataGridViewRow row in dgvShop.Rows)
{
if (row.Visible == true)
{
if (row.Cells["colLoginStatus"].Value.ParseToString() == "在线")
{
row.Cells["colSelect"].Value = true;
}
else
{
row.Cells["colSelect"].Value = false;
}
}
}
}
private void btnSelectOffline_Click(object sender, EventArgs e)
{
foreach (DataGridViewRow row in dgvShop.Rows)
{
if (row.Visible == true)
{
if (row.Cells["colLoginStatus"].Value.ParseToString() != "在线")
{
row.Cells["colSelect"].Value = true;
}
else
{
row.Cells["colSelect"].Value = false;
}
}
}
}
private void btnExportCSV_Click(object sender, EventArgs e)
{
var selectRows = dgvShop.Rows.Cast<DataGridViewRow>().Where(r => r.Cells["colSelect"].Value.ParseToBool() == true).ToList();
if (selectRows.Count == 0)
{
BaseMsgForm.ShowError("请选择店铺");
return;
}
var selectTaxRows = dgvTaxMoney.Rows.Cast<DataGridViewRow>().Where(r => r.Cells["colCheck"].Value.ParseToBool() == true).ToList();
if (selectTaxRows.Count == 0)
{
BaseMsgForm.ShowError("请选择要导出的流水");
return;
}
SaveFileDialog dialog = new SaveFileDialog();
dialog.Title = "保存文件...";
dialog.Filter = "CSV文件 (*.csv)|*.csv|All files (*.*)|*.*";
dialog.RestoreDirectory = true;
dialog.FileName = "用户 " + BaseClass.NickName + DateTime.Now.ToString(" 订单流水yyyyMMddHHmmss") + ".csv";
if (dialog.ShowDialog() != DialogResult.OK)
return;
var path = dialog.FileName;
//FolderBrowserDialog dialog = new FolderBrowserDialog();
//if (dialog.ShowDialog() != DialogResult.OK)
// return;
//var path = dialog.SelectedPath;
//string fileName = path + "\\用户 " + base + DateTime.Now.ToString("订单流水yyyyMMddHHmmss") + ".csv";
pictureBox1.Visible = true;
this.btnExport.Enabled = false;
this.btnSearch.Enabled = false;
Task.Run(() => {
Thread.Sleep(5000);
Invoke(new Action(() =>
{
this.btnExport.Enabled = true;
this.btnSearch.Enabled = true;
}));
});
Task.Run(() =>
{
int num = 0;
foreach (var row in selectRows)
{
num++;
Invoke(new Action(() =>
{
this.statusBar.lblTaskStatus.Text = "正在导出 第 " + num + " 个店铺,共 " + selectRows.Count + " 个店铺";
row.Cells["colMessage"].Value = "";
}));
if (this.cancellationTokenSource.IsCancellationRequested)
break;
var shopId = row.Cells["colShopId"].Value.ParseToString();
var shop = GlobalConfig.ValidShopLoginList.FirstOrDefault(s => s.ShopId == shopId);
if (shop != null)
{
var rows = dgvTaxMoney.Rows.Cast<DataGridViewRow>()
.Where(r => r.Cells["colDgvTaxShopId"].Value.ParseToString() == shop.ShopId && r.Cells["colCheck"].Value.ParseToBool() == true).ToList();
var rst = OutExcel.SaveFile(path, num == 1, true, rows, "", "登录", "进店", "店铺");
}
}
Invoke(new Action(() =>
{
pictureBox1.Visible = false;
if (cancellationTokenSource.IsCancellationRequested)
{
this.statusBar.lblTaskStatus.Text += " 导出操作中断";
BaseMsgForm.ShowInfo("导出操作中断");
}
else
{
this.statusBar.lblTaskStatus.Text += " 导出操作结束";
BaseMsgForm.ShowInfo("导出操作结束");
}
}));
}, cancellationTokenSource.Token);
}
private void dgvDaRenProd_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex < 0 || e.RowIndex < 0)
return;
string headerText = dgvTaxMoney.Columns[e.ColumnIndex].HeaderText;
var shopId = dgvTaxMoney.Rows[e.RowIndex].Cells["colDgvTaxShopId"].Value.ParseToString();
var shop = GlobalConfig.ValidShopLoginList.FirstOrDefault(s => s.ShopId == shopId);
switch (headerText)
{
case "删除":
break;
case "登录":
{
WXShopLoginForm shopLoginForm = new WXShopLoginForm(shop);
shopLoginForm.openType = EnumOpenType.login;
shopLoginForm.ShowDialog();
RefreshShopLogin();
}
break;
case "进店":
{
WXShopLoginForm shopLoginForm = new WXShopLoginForm(shop);
WXShopListForm.Instance.CheckShopLogin(new ShopLoginInfo[] { shop }, false);
if (shop.LoginStatus == "登录成功")
{
shopLoginForm.openType = EnumOpenType.manage;
shopLoginForm.WindowState = FormWindowState.Maximized;
shopLoginForm.InitUrl = "https://store.weixin.qq.com/shop/home";
shopLoginForm.Show();
}
else
{
shopLoginForm.openType = EnumOpenType.login;
shopLoginForm.ShowDialog();
RefreshShopLogin();
}
}
break;
//case "商品图片":
// {
// ShowImgForm imgFrom = new ShowImgForm(dgvTaxMoney.Rows[e.RowIndex].Cells["colDgvProdImgUrl"].Value.ParseToString());
// imgFrom.ShowDialog();
// break;
// }
//case "带货题图":
// {
// ShowImgForm imgFrom = new ShowImgForm(dgvTaxMoney.Rows[e.RowIndex].Cells["colLiveObjectImgUrl"].Value.ParseToString());
// imgFrom.ShowDialog();
// break;
// }
case "":
dgvTaxMoney.Rows[e.RowIndex].Cells["colCheck"].Value = !(bool)dgvTaxMoney.Rows[e.RowIndex].Cells["colCheck"].Value;
break;
default:
break;
}
}
public enum enumOrderSettleState
{
全部 = 0,
待结算 = 1,
无需结算 = 2,
已结算 = 60,
部分结算 = 100,
}
public enum enumSearchOrderState
{
全部 = 0,
待发货 = 20,
已发货 = 30,
已完成 = 100,
已取消 = 250,
}
public enum enumRstOrderState
{
全部 = 0,
礼物待收下 = 12,
待发货 = 20,
已发货 = 30,
已完成 = 100,
已取消 = 200,
}
public enum enumOrderPayMethod
{
全部 = 0,
微信支付 = 1,
先付后用 = 3,
}
}
public class WXTaxBLL
{
/// <summary>
///
/// </summary>
/// <param name="shop"></param>
/// <param name="orderSettleState">结算状态 0全部 1待结算 2无需结算 60已结算 100部分结算</param>
/// <param name="orderState">订单状态 0全部 20待发货 30已发货 100已完成 250已取消</param>
/// <param name="orderPayMethod">支付方式 0全部 1微信支付 3先用后付</param>
/// <param name="createTimeBegin">开始时间</param>
/// <param name="createTimeEnd">结束时间</param>
/// <param name="page"></param>
/// <param name="pageSize"></param>
/// <returns></returns>
public static string getListOrderFlow(ShopLoginInfo shop, int page = 1, int orderSettleState = 60, int orderState = 100, int orderPayMethod = 1,
int createTimeBegin = 0, int createTimeEnd = 0, int pageSize = 20)
{
if (createTimeEnd == 0)
createTimeEnd = BaseClass.DateTimeToTimestampSeconds(DateTime.Now.Date.AddDays(1).AddSeconds(-1));
pageSize = 20;
var offset = Math.Max(page - 1, 0) * pageSize;
string url = "https://store.weixin.qq.com/shop-faas/mmchannelstradefunds/cgi/listOrderFlow?token=&lang=zh_CN";
string body = @"{""orderSettleState"":" + orderSettleState + @",""orderState"":" + orderState + @",""orderPayMethod"":" + orderPayMethod +
@",""createTimeBegin"":""" + createTimeBegin + @""",""createTimeEnd"":""" + createTimeEnd + @""",""paginationInfo"":{""limit"":20,""offset"":" + offset + "}}";
string referer = "https://store.weixin.qq.com/shop/funds/moneyManage?section=3";
var result = WXHttpResponseBLL.WeiXinPostResponse(shop, url, body, referer);
return result;
}
}
public class WXAddFinderParam
{
public string ContactPerson { get; set; }
public string WxNumber { get; set; }
public string Mobile { get; set; }
public string Explain { get; set; }
}
public class WXProdIdWithListingTime
{
public string spuId { get; set; } // "10000538960743"
public string productName { get; set; } // "点教英语 《高中英语听力精听训练》强化版"
public int? listingTime { get; set; } // 1773912220
public int? soldNum { get; set; }
}
}
+207
View File
@@ -0,0 +1,207 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="colSelect.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colShopLoginName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colShopId.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colShopNotes.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colGroup.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colSelectProduct.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colLoginStatus.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colApi.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colCanUse.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colUploadCount.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colOnSaleNum.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colRemaining.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colMessage.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colCheck.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colDgvTaxShopId.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colDgvTaxShopName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colDgvProdLogin.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colDgvProdInShop.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colOrderId.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colCreateTime.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colOrderState.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colOrderSettleState.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colBuyerPaidAmount.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colMchReceivedAmount.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colPlatformCommissionAmount.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colBuyerRefundAmount.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colOtherExpenseAmount.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colMchSettleAmount.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colTaxMoneyShopName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>