产品库手动更新sku下架情况

This commit is contained in:
wule committed 2026-02-26 11:56:00 +08:00
1 parent 1b2b6bb553
commit 30efe8fccb
25 files changed
+2214 -490

No files matched your search

+452 -9
View File
@@ -35,6 +35,11 @@ namespace TemuKJD.ToolForms
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.btnNext = new System.Windows.Forms.Button();
this.btnPrev = new System.Windows.Forms.Button();
@@ -56,6 +61,36 @@ namespace TemuKJD.ToolForms
this.ucTabControlMetro1 = new PinBaoBao.UserControls.UcTabControlMetro();
this.tabPage1 = new System.Windows.Forms.TabPage();
this.tabPage2 = new System.Windows.Forms.TabPage();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.splitContainer3 = new System.Windows.Forms.SplitContainer();
this.btnStopGetDownSku = new DevComponents.DotNetBar.PanelEx();
this.btnResetCache = new DevComponents.DotNetBar.PanelEx();
this.label6 = new System.Windows.Forms.Label();
this.txtBeforeDay = new System.Windows.Forms.TextBox();
this.chkSkipDownSearch = new TemuKJD.UserComponent.UcCheckBox(this.components);
this.label5 = new System.Windows.Forms.Label();
this.txtBeforeHour = new System.Windows.Forms.TextBox();
this.statusBarUserControl1 = new TemuKJD.UserControls.StatusBarUserControl();
this.dtpEndTime = new System.Windows.Forms.DateTimePicker();
this.dtpStartTime = new System.Windows.Forms.DateTimePicker();
this.btnGetDownSku = new DevComponents.DotNetBar.PanelEx();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.dgvDownSku = new TemuKJD.UserComponent.DataGridViewEx();
this.colDownSelect = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.colDownSpuId = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colDownStyleCode = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colDownImgUrl = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colDownImg = new System.Windows.Forms.DataGridViewImageColumn();
this.colDownItemName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.skuDownItemCode = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colDownColourSpec = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colDownSupplierName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colDownSupplyPrice = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colDownShelvesTime = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colDownLastOperator = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colDownDrpItemStatus = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewLinkColumn1 = new System.Windows.Forms.DataGridViewLinkColumn();
this.dataGridViewTextBoxColumn8 = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.pnlMultiLogin = new System.Windows.Forms.Panel();
this.cmbMultiCookieName = new DevComponents.DotNetBar.Controls.ComboBoxEx();
this.btnMultiLogin = new DevComponents.DotNetBar.PanelEx();
@@ -97,6 +132,13 @@ namespace TemuKJD.ToolForms
this.ucTabControlMetro1.SuspendLayout();
this.tabPage1.SuspendLayout();
this.tabPage2.SuspendLayout();
this.tabPage3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).BeginInit();
this.splitContainer3.Panel1.SuspendLayout();
this.splitContainer3.Panel2.SuspendLayout();
this.splitContainer3.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dgvDownSku)).BeginInit();
this.pnlMultiLogin.SuspendLayout();
this.SuspendLayout();
//
@@ -114,7 +156,7 @@ namespace TemuKJD.ToolForms
this.splitContainer2.Panel1.Controls.Add(this.btnNext);
this.splitContainer2.Panel1.Controls.Add(this.btnPrev);
this.splitContainer2.Panel1.Controls.Add(this.txtAddress);
this.splitContainer2.Size = new System.Drawing.Size(1390, 434);
this.splitContainer2.Size = new System.Drawing.Size(1390, 442);
this.splitContainer2.SplitterDistance = 26;
this.splitContainer2.TabIndex = 6;
//
@@ -153,7 +195,7 @@ namespace TemuKJD.ToolForms
//
this.pbLoading.Anchor = System.Windows.Forms.AnchorStyles.None;
this.pbLoading.Image = global::TemuKJD.Properties.Resources.loading_blue;
this.pbLoading.Location = new System.Drawing.Point(673, 195);
this.pbLoading.Location = new System.Drawing.Point(673, 197);
this.pbLoading.Name = "pbLoading";
this.pbLoading.Size = new System.Drawing.Size(50, 50);
this.pbLoading.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
@@ -197,7 +239,7 @@ namespace TemuKJD.ToolForms
this.dgvProduct.Name = "dgvProduct";
this.dgvProduct.ReadOnly = true;
this.dgvProduct.RowTemplate.Height = 23;
this.dgvProduct.Size = new System.Drawing.Size(1390, 434);
this.dgvProduct.Size = new System.Drawing.Size(1390, 441);
this.dgvProduct.TabIndex = 7;
this.dgvProduct.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvProduct_CellContentClick);
//
@@ -333,7 +375,7 @@ namespace TemuKJD.ToolForms
this.splitContainer1.Panel2.Controls.Add(this.btnImportCookie);
this.splitContainer1.Panel2.Controls.Add(this.label2);
this.splitContainer1.Size = new System.Drawing.Size(1404, 561);
this.splitContainer1.SplitterDistance = 470;
this.splitContainer1.SplitterDistance = 478;
this.splitContainer1.SplitterWidth = 3;
this.splitContainer1.TabIndex = 4;
//
@@ -343,12 +385,13 @@ namespace TemuKJD.ToolForms
this.ucTabControlMetro1.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(0)))), ((int)(((byte)(174)))), ((int)(((byte)(157)))));
this.ucTabControlMetro1.Controls.Add(this.tabPage1);
this.ucTabControlMetro1.Controls.Add(this.tabPage2);
this.ucTabControlMetro1.Controls.Add(this.tabPage3);
this.ucTabControlMetro1.Dock = System.Windows.Forms.DockStyle.Fill;
this.ucTabControlMetro1.Location = new System.Drawing.Point(0, 0);
this.ucTabControlMetro1.Name = "ucTabControlMetro1";
this.ucTabControlMetro1.SelectedIndex = 0;
this.ucTabControlMetro1.ShowCloseButton = false;
this.ucTabControlMetro1.Size = new System.Drawing.Size(1404, 470);
this.ucTabControlMetro1.Size = new System.Drawing.Size(1404, 478);
this.ucTabControlMetro1.TabIndex = 462;
this.ucTabControlMetro1.TabSelectColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.ucTabControlMetro1.TabSelectTextColor = System.Drawing.Color.Gray;
@@ -360,7 +403,7 @@ namespace TemuKJD.ToolForms
this.tabPage1.Location = new System.Drawing.Point(4, 26);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(1396, 440);
this.tabPage1.Size = new System.Drawing.Size(1396, 448);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "商品页面";
this.tabPage1.UseVisualStyleBackColor = true;
@@ -372,11 +415,373 @@ namespace TemuKJD.ToolForms
this.tabPage2.Location = new System.Drawing.Point(4, 26);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(1396, 440);
this.tabPage2.Size = new System.Drawing.Size(1396, 447);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "采集列表";
this.tabPage2.UseVisualStyleBackColor = true;
//
// tabPage3
//
this.tabPage3.Controls.Add(this.splitContainer3);
this.tabPage3.Location = new System.Drawing.Point(4, 26);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Size = new System.Drawing.Size(1396, 448);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "下架SKU查询";
this.tabPage3.UseVisualStyleBackColor = true;
//
// splitContainer3
//
this.splitContainer3.BackColor = System.Drawing.Color.White;
this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer3.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
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.btnStopGetDownSku);
this.splitContainer3.Panel1.Controls.Add(this.btnResetCache);
this.splitContainer3.Panel1.Controls.Add(this.label6);
this.splitContainer3.Panel1.Controls.Add(this.txtBeforeDay);
this.splitContainer3.Panel1.Controls.Add(this.chkSkipDownSearch);
this.splitContainer3.Panel1.Controls.Add(this.label5);
this.splitContainer3.Panel1.Controls.Add(this.txtBeforeHour);
this.splitContainer3.Panel1.Controls.Add(this.statusBarUserControl1);
this.splitContainer3.Panel1.Controls.Add(this.dtpEndTime);
this.splitContainer3.Panel1.Controls.Add(this.dtpStartTime);
this.splitContainer3.Panel1.Controls.Add(this.btnGetDownSku);
//
// splitContainer3.Panel2
//
this.splitContainer3.Panel2.Controls.Add(this.pictureBox1);
this.splitContainer3.Panel2.Controls.Add(this.dgvDownSku);
this.splitContainer3.Size = new System.Drawing.Size(1396, 448);
this.splitContainer3.SplitterDistance = 82;
this.splitContainer3.TabIndex = 0;
//
// btnStopGetDownSku
//
this.btnStopGetDownSku.CanvasColor = System.Drawing.SystemColors.Control;
this.btnStopGetDownSku.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnStopGetDownSku.DisabledBackColor = System.Drawing.Color.Empty;
this.btnStopGetDownSku.Location = new System.Drawing.Point(462, 14);
this.btnStopGetDownSku.Name = "btnStopGetDownSku";
this.btnStopGetDownSku.Size = new System.Drawing.Size(72, 23);
this.btnStopGetDownSku.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnStopGetDownSku.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
this.btnStopGetDownSku.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
this.btnStopGetDownSku.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
this.btnStopGetDownSku.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnStopGetDownSku.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
this.btnStopGetDownSku.Style.GradientAngle = 90;
this.btnStopGetDownSku.StyleMouseDown.Alignment = System.Drawing.StringAlignment.Center;
this.btnStopGetDownSku.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnStopGetDownSku.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnStopGetDownSku.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnStopGetDownSku.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White;
this.btnStopGetDownSku.TabIndex = 964;
this.btnStopGetDownSku.Text = "停止采集";
this.btnStopGetDownSku.Click += new System.EventHandler(this.btnStopGetDownSku_Click);
//
// btnResetCache
//
this.btnResetCache.CanvasColor = System.Drawing.SystemColors.Control;
this.btnResetCache.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnResetCache.DisabledBackColor = System.Drawing.Color.Empty;
this.btnResetCache.Location = new System.Drawing.Point(1017, 14);
this.btnResetCache.Name = "btnResetCache";
this.btnResetCache.Size = new System.Drawing.Size(110, 23);
this.btnResetCache.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnResetCache.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
this.btnResetCache.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
this.btnResetCache.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
this.btnResetCache.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnResetCache.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
this.btnResetCache.Style.GradientAngle = 90;
this.btnResetCache.StyleMouseDown.Alignment = System.Drawing.StringAlignment.Center;
this.btnResetCache.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnResetCache.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnResetCache.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnResetCache.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White;
this.btnResetCache.TabIndex = 954;
this.btnResetCache.Text = "清除采集緩存";
this.btnResetCache.Click += new System.EventHandler(this.btnResetCache_Click);
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(883, 17);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(128, 17);
this.label6.TabIndex = 944;
this.label6.Text = "小时之前时,结束采集";
//
// txtBeforeDay
//
this.txtBeforeDay.Location = new System.Drawing.Point(776, 14);
this.txtBeforeDay.Name = "txtBeforeDay";
this.txtBeforeDay.Size = new System.Drawing.Size(43, 23);
this.txtBeforeDay.TabIndex = 829;
this.txtBeforeDay.Text = "1";
this.txtBeforeDay.TextChanged += new System.EventHandler(this.txtBeforeDay_TextChanged);
//
// chkSkipDownSearch
//
this.chkSkipDownSearch.AutoSize = true;
this.chkSkipDownSearch.Checked = true;
this.chkSkipDownSearch.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkSkipDownSearch.Location = new System.Drawing.Point(540, 15);
this.chkSkipDownSearch.Name = "chkSkipDownSearch";
this.chkSkipDownSearch.Size = new System.Drawing.Size(243, 21);
this.chkSkipDownSearch.TabIndex = 943;
this.chkSkipDownSearch.Text = "SKU下架库中存在当前采集且采集时间在";
this.chkSkipDownSearch.UseVisualStyleBackColor = true;
//
// label5
//
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(820, 17);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(20, 17);
this.label5.TabIndex = 831;
this.label5.Text = "天";
//
// txtBeforeHour
//
this.txtBeforeHour.Location = new System.Drawing.Point(840, 14);
this.txtBeforeHour.Name = "txtBeforeHour";
this.txtBeforeHour.Size = new System.Drawing.Size(43, 23);
this.txtBeforeHour.TabIndex = 830;
this.txtBeforeHour.Text = "0";
this.txtBeforeHour.TextChanged += new System.EventHandler(this.txtBeforeDay_TextChanged);
//
// statusBarUserControl1
//
this.statusBarUserControl1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.statusBarUserControl1.BackColor = System.Drawing.Color.White;
this.statusBarUserControl1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.statusBarUserControl1.Location = new System.Drawing.Point(5, 49);
this.statusBarUserControl1.Margin = new System.Windows.Forms.Padding(0);
this.statusBarUserControl1.Name = "statusBarUserControl1";
this.statusBarUserControl1.Size = new System.Drawing.Size(1388, 25);
this.statusBarUserControl1.TabIndex = 824;
//
// dtpEndTime
//
this.dtpEndTime.Location = new System.Drawing.Point(165, 14);
this.dtpEndTime.Name = "dtpEndTime";
this.dtpEndTime.Size = new System.Drawing.Size(149, 23);
this.dtpEndTime.TabIndex = 800;
this.dtpEndTime.Value = new System.DateTime(2026, 1, 28, 0, 0, 0, 0);
this.dtpEndTime.ValueChanged += new System.EventHandler(this.dtpEndTime_ValueChanged);
//
// dtpStartTime
//
this.dtpStartTime.Location = new System.Drawing.Point(10, 14);
this.dtpStartTime.Name = "dtpStartTime";
this.dtpStartTime.Size = new System.Drawing.Size(149, 23);
this.dtpStartTime.TabIndex = 799;
this.dtpStartTime.Value = new System.DateTime(2026, 1, 28, 0, 0, 0, 0);
this.dtpStartTime.ValueChanged += new System.EventHandler(this.dtpStartTime_ValueChanged);
//
// btnGetDownSku
//
this.btnGetDownSku.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnGetDownSku.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnGetDownSku.DisabledBackColor = System.Drawing.Color.Empty;
this.btnGetDownSku.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnGetDownSku.Location = new System.Drawing.Point(320, 14);
this.btnGetDownSku.Name = "btnGetDownSku";
this.btnGetDownSku.Size = new System.Drawing.Size(136, 23);
this.btnGetDownSku.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnGetDownSku.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnGetDownSku.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnGetDownSku.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnGetDownSku.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnGetDownSku.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnGetDownSku.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnGetDownSku.Style.GradientAngle = 90;
this.btnGetDownSku.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnGetDownSku.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnGetDownSku.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnGetDownSku.TabIndex = 798;
this.btnGetDownSku.Text = "采集下架SKU列表";
this.btnGetDownSku.Click += new System.EventHandler(this.btnGetDownSku_Click);
//
// pictureBox1
//
this.pictureBox1.Anchor = System.Windows.Forms.AnchorStyles.None;
this.pictureBox1.Image = global::TemuKJD.Properties.Resources.loading_blue;
this.pictureBox1.Location = new System.Drawing.Point(673, 156);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(50, 50);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.pictureBox1.TabIndex = 9;
this.pictureBox1.TabStop = false;
this.pictureBox1.Visible = false;
//
// dgvDownSku
//
this.dgvDownSku.AllowUserToAddRows = false;
this.dgvDownSku.AllowUserToDeleteRows = false;
dataGridViewCellStyle6.BackColor = System.Drawing.Color.WhiteSmoke;
this.dgvDownSku.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle6;
this.dgvDownSku.AutoRowNumber = true;
this.dgvDownSku.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.dgvDownSku.BackgroundColor = System.Drawing.Color.White;
this.dgvDownSku.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
dataGridViewCellStyle7.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle7.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle7.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle7.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle7.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle7.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvDownSku.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle7;
this.dgvDownSku.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvDownSku.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.colDownSelect,
this.colDownSpuId,
this.colDownStyleCode,
this.colDownImgUrl,
this.colDownImg,
this.colDownItemName,
this.skuDownItemCode,
this.colDownColourSpec,
this.colDownSupplierName,
this.colDownSupplyPrice,
this.colDownShelvesTime,
this.colDownLastOperator,
this.colDownDrpItemStatus,
this.dataGridViewLinkColumn1,
this.dataGridViewTextBoxColumn8});
this.dgvDownSku.Dock = System.Windows.Forms.DockStyle.Fill;
this.dgvDownSku.Location = new System.Drawing.Point(0, 0);
this.dgvDownSku.Name = "dgvDownSku";
this.dgvDownSku.ReadOnly = true;
this.dgvDownSku.RowTemplate.Height = 23;
this.dgvDownSku.Size = new System.Drawing.Size(1396, 362);
this.dgvDownSku.TabIndex = 8;
//
// colDownSelect
//
this.colDownSelect.FillWeight = 26F;
this.colDownSelect.HeaderText = "选";
this.colDownSelect.Name = "colDownSelect";
this.colDownSelect.ReadOnly = true;
this.colDownSelect.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colDownSelect.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
//
// colDownSpuId
//
this.colDownSpuId.FillWeight = 50F;
this.colDownSpuId.HeaderText = "商品Id";
this.colDownSpuId.Name = "colDownSpuId";
this.colDownSpuId.ReadOnly = true;
//
// colDownStyleCode
//
this.colDownStyleCode.FillWeight = 50F;
this.colDownStyleCode.HeaderText = "资料编码";
this.colDownStyleCode.Name = "colDownStyleCode";
this.colDownStyleCode.ReadOnly = true;
//
// colDownImgUrl
//
this.colDownImgUrl.FillWeight = 300F;
this.colDownImgUrl.HeaderText = "图片路径";
this.colDownImgUrl.Name = "colDownImgUrl";
this.colDownImgUrl.ReadOnly = true;
this.colDownImgUrl.Visible = false;
//
// colDownImg
//
this.colDownImg.FillWeight = 40F;
this.colDownImg.HeaderText = "图片";
this.colDownImg.ImageLayout = System.Windows.Forms.DataGridViewImageCellLayout.Zoom;
this.colDownImg.Name = "colDownImg";
this.colDownImg.ReadOnly = true;
this.colDownImg.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colDownImg.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
//
// colDownItemName
//
dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colDownItemName.DefaultCellStyle = dataGridViewCellStyle8;
this.colDownItemName.FillWeight = 120F;
this.colDownItemName.HeaderText = "商品名称";
this.colDownItemName.Name = "colDownItemName";
this.colDownItemName.ReadOnly = true;
//
// skuDownItemCode
//
this.skuDownItemCode.FillWeight = 60F;
this.skuDownItemCode.HeaderText = "Sku编码";
this.skuDownItemCode.Name = "skuDownItemCode";
this.skuDownItemCode.ReadOnly = true;
//
// colDownColourSpec
//
this.colDownColourSpec.FillWeight = 60F;
this.colDownColourSpec.HeaderText = "Sku规格";
this.colDownColourSpec.Name = "colDownColourSpec";
this.colDownColourSpec.ReadOnly = true;
//
// colDownSupplierName
//
this.colDownSupplierName.HeaderText = "供应商名称";
this.colDownSupplierName.Name = "colDownSupplierName";
this.colDownSupplierName.ReadOnly = true;
//
// colDownSupplyPrice
//
dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colDownSupplyPrice.DefaultCellStyle = dataGridViewCellStyle9;
this.colDownSupplyPrice.FillWeight = 70F;
this.colDownSupplyPrice.HeaderText = "供货价";
this.colDownSupplyPrice.Name = "colDownSupplyPrice";
this.colDownSupplyPrice.ReadOnly = true;
//
// colDownShelvesTime
//
this.colDownShelvesTime.FillWeight = 80F;
this.colDownShelvesTime.HeaderText = "供应商加入时间";
this.colDownShelvesTime.Name = "colDownShelvesTime";
this.colDownShelvesTime.ReadOnly = true;
//
// colDownLastOperator
//
this.colDownLastOperator.FillWeight = 50F;
this.colDownLastOperator.HeaderText = "操作人";
this.colDownLastOperator.Name = "colDownLastOperator";
this.colDownLastOperator.ReadOnly = true;
//
// colDownDrpItemStatus
//
this.colDownDrpItemStatus.FillWeight = 50F;
this.colDownDrpItemStatus.HeaderText = "状态";
this.colDownDrpItemStatus.Name = "colDownDrpItemStatus";
this.colDownDrpItemStatus.ReadOnly = true;
//
// dataGridViewLinkColumn1
//
this.dataGridViewLinkColumn1.FillWeight = 35F;
this.dataGridViewLinkColumn1.HeaderText = "删除";
this.dataGridViewLinkColumn1.Name = "dataGridViewLinkColumn1";
this.dataGridViewLinkColumn1.ReadOnly = true;
//
// dataGridViewTextBoxColumn8
//
dataGridViewCellStyle10.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.dataGridViewTextBoxColumn8.DefaultCellStyle = dataGridViewCellStyle10;
this.dataGridViewTextBoxColumn8.FillWeight = 160F;
this.dataGridViewTextBoxColumn8.HeaderText = "操作结果";
this.dataGridViewTextBoxColumn8.Name = "dataGridViewTextBoxColumn8";
this.dataGridViewTextBoxColumn8.ReadOnly = true;
//
// pnlMultiLogin
//
this.pnlMultiLogin.Controls.Add(this.cmbMultiCookieName);
@@ -796,7 +1201,7 @@ namespace TemuKJD.ToolForms
this.btnSaveCookie.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnSaveCookie.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnSaveCookie.DisabledBackColor = System.Drawing.Color.Empty;
this.btnSaveCookie.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSaveCookie.Font = new System.Drawing.Font("微软雅黑", 8F);
this.btnSaveCookie.Location = new System.Drawing.Point(171, 30);
this.btnSaveCookie.Name = "btnSaveCookie";
this.btnSaveCookie.Size = new System.Drawing.Size(125, 25);
@@ -812,7 +1217,7 @@ namespace TemuKJD.ToolForms
this.btnSaveCookie.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnSaveCookie.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnSaveCookie.TabIndex = 765;
this.btnSaveCookie.Text = "保存网页cookie";
this.btnSaveCookie.Text = "保存网页cookie到服务";
this.btnSaveCookie.Click += new System.EventHandler(this.btnSaveCookie_Click);
//
// btnImportCookie
@@ -873,6 +1278,14 @@ namespace TemuKJD.ToolForms
this.ucTabControlMetro1.ResumeLayout(false);
this.tabPage1.ResumeLayout(false);
this.tabPage2.ResumeLayout(false);
this.tabPage3.ResumeLayout(false);
this.splitContainer3.Panel1.ResumeLayout(false);
this.splitContainer3.Panel1.PerformLayout();
this.splitContainer3.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).EndInit();
this.splitContainer3.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dgvDownSku)).EndInit();
this.pnlMultiLogin.ResumeLayout(false);
this.ResumeLayout(false);
@@ -929,5 +1342,35 @@ namespace TemuKJD.ToolForms
private System.Windows.Forms.TextBox txtTitle;
private DevComponents.DotNetBar.PanelEx btnSearchTitle;
private DevComponents.DotNetBar.PanelEx btnCancelSelect;
private System.Windows.Forms.TabPage tabPage3;
private System.Windows.Forms.SplitContainer splitContainer3;
private UserComponent.DataGridViewEx dgvDownSku;
private System.Windows.Forms.DateTimePicker dtpEndTime;
private System.Windows.Forms.DateTimePicker dtpStartTime;
private DevComponents.DotNetBar.PanelEx btnGetDownSku;
private UserControls.StatusBarUserControl statusBarUserControl1;
private System.Windows.Forms.DataGridViewCheckBoxColumn colDownSelect;
private System.Windows.Forms.DataGridViewTextBoxColumn colDownSpuId;
private System.Windows.Forms.DataGridViewTextBoxColumn colDownStyleCode;
private System.Windows.Forms.DataGridViewTextBoxColumn colDownImgUrl;
private System.Windows.Forms.DataGridViewImageColumn colDownImg;
private System.Windows.Forms.DataGridViewTextBoxColumn colDownItemName;
private System.Windows.Forms.DataGridViewTextBoxColumn skuDownItemCode;
private System.Windows.Forms.DataGridViewTextBoxColumn colDownColourSpec;
private System.Windows.Forms.DataGridViewTextBoxColumn colDownSupplierName;
private System.Windows.Forms.DataGridViewTextBoxColumn colDownSupplyPrice;
private System.Windows.Forms.DataGridViewTextBoxColumn colDownShelvesTime;
private System.Windows.Forms.DataGridViewTextBoxColumn colDownLastOperator;
private System.Windows.Forms.DataGridViewTextBoxColumn colDownDrpItemStatus;
private System.Windows.Forms.DataGridViewLinkColumn dataGridViewLinkColumn1;
private System.Windows.Forms.DataGridViewTextBoxColumn dataGridViewTextBoxColumn8;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TextBox txtBeforeDay;
private UserComponent.UcCheckBox chkSkipDownSearch;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.TextBox txtBeforeHour;
private DevComponents.DotNetBar.PanelEx btnResetCache;
private DevComponents.DotNetBar.PanelEx btnStopGetDownSku;
private System.Windows.Forms.PictureBox pictureBox1;
}
}
+503 -4
View File
@@ -22,6 +22,8 @@ using TemuKJD.BaseForms;
using TemuKJD.BLL;
using TemuKJD.Extension;
using TemuKJD.Helper;
using TemuKJD.PDDForms.ProductSelectForms;
using TemuKJD.WXForms.ProductForms;
using Work;
namespace TemuKJD.ToolForms
@@ -29,6 +31,7 @@ namespace TemuKJD.ToolForms
public partial class GetJuShuitanProdForm : BaseForms.BaseForm
{
public CancellationTokenSource cancellationTokenSource { get; set; } = null;
public CancellationTokenSource CancelGetDown { get; set; } = null;
string InitUrl = "https://sc.scm121.com/suppliersManage/suppliersList/onlineSuppliers";
public ChromiumWebBrowser cefWebBrowser = null;
private string currentUrl = "";
@@ -42,7 +45,14 @@ namespace TemuKJD.ToolForms
int filterSaleCount = 100;
string platformType = "Pinduoduo";
string jstPddShopId = "";
int downBeforeDays = 1;
int downBeforeHours = 0;
ConcurrentList<JSTListProductInfo> lstJSTListProductInfo = new ConcurrentList<JSTListProductInfo>();
/// <summary>
/// 聚水潭已下架sku
/// </summary>
ConcurrentList<JSTDownProdSkuInfo> lstJSTDownProdSkuInfo = new ConcurrentList<JSTDownProdSkuInfo>();
JstDownSkuGetInfo jstDownSkuGetInfo = new JstDownSkuGetInfo();
public GetJuShuitanProdForm()
{
@@ -51,15 +61,32 @@ namespace TemuKJD.ToolForms
private void GetJuShuitanProdForm_Load(object sender, EventArgs e)
{
//this.ucTabControlMetro1.TabPages.Remove(tabPage3);
this.splitContainer1.SplitterDistance = 472;
this.dgvProduct.AddSelectorColumn("colCheck");
this.dgvProduct.AddImgColumn("colImg", "colImgUrl");
var tmpProductLst = NaiBa.Util.Helper.ConfigHelper.LoadConfig<List<JSTListProductInfo>>("supplier_product_list_" + MainForm.ProcessCount);
if (tmpProductLst == null)
tmpProductLst = new List<JSTListProductInfo>();
lstJSTListProductInfo.AddRange(tmpProductLst);
this.dgvDownSku.AddSelectorColumn("colDownSelect");
this.dgvDownSku.AddImgColumn("colDownImg", "colDownImgUrl");
downBeforeDays = txtBeforeDay.Text.ParseToInt();
downBeforeHours = txtBeforeHour.Text.ParseToInt();
dtpEndTime.Value = DateTime.Now;
lstJSTListProductInfo = NaiBa.Util.Helper.ConfigHelper.LoadConfig<ConcurrentList<JSTListProductInfo>>("supplier_product_list_" + MainForm.ProcessCount);
if (lstJSTListProductInfo == null)
lstJSTListProductInfo = new ConcurrentList<JSTListProductInfo>();
lstJSTDownProdSkuInfo = NaiBa.Util.Helper.ConfigHelper.LoadConfig<ConcurrentList<JSTDownProdSkuInfo>>("jst_down_sku_list");
if (lstJSTDownProdSkuInfo == null)
lstJSTDownProdSkuInfo = new ConcurrentList<JSTDownProdSkuInfo>();
jstDownSkuGetInfo = NaiBa.Util.Helper.ConfigHelper.LoadConfig<JstDownSkuGetInfo>("jst_down_sku_get_info");
if (jstDownSkuGetInfo == null)
jstDownSkuGetInfo = new JstDownSkuGetInfo();
pbLoading.Visible = true;
pictureBox1.Visible = true;
Task.Run(() =>
{
int id = 0;
@@ -99,6 +126,40 @@ namespace TemuKJD.ToolForms
{
pbLoading.Visible = false;
}));
Invoke(new Action(() =>
{
this.statusBarUserControl1.lblTaskStatus.Text = "上次采集 " + jstDownSkuGetInfo.readPage + "/" + jstDownSkuGetInfo.totalPage + " 页,每页 " + 100;
}));
foreach (var downSku in lstJSTDownProdSkuInfo)
{
Invoke(new Action(() =>
{
var rowIndex = dgvDownSku.Rows.Add(
true,
downSku.spuId,
downSku.styleCode,
downSku.itemMainImage.FirstOrDefault().ParseToString(),
DataGridViewExtension.defaultBitmap,
downSku.itemName,
downSku.itemCode,
downSku.colourSpec,
downSku.supplierName,
downSku.supplyPrice,
downSku.shelvesTime,
downSku.lastOperator,
downSku.drpItemStatus,
"删除",
downSku.is_in_product_db == 1 ? "" : "产品库不存在,跳过"
);
dgvDownSku.Rows[rowIndex].Height = 60;
}));
}
Invoke(new Action(() =>
{
pictureBox1.Visible = false;
}));
});
InitCef();
@@ -219,6 +280,12 @@ namespace TemuKJD.ToolForms
private void btnImportCookie_Click(object sender, EventArgs e)
{
if (!txtCookie.Text.Contains("DISTRYBUTION_TOKEN"))
{
BaseMsgForm.ShowError("导入的cookie无效,请重新输入");
return;
}
Task.Run(() =>
{
var t = CEFBrowser.SetCookieAsync("scm121.com", txtCookie.Text, cefWebBrowser.GetCookieManager(null));
@@ -1111,6 +1178,27 @@ namespace TemuKJD.ToolForms
return response;
}
public string GetDownSkuLst(ShopLoginInfo shop, DateTime startTime, DateTime endTime, int pageNum, int pageSize)
{
string url = "https://sc.scm121.com/api/goods/goChannelPartnerSku/queryChannelPartnerSkuList";
string referer = "https://sc.scm121.com/manage/goods/distributionGoodsManage/sku?skuDrpItemStatus=true";
//string body = @"{""startTime"":""2026-01-30 00:00:00"",""endTime"":""2026-02-24 23:59:59"",""pageSize"":20,""pageNum"":1,""isAllChangePriceItemCode"":false,""skuDrpItemStatus"":""FOR_SHELVED"",""allRegulatePriceChangeSku"":false,""checkHasData"":false}";
string body =
@"{""startTime"":""" + startTime.ToString("yyyy-MM-dd HH:mm:ss") +
@""",""endTime"":""" + endTime.ToString("yyyy-MM-dd HH:mm:ss") +
@""",""pageSize"":" + pageSize + @",""pageNum"":" + Math.Max(1, pageNum) + @",""isAllChangePriceItemCode"":false," +
@"""skuDrpItemStatus"":""FOR_SHELVED"",""allRegulatePriceChangeSku"":false,""checkHasData"":false}";
var lstRst = "";
for (int i = 0; i < 3 && !lstRst.Contains("\"success\":true"); i++)
{
if (i > 0)
Thread.Sleep(Randomx.GetId(1000, 2000));
lstRst = JSTHttpResponseBLL.JSTPostResponse(shop, url, body, referer, appVersion);
}
return lstRst;
}
private void btnSearchTitle_Click(object sender, EventArgs e)
{
pbLoading.Visible = true;
@@ -1150,5 +1238,416 @@ namespace TemuKJD.ToolForms
}
});
}
private void btnGetDownSku_Click(object sender, EventArgs e)
{
if (!cefWebBrowser.Address.StartsWith("https://sc.scm121.com/manage/goods/distributionGoodsManage/") &&
!cefWebBrowser.Address.StartsWith("https://sc.scm121.com/suppliersManage/suppliersList/onlineSuppliers"))
{
BaseMsgForm.ShowError("请将网页切换到分销页面!");
return;
}
if (CancelGetDown != null)
CancelGetDown.Cancel();
CancelGetDown = new CancellationTokenSource();
pictureBox1.Visible = true;
Task.Run(() =>
{
GetDownSku(CancelGetDown);
Invoke(new Action(() =>
{
if (jstDownSkuGetInfo.status != "done")
BaseMsgForm.ShowError("采集并同步产品中断!");
else
BaseMsgForm.ShowError("采集并同步产品完成!");
pictureBox1.Visible = false;
}));
}, CancelGetDown.Token);
}
DateTime startTime = new DateTime(2026,1,28);
DateTime endTime;
void GetDownSku(CancellationTokenSource cancelGetDown)
{
List<Cookie> cookieList = CEFBrowser.GetCookieList(".scm121.com", cefWebBrowser.GetCookieManager(null));
var shop = new ShopLoginInfo();
shop.Cookies = JsonHelper.SerializeObject(cookieList);
int total, page, totalPage = jstDownSkuGetInfo.totalPage;
int startPage = jstDownSkuGetInfo.readPage;
int pageSize = 100;
#if DEBUG
pageSize = 100;
#endif
for (page = startPage; page < 999999; page++)
{
if (cancelGetDown.IsCancellationRequested)
{
Invoke(new Action(() =>
{
this.statusBarUserControl1.lblTaskStatus.Text = "采集终止 " + page + "/" + totalPage + " 页,每页 " + pageSize;
}));
return;
}
Invoke(new Action(() =>
{
this.statusBarUserControl1.lblTaskStatus.Text = "正在采集 " + page + "/" + totalPage + " 页,每页 " + pageSize;
}));
var rst = GetDownSkuLst(shop, startTime, endTime, page, pageSize);
Thread.Sleep(5000);
if (!rst.Contains("\"success\":true"))
{
Thread.Sleep(5000);
rst = GetDownSkuLst(shop, startTime, endTime, page, pageSize);
}
if (!rst.Contains("\"success\":true"))
{
var errMsg = BaseRegex.GetStringJson(ref rst, "message");
if (string.IsNullOrEmpty(errMsg))
errMsg = rst;
Invoke(new Action(() =>
{
this.statusBarUserControl1.lblTaskStatus.Text = "查询下架列表失败:" + errMsg;
}));
return;
}
total = BaseRegex.GetIntJson(ref rst, "total");
totalPage = Math.Ceiling(1.0m * total / pageSize).ParseToInt();
try
{
var jsonStr = JsonHelper.SerializeObject(JsonHelper.JObjectParse(rst)["data"]);
List<JSTDownProdSkuInfo> jstDownProdSkuLst = JsonHelper.DeserializeJsonToList<JSTDownProdSkuInfo>(jsonStr);
List<JSTDownProdSkuInfo> jstDownProdSkuGetExistLst = JsonHelper.DeserializeJsonToList<JSTDownProdSkuInfo>(jsonStr);
jstDownProdSkuLst = jstDownProdSkuLst.Where(sku => !lstJSTDownProdSkuInfo.Any(s => s.itemCode == sku.itemCode)).ToList();
var url = BaseClass.BuildPDDObjString("product/get_product_spu_id_list");
var data = UserLogin.GetSignaturex();
data += "&search_spu_ids=" + string.Join(",", jstDownProdSkuLst.Select(s => s.spuId).Distinct());
var result = GetHtml.PostUtf8(url, data);
if (!result.Contains("\"code\":200"))
result = GetHtml.PostUtf8(url, data);
if (!result.Contains("\"code\":200"))
{
var errMsg = BaseRegex.GetStringJson(ref rst, "message");
if (string.IsNullOrEmpty(errMsg))
errMsg = rst;
Invoke(new Action(() =>
{
this.statusBarUserControl1.lblTaskStatus.Text = "查询错误:" + errMsg;
}));
return;
}
List<KJDDBProduct> dbProdLst = JsonHelper.DeserializeJsonToList<KJDDBProduct>(JsonHelper.JObjectParse(result)["data"].ParseToString());
// 查询下架库有没有
url = BaseClass.BuildPDDObjString("product/get_prod_down_sku_lst_by_sku_codes");
data = UserLogin.GetSignaturex();
data += "&search_spu_ids=" + string.Join(",", jstDownProdSkuGetExistLst.Select(s => s.spuId).Distinct());
data += "&search_sku_codes=" + string.Join(",", jstDownProdSkuGetExistLst.Select(s => s.itemCode).Distinct());
result = GetHtml.PostUtf8(url, data);
if (!result.Contains("\"code\":200"))
result = GetHtml.PostUtf8(url, data);
if (!result.Contains("\"code\":200"))
{
var errMsg = BaseRegex.GetStringJson(ref rst, "message");
if (string.IsNullOrEmpty(errMsg))
errMsg = rst;
Invoke(new Action(() =>
{
this.statusBarUserControl1.lblTaskStatus.Text = "查询下架库错误:" + errMsg;
}));
return;
}
List<JSTDownProdSkuInfo> downSkuExistLst = JsonHelper.DeserializeJsonToList<JSTDownProdSkuInfo>(JsonHelper.JObjectParse(result)["data"].ParseToString());
if (chkSkipDownSearch.Checked && downSkuExistLst.Count > 0 && downSkuExistLst.All(se => se.add_time < DateTime.Now.AddDays(-downBeforeDays).AddHours(-downBeforeHours)))
{
// 存在之前采集的数据,说明已查询完最新数据,跳出
Invoke(new Action(() =>
{
this.statusBarUserControl1.lblTaskStatus.Text = "增量采集完成 " + page + "/" + totalPage + " 页,每页 " + pageSize;
}));
goto endDownSearch;
}
foreach (var dbProdLite in dbProdLst)
{
string errMsg;
var dbProd = WXDBProdUploadForm.GetProductDetail(dbProdLite.id.ParseToString(), out errMsg);
if (!string.IsNullOrEmpty(errMsg) || dbProd == null)
{
Invoke(new Action(() =>
{
this.statusBarUserControl1.lblTaskStatus.Text = "商品详情读取失败 " + errMsg;
}));
return;
}
var secretSkuLst = dbProd.sku_secret_json;
JObject jstSecretCodeLst = new JObject();
try
{
jstSecretCodeLst = JsonHelper.JObjectParse(dbProd.sku_secret_json.TrimStart('[').TrimEnd(']'));
}
catch
{
}
var secret_spu_id = dbProd.secret_spu_id;
if (secret_spu_id.IsNullOrEmpty() && jstSecretCodeLst !=null)
{
secret_spu_id = jstSecretCodeLst["goodsId"].ParseToString();
}
JObject prodJObj = new JObject();
try
{
prodJObj = JObject.Parse(dbProd.product_json);
foreach (var skuObj in prodJObj["pddData"]["skuInfo"]["goodsSkuDetail"])
{
var itemNo = skuObj["itemNo"].ParseToString();
foreach (var downSku in jstDownProdSkuLst)
{
if (downSku.colourSpec == "圆形黄色小号")
{
}
if (downSku.itemCode == itemNo && downSku.spuId == dbProd.spu_id)
{
skuObj["quantity"] = 0;
downSku.secret_spu_id = secret_spu_id;
try
{
var secret_sku_id = jstSecretCodeLst?["skus"]?.FirstOrDefault(s => s["skuCode"].ParseToString() == downSku.itemCode)?["skuId"].ParseToString();
downSku.secret_sku_id = secret_sku_id;
}
catch
{
}
}
}
}
dbProd.product_json = JsonHelper.SerializeObject(prodJObj);
url = BaseClass.BuildPDDObjString("product/mdy_product");
var prodNewData = Work.UserLogin.GetSignaturex() +
"&product_json=" + HttpUtility.UrlEncode(dbProd.product_json, Encoding.UTF8) + "&spu_id=" + dbProd.spu_id;
var html = "";
for (int i = 0; i< 3 && !html.Contains("\"code\":200"); i++ )
{
html = GetHtml.PostUtf8(url, prodNewData);
}
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
{
errMsg = BaseRegex.GetStringJson(ref html, "msg");
Invoke(new Action(() =>
{
this.statusBarUserControl1.lblTaskStatus.Text = "商品详情转换/更新保存失败 " + errMsg;
}));
return;
}
}
catch (Exception ex)
{
Invoke(new Action(() =>
{
this.statusBarUserControl1.lblTaskStatus.Text = "商品详情转换/更新失败 " + ex.Message;
}));
return;
}
}
foreach (var downSku in jstDownProdSkuLst)
{
if (dbProdLst.Any(p => p.spu_id == downSku.spuId))
downSku.is_in_product_db = 1;
// 1.先显示下架sku
lstJSTDownProdSkuInfo.Add(downSku);
Invoke(new Action(() =>
{
var rowIndex = dgvDownSku.Rows.Add(
true,
downSku.spuId,
downSku.styleCode,
downSku.itemMainImage.FirstOrDefault().ParseToString(),
DataGridViewExtension.defaultBitmap,
downSku.itemName,
downSku.itemCode,
downSku.colourSpec,
downSku.supplierName,
downSku.supplyPrice,
downSku.shelvesTime,
downSku.lastOperator,
downSku.drpItemStatus,
"删除",
downSku.is_in_product_db == 1 ? "已更新库存产品" : "产品库不存在,跳过"
);
dgvDownSku.Rows[rowIndex].Height = 60;
}));
// 2.再入下架sku库
// 产品库没有这个商品,直接跳过
if (downSku.is_in_product_db != 1)
continue;
// 产品库有这个商品,继续判断下架库是否有
var downSkuExist = downSkuExistLst.FirstOrDefault(p => p.spuId == downSku.spuId && p.itemCode == downSku.itemCode);
if (downSkuExist != null)
{
if (chkSkipDownSearch.Checked && downSkuExist.add_time < DateTime.Now.AddDays(-downBeforeDays).AddHours(-downBeforeHours))
{
// 存在之前采集的数据,说明已查询完最新数据,跳出
Invoke(new Action(() =>
{
this.statusBarUserControl1.lblTaskStatus.Text = "增量采集完成 " + page + "/" + totalPage + " 页,每页 " + pageSize;
}));
goto endDownSearch;
}
// 下架库里已存在,就跳过。
//if (downSku.is_in_product_db == 1)
continue;
}
else
{
// 入下架库
url = BaseClass.BuildPDDObjString("product/add_prod_down_sku");
var prodNewData = Work.UserLogin.GetSignaturex() +
"&itemMainImage=" + HttpUtility.UrlEncode(string.Join(",", downSku.itemMainImage), Encoding.UTF8) +
"&itemName=" + HttpUtility.UrlEncode(downSku.itemName, Encoding.UTF8) +
"&styleCode=" + HttpUtility.UrlEncode(downSku.styleCode, Encoding.UTF8) +
"&itemCode=" + HttpUtility.UrlEncode(downSku.itemCode, Encoding.UTF8) +
"&colourSpec=" + HttpUtility.UrlEncode(downSku.colourSpec, Encoding.UTF8) +
"&supplyPrice=" + downSku.supplyPrice.ParseToString() +
"&supplierName=" + downSku.supplierName +
"&shelvesTime=" + downSku.shelvesTime +
"&supplierCoId=" + downSku.supplierCoId +
"&coId=" + downSku.coId +
"&spuId=" + downSku.spuId +
"&partnerSkuId=" + downSku.partnerSkuId +
"&partnerSpuId=" + downSku.partnerSpuId +
"&supplierId=" + downSku.supplierId +
"&drpItemStatus=" + downSku.drpItemStatus +
"&lastOperator=" + downSku.lastOperator +
"&itemSpuIdMd5=" + downSku.itemSpuIdMd5 +
"&secret_spu_id=" + downSku.secret_spu_id +
"&secret_sku_id=" + downSku.secret_sku_id +
"&is_in_product_db=" + downSku.is_in_product_db;
var html = "";
for (int i = 0; i < 5 && (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200")); i++)
{
html = GetHtml.PostUtf8(url, prodNewData);
if (html.Contains("数据已存在"))
break;
}
if (html.Contains("数据已存在"))
{
// 数据已存在的暂时跳过不处理
}
else if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
{
// 入库失败终止
string errMsg = BaseRegex.GetStringJson(ref html, "msg");
Invoke(new Action(() =>
{
this.statusBarUserControl1.lblTaskStatus.Text = "下架商品Sku入库失败 " + errMsg;
}));
return;
}
}
}
if (page % 5 == 4 || !rst.Contains("\"hasNext\":true"))
{
NaiBa.Util.Helper.ConfigHelper.SaveConfig("jst_down_sku_list", lstJSTDownProdSkuInfo);
jstDownSkuGetInfo.readPage = page;
jstDownSkuGetInfo.totalPage = totalPage;
jstDownSkuGetInfo.status = "reading";
jstDownSkuGetInfo.lastReadDate = DateTime.Now.Date;
jstDownSkuGetInfo.totalCount = total;
NaiBa.Util.Helper.ConfigHelper.SaveConfig("jst_down_sku_get_info", jstDownSkuGetInfo);
}
}
catch (Exception ex)
{
Invoke(new Action(() =>
{
this.statusBarUserControl1.lblTaskStatus.Text = "采集失败 " + ex.Message;
}));
return;
}
if (!rst.Contains("\"hasNext\":true"))
{
Invoke(new Action(() =>
{
this.statusBarUserControl1.lblTaskStatus.Text = "采集完成 " + page + "/" + totalPage + " 页,每页 " + pageSize;
}));
goto endDownSearch;
}
}
endDownSearch:
NaiBa.Util.Helper.ConfigHelper.SaveConfig("jst_down_sku_list", lstJSTDownProdSkuInfo);
jstDownSkuGetInfo.readPage = 0;
jstDownSkuGetInfo.status = "done";
jstDownSkuGetInfo.lastReadDate = DateTime.Now.Date;
NaiBa.Util.Helper.ConfigHelper.SaveConfig("jst_down_sku_get_info", jstDownSkuGetInfo);
}
private void dtpStartTime_ValueChanged(object sender, EventArgs e)
{
startTime = dtpStartTime.Value;
}
private void dtpEndTime_ValueChanged(object sender, EventArgs e)
{
endTime = dtpEndTime.Value;
}
private void txtBeforeDay_TextChanged(object sender, EventArgs e)
{
downBeforeDays = txtBeforeDay.Text.ParseToInt();
downBeforeHours = txtBeforeHour.Text.ParseToInt();
}
private void btnResetCache_Click(object sender, EventArgs e)
{
if (BaseMsgForm.ShowConfirm("确定清除采集缓存吗?再次采集将从第一页开始!").DialogResult == DialogResult.OK)
{
dgvDownSku.Rows.Clear();
lstJSTDownProdSkuInfo = new ConcurrentList<JSTDownProdSkuInfo>();
jstDownSkuGetInfo = new JstDownSkuGetInfo();
NaiBa.Util.Helper.ConfigHelper.SaveConfig("jst_down_sku_list", lstJSTDownProdSkuInfo);
NaiBa.Util.Helper.ConfigHelper.SaveConfig("jst_down_sku_get_info", jstDownSkuGetInfo);
this.statusBarUserControl1.lblTaskStatus.Text = "准备就绪";
}
}
private void btnStopGetDownSku_Click(object sender, EventArgs e)
{
if (CancelGetDown != null)
CancelGetDown.Cancel();
}
}
/// <summary>
/// 记录获取聚水潭下架sku的信息
/// </summary>
public class JstDownSkuGetInfo
{
public int readPage { get; set; } = 1;
public int totalPage { get; set; } = 1;
/// <summary>
/// done reading
/// </summary>
public string status { get; set; } = "done";
public int totalCount { get; set; } = 999999;
public DateTime lastReadDate { get; set; } = DateTime.MinValue;
}
}
@@ -150,4 +150,49 @@
<metadata name="colMsg.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colDownSelect.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colDownSpuId.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colDownStyleCode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colDownImgUrl.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colDownImg.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colDownItemName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="skuDownItemCode.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colDownColourSpec.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colDownSupplierName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colDownSupplyPrice.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colDownShelvesTime.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colDownLastOperator.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colDownDrpItemStatus.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewLinkColumn1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewTextBoxColumn8.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>