书籍类目采集和入库
This commit is contained in:
1 parent
6ce238ca01
commit
dbc954a200
19 files changed
+664
-1205
No files matched your search
+110
-82
@@ -40,7 +40,6 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle();
|
||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||
this.ucGroupBoxEx2 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components);
|
||||
this.并发上传 = new DevComponents.DotNetBar.PanelEx();
|
||||
this.chkSkipUploaded = new TemuKJD.UserComponent.UcCheckBox(this.components);
|
||||
this.chkSameSpecPrice = new TemuKJD.UserComponent.UcCheckBox(this.components);
|
||||
this.label5 = new System.Windows.Forms.Label();
|
||||
@@ -71,8 +70,9 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
this.label4 = new System.Windows.Forms.Label();
|
||||
this.label9 = new System.Windows.Forms.Label();
|
||||
this.chkStepAddPrice = new TemuKJD.UserComponent.UcCheckBox(this.components);
|
||||
this.chkUpDraft = new TemuKJD.UserComponent.UcCheckBox(this.components);
|
||||
this.ucGroupBoxEx4 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components);
|
||||
this.cmbSpProdType = new System.Windows.Forms.ComboBox();
|
||||
this.label17 = new System.Windows.Forms.Label();
|
||||
this.cmbWxSafe = new System.Windows.Forms.ComboBox();
|
||||
this.label13 = new System.Windows.Forms.Label();
|
||||
this.cmbSourceType = new System.Windows.Forms.ComboBox();
|
||||
@@ -107,9 +107,11 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
this.colUploadCount = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.colRemaining = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.colMessage = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
this.并发上传 = new DevComponents.DotNetBar.PanelEx();
|
||||
this.pbLoading = new System.Windows.Forms.PictureBox();
|
||||
this.label11 = new System.Windows.Forms.Label();
|
||||
this.txtSinglePriceAdd = new System.Windows.Forms.TextBox();
|
||||
this.chkUpDraft = new TemuKJD.UserComponent.UcCheckBox(this.components);
|
||||
this.dgvSelectProduct = new TemuKJD.UserComponent.DataGridViewEx();
|
||||
this.colCheck = new System.Windows.Forms.DataGridViewCheckBoxColumn();
|
||||
this.colSelectId = new System.Windows.Forms.DataGridViewTextBoxColumn();
|
||||
@@ -182,7 +184,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
//
|
||||
this.splitContainer1.Panel2.Controls.Add(this.splitContainer3);
|
||||
this.splitContainer1.Size = new System.Drawing.Size(1523, 546);
|
||||
this.splitContainer1.SplitterDistance = 140;
|
||||
this.splitContainer1.SplitterDistance = 150;
|
||||
this.splitContainer1.TabIndex = 11;
|
||||
//
|
||||
// ucGroupBoxEx2
|
||||
@@ -220,37 +222,11 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
this.ucGroupBoxEx2.Controls.Add(this.chkStepAddPrice);
|
||||
this.ucGroupBoxEx2.Location = new System.Drawing.Point(459, 2);
|
||||
this.ucGroupBoxEx2.Name = "ucGroupBoxEx2";
|
||||
this.ucGroupBoxEx2.Size = new System.Drawing.Size(1062, 140);
|
||||
this.ucGroupBoxEx2.Size = new System.Drawing.Size(1062, 150);
|
||||
this.ucGroupBoxEx2.TabIndex = 667;
|
||||
this.ucGroupBoxEx2.TabStop = false;
|
||||
this.ucGroupBoxEx2.Text = "商品上传";
|
||||
//
|
||||
// 并发上传
|
||||
//
|
||||
this.并发上传.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.并发上传.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
|
||||
this.并发上传.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
this.并发上传.DisabledBackColor = System.Drawing.Color.Empty;
|
||||
this.并发上传.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.并发上传.Location = new System.Drawing.Point(1093, 30);
|
||||
this.并发上传.Name = "并发上传";
|
||||
this.并发上传.Size = new System.Drawing.Size(118, 23);
|
||||
this.并发上传.Style.Alignment = System.Drawing.StringAlignment.Center;
|
||||
this.并发上传.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
|
||||
this.并发上传.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
|
||||
this.并发上传.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
|
||||
this.并发上传.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
|
||||
this.并发上传.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
|
||||
this.并发上传.Style.ForeColor.Color = System.Drawing.Color.White;
|
||||
this.并发上传.Style.GradientAngle = 90;
|
||||
this.并发上传.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
|
||||
this.并发上传.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
|
||||
this.并发上传.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
|
||||
this.并发上传.TabIndex = 768;
|
||||
this.并发上传.Text = "测试并发上传";
|
||||
this.并发上传.Visible = false;
|
||||
this.并发上传.Click += new System.EventHandler(this.并发上传_Click);
|
||||
//
|
||||
// chkSkipUploaded
|
||||
//
|
||||
this.chkSkipUploaded.AutoSize = true;
|
||||
@@ -396,7 +372,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
// chkAddMorePriceFirst
|
||||
//
|
||||
this.chkAddMorePriceFirst.AutoSize = true;
|
||||
this.chkAddMorePriceFirst.Location = new System.Drawing.Point(213, 111);
|
||||
this.chkAddMorePriceFirst.Location = new System.Drawing.Point(213, 121);
|
||||
this.chkAddMorePriceFirst.Name = "chkAddMorePriceFirst";
|
||||
this.chkAddMorePriceFirst.Size = new System.Drawing.Size(111, 21);
|
||||
this.chkAddMorePriceFirst.TabIndex = 625;
|
||||
@@ -435,7 +411,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
this.label14.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.label14.AutoSize = true;
|
||||
this.label14.ForeColor = System.Drawing.SystemColors.GrayText;
|
||||
this.label14.Location = new System.Drawing.Point(8, 62);
|
||||
this.label14.Location = new System.Drawing.Point(8, 66);
|
||||
this.label14.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
|
||||
this.label14.Name = "label14";
|
||||
this.label14.Size = new System.Drawing.Size(68, 51);
|
||||
@@ -446,7 +422,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
//
|
||||
this.label15.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.label15.AutoSize = true;
|
||||
this.label15.Location = new System.Drawing.Point(184, 113);
|
||||
this.label15.Location = new System.Drawing.Point(184, 123);
|
||||
this.label15.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
|
||||
this.label15.Name = "label15";
|
||||
this.label15.Size = new System.Drawing.Size(20, 17);
|
||||
@@ -461,7 +437,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
this.panel4.Controls.Add(this.panel3);
|
||||
this.panel4.Location = new System.Drawing.Point(76, 17);
|
||||
this.panel4.Name = "panel4";
|
||||
this.panel4.Size = new System.Drawing.Size(450, 89);
|
||||
this.panel4.Size = new System.Drawing.Size(450, 99);
|
||||
this.panel4.TabIndex = 577;
|
||||
//
|
||||
// panel3
|
||||
@@ -474,7 +450,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
this.panel3.Controls.Add(this.fPnlPriceRule);
|
||||
this.panel3.Location = new System.Drawing.Point(1, 1);
|
||||
this.panel3.Name = "panel3";
|
||||
this.panel3.Size = new System.Drawing.Size(448, 87);
|
||||
this.panel3.Size = new System.Drawing.Size(448, 97);
|
||||
this.panel3.TabIndex = 541;
|
||||
//
|
||||
// fPnlPriceRule
|
||||
@@ -579,7 +555,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
// txtAddMorePrice
|
||||
//
|
||||
this.txtAddMorePrice.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.txtAddMorePrice.Location = new System.Drawing.Point(153, 110);
|
||||
this.txtAddMorePrice.Location = new System.Drawing.Point(153, 120);
|
||||
this.txtAddMorePrice.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2);
|
||||
this.txtAddMorePrice.Name = "txtAddMorePrice";
|
||||
this.txtAddMorePrice.Size = new System.Drawing.Size(31, 23);
|
||||
@@ -590,7 +566,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
// txtAddTimes
|
||||
//
|
||||
this.txtAddTimes.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.txtAddTimes.Location = new System.Drawing.Point(78, 110);
|
||||
this.txtAddTimes.Location = new System.Drawing.Point(78, 120);
|
||||
this.txtAddTimes.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2);
|
||||
this.txtAddTimes.Name = "txtAddTimes";
|
||||
this.txtAddTimes.Size = new System.Drawing.Size(31, 23);
|
||||
@@ -602,7 +578,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
//
|
||||
this.label10.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.label10.AutoSize = true;
|
||||
this.label10.Location = new System.Drawing.Point(109, 113);
|
||||
this.label10.Location = new System.Drawing.Point(109, 123);
|
||||
this.label10.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
|
||||
this.label10.Name = "label10";
|
||||
this.label10.Size = new System.Drawing.Size(44, 17);
|
||||
@@ -636,7 +612,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
//
|
||||
// txtStockNum
|
||||
//
|
||||
this.txtStockNum.Location = new System.Drawing.Point(393, 110);
|
||||
this.txtStockNum.Location = new System.Drawing.Point(393, 120);
|
||||
this.txtStockNum.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2);
|
||||
this.txtStockNum.Name = "txtStockNum";
|
||||
this.txtStockNum.Size = new System.Drawing.Size(32, 23);
|
||||
@@ -647,7 +623,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
// label4
|
||||
//
|
||||
this.label4.AutoSize = true;
|
||||
this.label4.Location = new System.Drawing.Point(337, 113);
|
||||
this.label4.Location = new System.Drawing.Point(337, 123);
|
||||
this.label4.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
|
||||
this.label4.Name = "label4";
|
||||
this.label4.Size = new System.Drawing.Size(56, 17);
|
||||
@@ -658,7 +634,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
//
|
||||
this.label9.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.label9.AutoSize = true;
|
||||
this.label9.Location = new System.Drawing.Point(8, 113);
|
||||
this.label9.Location = new System.Drawing.Point(8, 123);
|
||||
this.label9.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
|
||||
this.label9.Name = "label9";
|
||||
this.label9.Size = new System.Drawing.Size(68, 17);
|
||||
@@ -676,24 +652,14 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
this.chkStepAddPrice.UseVisualStyleBackColor = true;
|
||||
this.chkStepAddPrice.CheckedChanged += new System.EventHandler(this.chkStepAddPrice_CheckedChanged);
|
||||
//
|
||||
// chkUpDraft
|
||||
//
|
||||
this.chkUpDraft.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.chkUpDraft.AutoSize = true;
|
||||
this.chkUpDraft.Location = new System.Drawing.Point(999, 31);
|
||||
this.chkUpDraft.Name = "chkUpDraft";
|
||||
this.chkUpDraft.Size = new System.Drawing.Size(99, 21);
|
||||
this.chkUpDraft.TabIndex = 769;
|
||||
this.chkUpDraft.Text = "上传到草稿箱";
|
||||
this.chkUpDraft.UseVisualStyleBackColor = true;
|
||||
this.chkUpDraft.Visible = false;
|
||||
//
|
||||
// ucGroupBoxEx4
|
||||
//
|
||||
this.ucGroupBoxEx4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
|
||||
| System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.ucGroupBoxEx4.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
|
||||
this.ucGroupBoxEx4.BorderStyle = TemuKJD.UserComponent.UcGroupBoxEx.GroupBoxBorderStyle.ROUND;
|
||||
this.ucGroupBoxEx4.Controls.Add(this.cmbSpProdType);
|
||||
this.ucGroupBoxEx4.Controls.Add(this.label17);
|
||||
this.ucGroupBoxEx4.Controls.Add(this.cmbWxSafe);
|
||||
this.ucGroupBoxEx4.Controls.Add(this.label13);
|
||||
this.ucGroupBoxEx4.Controls.Add(this.cmbSourceType);
|
||||
@@ -714,11 +680,33 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
this.ucGroupBoxEx4.Controls.Add(this.label16);
|
||||
this.ucGroupBoxEx4.Location = new System.Drawing.Point(139, 2);
|
||||
this.ucGroupBoxEx4.Name = "ucGroupBoxEx4";
|
||||
this.ucGroupBoxEx4.Size = new System.Drawing.Size(320, 140);
|
||||
this.ucGroupBoxEx4.Size = new System.Drawing.Size(320, 150);
|
||||
this.ucGroupBoxEx4.TabIndex = 666;
|
||||
this.ucGroupBoxEx4.TabStop = false;
|
||||
this.ucGroupBoxEx4.Text = "待传商品";
|
||||
//
|
||||
// cmbSpProdType
|
||||
//
|
||||
this.cmbSpProdType.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
this.cmbSpProdType.FormattingEnabled = true;
|
||||
this.cmbSpProdType.Items.AddRange(new object[] {
|
||||
"普通商品",
|
||||
"书籍"});
|
||||
this.cmbSpProdType.Location = new System.Drawing.Point(36, 95);
|
||||
this.cmbSpProdType.Name = "cmbSpProdType";
|
||||
this.cmbSpProdType.Size = new System.Drawing.Size(92, 25);
|
||||
this.cmbSpProdType.TabIndex = 686;
|
||||
//
|
||||
// label17
|
||||
//
|
||||
this.label17.AutoSize = true;
|
||||
this.label17.Location = new System.Drawing.Point(7, 99);
|
||||
this.label17.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
|
||||
this.label17.Name = "label17";
|
||||
this.label17.Size = new System.Drawing.Size(32, 17);
|
||||
this.label17.TabIndex = 685;
|
||||
this.label17.Text = "类别";
|
||||
//
|
||||
// cmbWxSafe
|
||||
//
|
||||
this.cmbWxSafe.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||
@@ -726,7 +714,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
this.cmbWxSafe.Items.AddRange(new object[] {
|
||||
"安全商品",
|
||||
"未校验"});
|
||||
this.cmbWxSafe.Location = new System.Drawing.Point(157, 78);
|
||||
this.cmbWxSafe.Location = new System.Drawing.Point(157, 68);
|
||||
this.cmbWxSafe.Name = "cmbWxSafe";
|
||||
this.cmbWxSafe.Size = new System.Drawing.Size(92, 25);
|
||||
this.cmbWxSafe.TabIndex = 675;
|
||||
@@ -734,7 +722,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
// label13
|
||||
//
|
||||
this.label13.AutoSize = true;
|
||||
this.label13.Location = new System.Drawing.Point(128, 82);
|
||||
this.label13.Location = new System.Drawing.Point(128, 72);
|
||||
this.label13.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
|
||||
this.label13.Name = "label13";
|
||||
this.label13.Size = new System.Drawing.Size(32, 17);
|
||||
@@ -749,7 +737,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
"店铺采集",
|
||||
"机会商品",
|
||||
"外部数据"});
|
||||
this.cmbSourceType.Location = new System.Drawing.Point(36, 78);
|
||||
this.cmbSourceType.Location = new System.Drawing.Point(36, 68);
|
||||
this.cmbSourceType.Name = "cmbSourceType";
|
||||
this.cmbSourceType.Size = new System.Drawing.Size(92, 25);
|
||||
this.cmbSourceType.TabIndex = 673;
|
||||
@@ -757,7 +745,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
// label12
|
||||
//
|
||||
this.label12.AutoSize = true;
|
||||
this.label12.Location = new System.Drawing.Point(7, 82);
|
||||
this.label12.Location = new System.Drawing.Point(7, 72);
|
||||
this.label12.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
|
||||
this.label12.Name = "label12";
|
||||
this.label12.Size = new System.Drawing.Size(32, 17);
|
||||
@@ -770,10 +758,10 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
this.btnClearFilter.CanvasColor = System.Drawing.SystemColors.Control;
|
||||
this.btnClearFilter.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
|
||||
this.btnClearFilter.DisabledBackColor = System.Drawing.Color.Empty;
|
||||
this.btnClearFilter.Location = new System.Drawing.Point(253, 22);
|
||||
this.btnClearFilter.Location = new System.Drawing.Point(253, 16);
|
||||
this.btnClearFilter.Margin = new System.Windows.Forms.Padding(4, 2, 2, 2);
|
||||
this.btnClearFilter.Name = "btnClearFilter";
|
||||
this.btnClearFilter.Size = new System.Drawing.Size(58, 52);
|
||||
this.btnClearFilter.Size = new System.Drawing.Size(58, 50);
|
||||
this.btnClearFilter.Style.Alignment = System.Drawing.StringAlignment.Center;
|
||||
this.btnClearFilter.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
|
||||
this.btnClearFilter.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
|
||||
@@ -793,7 +781,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
// lblGoodsCount
|
||||
//
|
||||
this.lblGoodsCount.AutoSize = true;
|
||||
this.lblGoodsCount.Location = new System.Drawing.Point(9, 110);
|
||||
this.lblGoodsCount.Location = new System.Drawing.Point(9, 122);
|
||||
this.lblGoodsCount.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
|
||||
this.lblGoodsCount.Name = "lblGoodsCount";
|
||||
this.lblGoodsCount.Size = new System.Drawing.Size(71, 17);
|
||||
@@ -807,7 +795,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
this.btnClearUpload.CanvasColor = System.Drawing.SystemColors.Control;
|
||||
this.btnClearUpload.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
|
||||
this.btnClearUpload.DisabledBackColor = System.Drawing.Color.Empty;
|
||||
this.btnClearUpload.Location = new System.Drawing.Point(253, 79);
|
||||
this.btnClearUpload.Location = new System.Drawing.Point(253, 93);
|
||||
this.btnClearUpload.Margin = new System.Windows.Forms.Padding(4, 2, 2, 2);
|
||||
this.btnClearUpload.Name = "btnClearUpload";
|
||||
this.btnClearUpload.Size = new System.Drawing.Size(58, 23);
|
||||
@@ -829,7 +817,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
//
|
||||
// txtIdFilter
|
||||
//
|
||||
this.txtIdFilter.Location = new System.Drawing.Point(157, 51);
|
||||
this.txtIdFilter.Location = new System.Drawing.Point(157, 43);
|
||||
this.txtIdFilter.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2);
|
||||
this.txtIdFilter.Name = "txtIdFilter";
|
||||
this.txtIdFilter.Size = new System.Drawing.Size(92, 23);
|
||||
@@ -838,7 +826,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
// label1
|
||||
//
|
||||
this.label1.AutoSize = true;
|
||||
this.label1.Location = new System.Drawing.Point(129, 54);
|
||||
this.label1.Location = new System.Drawing.Point(129, 47);
|
||||
this.label1.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
|
||||
this.label1.Name = "label1";
|
||||
this.label1.Size = new System.Drawing.Size(32, 17);
|
||||
@@ -848,7 +836,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
// cmbCateFilter
|
||||
//
|
||||
this.cmbCateFilter.FormattingEnabled = true;
|
||||
this.cmbCateFilter.Location = new System.Drawing.Point(157, 22);
|
||||
this.cmbCateFilter.Location = new System.Drawing.Point(157, 16);
|
||||
this.cmbCateFilter.Name = "cmbCateFilter";
|
||||
this.cmbCateFilter.Size = new System.Drawing.Size(92, 25);
|
||||
this.cmbCateFilter.TabIndex = 663;
|
||||
@@ -856,7 +844,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
// label2
|
||||
//
|
||||
this.label2.AutoSize = true;
|
||||
this.label2.Location = new System.Drawing.Point(129, 26);
|
||||
this.label2.Location = new System.Drawing.Point(129, 22);
|
||||
this.label2.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
|
||||
this.label2.Name = "label2";
|
||||
this.label2.Size = new System.Drawing.Size(32, 17);
|
||||
@@ -866,7 +854,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
// cmbGroupFilter
|
||||
//
|
||||
this.cmbGroupFilter.FormattingEnabled = true;
|
||||
this.cmbGroupFilter.Location = new System.Drawing.Point(36, 22);
|
||||
this.cmbGroupFilter.Location = new System.Drawing.Point(36, 16);
|
||||
this.cmbGroupFilter.Name = "cmbGroupFilter";
|
||||
this.cmbGroupFilter.Size = new System.Drawing.Size(92, 25);
|
||||
this.cmbGroupFilter.TabIndex = 641;
|
||||
@@ -874,7 +862,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
// label20
|
||||
//
|
||||
this.label20.AutoSize = true;
|
||||
this.label20.Location = new System.Drawing.Point(7, 25);
|
||||
this.label20.Location = new System.Drawing.Point(7, 19);
|
||||
this.label20.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
|
||||
this.label20.Name = "label20";
|
||||
this.label20.Size = new System.Drawing.Size(32, 17);
|
||||
@@ -883,7 +871,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
//
|
||||
// txtExtCodeFilter
|
||||
//
|
||||
this.txtExtCodeFilter.Location = new System.Drawing.Point(36, 51);
|
||||
this.txtExtCodeFilter.Location = new System.Drawing.Point(36, 43);
|
||||
this.txtExtCodeFilter.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2);
|
||||
this.txtExtCodeFilter.Name = "txtExtCodeFilter";
|
||||
this.txtExtCodeFilter.Size = new System.Drawing.Size(92, 23);
|
||||
@@ -895,7 +883,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
this.lblWaitToUp.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
this.lblWaitToUp.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Underline, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.lblWaitToUp.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
|
||||
this.lblWaitToUp.Location = new System.Drawing.Point(119, 110);
|
||||
this.lblWaitToUp.Location = new System.Drawing.Point(119, 122);
|
||||
this.lblWaitToUp.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
|
||||
this.lblWaitToUp.Name = "lblWaitToUp";
|
||||
this.lblWaitToUp.Size = new System.Drawing.Size(71, 17);
|
||||
@@ -905,7 +893,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
//
|
||||
// txtAddCount
|
||||
//
|
||||
this.txtAddCount.Location = new System.Drawing.Point(213, 107);
|
||||
this.txtAddCount.Location = new System.Drawing.Point(213, 119);
|
||||
this.txtAddCount.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2);
|
||||
this.txtAddCount.Name = "txtAddCount";
|
||||
this.txtAddCount.Size = new System.Drawing.Size(36, 23);
|
||||
@@ -918,7 +906,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
this.panelEx2.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
this.panelEx2.DisabledBackColor = System.Drawing.Color.Empty;
|
||||
this.panelEx2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.panelEx2.Location = new System.Drawing.Point(253, 107);
|
||||
this.panelEx2.Location = new System.Drawing.Point(253, 119);
|
||||
this.panelEx2.Name = "panelEx2";
|
||||
this.panelEx2.Size = new System.Drawing.Size(58, 23);
|
||||
this.panelEx2.Style.Alignment = System.Drawing.StringAlignment.Center;
|
||||
@@ -939,7 +927,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
// label16
|
||||
//
|
||||
this.label16.AutoSize = true;
|
||||
this.label16.Location = new System.Drawing.Point(7, 54);
|
||||
this.label16.Location = new System.Drawing.Point(7, 46);
|
||||
this.label16.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
|
||||
this.label16.Name = "label16";
|
||||
this.label16.Size = new System.Drawing.Size(32, 17);
|
||||
@@ -955,7 +943,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
this.ucGroupBoxEx1.Controls.Add(this.btnRefreshShop);
|
||||
this.ucGroupBoxEx1.Location = new System.Drawing.Point(3, 2);
|
||||
this.ucGroupBoxEx1.Name = "ucGroupBoxEx1";
|
||||
this.ucGroupBoxEx1.Size = new System.Drawing.Size(136, 140);
|
||||
this.ucGroupBoxEx1.Size = new System.Drawing.Size(136, 150);
|
||||
this.ucGroupBoxEx1.TabIndex = 399;
|
||||
this.ucGroupBoxEx1.TabStop = false;
|
||||
this.ucGroupBoxEx1.Text = "基础";
|
||||
@@ -1000,8 +988,8 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
// splitContainer3.Panel2
|
||||
//
|
||||
this.splitContainer3.Panel2.Controls.Add(this.splitContainer4);
|
||||
this.splitContainer3.Size = new System.Drawing.Size(1523, 402);
|
||||
this.splitContainer3.SplitterDistance = 372;
|
||||
this.splitContainer3.Size = new System.Drawing.Size(1523, 392);
|
||||
this.splitContainer3.SplitterDistance = 362;
|
||||
this.splitContainer3.TabIndex = 1;
|
||||
//
|
||||
// splitContainer2
|
||||
@@ -1025,7 +1013,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
this.splitContainer2.Panel2.Controls.Add(this.chkUpDraft);
|
||||
this.splitContainer2.Panel2.Controls.Add(this.dgvSelectProduct);
|
||||
this.splitContainer2.Panel2.Padding = new System.Windows.Forms.Padding(0, 0, 4, 0);
|
||||
this.splitContainer2.Size = new System.Drawing.Size(1523, 372);
|
||||
this.splitContainer2.Size = new System.Drawing.Size(1523, 362);
|
||||
this.splitContainer2.SplitterDistance = 300;
|
||||
this.splitContainer2.TabIndex = 0;
|
||||
//
|
||||
@@ -1065,7 +1053,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
this.dgvShop.ReadOnly = true;
|
||||
this.dgvShop.RowHeadersWidth = 25;
|
||||
this.dgvShop.RowTemplate.Height = 23;
|
||||
this.dgvShop.Size = new System.Drawing.Size(296, 372);
|
||||
this.dgvShop.Size = new System.Drawing.Size(296, 362);
|
||||
this.dgvShop.TabIndex = 6;
|
||||
this.dgvShop.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvShop_CellContentClick);
|
||||
//
|
||||
@@ -1158,11 +1146,37 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
this.colMessage.Name = "colMessage";
|
||||
this.colMessage.ReadOnly = true;
|
||||
//
|
||||
// 并发上传
|
||||
//
|
||||
this.并发上传.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.并发上传.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
|
||||
this.并发上传.Cursor = System.Windows.Forms.Cursors.Hand;
|
||||
this.并发上传.DisabledBackColor = System.Drawing.Color.Empty;
|
||||
this.并发上传.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
|
||||
this.并发上传.Location = new System.Drawing.Point(1093, 30);
|
||||
this.并发上传.Name = "并发上传";
|
||||
this.并发上传.Size = new System.Drawing.Size(118, 23);
|
||||
this.并发上传.Style.Alignment = System.Drawing.StringAlignment.Center;
|
||||
this.并发上传.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
|
||||
this.并发上传.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
|
||||
this.并发上传.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
|
||||
this.并发上传.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
|
||||
this.并发上传.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
|
||||
this.并发上传.Style.ForeColor.Color = System.Drawing.Color.White;
|
||||
this.并发上传.Style.GradientAngle = 90;
|
||||
this.并发上传.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
|
||||
this.并发上传.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
|
||||
this.并发上传.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
|
||||
this.并发上传.TabIndex = 768;
|
||||
this.并发上传.Text = "测试并发上传";
|
||||
this.并发上传.Visible = false;
|
||||
this.并发上传.Click += new System.EventHandler(this.并发上传_Click);
|
||||
//
|
||||
// pbLoading
|
||||
//
|
||||
this.pbLoading.Anchor = System.Windows.Forms.AnchorStyles.None;
|
||||
this.pbLoading.Image = global::TemuKJD.Properties.Resources.loading_blue;
|
||||
this.pbLoading.Location = new System.Drawing.Point(584, 161);
|
||||
this.pbLoading.Location = new System.Drawing.Point(584, 156);
|
||||
this.pbLoading.Name = "pbLoading";
|
||||
this.pbLoading.Size = new System.Drawing.Size(50, 50);
|
||||
this.pbLoading.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
|
||||
@@ -1174,7 +1188,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
//
|
||||
this.label11.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.label11.AutoSize = true;
|
||||
this.label11.Location = new System.Drawing.Point(25, 47);
|
||||
this.label11.Location = new System.Drawing.Point(25, 37);
|
||||
this.label11.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
|
||||
this.label11.Name = "label11";
|
||||
this.label11.Size = new System.Drawing.Size(68, 17);
|
||||
@@ -1185,7 +1199,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
// txtSinglePriceAdd
|
||||
//
|
||||
this.txtSinglePriceAdd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
|
||||
this.txtSinglePriceAdd.Location = new System.Drawing.Point(93, 44);
|
||||
this.txtSinglePriceAdd.Location = new System.Drawing.Point(93, 34);
|
||||
this.txtSinglePriceAdd.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2);
|
||||
this.txtSinglePriceAdd.Name = "txtSinglePriceAdd";
|
||||
this.txtSinglePriceAdd.Size = new System.Drawing.Size(31, 23);
|
||||
@@ -1194,6 +1208,18 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
this.txtSinglePriceAdd.Visible = false;
|
||||
this.txtSinglePriceAdd.TextChanged += new System.EventHandler(this.txtAddPrice_TextChanged);
|
||||
//
|
||||
// chkUpDraft
|
||||
//
|
||||
this.chkUpDraft.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
|
||||
this.chkUpDraft.AutoSize = true;
|
||||
this.chkUpDraft.Location = new System.Drawing.Point(999, 31);
|
||||
this.chkUpDraft.Name = "chkUpDraft";
|
||||
this.chkUpDraft.Size = new System.Drawing.Size(99, 21);
|
||||
this.chkUpDraft.TabIndex = 769;
|
||||
this.chkUpDraft.Text = "上传到草稿箱";
|
||||
this.chkUpDraft.UseVisualStyleBackColor = true;
|
||||
this.chkUpDraft.Visible = false;
|
||||
//
|
||||
// dgvSelectProduct
|
||||
//
|
||||
this.dgvSelectProduct.AllowUserToAddRows = false;
|
||||
@@ -1240,7 +1266,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
this.dgvSelectProduct.Name = "dgvSelectProduct";
|
||||
this.dgvSelectProduct.ReadOnly = true;
|
||||
this.dgvSelectProduct.RowTemplate.Height = 23;
|
||||
this.dgvSelectProduct.Size = new System.Drawing.Size(1215, 372);
|
||||
this.dgvSelectProduct.Size = new System.Drawing.Size(1215, 362);
|
||||
this.dgvSelectProduct.TabIndex = 187;
|
||||
this.dgvSelectProduct.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvSelectProduct_CellContentClick);
|
||||
//
|
||||
@@ -1661,5 +1687,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
private System.Windows.Forms.DataGridViewTextBoxColumn colMessage;
|
||||
private DevComponents.DotNetBar.PanelEx 并发上传;
|
||||
private UserComponent.UcCheckBox chkUpDraft;
|
||||
private System.Windows.Forms.ComboBox cmbSpProdType;
|
||||
private System.Windows.Forms.Label label17;
|
||||
}
|
||||
}
|
||||
@@ -52,6 +52,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
|
||||
private void UserSelectDbProductForm_Load(object sender, EventArgs e)
|
||||
{
|
||||
cmbSpProdType.SelectedIndex = 0;
|
||||
this.splitContainer1.Dock = DockStyle.Fill;
|
||||
this.panel1.Location = new Point(40, 30);
|
||||
this.panel1.Width = this.Width - 80;
|
||||
@@ -1944,6 +1945,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
data += "&in_cates=" + cmbCateFilter.Text;
|
||||
data += "&product_get_type=" + cmbSourceType.Text.Trim();
|
||||
data += "&wx_safe_status=" + cmbWxSafe.Text.Trim();
|
||||
data += "&special_prod_type=" + cmbSpProdType.Text.Trim();
|
||||
}));
|
||||
var html = GetHtml.PostUtf8(url, data);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
@@ -2094,6 +2096,7 @@ namespace TemuKJD.WXForms.ProductForms
|
||||
cmbGroupFilter.Text = "";
|
||||
cmbCateFilter.Text = "";
|
||||
cmbWxSafe.SelectedIndex = 0;
|
||||
cmbSpProdType.SelectedIndex = 0;
|
||||
int prodCount;
|
||||
GetRandomProductList(out prodCount, 1, 1);
|
||||
lblGoodsCount.Text = "产品库 " + prodCount + " 件";
|
||||
|
||||
@@ -25,862 +25,5 @@ namespace TemuKJD.WXForms.ShopForms
|
||||
public delegate void InfoReceivedHandler(string information);
|
||||
public event InfoReceivedHandler OnInfoReceived;
|
||||
|
||||
public string getProduct(string sProdId, string supplierId, PDDProductInfo prodInfo = null, bool notSaveDb = false)
|
||||
{
|
||||
var prodId = sProdId.ParseToLong();
|
||||
if (prodId <= 0)
|
||||
{
|
||||
BaseMsgForm.ShowError("商品Id不存在!");
|
||||
return "failed";
|
||||
}
|
||||
//var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == supplierId.ParseToString());
|
||||
var shop = PDDAdminShopListForm.lstAdminShopInfo.FirstOrDefault(s => s.ShopId == supplierId.ParseToString());
|
||||
if (string.IsNullOrEmpty(supplierId) || shop == null)
|
||||
{
|
||||
BaseMsgForm.ShowError("店铺不存在!");
|
||||
return "failed";
|
||||
}
|
||||
|
||||
Task.Run(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
var sourceShop = shop;
|
||||
var sourceProdId = prodId;
|
||||
string success_err_msg = "";
|
||||
//string errorMsg = "";
|
||||
var commit_id_rst = GetPddProdCommitId(sourceShop, sourceProdId.ToString());
|
||||
if (!commit_id_rst.Contains("\"success\":true") || !commit_id_rst.Contains("\"result\""))
|
||||
{
|
||||
var errMsg = BaseRegex.GetStringJson(ref commit_id_rst, "error_msg");
|
||||
if (string.IsNullOrEmpty(errMsg))
|
||||
errMsg = commit_id_rst;
|
||||
OnInfoReceived("商品获取失败!" + errMsg);
|
||||
return;
|
||||
}
|
||||
var commitId = BaseRegex.GetStringJson(ref commit_id_rst, "goods_commit_id");
|
||||
if (string.IsNullOrEmpty(commitId))
|
||||
{
|
||||
OnInfoReceived("商品获取失败!商品提交编号获取失败!");
|
||||
return;
|
||||
}
|
||||
|
||||
Thread.Sleep(Randomx.GetId(10, 50));
|
||||
var detail_json = "{}";
|
||||
PDDProductDetailInfo product = null;
|
||||
try
|
||||
{
|
||||
var prod_detail_rst = GetPddProdDetail(sourceShop, sourceProdId.ToString(), commitId);
|
||||
JObject prod_detail_obj = JObject.Parse(prod_detail_rst);
|
||||
detail_json = JsonHelper.SerializeObject(prod_detail_obj["result"]);
|
||||
|
||||
product = JsonHelper.DeserializeJsonToObject<PDDProductDetailInfo>(detail_json);
|
||||
if (product == null || detail_json.Length < 10)
|
||||
{
|
||||
OnInfoReceived("商品获取失败!商品数据格式获取失败!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnInfoReceived("商品获取失败!商品数据格式获取失败!" + ex.Message);
|
||||
return;
|
||||
}
|
||||
|
||||
Thread.Sleep(Randomx.GetId(10, 50));
|
||||
var size_json = "{}";
|
||||
if (product.size_spec_id.ParseToLong() != 0)
|
||||
{
|
||||
try
|
||||
{
|
||||
var prod_size_rst = GetPddProdSizeSpec(sourceShop, sourceProdId.ToString(), commitId, product.size_spec_id.ParseToString());
|
||||
prod_size_rst = GetHtml.Unicode2String(prod_size_rst);
|
||||
JObject prod_size_obj = JObject.Parse(prod_size_rst);
|
||||
size_json = JsonHelper.SerializeObject(prod_size_obj["result"]);
|
||||
var size = JsonHelper.DeserializeJsonToObject<PDDSizeSpecInfo>(size_json);
|
||||
if (size == null)
|
||||
{
|
||||
OnInfoReceived("尺码表获取失败!尺码数据格式获取失败!");
|
||||
return;
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnInfoReceived("尺码表获取失败!尺码数据格式获取失败!" + ex.Message);
|
||||
return;
|
||||
}
|
||||
}
|
||||
//temu尺码表暂时注释
|
||||
//if (product.sizeTemplateId > 0)
|
||||
//{
|
||||
// html = SizeSpecQuery(shop1, prodId1.ToString(), product.sizeTemplateId.ToString());
|
||||
// if(!html.Contains("\"success\":true"))
|
||||
// {
|
||||
// success_err_msg += " 尺码表获取失败!" + BaseRegex.GetStringJson(ref html, "errorMsg");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// obj = JObject.Parse(html);
|
||||
// sizeRst = JsonHelper.SerializeObject(obj["result"]);
|
||||
// }
|
||||
//}
|
||||
|
||||
Thread.Sleep(Randomx.GetId(10, 50));
|
||||
var property_json = "{}";
|
||||
PDDProductPropertyInfo property = null;
|
||||
try
|
||||
{
|
||||
var prod_property_rst = GetPddProdProperty(sourceShop, sourceProdId.ToString(), commitId);
|
||||
prod_property_rst = GetHtml.Unicode2String(prod_property_rst);
|
||||
JObject prod_property_obj = JObject.Parse(prod_property_rst);
|
||||
property_json = JsonHelper.SerializeObject(prod_property_obj["result"]);
|
||||
property = JsonHelper.DeserializeJsonToObject<PDDProductPropertyInfo>(property_json);
|
||||
}
|
||||
catch (Exception ex) { }
|
||||
if (property == null)
|
||||
{
|
||||
OnInfoReceived("商品获取失败!商品属性获取失败!");
|
||||
return;
|
||||
}
|
||||
|
||||
// 属性模板暂时注释
|
||||
//var prop_template_json = "{}";
|
||||
//PDDProductTemplateInfo templateInfo = null;
|
||||
//try
|
||||
//{
|
||||
// var prop_template_rst = GetPddCatPropTemplate(sourceShop, product.cat_id.ParseToString(), sourceProdId.ToString(), commitId);
|
||||
// JObject prop_template_obj = JObject.Parse(prop_template_rst);
|
||||
// prop_template_json = JsonHelper.SerializeObject(prop_template_obj["result"]);
|
||||
// templateInfo = JsonHelper.DeserializeJsonToObject<PDDProductTemplateInfo>(prop_template_json);
|
||||
//}
|
||||
//catch (Exception ex) { }
|
||||
//if (templateInfo == null)
|
||||
//{
|
||||
// OnInfoReceived("商品获取失败!商品属性模板获取失败!");
|
||||
// return;
|
||||
//}
|
||||
|
||||
Thread.Sleep(Randomx.GetId(10, 50));
|
||||
var decoration_json = "{}";
|
||||
PDDProductDecorationInfo decoration = null;
|
||||
try
|
||||
{
|
||||
var prod_decoration_rst = GetPddProdDecoration(sourceShop, sourceProdId.ToString(), commitId);
|
||||
if (!prod_decoration_rst.Contains("\"success\":true"))
|
||||
{
|
||||
var errMsg = BaseRegex.GetStringJson(ref prod_decoration_rst, "error_msg");
|
||||
if (string.IsNullOrEmpty(errMsg))
|
||||
errMsg = prod_decoration_rst;
|
||||
OnInfoReceived("商品获取失败!商品详情图获取失败!" + errMsg);
|
||||
return;
|
||||
}
|
||||
JObject prod_decoration_obj = JObject.Parse(prod_decoration_rst);
|
||||
if (!prod_decoration_obj["result"].IsNullOrEmpty())
|
||||
decoration_json = JsonHelper.SerializeObject(prod_decoration_obj["result"]);
|
||||
decoration = JsonHelper.DeserializeJsonToObject<PDDProductDecorationInfo>(decoration_json);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnInfoReceived("商品获取失败!商品详情图获取失败!" + ex.Message);
|
||||
return;
|
||||
}
|
||||
if (decoration != null && decoration_json.ParseToString().Length < 20)
|
||||
{
|
||||
//try
|
||||
//{ // 获取另一组详情数据,结构和主详情不一样无法通用
|
||||
// var prod_detail_decoration_rst = GetPddProdOnShopDetail(sourceShop, sourceProdId.ToString(), commitId);
|
||||
// JObject prod_detail_decoration_obj = JObject.Parse(prod_detail_decoration_rst);
|
||||
// foreach (JObject ob in prod_detail_decoration_obj["result"]["carousel_gallery"])
|
||||
// {
|
||||
|
||||
// }
|
||||
//}
|
||||
//catch (Exception ex)
|
||||
//{
|
||||
// OnInfoReceived("商品获取失败!商品详情图获取失败!" + ex.Message);
|
||||
// return;
|
||||
//}
|
||||
|
||||
PDDProdDecorationCommitParam decorationParam = new PDDProdDecorationCommitParam();
|
||||
decorationParam.goods_id = product.goods_id;
|
||||
decorationParam.goods_commit_id = commitId.ParseToLong();
|
||||
decorationParam.preview_key = "";
|
||||
decorationParam.decoration_floor_list = new List<decoration_floor_param>();
|
||||
foreach (var gallary in product.galleries)
|
||||
{
|
||||
if (gallary.type != 2)
|
||||
continue;
|
||||
|
||||
var floor_param = new decoration_floor_param();
|
||||
//floor_param.floor_id = 0; // floorItem.floor_id;
|
||||
floor_param.type = "image"; // floorItem.type;
|
||||
floor_param.content_list = new List<decoration_content_param>();
|
||||
//foreach (var c in floorItem.content_list)
|
||||
{
|
||||
var decorationContentParam = new decoration_content_param()
|
||||
{
|
||||
//file_id = c.file_id,
|
||||
img_url = gallary.url, //c.img_url,
|
||||
//height = c.height,
|
||||
//text = c.text,
|
||||
//text_module_details = null,
|
||||
//width = c.width,
|
||||
};
|
||||
//try { decorationContentParam.text_module_details = JsonHelper.DeserializeJsonToObject<text_module_detail_param>(JsonHelper.SerializeObject(c.text_module_details)); }
|
||||
//catch (Exception ex) { }
|
||||
floor_param.content_list.Add(decorationContentParam);
|
||||
}
|
||||
decorationParam.decoration_floor_list.Add(floor_param);
|
||||
}
|
||||
|
||||
var addDecorationRst = save_decoration(shop, decorationParam, product.goods_id.ParseToString(), commitId);
|
||||
Thread.Sleep(Randomx.GetId(10, 50));
|
||||
|
||||
// 第二次获取详情图
|
||||
try
|
||||
{
|
||||
var prod_decoration_rst = GetPddProdDecoration(sourceShop, sourceProdId.ToString(), commitId);
|
||||
if (!prod_decoration_rst.Contains("\"success\":true"))
|
||||
{
|
||||
var errMsg = BaseRegex.GetStringJson(ref prod_decoration_rst, "error_msg");
|
||||
if (string.IsNullOrEmpty(errMsg))
|
||||
errMsg = prod_decoration_rst;
|
||||
OnInfoReceived("商品获取失败!商品详情图获取失败!" + errMsg);
|
||||
return;
|
||||
}
|
||||
JObject prod_decoration_obj = JObject.Parse(prod_decoration_rst);
|
||||
if (!prod_decoration_obj["result"].IsNullOrEmpty())
|
||||
decoration_json = JsonHelper.SerializeObject(prod_decoration_obj["result"]);
|
||||
decoration = JsonHelper.DeserializeJsonToObject<PDDProductDecorationInfo>(decoration_json);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnInfoReceived("商品获取失败!商品详情图获取失败!" + ex.Message);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (decoration == null || decoration_json.ParseToString().Length < 20)
|
||||
{
|
||||
OnInfoReceived("商品获取失败!商品详情图获取失败!");
|
||||
return;
|
||||
}
|
||||
|
||||
Thread.Sleep(Randomx.GetId(10, 50));
|
||||
var material3_json = "{}";
|
||||
PDDMaterialInfo material3 = null;
|
||||
try
|
||||
{
|
||||
var material3_rst = GetPddGoodsMaterial(sourceShop, sourceProdId.ToString(), commitId, 3);
|
||||
if (!material3_rst.Contains("\"success\":true"))
|
||||
{
|
||||
var errMsg = BaseRegex.GetStringJson(ref material3_rst, "error_msg");
|
||||
if (string.IsNullOrEmpty(errMsg))
|
||||
errMsg = material3_rst;
|
||||
OnInfoReceived("商品获取失败!商品长图获取失败!" + errMsg);
|
||||
return;
|
||||
}
|
||||
JObject material3_obj = JObject.Parse(material3_rst);
|
||||
if (!material3_obj["result"].IsNullOrEmpty())
|
||||
material3_json = JsonHelper.SerializeObject(material3_obj["result"]);
|
||||
material3 = JsonHelper.DeserializeJsonToObject<PDDMaterialInfo>(material3_json);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnInfoReceived("商品获取失败!商品长图获取失败!" + ex.Message);
|
||||
return;
|
||||
}
|
||||
if (material3 == null)
|
||||
{
|
||||
OnInfoReceived("商品获取失败!商品长图获取失败!");
|
||||
return;
|
||||
}
|
||||
|
||||
Thread.Sleep(Randomx.GetId(10, 50));
|
||||
var material1_json = "{}";
|
||||
PDDMaterialInfo material1 = null;
|
||||
try
|
||||
{
|
||||
var material1_rst = GetPddGoodsMaterial(sourceShop, sourceProdId.ToString(), commitId, 1);
|
||||
if (!material1_rst.Contains("\"success\":true"))
|
||||
{
|
||||
var errMsg = BaseRegex.GetStringJson(ref material1_rst, "error_msg");
|
||||
if (string.IsNullOrEmpty(errMsg))
|
||||
errMsg = material1_rst;
|
||||
OnInfoReceived("商品获取失败!商品白底图获取失败!" + errMsg);
|
||||
return;
|
||||
}
|
||||
JObject material1_obj = JObject.Parse(material1_rst);
|
||||
if (!material1_obj["result"].IsNullOrEmpty())
|
||||
material1_json = JsonHelper.SerializeObject(material1_obj["result"]);
|
||||
material1 = JsonHelper.DeserializeJsonToObject<PDDMaterialInfo>(material1_json);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnInfoReceived("商品获取失败!商品白底图获取失败!" + ex.Message);
|
||||
return;
|
||||
}
|
||||
if (material1 == null)
|
||||
{
|
||||
OnInfoReceived("商品获取失败!商品白底图获取失败!");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
bool isExist = false;
|
||||
var existUrl = BaseClass.BuildObjString("product/get_product_list");
|
||||
string existData = UserLogin.GetSignaturex() + "&search_spu=" + product.goods_id;
|
||||
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"))
|
||||
html = GetHtml.PostUtf8(existUrl, existData);
|
||||
if (!string.IsNullOrEmpty(html) && html.Contains("\"code\":200"))
|
||||
{
|
||||
if (html.Contains("\"data\":[") && !html.Contains("\"data\":[]"))
|
||||
isExist = true;
|
||||
}
|
||||
|
||||
|
||||
string product_json = "{\"detail\":" + detail_json + ",\"size\":" + size_json + ",\"decoration\":" + decoration_json +
|
||||
",\"material3\":" + material3_json + ",\"material1\":" + material1_json + ",\"property\":" + property_json + "}";
|
||||
|
||||
if (notSaveDb)
|
||||
{
|
||||
prodInfo = JsonHelper.DeserializeJsonToObject<PDDProductInfo>(product_json);
|
||||
}
|
||||
else
|
||||
{
|
||||
string main_img = product.image_url;
|
||||
if (string.IsNullOrEmpty(main_img))
|
||||
main_img = product.hd_thumb_url;
|
||||
if (string.IsNullOrEmpty(main_img))
|
||||
main_img = product.thumb_url;
|
||||
if (string.IsNullOrEmpty(main_img))
|
||||
main_img = (product.galleries?.FirstOrDefault()?.url).ParseToString().Replace("https://", "http://");
|
||||
var url = BaseClass.BuildObjString("product/add_product");
|
||||
if (isExist)
|
||||
{
|
||||
bool isCover = false;
|
||||
MainForm.instance.Invoke(new Action(() =>
|
||||
{
|
||||
var ok = BaseMsgForm.ShowConfirm("产品库内已存在相同id商品,是否更新?").DialogResult;
|
||||
if (ok == DialogResult.OK)
|
||||
isCover = true;
|
||||
}));
|
||||
if (isCover)
|
||||
url = BaseClass.BuildObjString("product/mdy_product");
|
||||
else
|
||||
return;
|
||||
}
|
||||
|
||||
var data = Work.UserLogin.GetSignaturex() +
|
||||
"&from_shop_id=" + shop.ShopId +
|
||||
"&spu_id=" + product.goods_id.ParseToString() +
|
||||
"&skc_id=" + product.goods_id.ParseToString() +
|
||||
"&price_text=" + product.sku.Min(s => s.multi_price).ParseToInt() * 0.01m + "-" + product.sku.Max(s => s.multi_price).ParseToInt() * 0.01m +
|
||||
"&main_cat_id=" + (product.cat_ids?.FirstOrDefault(c => c != null)).ParseToString() +
|
||||
"&main_cat_name=" + HttpUtility.UrlEncode((product.cats?.FirstOrDefault(c => !string.IsNullOrEmpty(c))).ParseToString(), Encoding.UTF8) +
|
||||
"&cat_id=" + (product.cat_id).ParseToString() +
|
||||
"&cat_name=" + HttpUtility.UrlEncode((product.cats?.LastOrDefault(c => !string.IsNullOrEmpty(c))).ParseToString(), Encoding.UTF8) +
|
||||
"&ext_code=" + HttpUtility.UrlEncode(product.out_goods_sn, Encoding.UTF8) +
|
||||
"&product_name=" + HttpUtility.UrlEncode(product.goods_name, Encoding.UTF8) +
|
||||
"&product_json=" + HttpUtility.UrlEncode(product_json, Encoding.UTF8) +
|
||||
"&size_json=" + HttpUtility.UrlEncode(size_json, Encoding.UTF8) +
|
||||
"&main_img=" + HttpUtility.UrlEncode(main_img, Encoding.UTF8);
|
||||
|
||||
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"))
|
||||
html = GetHtml.PostUtf8(url, data);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
{
|
||||
string msg = "选品商品保存失败!请检查网络连接:" + BaseRegex.GetStringJson(ref html, "msg");
|
||||
//OnInfoReceived(msg);
|
||||
MainForm.instance.Invoke(new Action(() =>
|
||||
{
|
||||
BaseMsgForm.ShowError(msg);
|
||||
}));
|
||||
}
|
||||
else
|
||||
{
|
||||
//OnInfoReceived("选品商品保存成功!" + success_err_msg);
|
||||
MainForm.instance.Invoke(new Action(() =>
|
||||
{
|
||||
BaseMsgForm.ShowInfo("选品商品保存成功!" + success_err_msg);
|
||||
}));
|
||||
}
|
||||
|
||||
//// 创建 SaveFileDialog 的实例
|
||||
//SaveFileDialog saveFileDialog = new SaveFileDialog();
|
||||
|
||||
//// 单线程单元(STA)模式运行文件对话框,否则会报错。
|
||||
//System.Threading.Thread InvokeThread = new System.Threading.Thread(new System.Threading.ThreadStart(()=> {
|
||||
|
||||
// // 设置对话框的属性
|
||||
// saveFileDialog.Title = "保存商品";
|
||||
// saveFileDialog.Filter = "商品文件 (*.prd)|*.prd|所有文件 (*.*)|*.*"; // 过滤文件类型
|
||||
// saveFileDialog.FileName = product.productId.ParseToString(); // 默认文件名
|
||||
// saveFileDialog.DefaultExt = "txt"; // 默认文件扩展名
|
||||
|
||||
// // 显示对话框并获取结果
|
||||
// if (saveFileDialog.ShowDialog() == DialogResult.OK)
|
||||
// {
|
||||
// // 用户点击了“保存”按钮,此时可以获取文件的路径
|
||||
// string filePath = saveFileDialog.FileName;
|
||||
// // 在这里处理文件保存逻辑,例如写入数据到文件
|
||||
// System.IO.File.WriteAllText(filePath, result);
|
||||
|
||||
// //BaseMsgForm.ShowInfo("商品保存成功!");
|
||||
// }
|
||||
//}));
|
||||
//InvokeThread.SetApartmentState(System.Threading.ApartmentState.STA);
|
||||
//InvokeThread.Start();
|
||||
//InvokeThread.Join();
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
}
|
||||
});
|
||||
|
||||
return "success";
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 第三方获取商品并直接提交到第三方待上传列表
|
||||
/// </summary>
|
||||
/// <param name="sProdId"></param>
|
||||
/// <param name="supplierId"></param>
|
||||
/// <returns></returns>
|
||||
public string getThirdProduct(string sProdId, string supplierId)
|
||||
{
|
||||
var prodId = sProdId.ParseToLong();
|
||||
if (prodId <= 0)
|
||||
{
|
||||
BaseMsgForm.ShowError("商品Id不存在!");
|
||||
return "failed";
|
||||
}
|
||||
var shop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.ShopId == supplierId.ParseToString());
|
||||
if (string.IsNullOrEmpty(supplierId) || shop == null)
|
||||
{
|
||||
BaseMsgForm.ShowError("店铺不存在!");
|
||||
return "failed";
|
||||
}
|
||||
|
||||
Task.Run(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
var sourceShop = shop;
|
||||
var sourceProdId = prodId;
|
||||
string success_err_msg = "";
|
||||
string errorMsg = "";
|
||||
var html = GetPddProdCommitId(sourceShop, sourceProdId.ToString());
|
||||
if (!html.Contains("\"success\":true") || !html.Contains("\"result\""))
|
||||
{
|
||||
var errMsg = BaseRegex.GetStringJson(ref html, "error_msg");
|
||||
if (string.IsNullOrEmpty(errMsg))
|
||||
errMsg = html;
|
||||
OnInfoReceived("商品获取失败!" + errMsg);
|
||||
return;
|
||||
}
|
||||
var commitId = BaseRegex.GetStringJson(ref html, "goods_commit_id");
|
||||
if (string.IsNullOrEmpty(commitId))
|
||||
{
|
||||
OnInfoReceived("商品获取失败!商品提交编号获取失败!");
|
||||
return;
|
||||
}
|
||||
html = GetPddProdDetail(sourceShop, sourceProdId.ToString(), commitId);
|
||||
|
||||
JObject obj = JObject.Parse(html);
|
||||
var result = JsonHelper.SerializeObject(obj["result"]);
|
||||
var sizeRst = "";
|
||||
PDDProductDetailInfo product = JsonHelper.DeserializeJsonToObject<PDDProductDetailInfo>(result);
|
||||
if (product == null)
|
||||
{
|
||||
OnInfoReceived("商品获取失败!商品数据格式获取失败!");
|
||||
return;
|
||||
}
|
||||
|
||||
//拼多多暂时注释尺码
|
||||
//if (product.sizeTemplateId > 0)
|
||||
//{
|
||||
// html = SizeSpecQuery(sourceShop, sourceProdId.ToString(), product.sizeTemplateId.ToString());
|
||||
// if (!html.Contains("\"success\":true"))
|
||||
// {
|
||||
// success_err_msg += " 尺码表获取失败!" + BaseRegex.GetStringJson(ref html, "errorMsg");
|
||||
// }
|
||||
// else
|
||||
// {
|
||||
// obj = JObject.Parse(html);
|
||||
// sizeRst = JsonHelper.SerializeObject(obj["result"]);
|
||||
// }
|
||||
//}
|
||||
|
||||
List<ShopLoginInfo> shopLst = new List<ShopLoginInfo>();
|
||||
WXShopListForm.Instance.Invoke(new Action(() =>
|
||||
{
|
||||
PDDThirdProdSelectAddShopForm shopForm = new PDDThirdProdSelectAddShopForm();
|
||||
shopForm.ShowDialog();
|
||||
shopLst.AddRange(shopForm.lstSelectShop);
|
||||
}));
|
||||
if (shopLst.Count == 0)
|
||||
{
|
||||
OnInfoReceived("库存上传操作取消或未选择上传店铺!");
|
||||
return;
|
||||
}
|
||||
|
||||
var main_img = product.image_url;
|
||||
if (string.IsNullOrEmpty(main_img))
|
||||
main_img = product.hd_thumb_url;
|
||||
if (string.IsNullOrEmpty(main_img))
|
||||
main_img = product.thumb_url;
|
||||
if (string.IsNullOrEmpty(main_img))
|
||||
main_img = (product.galleries?.FirstOrDefault()?.url).ParseToString().Replace("https://", "http://");
|
||||
var url = BaseClass.BuildObjString("product_third/add_product");
|
||||
var data = UserLogin.GetSignaturex() +
|
||||
"&from_shop_id=" + shop.ShopId +
|
||||
"&spu_id=" + product.goods_id.ParseToString() +
|
||||
"&skc_id=" + product.goods_id.ParseToString() +
|
||||
"&cat_id=" + (product.cat_id).ParseToString() +
|
||||
"&cat_name=" + HttpUtility.UrlEncode((product.cats?.LastOrDefault(c => !string.IsNullOrEmpty(c))).ParseToString(), Encoding.UTF8) +
|
||||
"&ext_code=" + HttpUtility.UrlEncode(product.out_goods_sn, Encoding.UTF8) +
|
||||
"&product_name=" + HttpUtility.UrlEncode(product.goods_name, Encoding.UTF8) +
|
||||
"&product_json=" + HttpUtility.UrlEncode(result, Encoding.UTF8) +
|
||||
"&size_json=" + HttpUtility.UrlEncode(sizeRst, Encoding.UTF8) +
|
||||
"&main_img=" + HttpUtility.UrlEncode(main_img, Encoding.UTF8);
|
||||
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"))
|
||||
// html = GetHtml.PostUtf8(url, data);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
{
|
||||
errorMsg = "库存商品保存失败!请检查网络连接:" +
|
||||
BaseRegex.GetStringJson(ref html, "msg").ParseToString().Replace("'", "\\'").Replace("\"", "\\\"");
|
||||
}
|
||||
var id = BaseRegex.GetLongJson(ref html, "id");
|
||||
if (id == 0)
|
||||
goto end;
|
||||
|
||||
foreach (var addProdShop in shopLst)
|
||||
{
|
||||
url = BaseClass.BuildObjString("product_third/add_user_select_product");
|
||||
data = UserLogin.GetSignaturex() +
|
||||
"&out_product_id=" + id +
|
||||
"&shop_id=" + addProdShop.ShopId +
|
||||
"&shop_account=" + addProdShop.ShopAccount +
|
||||
"&main_user_name=" + addProdShop.UserName +
|
||||
"&sub_user_name=" + addProdShop.SubUserName +
|
||||
"&add_product_remaining=" + addProdShop.AddProductRemaining +
|
||||
"&status=待上传";
|
||||
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"))
|
||||
html = GetHtml.PostUtf8(url, data);
|
||||
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
|
||||
{
|
||||
errorMsg += product?.goods_id + " " + BaseRegex.GetStringJson(ref html, "msg") + "; ";
|
||||
}
|
||||
else
|
||||
{
|
||||
addProdShop.AddProductRemaining = addProdShop.AddProductRemaining - 1;
|
||||
}
|
||||
}
|
||||
end:;
|
||||
if (!string.IsNullOrEmpty(errorMsg))
|
||||
{
|
||||
OnInfoReceived(errorMsg);
|
||||
}
|
||||
else
|
||||
{
|
||||
OnInfoReceived("库存上传保存成功!" + success_err_msg);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
OnInfoReceived("发生错误:" + ex.Message);
|
||||
}
|
||||
});
|
||||
|
||||
return "success";
|
||||
}
|
||||
|
||||
TemuCat GetCat(TemuDetailProductInfo product)
|
||||
{
|
||||
if (product == null)
|
||||
return new TemuCat();
|
||||
|
||||
var cat = product.categories.cat10;
|
||||
if (string.IsNullOrWhiteSpace(cat.catName))
|
||||
cat = product.categories.cat9;
|
||||
if (string.IsNullOrWhiteSpace(cat.catName))
|
||||
cat = product.categories.cat8;
|
||||
if (string.IsNullOrWhiteSpace(cat.catName))
|
||||
cat = product.categories.cat7;
|
||||
if (string.IsNullOrWhiteSpace(cat.catName))
|
||||
cat = product.categories.cat6;
|
||||
if (string.IsNullOrWhiteSpace(cat.catName))
|
||||
cat = product.categories.cat5;
|
||||
if (string.IsNullOrWhiteSpace(cat.catName))
|
||||
cat = product.categories.cat4;
|
||||
if (string.IsNullOrWhiteSpace(cat.catName))
|
||||
cat = product.categories.cat3;
|
||||
if (string.IsNullOrWhiteSpace(cat.catName))
|
||||
cat = product.categories.cat2;
|
||||
if (string.IsNullOrWhiteSpace(cat.catName))
|
||||
cat = product.categories.cat1;
|
||||
|
||||
return cat;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private string GetPddProdCommitId(ShopLoginInfo shop, string prodId)
|
||||
{
|
||||
var anti = shop.AntiContents.LastOrDefault().ParseToString();
|
||||
if (shop.AntiContents.Count > 0)
|
||||
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
|
||||
string url = "https://mms.pinduoduo.com/glide/v2/mms/edit/commit/create_by_sn";
|
||||
string body = @"{""goods_id"":" + prodId + "}";
|
||||
string refere = "https://mms.pinduoduo.com/goods/goods_list?msfrom=mms_sidenav";
|
||||
var result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
|
||||
for (int i = 0; i < 5 && result.Contains("网络繁忙,请不要频繁操作"); i++)
|
||||
{
|
||||
shop.AntiContents.Remove(anti);
|
||||
anti = shop.AntiContents.FirstOrDefault().ParseToString();
|
||||
if (shop.AntiContents.Count > 0)
|
||||
{
|
||||
Thread.Sleep(Randomx.GetId(300, 500));
|
||||
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
|
||||
result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
private string GetPddProdDetail(ShopLoginInfo shop, string prodId, string commitId)
|
||||
{
|
||||
var anti = shop.AntiContents.LastOrDefault().ParseToString();
|
||||
if (shop.AntiContents.Count > 0)
|
||||
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
|
||||
//string url = "https://mms.pinduoduo.com/glide/v2/mms/query/commit/on_shop/detail"; //on_shop获取到的结构不对
|
||||
string url = "https://mms.pinduoduo.com/glide/v2/mms/query/commit/detail";
|
||||
//string body = @"{""goods_id"":" + prodId + "}";
|
||||
string body = @"{""goods_commit_id"":""" + commitId + @""",""goods_id"":""" + prodId + @"""}";
|
||||
string refere = "https://mms.pinduoduo.com/goods/goods_add/index?id=" + commitId + "&goods_id=" + prodId + "&type=edit";
|
||||
var result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
|
||||
for (int i = 0; i < 5 && result.Contains("网络繁忙,请不要频繁操作"); i++)
|
||||
{
|
||||
shop.AntiContents.Remove(anti);
|
||||
anti = shop.AntiContents.FirstOrDefault().ParseToString();
|
||||
if (shop.AntiContents.Count > 0)
|
||||
{
|
||||
Thread.Sleep(Randomx.GetId(300, 500));
|
||||
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
|
||||
result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
private string GetPddProdOnShopDetail(ShopLoginInfo shop, string prodId, string commitId)
|
||||
{
|
||||
var anti = shop.AntiContents.LastOrDefault().ParseToString();
|
||||
if (shop.AntiContents.Count > 0)
|
||||
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
|
||||
string url = "https://mms.pinduoduo.com/glide/v2/mms/query/commit/on_shop/detail"; //获取详情图
|
||||
//string url = "https://mms.pinduoduo.com/glide/v2/mms/query/commit/detail";
|
||||
//string body = @"{""goods_id"":" + prodId + "}";
|
||||
string body = @"{""goods_commit_id"":""" + commitId + @""",""goods_id"":""" + prodId + @"""}";
|
||||
string refere = "https://mms.pinduoduo.com/goods/goods_add/index?id=" + commitId + "&goods_id=" + prodId + "&type=edit";
|
||||
var result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
|
||||
for (int i = 0; i < 5 && result.Contains("网络繁忙,请不要频繁操作"); i++)
|
||||
{
|
||||
shop.AntiContents.Remove(anti);
|
||||
anti = shop.AntiContents.FirstOrDefault().ParseToString();
|
||||
if (shop.AntiContents.Count > 0)
|
||||
{
|
||||
Thread.Sleep(Randomx.GetId(300, 500));
|
||||
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
|
||||
result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存商品详情图装修列表
|
||||
/// gorse/mms/goods/decoration/commit/save
|
||||
/// </summary>
|
||||
/// <param name="shop"></param>
|
||||
/// <param name="decoration"></param>
|
||||
/// <param name="goodsId"></param>
|
||||
/// <param name="commitId"></param>
|
||||
/// <returns></returns>
|
||||
private string save_decoration(ShopLoginInfo shop, PDDProdDecorationCommitParam decoration, string goodsId, string commitId)
|
||||
{
|
||||
var anti = shop.AntiContents.LastOrDefault().ParseToString();
|
||||
if (shop.AntiContents.Count > 0)
|
||||
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
|
||||
string url = "https://mms.pinduoduo.com/gorse/mms/goods/decoration/commit/save";
|
||||
string body = @"{""goods_id"":" + goodsId + "}";
|
||||
body = JsonHelper.SerializeObject(decoration);
|
||||
string refere = "https://mms.pinduoduo.com/goods/goods_add/index?id=" + commitId + "&goods_id=" + goodsId + "&type=edit";
|
||||
|
||||
var result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
|
||||
for (int i = 0; i < 5 && result.Contains("网络繁忙,请不要频繁操作"); i++)
|
||||
{
|
||||
shop.AntiContents.Remove(anti);
|
||||
anti = shop.AntiContents.FirstOrDefault().ParseToString();
|
||||
if (shop.AntiContents.Count > 0)
|
||||
{
|
||||
Thread.Sleep(Randomx.GetId(300, 500));
|
||||
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
|
||||
result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
private string GetPddProdSizeSpec(ShopLoginInfo shop, string prodId, string commitId, string sizeSpecId)
|
||||
{
|
||||
var anti = shop.AntiContents.LastOrDefault().ParseToString();
|
||||
if (shop.AntiContents.Count > 0)
|
||||
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
|
||||
string url = "https://mms.pinduoduo.com/cabernet/mms/sizespec/query/draft";
|
||||
//string body = @"{""goods_id"":" + prodId + "}";
|
||||
string body = @"{""id"":" + sizeSpecId + @"}";
|
||||
string refere = "https://mms.pinduoduo.com/goods/goods_add/index?id=" + commitId + "&goods_id=" + prodId + "&type=edit";
|
||||
var result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
|
||||
for (int i = 0; i < 5 && result.Contains("网络繁忙,请不要频繁操作"); i++)
|
||||
{
|
||||
shop.AntiContents.Remove(anti);
|
||||
anti = shop.AntiContents.FirstOrDefault().ParseToString();
|
||||
if (shop.AntiContents.Count > 0)
|
||||
{
|
||||
Thread.Sleep(Randomx.GetId(300, 500));
|
||||
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
|
||||
result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
private string GetPddProdProperty(ShopLoginInfo shop, string prodId, string commitId)
|
||||
{
|
||||
var anti = shop.AntiContents.LastOrDefault().ParseToString();
|
||||
if (shop.AntiContents.Count > 0)
|
||||
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
|
||||
string url = "https://mms.pinduoduo.com/draco-ms/mms/query-goods-property";
|
||||
string body = @"{""goods_id"":" + prodId + "}";
|
||||
string refere = "https://mms.pinduoduo.com/goods/goods_add/index?id=" + commitId + "&goods_id=" + prodId + "&type=edit";
|
||||
var result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
|
||||
for (int i = 0; i < 5 && result.Contains("网络繁忙,请不要频繁操作"); i++)
|
||||
{
|
||||
shop.AntiContents.Remove(anti);
|
||||
anti = shop.AntiContents.FirstOrDefault().ParseToString();
|
||||
if (shop.AntiContents.Count > 0)
|
||||
{
|
||||
Thread.Sleep(Randomx.GetId(300, 500));
|
||||
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
|
||||
result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
private string GetPddProdDecoration(ShopLoginInfo shop, string prodId, string commitId)
|
||||
{
|
||||
var anti = shop.AntiContents.LastOrDefault().ParseToString();
|
||||
if (shop.AntiContents.Count > 0)
|
||||
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
|
||||
string url = "https://mms.pinduoduo.com/gorse/mms/goods/decoration/commit/query/V2";
|
||||
url = "https://mms.pinduoduo.com/gorse/mms/goods/decoration/commit/query/V2";
|
||||
string body = @"{""goods_commit_id"":" + commitId + @",""goods_id"":" + prodId + @"}";
|
||||
string refere = "https://mms.pinduoduo.com/goods/goods_add/index?id=" + commitId + "&goods_id=" + prodId + "&type=edit";
|
||||
var result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
|
||||
for (int i = 0; i < 5 && result.Contains("网络繁忙,请不要频繁操作"); i++)
|
||||
{
|
||||
shop.AntiContents.Remove(anti);
|
||||
anti = shop.AntiContents.FirstOrDefault().ParseToString();
|
||||
if (shop.AntiContents.Count > 0)
|
||||
{
|
||||
Thread.Sleep(Randomx.GetId(300, 500));
|
||||
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
|
||||
result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取物料详情 type = 1 或者 3 1是白底图,3是长图
|
||||
/// </summary>
|
||||
/// <param name="shop"></param>
|
||||
/// <param name="catId"></param>
|
||||
/// <param name="prodId"></param>
|
||||
/// <param name="commitId"></param>
|
||||
/// <param name="type"></param>
|
||||
/// <returns></returns>
|
||||
private string GetPddGoodsMaterial(ShopLoginInfo shop, string prodId, string commitId, int type)
|
||||
{
|
||||
var anti = shop.AntiContents.LastOrDefault().ParseToString();
|
||||
if (shop.AntiContents.Count > 0)
|
||||
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
|
||||
string url = "https://mms.pinduoduo.com/giraffe/mms/material/goodsMaterialInfo";
|
||||
string body = @"{""goods_id"":" + prodId + @",""type"":" + type + "}";
|
||||
string refere = "https://mms.pinduoduo.com/goods/goods_add/index?id=" + commitId + "&goods_id=" + prodId + "&type=edit";
|
||||
var result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
|
||||
for (int i = 0; i < 5 && (result.Contains("操作太过频繁") || result.Contains("网络繁忙,请不要频繁操作")); i++)
|
||||
{
|
||||
shop.AntiContents.Remove(anti);
|
||||
anti = shop.AntiContents.LastOrDefault().ParseToString();
|
||||
if (shop.AntiContents.Count > 0)
|
||||
{
|
||||
Thread.Sleep(Randomx.GetId(300, 500));
|
||||
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
|
||||
result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private string GetPddCatPropTemplate(ShopLoginInfo shop, string catId, string prodId, string commitId)
|
||||
{
|
||||
var anti = shop.AntiContents.LastOrDefault().ParseToString();
|
||||
if (shop.AntiContents.Count > 0)
|
||||
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
|
||||
string url = "https://mms.pinduoduo.com/draco-ms/mms/template/mall?catId=" + catId +
|
||||
"&goodsCommitId=" + commitId + "&goodsId=" + prodId;
|
||||
string body = @"";
|
||||
string refere = "https://mms.pinduoduo.com/goods/goods_add/index?id=" + commitId + "&goods_id=" + prodId + "&type=edit";
|
||||
var result = HttpResponseBLL.PDDGetResponse(shop, url, body, refere, anti);
|
||||
for (int i = 0; i < 5 && (result.Contains("操作太过频繁") || result.Contains("网络繁忙,请不要频繁操作")); i++)
|
||||
{
|
||||
shop.AntiContents.Remove(anti);
|
||||
anti = shop.AntiContents.LastOrDefault().ParseToString();
|
||||
if (shop.AntiContents.Count > 0)
|
||||
{
|
||||
Thread.Sleep(Randomx.GetId(300, 500));
|
||||
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
|
||||
result = HttpResponseBLL.PDDGetResponse(shop, url, body, refere, anti);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
private string SizeSpecQuery(ShopLoginInfo shop, string prodId, string sizeSpecId)
|
||||
{
|
||||
//string url = "https://seller.kuajingmaihuo.com/bg-anniston-mms/sizespec/query";
|
||||
//string body = @"{""businessId"":" + sizeSpecId + @",""reusable"":false}";
|
||||
//string refere = "https://seller.kuajingmaihuo.com/goods/product-create/product-edit?from=productList&productId=" + prodId;
|
||||
//return HttpResponseBLL.PostResponse(shop, url, body, refere);
|
||||
|
||||
return "";
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user