获取活动及折扣信息
This commit is contained in:
1 parent
e2fd294b85
commit
f73f56eea4
3 files changed
+447
-323
No files matched your search
+219
-202
@@ -37,13 +37,18 @@ namespace TemuKJD.KJDForms.SalesCenterForms
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||
this.splitContainer3 = new System.Windows.Forms.SplitContainer();
|
||||
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
|
||||
this.splitContainer5 = new System.Windows.Forms.SplitContainer();
|
||||
this.splitContainer4 = new System.Windows.Forms.SplitContainer();
|
||||
this.panelEx1 = new DevComponents.DotNetBar.PanelEx();
|
||||
this.btnClear = new DevComponents.DotNetBar.PanelEx();
|
||||
this.ucGroupBoxEx3 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components);
|
||||
this.ucGroupBoxEx1 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components);
|
||||
this.btnRefreshShop = new DevComponents.DotNetBar.PanelEx();
|
||||
this.ucGroupBoxEx2 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components);
|
||||
this.chkGetDiscount = new TemuKJD.UserComponent.UcCheckBox(this.components);
|
||||
this.btnSearchActivity = new DevComponents.DotNetBar.PanelEx();
|
||||
this.splitContainer3 = new System.Windows.Forms.SplitContainer();
|
||||
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
|
||||
this.dgvShop = new TemuKJD.UserComponent.DataGridViewEx();
|
||||
this.colSelect = new TemuKJD.UserComponent.UcDataGridViewCheckBoxColumn(this.components);
|
||||
this.colShopLoginName = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
@@ -52,8 +57,14 @@ namespace TemuKJD.KJDForms.SalesCenterForms
|
||||
this.colLoginStatus = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.colCanUse = new System.Windows.Forms.DataGridViewCheckBoxColumn();
|
||||
this.colMessage = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.splitContainer5 = new System.Windows.Forms.SplitContainer();
|
||||
this.dgvActivity = new TemuKJD.UserComponent.DataGridViewEx();
|
||||
this.colCheckActivity = new System.Windows.Forms.DataGridViewCheckBoxColumn();
|
||||
this.colActivityId = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.colActivityName = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.colActivityTime = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.colSignUpTime = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.colDiscount = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.colActivityMsg = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.dgvProduct = new TemuKJD.UserComponent.DataGridViewEx();
|
||||
this.colCheckProduct = new System.Windows.Forms.DataGridViewCheckBoxColumn();
|
||||
this.colSupplierId = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
@@ -68,25 +79,13 @@ namespace TemuKJD.KJDForms.SalesCenterForms
|
||||
this.colPrcie = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.colInventory = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.colMsg = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.splitContainer4 = new System.Windows.Forms.SplitContainer();
|
||||
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
|
||||
this.panelEx1 = new DevComponents.DotNetBar.PanelEx();
|
||||
this.btnClear = new DevComponents.DotNetBar.PanelEx();
|
||||
this.chkFullShop = new TemuKJD.UserComponent.UcCheckBox(this.components);
|
||||
this.chkNoSaleProd = new TemuKJD.UserComponent.UcCheckBox(this.components);
|
||||
this.colCheckActivity = new System.Windows.Forms.DataGridViewCheckBoxColumn();
|
||||
this.colActivityId = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.colActivityName = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.colActivityTime = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.colSignUpTime = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.colDiscount = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.dataGridViewTextBoxColumn9 = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||
this.splitContainer1.Panel1.SuspendLayout();
|
||||
this.splitContainer1.Panel2.SuspendLayout();
|
||||
this.splitContainer1.SuspendLayout();
|
||||
this.ucGroupBoxEx1.SuspendLayout();
|
||||
this.ucGroupBoxEx2.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).BeginInit();
|
||||
this.splitContainer3.Panel1.SuspendLayout();
|
||||
this.splitContainer3.Panel2.SuspendLayout();
|
||||
@@ -95,17 +94,19 @@ namespace TemuKJD.KJDForms.SalesCenterForms
|
||||
this.splitContainer2.Panel1.SuspendLayout();
|
||||
this.splitContainer2.Panel2.SuspendLayout();
|
||||
this.splitContainer2.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvShop)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer5)).BeginInit();
|
||||
this.splitContainer5.Panel1.SuspendLayout();
|
||||
this.splitContainer5.Panel2.SuspendLayout();
|
||||
this.splitContainer5.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvActivity)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvProduct)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer4)).BeginInit();
|
||||
this.splitContainer4.Panel1.SuspendLayout();
|
||||
this.splitContainer4.Panel2.SuspendLayout();
|
||||
this.splitContainer4.SuspendLayout();
|
||||
this.ucGroupBoxEx1.SuspendLayout();
|
||||
this.ucGroupBoxEx2.SuspendLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvShop)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvActivity)).BeginInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvProduct)).BeginInit();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// splitContainer1
|
||||
@@ -129,6 +130,131 @@ namespace TemuKJD.KJDForms.SalesCenterForms
|
||||
this.splitContainer1.SplitterDistance = 120;
|
||||
this.splitContainer1.TabIndex = 11;
|
||||
//
|
||||
// splitContainer3
|
||||
//
|
||||
this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitContainer3.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
|
||||
this.splitContainer3.Location = new System.Drawing.Point(0, 0);
|
||||
this.splitContainer3.Name = "splitContainer3";
|
||||
this.splitContainer3.Orientation = System.Windows.Forms.Orientation.Horizontal;
|
||||
//
|
||||
// splitContainer3.Panel1
|
||||
//
|
||||
this.splitContainer3.Panel1.Controls.Add(this.splitContainer2);
|
||||
//
|
||||
// splitContainer3.Panel2
|
||||
//
|
||||
this.splitContainer3.Panel2.Controls.Add(this.splitContainer4);
|
||||
this.splitContainer3.Size = new System.Drawing.Size(978, 420);
|
||||
this.splitContainer3.SplitterDistance = 390;
|
||||
this.splitContainer3.TabIndex = 1;
|
||||
//
|
||||
// splitContainer2
|
||||
//
|
||||
this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitContainer2.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
|
||||
this.splitContainer2.Location = new System.Drawing.Point(0, 0);
|
||||
this.splitContainer2.Name = "splitContainer2";
|
||||
//
|
||||
// splitContainer2.Panel1
|
||||
//
|
||||
this.splitContainer2.Panel1.Controls.Add(this.dgvShop);
|
||||
this.splitContainer2.Panel1.Padding = new System.Windows.Forms.Padding(4, 0, 0, 0);
|
||||
//
|
||||
// splitContainer2.Panel2
|
||||
//
|
||||
this.splitContainer2.Panel2.Controls.Add(this.splitContainer5);
|
||||
this.splitContainer2.Panel2.Padding = new System.Windows.Forms.Padding(0, 0, 4, 0);
|
||||
this.splitContainer2.Size = new System.Drawing.Size(978, 390);
|
||||
this.splitContainer2.SplitterDistance = 270;
|
||||
this.splitContainer2.TabIndex = 0;
|
||||
//
|
||||
// splitContainer5
|
||||
//
|
||||
this.splitContainer5.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitContainer5.Location = new System.Drawing.Point(0, 0);
|
||||
this.splitContainer5.Name = "splitContainer5";
|
||||
this.splitContainer5.Orientation = System.Windows.Forms.Orientation.Horizontal;
|
||||
//
|
||||
// splitContainer5.Panel1
|
||||
//
|
||||
this.splitContainer5.Panel1.Controls.Add(this.dgvActivity);
|
||||
//
|
||||
// splitContainer5.Panel2
|
||||
//
|
||||
this.splitContainer5.Panel2.Controls.Add(this.dgvProduct);
|
||||
this.splitContainer5.Size = new System.Drawing.Size(700, 390);
|
||||
this.splitContainer5.SplitterDistance = 134;
|
||||
this.splitContainer5.TabIndex = 0;
|
||||
//
|
||||
// splitContainer4
|
||||
//
|
||||
this.splitContainer4.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitContainer4.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
|
||||
this.splitContainer4.Location = new System.Drawing.Point(0, 0);
|
||||
this.splitContainer4.Name = "splitContainer4";
|
||||
//
|
||||
// splitContainer4.Panel1
|
||||
//
|
||||
this.splitContainer4.Panel1.Controls.Add(this.statusBar);
|
||||
//
|
||||
// splitContainer4.Panel2
|
||||
//
|
||||
this.splitContainer4.Panel2.Controls.Add(this.panelEx1);
|
||||
this.splitContainer4.Panel2.Controls.Add(this.btnClear);
|
||||
this.splitContainer4.Size = new System.Drawing.Size(978, 26);
|
||||
this.splitContainer4.SplitterDistance = 700;
|
||||
this.splitContainer4.TabIndex = 3;
|
||||
//
|
||||
// panelEx1
|
||||
//
|
||||
this.panelEx1.CanvasColor = System.Drawing.SystemColors.Control;
|
||||
this.panelEx1.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
|
||||
this.panelEx1.DisabledBackColor = System.Drawing.Color.Empty;
|
||||
this.panelEx1.Location = new System.Drawing.Point(155, 0);
|
||||
this.panelEx1.Name = "panelEx1";
|
||||
this.panelEx1.Size = new System.Drawing.Size(115, 21);
|
||||
this.panelEx1.Style.Alignment = System.Drawing.StringAlignment.Center;
|
||||
this.panelEx1.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
|
||||
this.panelEx1.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
|
||||
this.panelEx1.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
|
||||
this.panelEx1.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
|
||||
this.panelEx1.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
|
||||
this.panelEx1.Style.GradientAngle = 90;
|
||||
this.panelEx1.StyleMouseDown.Alignment = System.Drawing.StringAlignment.Center;
|
||||
this.panelEx1.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
|
||||
this.panelEx1.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
|
||||
this.panelEx1.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
|
||||
this.panelEx1.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White;
|
||||
this.panelEx1.TabIndex = 668;
|
||||
this.panelEx1.Text = "停止当前操作";
|
||||
//
|
||||
// btnClear
|
||||
//
|
||||
this.btnClear.Anchor = System.Windows.Forms.AnchorStyles.Right;
|
||||
this.btnClear.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
|
||||
this.btnClear.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
this.btnClear.DisabledBackColor = System.Drawing.Color.Empty;
|
||||
this.btnClear.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnClear.Location = new System.Drawing.Point(47, 0);
|
||||
this.btnClear.Name = "btnClear";
|
||||
this.btnClear.Size = new System.Drawing.Size(90, 21);
|
||||
this.btnClear.Style.Alignment = System.Drawing.StringAlignment.Center;
|
||||
this.btnClear.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
|
||||
this.btnClear.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
|
||||
this.btnClear.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
|
||||
this.btnClear.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
|
||||
this.btnClear.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
|
||||
this.btnClear.Style.ForeColor.Color = System.Drawing.Color.White;
|
||||
this.btnClear.Style.GradientAngle = 90;
|
||||
this.btnClear.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
|
||||
this.btnClear.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
|
||||
this.btnClear.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
|
||||
this.btnClear.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White;
|
||||
this.btnClear.TabIndex = 440;
|
||||
this.btnClear.Text = "清空结果";
|
||||
this.btnClear.Visible = false;
|
||||
//
|
||||
// ucGroupBoxEx3
|
||||
//
|
||||
this.ucGroupBoxEx3.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
@@ -188,13 +314,26 @@ namespace TemuKJD.KJDForms.SalesCenterForms
|
||||
| System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.ucGroupBoxEx2.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
|
||||
this.ucGroupBoxEx2.BorderStyle = TemuKJD.UserComponent.UcGroupBoxEx.GroupBoxBorderStyle.ROUND;
|
||||
this.ucGroupBoxEx2.Controls.Add(this.chkGetDiscount);
|
||||
this.ucGroupBoxEx2.Controls.Add(this.btnSearchActivity);
|
||||
this.ucGroupBoxEx2.Location = new System.Drawing.Point(147, 2);
|
||||
this.ucGroupBoxEx2.Name = "ucGroupBoxEx2";
|
||||
this.ucGroupBoxEx2.Size = new System.Drawing.Size(125, 120);
|
||||
this.ucGroupBoxEx2.TabIndex = 469;
|
||||
this.ucGroupBoxEx2.TabStop = false;
|
||||
this.ucGroupBoxEx2.Text = "读取活动";
|
||||
this.ucGroupBoxEx2.Text = "查询活动";
|
||||
//
|
||||
// chkGetDiscount
|
||||
//
|
||||
this.chkGetDiscount.AutoSize = true;
|
||||
this.chkGetDiscount.Checked = true;
|
||||
this.chkGetDiscount.CheckState = System.Windows.Forms.CheckState.Checked;
|
||||
this.chkGetDiscount.Location = new System.Drawing.Point(15, 68);
|
||||
this.chkGetDiscount.Name = "chkGetDiscount";
|
||||
this.chkGetDiscount.Size = new System.Drawing.Size(96, 28);
|
||||
this.chkGetDiscount.TabIndex = 0;
|
||||
this.chkGetDiscount.Text = "同时查询折扣\r\n (较耗时)";
|
||||
this.chkGetDiscount.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// btnSearchActivity
|
||||
//
|
||||
@@ -217,48 +356,9 @@ namespace TemuKJD.KJDForms.SalesCenterForms
|
||||
this.btnSearchActivity.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
|
||||
this.btnSearchActivity.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
|
||||
this.btnSearchActivity.TabIndex = 427;
|
||||
this.btnSearchActivity.Text = "读取活动";
|
||||
this.btnSearchActivity.Text = "查询活动";
|
||||
this.btnSearchActivity.Click += new System.EventHandler(this.btnSearchActivity_Click);
|
||||
//
|
||||
// splitContainer3
|
||||
//
|
||||
this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitContainer3.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
|
||||
this.splitContainer3.Location = new System.Drawing.Point(0, 0);
|
||||
this.splitContainer3.Name = "splitContainer3";
|
||||
this.splitContainer3.Orientation = System.Windows.Forms.Orientation.Horizontal;
|
||||
//
|
||||
// splitContainer3.Panel1
|
||||
//
|
||||
this.splitContainer3.Panel1.Controls.Add(this.splitContainer2);
|
||||
//
|
||||
// splitContainer3.Panel2
|
||||
//
|
||||
this.splitContainer3.Panel2.Controls.Add(this.splitContainer4);
|
||||
this.splitContainer3.Size = new System.Drawing.Size(978, 420);
|
||||
this.splitContainer3.SplitterDistance = 390;
|
||||
this.splitContainer3.TabIndex = 1;
|
||||
//
|
||||
// splitContainer2
|
||||
//
|
||||
this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitContainer2.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
|
||||
this.splitContainer2.Location = new System.Drawing.Point(0, 0);
|
||||
this.splitContainer2.Name = "splitContainer2";
|
||||
//
|
||||
// splitContainer2.Panel1
|
||||
//
|
||||
this.splitContainer2.Panel1.Controls.Add(this.dgvShop);
|
||||
this.splitContainer2.Panel1.Padding = new System.Windows.Forms.Padding(4, 0, 0, 0);
|
||||
//
|
||||
// splitContainer2.Panel2
|
||||
//
|
||||
this.splitContainer2.Panel2.Controls.Add(this.splitContainer5);
|
||||
this.splitContainer2.Panel2.Padding = new System.Windows.Forms.Padding(0, 0, 4, 0);
|
||||
this.splitContainer2.Size = new System.Drawing.Size(978, 390);
|
||||
this.splitContainer2.SplitterDistance = 270;
|
||||
this.splitContainer2.TabIndex = 0;
|
||||
//
|
||||
// dgvShop
|
||||
//
|
||||
this.dgvShop.AllowUserToAddRows = false;
|
||||
@@ -351,24 +451,6 @@ namespace TemuKJD.KJDForms.SalesCenterForms
|
||||
this.colMessage.ReadOnly = true;
|
||||
this.colMessage.Width = 120;
|
||||
//
|
||||
// splitContainer5
|
||||
//
|
||||
this.splitContainer5.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitContainer5.Location = new System.Drawing.Point(0, 0);
|
||||
this.splitContainer5.Name = "splitContainer5";
|
||||
this.splitContainer5.Orientation = System.Windows.Forms.Orientation.Horizontal;
|
||||
//
|
||||
// splitContainer5.Panel1
|
||||
//
|
||||
this.splitContainer5.Panel1.Controls.Add(this.dgvActivity);
|
||||
//
|
||||
// splitContainer5.Panel2
|
||||
//
|
||||
this.splitContainer5.Panel2.Controls.Add(this.dgvProduct);
|
||||
this.splitContainer5.Size = new System.Drawing.Size(700, 390);
|
||||
this.splitContainer5.SplitterDistance = 134;
|
||||
this.splitContainer5.TabIndex = 0;
|
||||
//
|
||||
// dgvActivity
|
||||
//
|
||||
this.dgvActivity.AllowUserToAddRows = false;
|
||||
@@ -393,7 +475,7 @@ namespace TemuKJD.KJDForms.SalesCenterForms
|
||||
this.colActivityTime,
|
||||
this.colSignUpTime,
|
||||
this.colDiscount,
|
||||
this.dataGridViewTextBoxColumn9});
|
||||
this.colActivityMsg});
|
||||
this.dgvActivity.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.dgvActivity.Location = new System.Drawing.Point(0, 0);
|
||||
this.dgvActivity.Name = "dgvActivity";
|
||||
@@ -401,6 +483,57 @@ namespace TemuKJD.KJDForms.SalesCenterForms
|
||||
this.dgvActivity.RowTemplate.Height = 23;
|
||||
this.dgvActivity.Size = new System.Drawing.Size(700, 134);
|
||||
this.dgvActivity.TabIndex = 189;
|
||||
this.dgvActivity.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvActivity_CellContentClick);
|
||||
//
|
||||
// colCheckActivity
|
||||
//
|
||||
this.colCheckActivity.HeaderText = "选择";
|
||||
this.colCheckActivity.Name = "colCheckActivity";
|
||||
this.colCheckActivity.ReadOnly = true;
|
||||
this.colCheckActivity.Resizable = System.Windows.Forms.DataGridViewTriState.True;
|
||||
this.colCheckActivity.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
|
||||
this.colCheckActivity.Width = 30;
|
||||
//
|
||||
// colActivityId
|
||||
//
|
||||
this.colActivityId.HeaderText = "活动编号";
|
||||
this.colActivityId.Name = "colActivityId";
|
||||
this.colActivityId.ReadOnly = true;
|
||||
this.colActivityId.Visible = false;
|
||||
//
|
||||
// colActivityName
|
||||
//
|
||||
this.colActivityName.HeaderText = "活动主题";
|
||||
this.colActivityName.Name = "colActivityName";
|
||||
this.colActivityName.ReadOnly = true;
|
||||
this.colActivityName.Width = 280;
|
||||
//
|
||||
// colActivityTime
|
||||
//
|
||||
this.colActivityTime.HeaderText = "活动时间";
|
||||
this.colActivityTime.Name = "colActivityTime";
|
||||
this.colActivityTime.ReadOnly = true;
|
||||
this.colActivityTime.Width = 320;
|
||||
//
|
||||
// colSignUpTime
|
||||
//
|
||||
this.colSignUpTime.HeaderText = "报名截止";
|
||||
this.colSignUpTime.Name = "colSignUpTime";
|
||||
this.colSignUpTime.ReadOnly = true;
|
||||
this.colSignUpTime.Width = 110;
|
||||
//
|
||||
// colDiscount
|
||||
//
|
||||
this.colDiscount.HeaderText = "活动折扣";
|
||||
this.colDiscount.Name = "colDiscount";
|
||||
this.colDiscount.ReadOnly = true;
|
||||
//
|
||||
// colActivityMsg
|
||||
//
|
||||
this.colActivityMsg.HeaderText = "状态";
|
||||
this.colActivityMsg.Name = "colActivityMsg";
|
||||
this.colActivityMsg.ReadOnly = true;
|
||||
this.colActivityMsg.Width = 400;
|
||||
//
|
||||
// dgvProduct
|
||||
//
|
||||
@@ -538,25 +671,6 @@ namespace TemuKJD.KJDForms.SalesCenterForms
|
||||
this.colMsg.ReadOnly = true;
|
||||
this.colMsg.Width = 400;
|
||||
//
|
||||
// splitContainer4
|
||||
//
|
||||
this.splitContainer4.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitContainer4.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
|
||||
this.splitContainer4.Location = new System.Drawing.Point(0, 0);
|
||||
this.splitContainer4.Name = "splitContainer4";
|
||||
//
|
||||
// splitContainer4.Panel1
|
||||
//
|
||||
this.splitContainer4.Panel1.Controls.Add(this.statusBar);
|
||||
//
|
||||
// splitContainer4.Panel2
|
||||
//
|
||||
this.splitContainer4.Panel2.Controls.Add(this.panelEx1);
|
||||
this.splitContainer4.Panel2.Controls.Add(this.btnClear);
|
||||
this.splitContainer4.Size = new System.Drawing.Size(978, 26);
|
||||
this.splitContainer4.SplitterDistance = 700;
|
||||
this.splitContainer4.TabIndex = 3;
|
||||
//
|
||||
// statusBar
|
||||
//
|
||||
this.statusBar.BackColor = System.Drawing.Color.White;
|
||||
@@ -568,55 +682,6 @@ namespace TemuKJD.KJDForms.SalesCenterForms
|
||||
this.statusBar.Size = new System.Drawing.Size(700, 26);
|
||||
this.statusBar.TabIndex = 2;
|
||||
//
|
||||
// panelEx1
|
||||
//
|
||||
this.panelEx1.CanvasColor = System.Drawing.SystemColors.Control;
|
||||
this.panelEx1.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
|
||||
this.panelEx1.DisabledBackColor = System.Drawing.Color.Empty;
|
||||
this.panelEx1.Location = new System.Drawing.Point(155, 0);
|
||||
this.panelEx1.Name = "panelEx1";
|
||||
this.panelEx1.Size = new System.Drawing.Size(115, 21);
|
||||
this.panelEx1.Style.Alignment = System.Drawing.StringAlignment.Center;
|
||||
this.panelEx1.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
|
||||
this.panelEx1.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
|
||||
this.panelEx1.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
|
||||
this.panelEx1.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
|
||||
this.panelEx1.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
|
||||
this.panelEx1.Style.GradientAngle = 90;
|
||||
this.panelEx1.StyleMouseDown.Alignment = System.Drawing.StringAlignment.Center;
|
||||
this.panelEx1.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
|
||||
this.panelEx1.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
|
||||
this.panelEx1.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
|
||||
this.panelEx1.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White;
|
||||
this.panelEx1.TabIndex = 668;
|
||||
this.panelEx1.Text = "停止当前操作";
|
||||
//
|
||||
// btnClear
|
||||
//
|
||||
this.btnClear.Anchor = System.Windows.Forms.AnchorStyles.Right;
|
||||
this.btnClear.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
|
||||
this.btnClear.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
this.btnClear.DisabledBackColor = System.Drawing.Color.Empty;
|
||||
this.btnClear.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.btnClear.Location = new System.Drawing.Point(47, 0);
|
||||
this.btnClear.Name = "btnClear";
|
||||
this.btnClear.Size = new System.Drawing.Size(90, 21);
|
||||
this.btnClear.Style.Alignment = System.Drawing.StringAlignment.Center;
|
||||
this.btnClear.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
|
||||
this.btnClear.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
|
||||
this.btnClear.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
|
||||
this.btnClear.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
|
||||
this.btnClear.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
|
||||
this.btnClear.Style.ForeColor.Color = System.Drawing.Color.White;
|
||||
this.btnClear.Style.GradientAngle = 90;
|
||||
this.btnClear.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
|
||||
this.btnClear.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
|
||||
this.btnClear.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
|
||||
this.btnClear.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White;
|
||||
this.btnClear.TabIndex = 440;
|
||||
this.btnClear.Text = "清空结果";
|
||||
this.btnClear.Visible = false;
|
||||
//
|
||||
// chkFullShop
|
||||
//
|
||||
this.chkFullShop.AutoSize = true;
|
||||
@@ -639,56 +704,6 @@ namespace TemuKJD.KJDForms.SalesCenterForms
|
||||
this.chkNoSaleProd.UseVisualStyleBackColor = true;
|
||||
this.chkNoSaleProd.CheckedChanged += new System.EventHandler(this.chkNoSaleProd_CheckedChanged);
|
||||
//
|
||||
// colCheckActivity
|
||||
//
|
||||
this.colCheckActivity.HeaderText = "选择";
|
||||
this.colCheckActivity.Name = "colCheckActivity";
|
||||
this.colCheckActivity.ReadOnly = true;
|
||||
this.colCheckActivity.Resizable = System.Windows.Forms.DataGridViewTriState.True;
|
||||
this.colCheckActivity.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
|
||||
this.colCheckActivity.Width = 30;
|
||||
//
|
||||
// colActivityId
|
||||
//
|
||||
this.colActivityId.HeaderText = "活动编号";
|
||||
this.colActivityId.Name = "colActivityId";
|
||||
this.colActivityId.ReadOnly = true;
|
||||
this.colActivityId.Visible = false;
|
||||
//
|
||||
// colActivityName
|
||||
//
|
||||
this.colActivityName.HeaderText = "活动主题";
|
||||
this.colActivityName.Name = "colActivityName";
|
||||
this.colActivityName.ReadOnly = true;
|
||||
this.colActivityName.Width = 280;
|
||||
//
|
||||
// colActivityTime
|
||||
//
|
||||
this.colActivityTime.HeaderText = "活动时间";
|
||||
this.colActivityTime.Name = "colActivityTime";
|
||||
this.colActivityTime.ReadOnly = true;
|
||||
this.colActivityTime.Width = 320;
|
||||
//
|
||||
// colSignUpTime
|
||||
//
|
||||
this.colSignUpTime.HeaderText = "报名截止";
|
||||
this.colSignUpTime.Name = "colSignUpTime";
|
||||
this.colSignUpTime.ReadOnly = true;
|
||||
this.colSignUpTime.Width = 110;
|
||||
//
|
||||
// colDiscount
|
||||
//
|
||||
this.colDiscount.HeaderText = "活动折扣";
|
||||
this.colDiscount.Name = "colDiscount";
|
||||
this.colDiscount.ReadOnly = true;
|
||||
//
|
||||
// dataGridViewTextBoxColumn9
|
||||
//
|
||||
this.dataGridViewTextBoxColumn9.HeaderText = "状态";
|
||||
this.dataGridViewTextBoxColumn9.Name = "dataGridViewTextBoxColumn9";
|
||||
this.dataGridViewTextBoxColumn9.ReadOnly = true;
|
||||
this.dataGridViewTextBoxColumn9.Width = 400;
|
||||
//
|
||||
// MarketingActivityForm
|
||||
//
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
|
||||
@@ -703,8 +718,6 @@ namespace TemuKJD.KJDForms.SalesCenterForms
|
||||
this.splitContainer1.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
|
||||
this.splitContainer1.ResumeLayout(false);
|
||||
this.ucGroupBoxEx1.ResumeLayout(false);
|
||||
this.ucGroupBoxEx2.ResumeLayout(false);
|
||||
this.splitContainer3.Panel1.ResumeLayout(false);
|
||||
this.splitContainer3.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).EndInit();
|
||||
@@ -713,17 +726,20 @@ namespace TemuKJD.KJDForms.SalesCenterForms
|
||||
this.splitContainer2.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
|
||||
this.splitContainer2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvShop)).EndInit();
|
||||
this.splitContainer5.Panel1.ResumeLayout(false);
|
||||
this.splitContainer5.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer5)).EndInit();
|
||||
this.splitContainer5.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvActivity)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvProduct)).EndInit();
|
||||
this.splitContainer4.Panel1.ResumeLayout(false);
|
||||
this.splitContainer4.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer4)).EndInit();
|
||||
this.splitContainer4.ResumeLayout(false);
|
||||
this.ucGroupBoxEx1.ResumeLayout(false);
|
||||
this.ucGroupBoxEx2.ResumeLayout(false);
|
||||
this.ucGroupBoxEx2.PerformLayout();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvShop)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvActivity)).EndInit();
|
||||
((System.ComponentModel.ISupportInitialize)(this.dgvProduct)).EndInit();
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
@@ -774,6 +790,7 @@ namespace TemuKJD.KJDForms.SalesCenterForms
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn colActivityTime;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn colSignUpTime;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn colDiscount;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn9;
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn colActivityMsg;
|
||||
private UserComponent.UcCheckBox chkGetDiscount;
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,7 @@ namespace TemuKJD.KJDForms.SalesCenterForms
|
||||
private CheckBox chkSelectAll = null;
|
||||
public CancellationTokenSource cancellationTokenSource { get; set; } = null;
|
||||
public List<TemuActivityThematicInfo> lstActivityThematic { get; set; } = new List<TemuActivityThematicInfo>();
|
||||
public List<string> lstShopIdSelect = new List<string>();
|
||||
|
||||
public MarketingActivityForm()
|
||||
{
|
||||
@@ -174,6 +175,29 @@ namespace TemuKJD.KJDForms.SalesCenterForms
|
||||
}
|
||||
}
|
||||
|
||||
private void dgvActivity_CellContentClick(object sender, DataGridViewCellEventArgs e)
|
||||
{
|
||||
if (e.ColumnIndex < 0 || e.RowIndex < 0)
|
||||
return;
|
||||
string headerText = dgvActivity.Columns[e.ColumnIndex].HeaderText;
|
||||
string columnName = dgvActivity.Columns[e.ColumnIndex].Name;
|
||||
long activityId = dgvActivity.Rows[e.RowIndex].Cells["colActivityId"].Value.ParseToLong();
|
||||
var activity = lstActivityThematic.FirstOrDefault(s => s.activityThematicId == activityId);
|
||||
var row = dgvActivity.Rows[e.RowIndex];
|
||||
switch (columnName)
|
||||
{
|
||||
case "colCheckActivity":
|
||||
row.Cells["colCheckActivity"].Value = !row.Cells["colCheckActivity"].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;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void chkFullShop_CheckedChanged(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
@@ -208,11 +232,11 @@ namespace TemuKJD.KJDForms.SalesCenterForms
|
||||
|
||||
Task.Run(() =>
|
||||
{
|
||||
var lstShopIdTemp = new List<string>();
|
||||
lstShopIdTemp.AddRange(lstShopId);
|
||||
lstShopIdSelect.Clear();
|
||||
lstShopIdSelect.AddRange(lstShopId);
|
||||
int i = 0;
|
||||
|
||||
foreach (var shopId in lstShopIdTemp)
|
||||
foreach (var shopId in lstShopIdSelect)
|
||||
{
|
||||
if (lstActivityThematic.Count > 0)
|
||||
break;
|
||||
@@ -220,7 +244,7 @@ namespace TemuKJD.KJDForms.SalesCenterForms
|
||||
this.Invoke(new Action(() =>
|
||||
{
|
||||
this.statusBar.lblTaskStatus.Text = "正在查询活动...";
|
||||
this.statusBar.pgbTaskProgress.Maximum = lstShopIdTemp.Count;
|
||||
this.statusBar.pgbTaskProgress.Maximum = lstShopIdSelect.Count;
|
||||
this.statusBar.UpdateProgressBar(i + 1);
|
||||
i++;
|
||||
}));
|
||||
@@ -364,133 +388,29 @@ namespace TemuKJD.KJDForms.SalesCenterForms
|
||||
}));
|
||||
}
|
||||
|
||||
foreach (var shopId in lstShopIdTemp)
|
||||
foreach (var actInfo in lstActivityThematic)
|
||||
{
|
||||
if (cancellationTokenSource.IsCancellationRequested)
|
||||
break;
|
||||
|
||||
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == shopId);
|
||||
if (shop == null)
|
||||
continue;
|
||||
shop.LastRefreshDate = "";
|
||||
}
|
||||
|
||||
i = 0;
|
||||
// 查询所有活动是否有店铺可以报名,可报名的才显示
|
||||
foreach (var pInfo in lstActivityThematic)
|
||||
{
|
||||
this.Invoke(new Action(() =>
|
||||
{
|
||||
this.statusBar.lblTaskStatus.Text = "正在查询活动" + (i + 1) + "...";
|
||||
this.statusBar.pgbTaskProgress.Maximum = lstActivityThematic.Count;
|
||||
this.statusBar.UpdateProgressBar(i + 1);
|
||||
i++;
|
||||
}));
|
||||
foreach (var shopId in lstShopIdTemp)
|
||||
{
|
||||
if (cancellationTokenSource.IsCancellationRequested)
|
||||
break;
|
||||
|
||||
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == shopId);
|
||||
if (shop == null)
|
||||
continue;
|
||||
|
||||
#region 检测登录
|
||||
if (shop.LoginStatus2 != "国际版在线")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (ShopListForm.Instance == null)
|
||||
ShopListForm.Instance = new ShopListForm();
|
||||
if (shop.LastRefreshDate == "")
|
||||
ShopListForm.Instance.CheckShopLogin(new string[] { shop.LoginName }, false);
|
||||
if (shop.LoginStatus2 != "国际版在线")
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
var rows = this.dgvShop.Rows.Cast<DataGridViewRow>().Where(r => r.Cells["colShopLoginName"].Value.ToString() == shop.LoginName);
|
||||
foreach (var row in rows)
|
||||
{
|
||||
row.Cells["colMessage"].Value = "店铺掉线";
|
||||
row.Cells["colLoginStatus"].Value = "国际版未登录";
|
||||
row.Cells["colCanUse"].Value = false;
|
||||
}
|
||||
}));
|
||||
continue;
|
||||
}
|
||||
#endregion
|
||||
|
||||
int tryCount = 0;
|
||||
tryAgain:
|
||||
Thread.Sleep(100 + Randomx.GetId(200));
|
||||
string jsonStr = GetActivityMatch(shop, pInfo.activityThematicId.ParseToLong());
|
||||
if (jsonStr.Contains("指定的值含有无效的控制字符"))
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
var rows = this.dgvShop.Rows.Cast<DataGridViewRow>().Where(r => r.Cells["colShopLoginName"].Value.ToString() == shop.LoginName);
|
||||
foreach (var row in rows)
|
||||
{
|
||||
row.Cells["colMessage"].Value = "店铺掉线";
|
||||
row.Cells["colLoginStatus"].Value = "国际版未登录";
|
||||
row.Cells["colCanUse"].Value = false;
|
||||
}
|
||||
}));
|
||||
continue;
|
||||
}
|
||||
if (jsonStr.Contains("当前操作人数太多,请稍后重试") && tryCount < 5)
|
||||
{
|
||||
tryCount++;
|
||||
goto tryAgain;
|
||||
}
|
||||
if (jsonStr.Contains("当前操作人数太多,请稍后重试"))
|
||||
{
|
||||
}
|
||||
if (!jsonStr.Contains("\"success\":true"))
|
||||
{
|
||||
//isError = true;
|
||||
//string sErr = BaseRegex.GetStringJson(ref jsonStr, "errorMsg");
|
||||
//if (!string.IsNullOrWhiteSpace(sErr) && !errMsg.Contains(sErr))
|
||||
// errMsg += sErr + " ";
|
||||
//page++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (jsonStr.Contains("\"success\":true"))
|
||||
{
|
||||
//var jArr = new JArray();
|
||||
//try
|
||||
//{
|
||||
// var jObj = JObject.Parse(jsonStr);
|
||||
// jArr = jObj["result"]?["activityList"] as JArray;
|
||||
// if (jArr == null)
|
||||
// jArr = new JArray();
|
||||
//}
|
||||
//catch (Exception ex) { BaseMsgForm.ShowError(ex.Message); }
|
||||
//foreach (var item in jArr)
|
||||
//{
|
||||
//}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
int rowId = this.dgvActivity.Rows.Add(
|
||||
false,
|
||||
pInfo.activityThematicId,
|
||||
pInfo.activityThematicName,
|
||||
BaseClass.StampToDateTime((int)(pInfo.startTime.ParseToLong() / 1000)).ToString("yyyy/MM/dd HH:mm:ss") + "~" +
|
||||
BaseClass.StampToDateTime((int)(pInfo.endTime.ParseToLong() / 1000)).ToString("yyyy/MM/dd HH:mm:ss") + "(" +
|
||||
pInfo.durationDays + "天)",
|
||||
(BaseClass.StampToDateTime((int)(pInfo.enrollDeadLine.ParseToLong() / 1000)) - DateTime.Now).Days + "天后截止",
|
||||
pInfo.discount
|
||||
actInfo.activityThematicId,
|
||||
actInfo.activityThematicName,
|
||||
BaseClass.StampToDateTime((int)(actInfo.startTime.ParseToLong() / 1000)).ToString("yyyy/MM/dd HH:mm:ss") + "~" +
|
||||
BaseClass.StampToDateTime((int)(actInfo.endTime.ParseToLong() / 1000)).ToString("yyyy/MM/dd HH:mm:ss") + "(" +
|
||||
actInfo.durationDays + "天)",
|
||||
(BaseClass.StampToDateTime((int)(actInfo.enrollDeadLine.ParseToLong() / 1000)) - DateTime.Now).Days + "天后截止",
|
||||
actInfo.discount
|
||||
);
|
||||
|
||||
dgvActivity.Rows[rowId].Height = 40;
|
||||
}));
|
||||
}
|
||||
|
||||
//进详情页查询折扣比例信息,因部分活动可能无符合条件商品,查询可能速度较慢
|
||||
if(chkGetDiscount.Checked)
|
||||
GetDiscount();
|
||||
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
ucGroupBoxEx2.Enabled = true;
|
||||
@@ -505,6 +425,193 @@ namespace TemuKJD.KJDForms.SalesCenterForms
|
||||
}, cancellationTokenSource.Token);
|
||||
}
|
||||
|
||||
// 查询活动折扣
|
||||
void GetDiscount()
|
||||
{
|
||||
foreach (var shopId in lstShopIdSelect)
|
||||
{
|
||||
if (cancellationTokenSource.IsCancellationRequested)
|
||||
break;
|
||||
|
||||
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == shopId);
|
||||
if (shop == null)
|
||||
continue;
|
||||
shop.LastRefreshDate = "";
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
// 查询所有活动是否有店铺可以报名,可报名的才显示
|
||||
foreach (var actInfo in lstActivityThematic)
|
||||
{
|
||||
this.Invoke(new Action(() =>
|
||||
{
|
||||
this.statusBar.lblTaskStatus.Text = "正在查询活动折扣" + (i + 1) + "...";
|
||||
this.statusBar.pgbTaskProgress.Maximum = lstActivityThematic.Count;
|
||||
this.statusBar.UpdateProgressBar(i + 1);
|
||||
i++;
|
||||
}));
|
||||
|
||||
if (actInfo == null)
|
||||
continue;
|
||||
|
||||
var actRow = this.dgvActivity.Rows.Cast<DataGridViewRow>()
|
||||
.FirstOrDefault(r => r.Cells["colActivityId"].Value.ParseToLong() == actInfo?.activityThematicId);
|
||||
if (actRow == null)
|
||||
continue;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(actInfo.discount) && actInfo.discount != "-")
|
||||
{
|
||||
this.Invoke(new Action(() =>
|
||||
{
|
||||
actRow.Cells["colActivityMsg"].Value = "折扣查询成功";
|
||||
}));
|
||||
continue;
|
||||
}
|
||||
|
||||
this.Invoke(new Action(() =>
|
||||
{
|
||||
actRow.Cells["colActivityMsg"].Value = "正在查询折扣...";
|
||||
}));
|
||||
|
||||
foreach (var shopId in lstShopIdSelect)
|
||||
{
|
||||
if (cancellationTokenSource.IsCancellationRequested)
|
||||
break;
|
||||
|
||||
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == shopId);
|
||||
if (shop == null)
|
||||
continue;
|
||||
|
||||
var shopRow = this.dgvShop.Rows.Cast<DataGridViewRow>()
|
||||
.FirstOrDefault(r => r.Cells["colShopId"].Value.ParseToString() == shop.ShopId);
|
||||
if (shopRow == null)
|
||||
continue;
|
||||
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
shopRow.Cells["colMessage"].Value = "查询折扣,活动:" + actInfo.activityThematicName;
|
||||
}));
|
||||
|
||||
#region 检测登录
|
||||
if (shop.LoginStatus2 != "国际版在线")
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if (ShopListForm.Instance == null)
|
||||
ShopListForm.Instance = new ShopListForm();
|
||||
if (shop.LastRefreshDate == "")
|
||||
ShopListForm.Instance.CheckShopLogin(new string[] { shop.LoginName }, false);
|
||||
if (shop.LoginStatus2 != "国际版在线")
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
var shopRows = this.dgvShop.Rows.Cast<DataGridViewRow>().Where(r => r.Cells["colShopLoginName"].Value.ToString() == shop.LoginName);
|
||||
foreach (var r in shopRows)
|
||||
{
|
||||
r.Cells["colMessage"].Value = "店铺掉线";
|
||||
r.Cells["colLoginStatus"].Value = "国际版未登录";
|
||||
r.Cells["colCanUse"].Value = false;
|
||||
}
|
||||
}));
|
||||
continue;
|
||||
}
|
||||
#endregion
|
||||
|
||||
int tryCount = 0;
|
||||
tryAgain:
|
||||
Thread.Sleep(100 + Randomx.GetId(200));
|
||||
string jsonStr = GetActivityMatch(shop, actInfo.activityThematicId.ParseToLong());
|
||||
if (jsonStr.Contains("指定的值含有无效的控制字符"))
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
var shopRows = this.dgvShop.Rows.Cast<DataGridViewRow>().Where(r => r.Cells["colShopLoginName"].Value.ToString() == shop.LoginName);
|
||||
foreach (var r in shopRows)
|
||||
{
|
||||
r.Cells["colMessage"].Value = "店铺掉线";
|
||||
r.Cells["colLoginStatus"].Value = "国际版未登录";
|
||||
r.Cells["colCanUse"].Value = false;
|
||||
}
|
||||
}));
|
||||
continue;
|
||||
}
|
||||
if (jsonStr.Contains("当前操作人数太多,请稍后重试") && tryCount < 5)
|
||||
{
|
||||
tryCount++;
|
||||
goto tryAgain;
|
||||
}
|
||||
if (jsonStr.Contains("当前操作人数太多,请稍后重试"))
|
||||
{
|
||||
}
|
||||
if (!jsonStr.Contains("\"success\":true"))
|
||||
{
|
||||
//isError = true;
|
||||
//string sErr = BaseRegex.GetStringJson(ref jsonStr, "errorMsg");
|
||||
//if (!string.IsNullOrWhiteSpace(sErr) && !errMsg.Contains(sErr))
|
||||
// errMsg += sErr + " ";
|
||||
//page++;
|
||||
string sErr = BaseRegex.GetStringJson(ref jsonStr, "errorMsg");
|
||||
if (string.IsNullOrEmpty(sErr))
|
||||
sErr = BaseRegex.GetStringJson(ref jsonStr, "err_msg");
|
||||
if (string.IsNullOrEmpty(sErr))
|
||||
sErr = jsonStr;
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
actRow.Cells["colActivityMsg"].Value = sErr;
|
||||
shopRow.Cells["colMessage"].Value = "";
|
||||
}));
|
||||
continue;
|
||||
}
|
||||
|
||||
if (jsonStr.Contains("\"success\":true"))
|
||||
{
|
||||
var jArr = new JArray();
|
||||
try
|
||||
{
|
||||
var jObj = JObject.Parse(jsonStr);
|
||||
jArr = jObj["result"]?["matchList"] as JArray;
|
||||
if (jArr == null)
|
||||
jArr = new JArray();
|
||||
}
|
||||
catch (Exception ex) { BaseMsgForm.ShowError(ex.Message); }
|
||||
|
||||
if (jArr.Count() == 0)
|
||||
{
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
shopRow.Cells["colMessage"].Value = "";
|
||||
}));
|
||||
continue;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var skuObj = jArr[0]["skcList"][0]["skuList"][0];
|
||||
var suggestActivityPrice = skuObj["suggestActivityPrice"].ParseToInt();
|
||||
var dailyPrice = skuObj["dailyPrice"].ParseToInt();
|
||||
var discount = suggestActivityPrice * 100.0 / dailyPrice;
|
||||
actInfo.discount = Math.Round(discount) + "折";
|
||||
Invoke(new Action(() =>
|
||||
{
|
||||
actRow.Cells["colDiscount"].Value = actInfo.discount;
|
||||
actRow.Cells["colActivityMsg"].Value = "折扣查询成功";
|
||||
shopRow.Cells["colMessage"].Value = "";
|
||||
}));
|
||||
break;
|
||||
}
|
||||
catch (Exception ex) { BaseMsgForm.ShowError(ex.Message); }
|
||||
}
|
||||
}
|
||||
if(string.IsNullOrEmpty(actInfo.discount) || !actInfo.discount.Contains("折"))
|
||||
{
|
||||
this.Invoke(new Action(() =>
|
||||
{
|
||||
actRow.Cells["colActivityMsg"].Value = "没有活动可用商品,折扣查询失败";
|
||||
}));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取活动列表
|
||||
/// </summary>
|
||||
|
||||
@@ -153,7 +153,7 @@
|
||||
<metadata name="colDiscount.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="dataGridViewTextBoxColumn9.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<metadata name="colActivityMsg.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<metadata name="colCheckProduct.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
|
||||
Reference in new issue
Block a user