1688上传类目转换等优化 充值用户服务充值和用户续费店铺功能

This commit is contained in:
wule committed 2026-05-27 22:01:04 +08:00
1 parent ecb291e3d7
commit aab73b978f
56 files changed
+4532 -1748

No files matched your search

+231 -19
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.line1 = new DevComponents.DotNetBar.Controls.Line();
this.label2 = new System.Windows.Forms.Label();
this.btnImportCookie = new DevComponents.DotNetBar.PanelEx();
@@ -90,8 +95,24 @@ namespace TemuKJD.ToolForms
this.colMsg = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.tabPage3 = new System.Windows.Forms.TabPage();
this.panel1 = new System.Windows.Forms.Panel();
this.tabPage4 = new System.Windows.Forms.TabPage();
this.panel2 = new System.Windows.Forms.Panel();
this.dgvOut1688Prod = new TemuKJD.UserComponent.DataGridViewEx();
this.chkSkip = new TemuKJD.UserComponent.UcCheckBox(this.components);
this.btnGetDetail = new DevComponents.DotNetBar.PanelEx();
this.dataGridViewCheckBoxColumn1 = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.colFileName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colOutSupplierId = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colOutSupplierName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colOutGoodsId = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colOutGoodsName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colOutCat = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colOutImgUrl = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colOutImg = new System.Windows.Forms.DataGridViewImageColumn();
this.colOutPrice = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colOutStock = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.dataGridViewLinkColumn1 = new System.Windows.Forms.DataGridViewLinkColumn();
this.colOutMsg = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.pnlMultiLogin.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
@@ -106,6 +127,9 @@ namespace TemuKJD.ToolForms
((System.ComponentModel.ISupportInitialize)(this.pbLoading)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dgvProduct)).BeginInit();
this.tabPage3.SuspendLayout();
this.tabPage4.SuspendLayout();
this.panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.dgvOut1688Prod)).BeginInit();
this.SuspendLayout();
//
// line1
@@ -257,9 +281,9 @@ namespace TemuKJD.ToolForms
this.btnSaveDb.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnSaveDb.DisabledBackColor = System.Drawing.Color.Empty;
this.btnSaveDb.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSaveDb.Location = new System.Drawing.Point(1321, 58);
this.btnSaveDb.Location = new System.Drawing.Point(1221, 58);
this.btnSaveDb.Name = "btnSaveDb";
this.btnSaveDb.Size = new System.Drawing.Size(76, 23);
this.btnSaveDb.Size = new System.Drawing.Size(86, 23);
this.btnSaveDb.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnSaveDb.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnSaveDb.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
@@ -281,9 +305,9 @@ namespace TemuKJD.ToolForms
this.btnStopStop.CanvasColor = System.Drawing.SystemColors.Control;
this.btnStopStop.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnStopStop.DisabledBackColor = System.Drawing.Color.Empty;
this.btnStopStop.Location = new System.Drawing.Point(1071, 58);
this.btnStopStop.Location = new System.Drawing.Point(1311, 58);
this.btnStopStop.Name = "btnStopStop";
this.btnStopStop.Size = new System.Drawing.Size(76, 23);
this.btnStopStop.Size = new System.Drawing.Size(86, 23);
this.btnStopStop.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnStopStop.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
this.btnStopStop.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
@@ -297,7 +321,7 @@ namespace TemuKJD.ToolForms
this.btnStopStop.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnStopStop.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White;
this.btnStopStop.TabIndex = 853;
this.btnStopStop.Text = "停止查询";
this.btnStopStop.Text = "停止查询/入库";
this.btnStopStop.Click += new System.EventHandler(this.btnStopStop_Click);
//
// chkOverride
@@ -376,9 +400,9 @@ namespace TemuKJD.ToolForms
this.btnGetGoods.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnGetGoods.DisabledBackColor = System.Drawing.Color.Empty;
this.btnGetGoods.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnGetGoods.Location = new System.Drawing.Point(1151, 58);
this.btnGetGoods.Location = new System.Drawing.Point(1041, 58);
this.btnGetGoods.Name = "btnGetGoods";
this.btnGetGoods.Size = new System.Drawing.Size(82, 23);
this.btnGetGoods.Size = new System.Drawing.Size(86, 23);
this.btnGetGoods.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnGetGoods.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnGetGoods.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
@@ -544,6 +568,7 @@ namespace TemuKJD.ToolForms
this.splitContainer1.Panel2.BackColor = System.Drawing.Color.White;
this.splitContainer1.Panel2.Controls.Add(this.chkSkip);
this.splitContainer1.Panel2.Controls.Add(this.btnGetDetail);
this.splitContainer1.Panel2.Controls.Add(this.btnStopStop);
this.splitContainer1.Panel2.Controls.Add(this.btnExportCookie);
this.splitContainer1.Panel2.Controls.Add(this.label7);
this.splitContainer1.Panel2.Controls.Add(this.txtWaitSeconds);
@@ -553,7 +578,6 @@ namespace TemuKJD.ToolForms
this.splitContainer1.Panel2.Controls.Add(this.txtTitle);
this.splitContainer1.Panel2.Controls.Add(this.btnSearchTitle);
this.splitContainer1.Panel2.Controls.Add(this.chkOverride);
this.splitContainer1.Panel2.Controls.Add(this.btnStopStop);
this.splitContainer1.Panel2.Controls.Add(this.btnSaveDb);
this.splitContainer1.Panel2.Controls.Add(this.statusBar);
this.splitContainer1.Panel2.Controls.Add(this.label4);
@@ -567,7 +591,7 @@ namespace TemuKJD.ToolForms
this.splitContainer1.Panel2.Controls.Add(this.label2);
this.splitContainer1.Panel2.Controls.Add(this.line1);
this.splitContainer1.Size = new System.Drawing.Size(1404, 561);
this.splitContainer1.SplitterDistance = 465;
this.splitContainer1.SplitterDistance = 469;
this.splitContainer1.SplitterWidth = 3;
this.splitContainer1.TabIndex = 4;
//
@@ -578,17 +602,19 @@ namespace TemuKJD.ToolForms
this.ucTabControlMetro1.Controls.Add(this.tabPage1);
this.ucTabControlMetro1.Controls.Add(this.tabPage2);
this.ucTabControlMetro1.Controls.Add(this.tabPage3);
this.ucTabControlMetro1.Controls.Add(this.tabPage4);
this.ucTabControlMetro1.Dock = System.Windows.Forms.DockStyle.Fill;
this.ucTabControlMetro1.ItemSize = new System.Drawing.Size(72, 24);
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, 465);
this.ucTabControlMetro1.Size = new System.Drawing.Size(1404, 469);
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;
this.ucTabControlMetro1.TabUnSelectTextColor = System.Drawing.Color.White;
this.ucTabControlMetro1.SelectedIndexChanged += new System.EventHandler(this.ucTabControlMetro1_SelectedIndexChanged);
//
// tabPage1
//
@@ -597,7 +623,7 @@ namespace TemuKJD.ToolForms
this.tabPage1.Margin = new System.Windows.Forms.Padding(5);
this.tabPage1.Name = "tabPage1";
this.tabPage1.Padding = new System.Windows.Forms.Padding(3);
this.tabPage1.Size = new System.Drawing.Size(1396, 433);
this.tabPage1.Size = new System.Drawing.Size(1396, 437);
this.tabPage1.TabIndex = 0;
this.tabPage1.Text = "商品页面";
this.tabPage1.UseVisualStyleBackColor = true;
@@ -616,7 +642,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, 427);
this.splitContainer2.Size = new System.Drawing.Size(1390, 431);
this.splitContainer2.SplitterDistance = 26;
this.splitContainer2.TabIndex = 6;
//
@@ -658,7 +684,7 @@ namespace TemuKJD.ToolForms
this.tabPage2.Location = new System.Drawing.Point(4, 28);
this.tabPage2.Name = "tabPage2";
this.tabPage2.Padding = new System.Windows.Forms.Padding(3);
this.tabPage2.Size = new System.Drawing.Size(1396, 433);
this.tabPage2.Size = new System.Drawing.Size(1396, 436);
this.tabPage2.TabIndex = 1;
this.tabPage2.Text = "采集商品列表";
this.tabPage2.UseVisualStyleBackColor = true;
@@ -667,7 +693,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, 189);
this.pbLoading.Location = new System.Drawing.Point(673, 191);
this.pbLoading.Name = "pbLoading";
this.pbLoading.Size = new System.Drawing.Size(50, 50);
this.pbLoading.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
@@ -718,7 +744,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, 427);
this.dgvProduct.Size = new System.Drawing.Size(1390, 430);
this.dgvProduct.TabIndex = 7;
this.dgvProduct.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvProduct_CellContentClick);
//
@@ -860,7 +886,7 @@ namespace TemuKJD.ToolForms
this.tabPage3.Location = new System.Drawing.Point(4, 28);
this.tabPage3.Name = "tabPage3";
this.tabPage3.Padding = new System.Windows.Forms.Padding(3);
this.tabPage3.Size = new System.Drawing.Size(1396, 432);
this.tabPage3.Size = new System.Drawing.Size(1396, 436);
this.tabPage3.TabIndex = 2;
this.tabPage3.Text = "1688地址管理";
this.tabPage3.UseVisualStyleBackColor = true;
@@ -870,9 +896,71 @@ namespace TemuKJD.ToolForms
this.panel1.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel1.Location = new System.Drawing.Point(3, 3);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(1390, 426);
this.panel1.Size = new System.Drawing.Size(1390, 430);
this.panel1.TabIndex = 0;
//
// tabPage4
//
this.tabPage4.Controls.Add(this.panel2);
this.tabPage4.Location = new System.Drawing.Point(4, 28);
this.tabPage4.Name = "tabPage4";
this.tabPage4.Padding = new System.Windows.Forms.Padding(3);
this.tabPage4.Size = new System.Drawing.Size(1396, 437);
this.tabPage4.TabIndex = 3;
this.tabPage4.Text = "1688外部数据";
this.tabPage4.UseVisualStyleBackColor = true;
//
// panel2
//
this.panel2.Controls.Add(this.dgvOut1688Prod);
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel2.Location = new System.Drawing.Point(3, 3);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(1390, 431);
this.panel2.TabIndex = 1;
//
// dgvOut1688Prod
//
this.dgvOut1688Prod.AllowUserToAddRows = false;
this.dgvOut1688Prod.AllowUserToDeleteRows = false;
dataGridViewCellStyle6.BackColor = System.Drawing.Color.WhiteSmoke;
this.dgvOut1688Prod.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle6;
this.dgvOut1688Prod.AutoRowNumber = true;
this.dgvOut1688Prod.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.dgvOut1688Prod.BackgroundColor = System.Drawing.Color.White;
this.dgvOut1688Prod.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.dgvOut1688Prod.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle7;
this.dgvOut1688Prod.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvOut1688Prod.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.dataGridViewCheckBoxColumn1,
this.colFileName,
this.colOutSupplierId,
this.colOutSupplierName,
this.colOutGoodsId,
this.colOutGoodsName,
this.colOutCat,
this.colOutImgUrl,
this.colOutImg,
this.colOutPrice,
this.colOutStock,
this.dataGridViewLinkColumn1,
this.colOutMsg});
this.dgvOut1688Prod.Dock = System.Windows.Forms.DockStyle.Fill;
this.dgvOut1688Prod.Location = new System.Drawing.Point(0, 0);
this.dgvOut1688Prod.MultiSelectCheckBox = true;
this.dgvOut1688Prod.Name = "dgvOut1688Prod";
this.dgvOut1688Prod.ReadOnly = true;
this.dgvOut1688Prod.RowTemplate.Height = 23;
this.dgvOut1688Prod.Size = new System.Drawing.Size(1390, 431);
this.dgvOut1688Prod.TabIndex = 839;
//
// chkSkip
//
this.chkSkip.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
@@ -893,9 +981,9 @@ namespace TemuKJD.ToolForms
this.btnGetDetail.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnGetDetail.DisabledBackColor = System.Drawing.Color.Empty;
this.btnGetDetail.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnGetDetail.Location = new System.Drawing.Point(1236, 58);
this.btnGetDetail.Location = new System.Drawing.Point(1131, 58);
this.btnGetDetail.Name = "btnGetDetail";
this.btnGetDetail.Size = new System.Drawing.Size(82, 23);
this.btnGetDetail.Size = new System.Drawing.Size(86, 23);
this.btnGetDetail.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnGetDetail.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnGetDetail.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
@@ -911,6 +999,111 @@ namespace TemuKJD.ToolForms
this.btnGetDetail.Text = "采集商品详情";
this.btnGetDetail.Click += new System.EventHandler(this.btnGetDetail_Click);
//
// dataGridViewCheckBoxColumn1
//
this.dataGridViewCheckBoxColumn1.FillWeight = 26F;
this.dataGridViewCheckBoxColumn1.HeaderText = "选";
this.dataGridViewCheckBoxColumn1.Name = "dataGridViewCheckBoxColumn1";
this.dataGridViewCheckBoxColumn1.ReadOnly = true;
this.dataGridViewCheckBoxColumn1.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.dataGridViewCheckBoxColumn1.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
//
// colFileName
//
this.colFileName.FillWeight = 150F;
this.colFileName.HeaderText = "文件名称";
this.colFileName.Name = "colFileName";
this.colFileName.ReadOnly = true;
//
// colOutSupplierId
//
this.colOutSupplierId.FillWeight = 50F;
this.colOutSupplierId.HeaderText = "供应商Id";
this.colOutSupplierId.Name = "colOutSupplierId";
this.colOutSupplierId.ReadOnly = true;
//
// colOutSupplierName
//
this.colOutSupplierName.FillWeight = 90F;
this.colOutSupplierName.HeaderText = "供应商名称";
this.colOutSupplierName.Name = "colOutSupplierName";
this.colOutSupplierName.ReadOnly = true;
//
// colOutGoodsId
//
this.colOutGoodsId.FillWeight = 50F;
this.colOutGoodsId.HeaderText = "商品Id";
this.colOutGoodsId.Name = "colOutGoodsId";
this.colOutGoodsId.ReadOnly = true;
//
// colOutGoodsName
//
dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colOutGoodsName.DefaultCellStyle = dataGridViewCellStyle8;
this.colOutGoodsName.FillWeight = 150F;
this.colOutGoodsName.HeaderText = "商品名称";
this.colOutGoodsName.Name = "colOutGoodsName";
this.colOutGoodsName.ReadOnly = true;
//
// colOutCat
//
this.colOutCat.FillWeight = 40F;
this.colOutCat.HeaderText = "商品类目";
this.colOutCat.Name = "colOutCat";
this.colOutCat.ReadOnly = true;
//
// colOutImgUrl
//
this.colOutImgUrl.FillWeight = 300F;
this.colOutImgUrl.HeaderText = "图片路径";
this.colOutImgUrl.Name = "colOutImgUrl";
this.colOutImgUrl.ReadOnly = true;
this.colOutImgUrl.Visible = false;
//
// colOutImg
//
this.colOutImg.FillWeight = 40F;
this.colOutImg.HeaderText = "图片";
this.colOutImg.ImageLayout = System.Windows.Forms.DataGridViewImageCellLayout.Zoom;
this.colOutImg.Name = "colOutImg";
this.colOutImg.ReadOnly = true;
this.colOutImg.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colOutImg.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
//
// colOutPrice
//
dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colOutPrice.DefaultCellStyle = dataGridViewCellStyle9;
this.colOutPrice.FillWeight = 40F;
this.colOutPrice.HeaderText = "供货价";
this.colOutPrice.Name = "colOutPrice";
this.colOutPrice.ReadOnly = true;
//
// colOutStock
//
this.colOutStock.FillWeight = 50F;
this.colOutStock.HeaderText = "库存";
this.colOutStock.Name = "colOutStock";
this.colOutStock.ReadOnly = true;
this.colOutStock.Visible = false;
//
// dataGridViewLinkColumn1
//
this.dataGridViewLinkColumn1.FillWeight = 35F;
this.dataGridViewLinkColumn1.HeaderText = "删除";
this.dataGridViewLinkColumn1.Name = "dataGridViewLinkColumn1";
this.dataGridViewLinkColumn1.ReadOnly = true;
this.dataGridViewLinkColumn1.Visible = false;
//
// colOutMsg
//
dataGridViewCellStyle10.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colOutMsg.DefaultCellStyle = dataGridViewCellStyle10;
this.colOutMsg.FillWeight = 160F;
this.colOutMsg.HeaderText = "操作结果";
this.colOutMsg.Name = "colOutMsg";
this.colOutMsg.ReadOnly = true;
//
// Get1688ProductForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -937,6 +1130,9 @@ namespace TemuKJD.ToolForms
((System.ComponentModel.ISupportInitialize)(this.pbLoading)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dgvProduct)).EndInit();
this.tabPage3.ResumeLayout(false);
this.tabPage4.ResumeLayout(false);
this.panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.dgvOut1688Prod)).EndInit();
this.ResumeLayout(false);
}
@@ -1000,5 +1196,21 @@ namespace TemuKJD.ToolForms
private System.Windows.Forms.DataGridViewTextBoxColumn colMsg;
private System.Windows.Forms.TabPage tabPage3;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.TabPage tabPage4;
private System.Windows.Forms.Panel panel2;
private UserComponent.DataGridViewEx dgvOut1688Prod;
private System.Windows.Forms.DataGridViewCheckBoxColumn dataGridViewCheckBoxColumn1;
private System.Windows.Forms.DataGridViewTextBoxColumn colFileName;
private System.Windows.Forms.DataGridViewTextBoxColumn colOutSupplierId;
private System.Windows.Forms.DataGridViewTextBoxColumn colOutSupplierName;
private System.Windows.Forms.DataGridViewTextBoxColumn colOutGoodsId;
private System.Windows.Forms.DataGridViewTextBoxColumn colOutGoodsName;
private System.Windows.Forms.DataGridViewTextBoxColumn colOutCat;
private System.Windows.Forms.DataGridViewTextBoxColumn colOutImgUrl;
private System.Windows.Forms.DataGridViewImageColumn colOutImg;
private System.Windows.Forms.DataGridViewTextBoxColumn colOutPrice;
private System.Windows.Forms.DataGridViewTextBoxColumn colOutStock;
private System.Windows.Forms.DataGridViewLinkColumn dataGridViewLinkColumn1;
private System.Windows.Forms.DataGridViewTextBoxColumn colOutMsg;
}
}
+408 -147
View File
@@ -16,6 +16,7 @@ using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
@@ -48,7 +49,7 @@ namespace TemuKJD.ToolForms
private string currentGet1688ListProductData = "";
private string appVersion = "";
private string currentSupplierId = "";
int getDetailWait = 1;
int getDetailWait = 5;
int pageStart = 1;
int pageEnd = 9999;
ConcurrentList<_1688OneProductListInfo> lst1688OneProductListInfo = new ConcurrentList<_1688OneProductListInfo>();
@@ -63,6 +64,7 @@ namespace TemuKJD.ToolForms
this.splitContainer1.SplitterDistance = 472;
this.dgvProduct.AddSelectorColumn("colCheck");
this.dgvProduct.AddImgColumn("colImg", "colImgUrl");
this.dgvOut1688Prod.AddImgColumn("colOutImg", "colOutImgUrl");
lst1688cookie = NaiBa.Util.Helper.ConfigHelper.LoadConfig<List<Cookie>>("1688_cookies");
if (lst1688cookie == null)
@@ -227,9 +229,15 @@ namespace TemuKJD.ToolForms
Task.Run(() => { GetCurrent1688SearchData(postData, responseData, request); });
}
//if (url.Contains("https://detail.1688.com/offer/"))
//{
// Task.Run(() => { currentDetailData = responseData; });
//}
if (url.Contains("https://detail.1688.com/offer/"))
{
Task.Run(() => { currentDetailData = responseData; });
var dataTmp = responseData;
if (dataTmp.Contains("specId"))
Task.Run(() => { currentDetailData = dataTmp; });
}
if (responseData.Contains("赛龙宠物"))
@@ -621,24 +629,34 @@ namespace TemuKJD.ToolForms
currentDetailData = "";
//var get1688DetailRst = Get1688DetailData(shop, prod);
string url = "https://detail.1688.com/offer/" + prod.offerId + ".html?fxcv=2&sk=consign";
//string url = "https://detail.1688.com/offer/" + prod.offerId + ".html";
this.cefWebBrowser.Load(url);
// 额外休眠
Thread.Sleep(Math.Max(3, getDetailWait) * 1000);
for (int i = 0; i < 20; i++)
{
if (string.IsNullOrEmpty(currentDetailData))
{
Thread.Sleep(500);
}
}
string get1688DetailRst = currentDetailData;
//Invoke(new Action(() => { this.ucTabControlMetro1.SelectedIndex = 0; }));
if (!get1688DetailRst.Contains("\"success\":true"))
if (!get1688DetailRst.Contains("\"success\":true") && !get1688DetailRst.Contains("\"specId\":\""))
{
if (get1688DetailRst.Contains("___tmd___") || get1688DetailRst.Contains("___TMD___"))
{
Invoke(new Action(() => { this.ucTabControlMetro1.SelectedIndex = 0; }));
//Invoke(new Action(() => { this.ucTabControlMetro1.SelectedIndex = 0; }));
Thread.Sleep(5000);
}
var errMsg = BaseRegex.GetStringJson(ref get1688DetailRst, "message");
if (string.IsNullOrEmpty(errMsg))
errMsg = get1688DetailRst;
if (errMsg.Length > 500)
errMsg = errMsg.Substring(0, 500);
prod.getProductMsg = "采集失败 " + errMsg;
Invoke(new Action(() =>
{
@@ -784,169 +802,176 @@ namespace TemuKJD.ToolForms
private void btnSaveDb_Click(object sender, EventArgs e)
{
//"&product_get_type=" + HttpUtility.UrlEncode("厂商直采", Encoding.UTF8);
List<Cookie> cookieList = CEFBrowser.GetCookieList(".scm121.com", cefWebBrowser.GetCookieManager(null));
var shop = new ShopLoginInfo();
shop.Cookies = JsonHelper.SerializeObject(cookieList);
List<DataGridViewRow> rowLst = new List<DataGridViewRow>();
rowLst.AddRange(dgvProduct.Rows.Cast<DataGridViewRow>().Where(r => r.Cells["colCheck"].Value.ParseToBool() == true));
if (cancellationTokenSource != null && cancellationTokenSource.IsCancellationRequested)
cancellationTokenSource.Cancel();
cancellationTokenSource = new CancellationTokenSource();
this.pbLoading.Visible = true;
var t = Task.Run(() =>
if (btnSaveDb.Text == "商品入库")
{
int success = 0;
int total = rowLst.Count;
foreach (var row in rowLst)
//"&product_get_type=" + HttpUtility.UrlEncode("厂商直采", Encoding.UTF8);
List<Cookie> cookieList = CEFBrowser.GetCookieList(".scm121.com", cefWebBrowser.GetCookieManager(null));
var shop = new ShopLoginInfo();
shop.Cookies = JsonHelper.SerializeObject(cookieList);
List<DataGridViewRow> rowLst = new List<DataGridViewRow>();
rowLst.AddRange(dgvProduct.Rows.Cast<DataGridViewRow>().Where(r => r.Cells["colCheck"].Value.ParseToBool() == true));
if (cancellationTokenSource != null && cancellationTokenSource.IsCancellationRequested)
cancellationTokenSource.Cancel();
cancellationTokenSource = new CancellationTokenSource();
this.pbLoading.Visible = true;
var t = Task.Run(() =>
{
if (cancellationTokenSource.IsCancellationRequested)
break;
Invoke(new Action(() =>
int success = 0;
int total = rowLst.Count;
foreach (var row in rowLst)
{
row.Cells["colMsg"].Value = "";
}));
if (cancellationTokenSource.IsCancellationRequested)
break;
Invoke(new Action(() =>
{
this.statusBar.lblTaskStatus.Text = "正在入库表格第 " + (row.Index + 1) + " 行数据 成功 " + success + " 条";
}));
var prodId = row.Cells["colProductId"].Value.ParseToString();
var prod = lst1688OneProductListInfo.FirstOrDefault(c => c.offerId.ParseToString() == prodId);
if (prod == null || prod.dbProduct == null || prod.dbProduct.product_json.Length < 10)
continue;
var dbProd = prod.dbProduct;
if (!chkOverride.Checked && !prod.getProductMsg.IsNullOrEmpty())
{
if (prod.getProductMsg.Contains("已存在相同Id商品") || prod.getProductMsg.Contains("商品覆盖成功") || prod.getProductMsg.Contains("商品入库成功"))
{
//已存在相同Id商品,跳过
//商品覆盖成功!
//商品入库成功!
prod.getProductMsg = "已存在相同Id商品,跳过";
Invoke(new Action(() =>
{
row.Cells["colMsg"].Value = prod.getProductMsg;
}));
success++;
continue;
}
}
Thread.Sleep(25);
if (row.Index % 20 == 0)
NaiBa.Util.Helper.ConfigHelper.SaveConfig("1688_product_list_" + MainForm.ProcessCount, lst1688OneProductListInfo);
bool isExist = false;
var existUrl = BaseClass.BuildPDDObjString("product/get_product_spu_id_list");
string existData = UserLogin.GetSignaturex() + "&search_spu_ids=" + prod.offerId;
string html = GetHtml.PostUtf8(existUrl, existData);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
html = GetHtml.PostUtf8(existUrl, existData);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
{
Invoke(new Action(() =>
{
row.Cells["colMsg"].Value = "入库失败,产品数据库连接失败";
row.Cells["colMsg"].Value = "";
}));
continue;
}
else
{
if (html.Contains("\"data\":[") && !html.Contains("\"data\":[]"))
isExist = true;
}
//var SetPartnerSpuRst = "";
var url = BaseClass.BuildPDDObjString("product/add_product");
if (isExist)
{
if (chkOverride.Checked)
Invoke(new Action(() =>
{
url = BaseClass.BuildPDDObjString("product/mdy_product");
this.statusBar.lblTaskStatus.Text = "正在入库表格第 " + (row.Index + 1) + " 行数据 成功 " + success + " 条";
}));
var prodId = row.Cells["colProductId"].Value.ParseToString();
var prod = lst1688OneProductListInfo.FirstOrDefault(c => c.offerId.ParseToString() == prodId);
if (prod == null || prod.dbProduct == null || prod.dbProduct.product_json.Length < 10)
continue;
var dbProd = prod.dbProduct;
if (!chkOverride.Checked && !prod.getProductMsg.IsNullOrEmpty())
{
if (prod.getProductMsg.Contains("已存在相同Id商品") || prod.getProductMsg.Contains("商品覆盖成功") || prod.getProductMsg.Contains("商品入库成功"))
{
//已存在相同Id商品,跳过
//商品覆盖成功!
//商品入库成功!
prod.getProductMsg = "已存在相同Id商品,跳过";
Invoke(new Action(() =>
{
row.Cells["colMsg"].Value = prod.getProductMsg;
}));
success++;
continue;
}
}
Thread.Sleep(25);
if (row.Index % 20 == 0)
NaiBa.Util.Helper.ConfigHelper.SaveConfig("1688_product_list_" + MainForm.ProcessCount, lst1688OneProductListInfo);
bool isExist = false;
var existUrl = BaseClass.BuildPDDObjString("product/get_product_spu_id_list");
string existData = UserLogin.GetSignaturex() + "&search_spu_ids=" + prod.offerId;
string html = GetHtml.PostUtf8(existUrl, existData);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
html = GetHtml.PostUtf8(existUrl, existData);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
{
Invoke(new Action(() =>
{
row.Cells["colMsg"].Value = "入库失败,产品数据库连接失败";
}));
continue;
}
else
{
//入库成功 已存在相同id商品
prod.getProductMsg = "已存在相同SkuId,跳过";
if (html.Contains("\"data\":[") && !html.Contains("\"data\":[]"))
isExist = true;
}
//var SetPartnerSpuRst = "";
var url = BaseClass.BuildPDDObjString("product/add_product");
if (isExist)
{
if (chkOverride.Checked)
{
url = BaseClass.BuildPDDObjString("product/mdy_product");
}
else
{
//入库成功 已存在相同id商品
prod.getProductMsg = "已存在相同id商品,跳过";
Invoke(new Action(() =>
{
row.Cells["colMsg"].Value = prod.getProductMsg;
}));
success++;
continue;
}
}
var data = Work.UserLogin.GetSignaturex() +
"&from_shop_id=" + prod.dbProduct.from_shop_id +
"&from_shop_name=" + prod.dbProduct.from_shop_name +
//"&offline_supplier_id=" + prod.dbProduct.offline_supplier_id +
//"&offline_supplier_name=" + prod.dbProduct.offline_supplier_name +
"&spu_id=" + prod.dbProduct.spu_id.ParseToString() +
"&skc_id=" + prod.dbProduct.skc_id.ParseToString() +
"&price_text=" + prod.dbProduct.price_text +
"&ext_code=" + HttpUtility.UrlEncode(prod.dbProduct.ext_code, Encoding.UTF8) +
"&product_name=" + HttpUtility.UrlEncode(prod.dbProduct.product_name, Encoding.UTF8) +
"&product_json=" + HttpUtility.UrlEncode(dbProd.product_json, Encoding.UTF8) +
"&size_json=" + HttpUtility.UrlEncode(dbProd.size_json, Encoding.UTF8) +
"&sale_count=" + dbProd.sale_count +
"&sale_count_text=" + HttpUtility.UrlEncode(dbProd.sale_count_text, Encoding.UTF8) +
"&main_img=" + HttpUtility.UrlEncode(dbProd.main_img, Encoding.UTF8) +
"&wx_safe_status=" + HttpUtility.UrlEncode("未校验", Encoding.UTF8) +
"&product_get_type=" + HttpUtility.UrlEncode("1688厂家", Encoding.UTF8);
if (!isExist)
{
data += "&main_cat_id=" + prod.dbProduct.main_cat_id +
"&main_cat_name=" + HttpUtility.UrlEncode(prod.dbProduct.main_cat_name.ParseToString(), Encoding.UTF8) +
"&cat_id=" + prod.dbProduct.cat_id +
"&cat_name=" + HttpUtility.UrlEncode((prod.dbProduct.cat_name ?? prod.dbProduct.cat_name).ParseToString(), Encoding.UTF8);
}
if (1 == 1)
{
//1688没有分销,但是聚水潭上货条件要判断1是否类目识别 2是否服务端加密 3是否分销
//作为1688和聚水潭一致的上货必备条件,此处1688分销直接设置为1
prod.dbProduct.distribution_set = 1;
data += "&distribution_set=1";
}
html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
{
string msg = "商品入库失败!请检查网络连接:" + BaseRegex.GetStringJson(ref html, "msg");
Invoke(new Action(() =>
{
row.Cells["colMsg"].Value = msg;
}));
}
else
{
success++;
prod.getProductMsg = "商品入库成功!";
if (url == BaseClass.BuildPDDObjString("product/mdy_product"))
prod.getProductMsg = "商品覆盖成功!";
Invoke(new Action(() =>
{
row.Cells["colMsg"].Value = prod.getProductMsg;
}));
success++;
continue;
}
}
NaiBa.Util.Helper.ConfigHelper.SaveConfig("1688_product_list_" + MainForm.ProcessCount, lst1688OneProductListInfo);
var data = Work.UserLogin.GetSignaturex() +
"&from_shop_id=" + prod.dbProduct.from_shop_id +
"&from_shop_name=" + prod.dbProduct.from_shop_name +
//"&offline_supplier_id=" + prod.dbProduct.offline_supplier_id +
//"&offline_supplier_name=" + prod.dbProduct.offline_supplier_name +
"&spu_id=" + prod.dbProduct.spu_id.ParseToString() +
"&skc_id=" + prod.dbProduct.skc_id.ParseToString() +
"&price_text=" + prod.dbProduct.price_text +
"&ext_code=" + HttpUtility.UrlEncode(prod.dbProduct.ext_code, Encoding.UTF8) +
"&product_name=" + HttpUtility.UrlEncode(prod.dbProduct.product_name, Encoding.UTF8) +
"&product_json=" + HttpUtility.UrlEncode(dbProd.product_json, Encoding.UTF8) +
"&size_json=" + HttpUtility.UrlEncode(dbProd.size_json, Encoding.UTF8) +
"&sale_count=" + dbProd.sale_count +
"&sale_count_text=" + HttpUtility.UrlEncode(dbProd.sale_count_text, Encoding.UTF8) +
"&main_img=" + HttpUtility.UrlEncode(dbProd.main_img, Encoding.UTF8) +
"&wx_safe_status=" + HttpUtility.UrlEncode("未校验", Encoding.UTF8) +
"&product_get_type=" + HttpUtility.UrlEncode("1688厂家", Encoding.UTF8);
if (!isExist)
Invoke(new Action(() =>
{
data += "&main_cat_id=" + prod.dbProduct.main_cat_id +
"&main_cat_name=" + HttpUtility.UrlEncode(prod.dbProduct.main_cat_name.ParseToString(), Encoding.UTF8) +
"&cat_id=" + prod.dbProduct.cat_id +
"&cat_name=" + HttpUtility.UrlEncode((prod.dbProduct.cat_name ?? prod.dbProduct.cat_name).ParseToString(), Encoding.UTF8);
}
if (1 == 1)
{
//1688没有分销,但是聚水潭上货条件要判断1是否类目识别 2是否服务端加密 3是否分销
//作为1688和聚水潭一致的上货必备条件,此处1688分销直接设置为1
prod.dbProduct.distribution_set = 1;
data += "&distribution_set=1";
}
html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
{
string msg = "商品入库失败!请检查网络连接:" + BaseRegex.GetStringJson(ref html, "msg");
Invoke(new Action(() =>
{
row.Cells["colMsg"].Value = msg;
}));
}
else
{
success++;
prod.getProductMsg = "商品入库成功!";
if (url == BaseClass.BuildPDDObjString("product/mdy_product"))
prod.getProductMsg = "商品覆盖成功!";
Invoke(new Action(() =>
{
row.Cells["colMsg"].Value = prod.getProductMsg;
}));
}
}
NaiBa.Util.Helper.ConfigHelper.SaveConfig("1688_product_list_" + MainForm.ProcessCount, lst1688OneProductListInfo);
Invoke(new Action(() =>
{
this.pbLoading.Visible = false;
BaseMsgForm.ShowInfo("商品入库完毕!");
}));
}, cancellationTokenSource.Token);
this.pbLoading.Visible = false;
BaseMsgForm.ShowInfo("商品入库完毕!");
}));
}, cancellationTokenSource.Token);
}
else if (btnSaveDb.Text == "外部商品入库")
{
Out1688ProductImport();
}
}
@@ -1102,5 +1127,241 @@ namespace TemuKJD.ToolForms
if (CancelReturn != null)
CancelReturn.Cancel();
}
private void ucTabControlMetro1_SelectedIndexChanged(object sender, EventArgs e)
{
if (ucTabControlMetro1.SelectedTab.Text == "1688外部数据")
{
btnSaveDb.Text = "外部商品入库";
btnGetDetail.Visible = false;
btnGetGoods.Visible = false;
}
else
{
btnSaveDb.Text = "商品入库";
btnGetDetail.Visible = true;
btnGetGoods.Visible = true;
}
}
void Out1688ProductImport()
{
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.Multiselect = true;
// 设置过滤条件,只显示文本文件
openFileDialog.Filter = "文本文件 (*.txt)|*.txt|All files (*.*)|*.*";
// 显示对话框并获取结果
if (openFileDialog.ShowDialog() == DialogResult.OK)
{
var filePathLst = openFileDialog.FileNames.ToList();
dgvOut1688Prod.Rows.Clear();
pbLoading.Visible = true;
this.statusBar.pgbTaskProgress.Maximum = filePathLst.Count;
this.statusBar.UpdateProgressBar(0);
Task.Run(() =>
{
int successNum = 0;
int failedNum = 0;
foreach (var path in filePathLst)
{
string content = "";
string rst = "";
try
{
using (StreamReader sr = new StreamReader(path))
{
content = sr.ReadToEnd();
}
rst = Out1688ProdImportOne(path, content);
Thread.Sleep(100);
}
catch (Exception ex)
{
rst = ex.Message;
}
if (string.IsNullOrEmpty(rst))
successNum++;
else
failedNum++;
Invoke(new Action(() =>
{
this.statusBar.UpdateProgressBar(this.statusBar.pgbTaskProgress.Value + 1);
this.statusBar.lblTaskStatus.Text = "正在导入";
}));
}
Invoke(new Action(() =>
{
pbLoading.Visible = false;
this.statusBar.lblTaskStatus.Text = "导入完成";
BaseMsgForm.ShowInfo("导入完成!");
}));
});
}
}
string Out1688ProdImportOne(string filePath, string content)
{
DataGridViewRow row = null;
Invoke(new Action(() =>
{
var index = dgvOut1688Prod.Rows.Add(false, filePath);
row = dgvOut1688Prod.Rows[index];
row.Height = 60;
}));
try
{
if (string.IsNullOrEmpty(content) || content.Length < 10)
return "商品数据为空";
KJDDBProduct dbProd = new KJDDBProduct();
dbProd.product_get_type_text = "1688外部数据";
dbProd.product_json = content;
dbProd.size_json = "{}";
_1688OutProductInfo outProd = JsonHelper.DeserializeJsonToObject<_1688OutProductInfo>(content);
string convertRst = "";
var prodInfo = new PDDProdFormConverter()._1688OutToPddConvert(out convertRst, dbProd);
if (!string.IsNullOrEmpty(convertRst))
return convertRst;
Thread.Sleep(25);
//if (row.Index % 20 == 0)
// NaiBa.Util.Helper.ConfigHelper.SaveConfig("1688_product_list_" + MainForm.ProcessCount, lst1688OneProductListInfo);
bool isExist = false;
var existUrl = BaseClass.BuildPDDObjString("product/get_product_spu_id_list");
string existData = UserLogin.GetSignaturex() + "&search_spu_ids=" + outProd.productId;
string html = GetHtml.PostUtf8(existUrl, existData);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
html = GetHtml.PostUtf8(existUrl, existData);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
{
Invoke(new Action(() =>
{
row.Cells["colOutMsg"].Value = "入库失败,产品数据库连接失败";
}));
return "入库失败,产品数据库连接失败";
}
else
{
if (html.Contains("\"data\":[") && !html.Contains("\"data\":[]"))
isExist = true;
}
var priceMin = (prodInfo.detail.sku?.Min(x => x.multi_price)).ParseToInt() * 0.01m;
var priceMax = (prodInfo.detail.sku?.Max(x => x.multi_price)).ParseToInt() * 0.01m;
Invoke(new Action(() =>
{
row.Cells["colOutSupplierId"].Value = (string.IsNullOrEmpty(outProd.shopId) ? outProd.shopName : outProd.shopId);
row.Cells["colOutSupplierName"].Value = outProd.shopName;
row.Cells["colOutGoodsId"].Value = prodInfo.detail.goods_id.ParseToString();
row.Cells["colOutGoodsName"].Value = prodInfo.detail.goods_name;
row.Cells["colOutCat"].Value = outProd.categoryName;
row.Cells["colOutImgUrl"].Value = prodInfo.detail.image_url;
row.Cells["colOutPrice"].Value = priceMin + "-" + priceMax;
}));
//var SetPartnerSpuRst = "";
var url = BaseClass.BuildPDDObjString("product/add_product");
if (isExist)
{
if (chkOverride.Checked)
{
url = BaseClass.BuildPDDObjString("product/mdy_product");
}
else
{
//入库成功 已存在相同id商品
Invoke(new Action(() =>
{
row.Cells["colOutMsg"].Value = "已存在相同商品Id,跳过";
}));
return "";
}
}
if (outProd.minOrderQuaitity.ParseToInt() > 1)
{
//Invoke(new Action(() =>
//{
// row.Cells["colOutMsg"].Value = "起批数量超过1,跳过";
//}));
//return "起批数量超过1,跳过";
}
var data = Work.UserLogin.GetSignaturex() +
"&from_shop_id=" + (string.IsNullOrEmpty(outProd.shopId) ? outProd.shopName : outProd.shopId) +
"&from_shop_name=" + outProd.shopName +
//"&offline_supplier_id=" + prod.dbProduct.offline_supplier_id +
//"&offline_supplier_name=" + prod.dbProduct.offline_supplier_name +
"&spu_id=" + prodInfo.detail.goods_id.ParseToString() +
"&skc_id=" + prodInfo.detail.goods_id.ParseToString() +
"&price_text=" + priceMin + "-" + priceMax +
"&ext_code=" + HttpUtility.UrlEncode(prodInfo.detail.out_goods_sn, Encoding.UTF8) +
"&product_name=" + HttpUtility.UrlEncode(prodInfo.detail.goods_name, Encoding.UTF8) +
"&product_json=" + HttpUtility.UrlEncode(content, Encoding.UTF8) +
"&size_json=" + HttpUtility.UrlEncode(dbProd.size_json, Encoding.UTF8) +
"&sale_count=" + dbProd.sale_count +
"&sale_count_text=" + HttpUtility.UrlEncode(dbProd.sale_count_text, Encoding.UTF8) +
"&main_img=" + HttpUtility.UrlEncode(prodInfo.detail.image_url, Encoding.UTF8) +
"&wx_safe_status=" + HttpUtility.UrlEncode("未校验", Encoding.UTF8) +
"&product_get_type=" + HttpUtility.UrlEncode("1688外部数据", Encoding.UTF8);
if (!isExist)
{
data += "&main_cat_id=" + "" +
"&main_cat_name=" + "" +
"&cat_id=" + outProd.categoryId +
"&cat_name=" + HttpUtility.UrlEncode(outProd.categoryName, Encoding.UTF8);
}
if (1 == 1)
{
//1688没有分销,但是聚水潭上货条件要判断1是否类目识别 2是否服务端加密 3是否分销
//作为1688和聚水潭一致的上货必备条件,此处1688分销直接设置为1
//dbProd.distribution_set = 1;
//data += "&distribution_set=1";
}
html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
{
string msg = "商品入库失败!请检查网络连接:" + BaseRegex.GetStringJson(ref html, "msg");
Invoke(new Action(() =>
{
row.Cells["colOutMsg"].Value = msg;
}));
return msg;
}
else
{
var getProductMsg = "商品入库成功!";
if (url == BaseClass.BuildPDDObjString("product/mdy_product"))
getProductMsg = "商品覆盖成功!";
Invoke(new Action(() =>
{
row.Cells["colOutMsg"].Value = getProductMsg;
}));
}
//NaiBa.Util.Helper.ConfigHelper.SaveConfig("1688_product_list_" + MainForm.ProcessCount, lst1688OneProductListInfo);
}
catch (Exception ex)
{
Invoke(new Action(() =>
{
row.Cells["colOutMsg"].Value = "商品入库失败" + ex.Message;
}));
return "商品入库失败" + ex.Message;
}
return "";
}
}
}
+39
View File
@@ -168,4 +168,43 @@
<metadata name="colMsg.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="dataGridViewCheckBoxColumn1.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colFileName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colOutSupplierId.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colOutSupplierName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colOutGoodsId.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colOutGoodsName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colOutCat.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colOutImgUrl.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colOutImg.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colOutPrice.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colOutStock.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="colOutMsg.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>