1前端采集数据管理端直传上货 2店铺jit 完成15%

This commit is contained in:
wule committed 2025-11-14 19:19:23 +08:00
1 parent 41a3cb3e34
commit 94f933a5e8
32 files changed
+3768 -466

No files matched your search

@@ -30,6 +30,8 @@
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DbProductEditNotesForm));
this.panel2 = new System.Windows.Forms.Panel();
this.btnAuto = new DevComponents.DotNetBar.PanelEx();
this.pnlRestore = new DevComponents.DotNetBar.PanelEx();
this.btnSkuAi = new TemuKJD.UserControls.ButtonEx();
this.label7 = new System.Windows.Forms.Label();
this.txtFissionWords = new DevComponents.DotNetBar.Controls.TextBoxX();
@@ -56,6 +58,8 @@
// panel2
//
this.panel2.BackColor = System.Drawing.Color.White;
this.panel2.Controls.Add(this.btnAuto);
this.panel2.Controls.Add(this.pnlRestore);
this.panel2.Controls.Add(this.btnSkuAi);
this.panel2.Controls.Add(this.label7);
this.panel2.Controls.Add(this.txtFissionWords);
@@ -81,6 +85,55 @@
this.panel2.Size = new System.Drawing.Size(464, 686);
this.panel2.TabIndex = 1;
//
// btnAuto
//
this.btnAuto.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnAuto.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnAuto.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnAuto.DisabledBackColor = System.Drawing.Color.Empty;
this.btnAuto.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnAuto.Location = new System.Drawing.Point(348, 353);
this.btnAuto.Name = "btnAuto";
this.btnAuto.Size = new System.Drawing.Size(35, 23);
this.btnAuto.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnAuto.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnAuto.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnAuto.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnAuto.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnAuto.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnAuto.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnAuto.Style.GradientAngle = 90;
this.btnAuto.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnAuto.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnAuto.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnAuto.TabIndex = 439;
this.btnAuto.Text = "自动";
this.btnAuto.Click += new System.EventHandler(this.btnAuto_Click);
//
// pnlRestore
//
this.pnlRestore.CanvasColor = System.Drawing.SystemColors.Control;
this.pnlRestore.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.pnlRestore.DisabledBackColor = System.Drawing.Color.Empty;
this.pnlRestore.Location = new System.Drawing.Point(388, 353);
this.pnlRestore.Name = "pnlRestore";
this.pnlRestore.Size = new System.Drawing.Size(39, 23);
this.pnlRestore.Style.Alignment = System.Drawing.StringAlignment.Center;
this.pnlRestore.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
this.pnlRestore.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
this.pnlRestore.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
this.pnlRestore.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.pnlRestore.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
this.pnlRestore.Style.GradientAngle = 90;
this.pnlRestore.StyleMouseDown.Alignment = System.Drawing.StringAlignment.Center;
this.pnlRestore.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.pnlRestore.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.pnlRestore.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.pnlRestore.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White;
this.pnlRestore.TabIndex = 435;
this.pnlRestore.Text = "还原";
this.pnlRestore.Click += new System.EventHandler(this.pnlRestore_Click);
//
// btnSkuAi
//
this.btnSkuAi.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
@@ -135,25 +188,25 @@
//
this.txtEndWords.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.txtEndWords.Location = new System.Drawing.Point(291, 353);
this.txtEndWords.Location = new System.Drawing.Point(232, 353);
this.txtEndWords.Name = "txtEndWords";
this.txtEndWords.Size = new System.Drawing.Size(136, 23);
this.txtEndWords.Size = new System.Drawing.Size(111, 23);
this.txtEndWords.TabIndex = 401;
//
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(233, 356);
this.label6.Location = new System.Drawing.Point(201, 356);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(56, 17);
this.label6.Size = new System.Drawing.Size(32, 17);
this.label6.TabIndex = 400;
this.label6.Text = "标题后缀";
this.label6.Text = "后缀";
//
// txtHeadWords
//
this.txtHeadWords.Location = new System.Drawing.Point(90, 353);
this.txtHeadWords.Name = "txtHeadWords";
this.txtHeadWords.Size = new System.Drawing.Size(136, 23);
this.txtHeadWords.Size = new System.Drawing.Size(111, 23);
this.txtHeadWords.TabIndex = 399;
//
// label5
@@ -338,5 +391,7 @@
private System.Windows.Forms.TextBox txtHeadWords;
private System.Windows.Forms.Label label5;
private UserControls.ButtonEx btnSkuAi;
private DevComponents.DotNetBar.PanelEx pnlRestore;
private DevComponents.DotNetBar.PanelEx btnAuto;
}
}
@@ -38,8 +38,10 @@ namespace TemuKJD.KJDForms.ProductSelectForms
this.txtNotes.Text = dbProd.notes;
this.txtExtCode.Text = dbProd.ext_code;
this.txtFissionWords.Text = dbProd.fission_words;
this.txtHeadWords.Text = string.IsNullOrWhiteSpace(dbProd.head_words) ? "5-99个" : dbProd.head_words;
this.txtEndWords.Text = string.IsNullOrWhiteSpace(dbProd.end_words) ? "适合不同的搭配风格" : dbProd.end_words;
//this.txtHeadWords.Text = string.IsNullOrWhiteSpace(dbProd.head_words) ? "5-99个" : dbProd.head_words;
//this.txtEndWords.Text = string.IsNullOrWhiteSpace(dbProd.end_words) ? "适合不同的搭配风格" : dbProd.end_words;
this.txtHeadWords.Text = dbProd.head_words;
this.txtEndWords.Text = dbProd.end_words;
}
}
@@ -80,5 +82,17 @@ namespace TemuKJD.KJDForms.ProductSelectForms
DouBaoImgCefForm doubaoForm = new DouBaoImgCefForm(dbProd);
doubaoForm.ShowDialog();
}
private void btnAuto_Click(object sender, EventArgs e)
{
this.txtHeadWords.Text = "5-99个";
this.txtEndWords.Text = "适合不同的搭配风格";
}
private void pnlRestore_Click(object sender, EventArgs e)
{
this.txtHeadWords.Text = dbProd.head_words;
this.txtEndWords.Text = dbProd.end_words;
}
}
}
@@ -36,8 +36,11 @@ namespace TemuKJD.KJDForms.ProductSelectForms
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.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DbProductListForm));
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.btnImportHtml = new DevComponents.DotNetBar.PanelEx();
this.cmbSort = new System.Windows.Forms.ComboBox();
this.btnSelect = new TemuKJD.UserControls.ButtonEx();
this.txtNotes = new System.Windows.Forms.TextBox();
@@ -57,6 +60,23 @@ namespace TemuKJD.KJDForms.ProductSelectForms
this.label6 = new System.Windows.Forms.Label();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.pbLoading = new System.Windows.Forms.PictureBox();
this.panel2 = new System.Windows.Forms.Panel();
this.lblProdName = new System.Windows.Forms.Label();
this.numCount = new System.Windows.Forms.NumericUpDown();
this.dgvSelectShop = new TemuKJD.UserComponent.DataGridViewEx();
this.colCheck = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.colUserName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colSubUserName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colShopId = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colShopName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colShopNotes = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.btnCancel = new DevComponents.DotNetBar.PanelEx();
this.btnAddToSelectDb = new DevComponents.DotNetBar.PanelEx();
this.btnGetShop = new DevComponents.DotNetBar.PanelEx();
this.txtShopName = new System.Windows.Forms.TextBox();
this.label7 = new System.Windows.Forms.Label();
this.txtShopId = new System.Windows.Forms.TextBox();
this.label8 = new System.Windows.Forms.Label();
this.dgvDbProduct = new TemuKJD.UserComponent.DataGridViewEx();
this.ucSplitPage1 = new TemuKJD.UserControls.UcSplitPage();
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
@@ -71,11 +91,13 @@ namespace TemuKJD.KJDForms.ProductSelectForms
this.col_ext_code = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colAddTimes = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colSelectTotalCount = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colProdGetType = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.col_notes = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colHeadWords = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colEndWords = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colFissionWords = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colAddTime = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colSelectProd = new System.Windows.Forms.DataGridViewLinkColumn();
this.col_edit = new System.Windows.Forms.DataGridViewLinkColumn();
this.col_delete = new System.Windows.Forms.DataGridViewLinkColumn();
this.col_select_product = new System.Windows.Forms.DataGridViewLinkColumn();
@@ -88,6 +110,9 @@ namespace TemuKJD.KJDForms.ProductSelectForms
this.splitContainer2.Panel2.SuspendLayout();
this.splitContainer2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pbLoading)).BeginInit();
this.panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.numCount)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dgvSelectShop)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.dgvDbProduct)).BeginInit();
this.SuspendLayout();
//
@@ -102,6 +127,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.btnImportHtml);
this.splitContainer1.Panel1.Controls.Add(this.cmbSort);
this.splitContainer1.Panel1.Controls.Add(this.btnSelect);
this.splitContainer1.Panel1.Controls.Add(this.txtNotes);
@@ -127,13 +153,37 @@ namespace TemuKJD.KJDForms.ProductSelectForms
this.splitContainer1.SplitterDistance = 53;
this.splitContainer1.TabIndex = 1;
//
// btnImportHtml
//
this.btnImportHtml.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnImportHtml.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnImportHtml.DisabledBackColor = System.Drawing.Color.Empty;
this.btnImportHtml.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnImportHtml.Location = new System.Drawing.Point(1046, 14);
this.btnImportHtml.Name = "btnImportHtml";
this.btnImportHtml.Size = new System.Drawing.Size(91, 26);
this.btnImportHtml.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnImportHtml.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnImportHtml.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnImportHtml.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnImportHtml.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnImportHtml.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnImportHtml.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnImportHtml.Style.GradientAngle = 90;
this.btnImportHtml.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnImportHtml.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnImportHtml.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnImportHtml.TabIndex = 491;
this.btnImportHtml.Text = "导入html商品";
this.btnImportHtml.Click += new System.EventHandler(this.btnImportHtml_Click);
//
// cmbSort
//
this.cmbSort.FormattingEnabled = true;
this.cmbSort.Items.AddRange(new object[] {
"入库时间",
"认领总数"});
this.cmbSort.Location = new System.Drawing.Point(1001, 15);
this.cmbSort.Location = new System.Drawing.Point(929, 15);
this.cmbSort.Name = "cmbSort";
this.cmbSort.Size = new System.Drawing.Size(79, 25);
this.cmbSort.TabIndex = 448;
@@ -159,15 +209,15 @@ namespace TemuKJD.KJDForms.ProductSelectForms
//
// txtNotes
//
this.txtNotes.Location = new System.Drawing.Point(683, 16);
this.txtNotes.Location = new System.Drawing.Point(653, 16);
this.txtNotes.Name = "txtNotes";
this.txtNotes.Size = new System.Drawing.Size(90, 23);
this.txtNotes.Size = new System.Drawing.Size(85, 23);
this.txtNotes.TabIndex = 439;
//
// lblNotes
//
this.lblNotes.AutoSize = true;
this.lblNotes.Location = new System.Drawing.Point(649, 19);
this.lblNotes.Location = new System.Drawing.Point(619, 19);
this.lblNotes.Name = "lblNotes";
this.lblNotes.Size = new System.Drawing.Size(44, 17);
this.lblNotes.TabIndex = 440;
@@ -177,7 +227,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
//
this.txtSPU.Location = new System.Drawing.Point(44, 16);
this.txtSPU.Name = "txtSPU";
this.txtSPU.Size = new System.Drawing.Size(90, 23);
this.txtSPU.Size = new System.Drawing.Size(85, 23);
this.txtSPU.TabIndex = 434;
//
// label5
@@ -191,15 +241,15 @@ namespace TemuKJD.KJDForms.ProductSelectForms
//
// txtSKC
//
this.txtSKC.Location = new System.Drawing.Point(171, 16);
this.txtSKC.Location = new System.Drawing.Point(165, 16);
this.txtSKC.Name = "txtSKC";
this.txtSKC.Size = new System.Drawing.Size(90, 23);
this.txtSKC.Size = new System.Drawing.Size(85, 23);
this.txtSKC.TabIndex = 432;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(138, 19);
this.label1.Location = new System.Drawing.Point(132, 19);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(43, 17);
this.label1.TabIndex = 433;
@@ -210,7 +260,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
this.pnlEmpty.CanvasColor = System.Drawing.SystemColors.Control;
this.pnlEmpty.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.pnlEmpty.DisabledBackColor = System.Drawing.Color.Empty;
this.pnlEmpty.Location = new System.Drawing.Point(843, 14);
this.pnlEmpty.Location = new System.Drawing.Point(805, 14);
this.pnlEmpty.Name = "pnlEmpty";
this.pnlEmpty.Size = new System.Drawing.Size(56, 26);
this.pnlEmpty.Style.Alignment = System.Drawing.StringAlignment.Center;
@@ -236,7 +286,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
this.btnSearch.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSearch.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSearch.ForeColor = System.Drawing.Color.White;
this.btnSearch.Location = new System.Drawing.Point(782, 14);
this.btnSearch.Location = new System.Drawing.Point(744, 14);
this.btnSearch.Margin = new System.Windows.Forms.Padding(2);
this.btnSearch.Name = "btnSearch";
this.btnSearch.Size = new System.Drawing.Size(56, 26);
@@ -247,15 +297,15 @@ namespace TemuKJD.KJDForms.ProductSelectForms
//
// txtExtCode
//
this.txtExtCode.Location = new System.Drawing.Point(555, 16);
this.txtExtCode.Location = new System.Drawing.Point(531, 16);
this.txtExtCode.Name = "txtExtCode";
this.txtExtCode.Size = new System.Drawing.Size(90, 23);
this.txtExtCode.Size = new System.Drawing.Size(85, 23);
this.txtExtCode.TabIndex = 429;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(521, 19);
this.label4.Location = new System.Drawing.Point(497, 19);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(44, 17);
this.label4.TabIndex = 430;
@@ -263,15 +313,15 @@ namespace TemuKJD.KJDForms.ProductSelectForms
//
// txtProdName
//
this.txtProdName.Location = new System.Drawing.Point(427, 16);
this.txtProdName.Location = new System.Drawing.Point(409, 16);
this.txtProdName.Name = "txtProdName";
this.txtProdName.Size = new System.Drawing.Size(90, 23);
this.txtProdName.Size = new System.Drawing.Size(85, 23);
this.txtProdName.TabIndex = 427;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(393, 19);
this.label3.Location = new System.Drawing.Point(375, 19);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(44, 17);
this.label3.TabIndex = 428;
@@ -279,15 +329,15 @@ namespace TemuKJD.KJDForms.ProductSelectForms
//
// txtCat
//
this.txtCat.Location = new System.Drawing.Point(299, 16);
this.txtCat.Location = new System.Drawing.Point(287, 16);
this.txtCat.Name = "txtCat";
this.txtCat.Size = new System.Drawing.Size(90, 23);
this.txtCat.Size = new System.Drawing.Size(85, 23);
this.txtCat.TabIndex = 425;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(265, 19);
this.label2.Location = new System.Drawing.Point(253, 19);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(44, 17);
this.label2.TabIndex = 426;
@@ -296,7 +346,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(944, 19);
this.label6.Location = new System.Drawing.Point(872, 19);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(68, 17);
this.label6.TabIndex = 449;
@@ -313,6 +363,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
// splitContainer2.Panel1
//
this.splitContainer2.Panel1.Controls.Add(this.pbLoading);
this.splitContainer2.Panel1.Controls.Add(this.panel2);
this.splitContainer2.Panel1.Controls.Add(this.dgvDbProduct);
this.splitContainer2.Panel1.Padding = new System.Windows.Forms.Padding(4, 0, 4, 0);
//
@@ -335,15 +386,59 @@ namespace TemuKJD.KJDForms.ProductSelectForms
this.pbLoading.TabIndex = 7;
this.pbLoading.TabStop = false;
//
// dgvDbProduct
// panel2
//
this.dgvDbProduct.AllowUserToAddRows = false;
this.dgvDbProduct.AllowUserToDeleteRows = false;
this.panel2.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.panel2.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panel2.Controls.Add(this.lblProdName);
this.panel2.Controls.Add(this.numCount);
this.panel2.Controls.Add(this.dgvSelectShop);
this.panel2.Controls.Add(this.btnCancel);
this.panel2.Controls.Add(this.btnAddToSelectDb);
this.panel2.Controls.Add(this.btnGetShop);
this.panel2.Controls.Add(this.txtShopName);
this.panel2.Controls.Add(this.label7);
this.panel2.Controls.Add(this.txtShopId);
this.panel2.Controls.Add(this.label8);
this.panel2.Location = new System.Drawing.Point(406, 54);
this.panel2.Name = "panel2";
this.panel2.Size = new System.Drawing.Size(467, 246);
this.panel2.TabIndex = 8;
this.panel2.Visible = false;
//
// lblProdName
//
this.lblProdName.Location = new System.Drawing.Point(363, 46);
this.lblProdName.Name = "lblProdName";
this.lblProdName.Size = new System.Drawing.Size(90, 123);
this.lblProdName.TabIndex = 515;
this.lblProdName.Text = "商品名称";
//
// numCount
//
this.numCount.Location = new System.Drawing.Point(363, 175);
this.numCount.Maximum = new decimal(new int[] {
1000,
0,
0,
0});
this.numCount.Name = "numCount";
this.numCount.Size = new System.Drawing.Size(91, 23);
this.numCount.TabIndex = 505;
this.numCount.Value = new decimal(new int[] {
100,
0,
0,
0});
//
// dgvSelectShop
//
this.dgvSelectShop.AllowUserToAddRows = false;
this.dgvSelectShop.AllowUserToDeleteRows = false;
dataGridViewCellStyle1.BackColor = System.Drawing.Color.WhiteSmoke;
this.dgvDbProduct.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
this.dgvDbProduct.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.dgvDbProduct.BackgroundColor = System.Drawing.Color.White;
this.dgvDbProduct.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.dgvSelectShop.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1;
this.dgvSelectShop.BackgroundColor = System.Drawing.Color.White;
this.dgvSelectShop.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle2.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
@@ -351,7 +446,190 @@ namespace TemuKJD.KJDForms.ProductSelectForms
dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvDbProduct.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
this.dgvSelectShop.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2;
this.dgvSelectShop.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvSelectShop.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.colCheck,
this.colUserName,
this.colSubUserName,
this.colShopId,
this.colShopName,
this.colShopNotes});
this.dgvSelectShop.Location = new System.Drawing.Point(19, 46);
this.dgvSelectShop.Name = "dgvSelectShop";
this.dgvSelectShop.ReadOnly = true;
this.dgvSelectShop.RowHeadersWidth = 28;
this.dgvSelectShop.RowTemplate.Height = 23;
this.dgvSelectShop.Size = new System.Drawing.Size(338, 184);
this.dgvSelectShop.TabIndex = 504;
this.dgvSelectShop.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvSelectShop_CellContentClick);
//
// colCheck
//
this.colCheck.HeaderText = "选择";
this.colCheck.MinimumWidth = 6;
this.colCheck.Name = "colCheck";
this.colCheck.ReadOnly = true;
this.colCheck.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colCheck.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colCheck.Width = 30;
//
// colUserName
//
this.colUserName.HeaderText = "用户名称";
this.colUserName.MinimumWidth = 6;
this.colUserName.Name = "colUserName";
this.colUserName.ReadOnly = true;
this.colUserName.Visible = false;
this.colUserName.Width = 125;
//
// colSubUserName
//
this.colSubUserName.HeaderText = "子账户名称";
this.colSubUserName.Name = "colSubUserName";
this.colSubUserName.ReadOnly = true;
this.colSubUserName.Visible = false;
this.colSubUserName.Width = 150;
//
// colShopId
//
this.colShopId.HeaderText = "店铺Id";
this.colShopId.Name = "colShopId";
this.colShopId.ReadOnly = true;
//
// colShopName
//
this.colShopName.HeaderText = "店铺名称";
this.colShopName.Name = "colShopName";
this.colShopName.ReadOnly = true;
//
// colShopNotes
//
this.colShopNotes.HeaderText = "店铺备注";
this.colShopNotes.Name = "colShopNotes";
this.colShopNotes.ReadOnly = true;
//
// btnCancel
//
this.btnCancel.CanvasColor = System.Drawing.SystemColors.Control;
this.btnCancel.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnCancel.DisabledBackColor = System.Drawing.Color.Empty;
this.btnCancel.Location = new System.Drawing.Point(411, 204);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(42, 26);
this.btnCancel.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnCancel.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
this.btnCancel.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
this.btnCancel.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
this.btnCancel.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnCancel.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
this.btnCancel.Style.GradientAngle = 90;
this.btnCancel.StyleMouseDown.Alignment = System.Drawing.StringAlignment.Center;
this.btnCancel.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnCancel.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnCancel.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnCancel.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White;
this.btnCancel.TabIndex = 503;
this.btnCancel.Text = "关闭";
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// btnAddToSelectDb
//
this.btnAddToSelectDb.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnAddToSelectDb.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnAddToSelectDb.DisabledBackColor = System.Drawing.Color.Empty;
this.btnAddToSelectDb.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnAddToSelectDb.Location = new System.Drawing.Point(363, 204);
this.btnAddToSelectDb.Name = "btnAddToSelectDb";
this.btnAddToSelectDb.Size = new System.Drawing.Size(42, 26);
this.btnAddToSelectDb.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnAddToSelectDb.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnAddToSelectDb.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnAddToSelectDb.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnAddToSelectDb.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnAddToSelectDb.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnAddToSelectDb.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnAddToSelectDb.Style.GradientAngle = 90;
this.btnAddToSelectDb.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnAddToSelectDb.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnAddToSelectDb.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnAddToSelectDb.TabIndex = 499;
this.btnAddToSelectDb.Text = "直传";
this.btnAddToSelectDb.Click += new System.EventHandler(this.btnAddToSelectDb_Click);
//
// btnGetShop
//
this.btnGetShop.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnGetShop.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnGetShop.DisabledBackColor = System.Drawing.Color.Empty;
this.btnGetShop.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnGetShop.Location = new System.Drawing.Point(411, 11);
this.btnGetShop.Name = "btnGetShop";
this.btnGetShop.Size = new System.Drawing.Size(42, 26);
this.btnGetShop.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnGetShop.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnGetShop.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnGetShop.Style.BorderColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelBorder;
this.btnGetShop.Style.BorderDashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
this.btnGetShop.Style.BorderSide = DevComponents.DotNetBar.eBorderSide.None;
this.btnGetShop.Style.ForeColor.Color = System.Drawing.Color.White;
this.btnGetShop.Style.GradientAngle = 90;
this.btnGetShop.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnGetShop.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnGetShop.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnGetShop.TabIndex = 495;
this.btnGetShop.Text = "查找";
this.btnGetShop.Click += new System.EventHandler(this.btnGetShop_Click);
//
// txtShopName
//
this.txtShopName.Location = new System.Drawing.Point(263, 13);
this.txtShopName.Name = "txtShopName";
this.txtShopName.Size = new System.Drawing.Size(142, 23);
this.txtShopName.TabIndex = 433;
//
// label7
//
this.label7.AutoSize = true;
this.label7.Location = new System.Drawing.Point(206, 16);
this.label7.Name = "label7";
this.label7.Size = new System.Drawing.Size(68, 17);
this.label7.TabIndex = 434;
this.label7.Text = "店铺名称:";
//
// txtShopId
//
this.txtShopId.Location = new System.Drawing.Point(61, 13);
this.txtShopId.Name = "txtShopId";
this.txtShopId.Size = new System.Drawing.Size(142, 23);
this.txtShopId.TabIndex = 431;
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(16, 16);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(56, 17);
this.label8.TabIndex = 432;
this.label8.Text = "店铺Id:";
//
// dgvDbProduct
//
this.dgvDbProduct.AllowUserToAddRows = false;
this.dgvDbProduct.AllowUserToDeleteRows = false;
dataGridViewCellStyle3.BackColor = System.Drawing.Color.WhiteSmoke;
this.dgvDbProduct.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle3;
this.dgvDbProduct.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.dgvDbProduct.BackgroundColor = System.Drawing.Color.White;
this.dgvDbProduct.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle4.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle4.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle4.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle4.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle4.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvDbProduct.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4;
this.dgvDbProduct.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvDbProduct.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.colSelect,
@@ -365,11 +643,13 @@ namespace TemuKJD.KJDForms.ProductSelectForms
this.col_ext_code,
this.colAddTimes,
this.colSelectTotalCount,
this.colProdGetType,
this.col_notes,
this.colHeadWords,
this.colEndWords,
this.colFissionWords,
this.colAddTime,
this.colSelectProd,
this.col_edit,
this.col_delete,
this.col_select_product});
@@ -426,9 +706,9 @@ namespace TemuKJD.KJDForms.ProductSelectForms
//
// col_product_name
//
dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.col_product_name.DefaultCellStyle = dataGridViewCellStyle3;
this.col_product_name.FillWeight = 180F;
dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.col_product_name.DefaultCellStyle = dataGridViewCellStyle5;
this.col_product_name.FillWeight = 160F;
this.col_product_name.HeaderText = "标题";
this.col_product_name.Name = "col_product_name";
this.col_product_name.ReadOnly = true;
@@ -490,18 +770,25 @@ namespace TemuKJD.KJDForms.ProductSelectForms
this.colSelectTotalCount.Name = "colSelectTotalCount";
this.colSelectTotalCount.ReadOnly = true;
//
// colProdGetType
//
this.colProdGetType.FillWeight = 60F;
this.colProdGetType.HeaderText = "采集来源";
this.colProdGetType.Name = "colProdGetType";
this.colProdGetType.ReadOnly = true;
//
// col_notes
//
dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.col_notes.DefaultCellStyle = dataGridViewCellStyle4;
dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.col_notes.DefaultCellStyle = dataGridViewCellStyle6;
this.col_notes.HeaderText = "备注";
this.col_notes.Name = "col_notes";
this.col_notes.ReadOnly = true;
//
// colHeadWords
//
dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colHeadWords.DefaultCellStyle = dataGridViewCellStyle5;
dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colHeadWords.DefaultCellStyle = dataGridViewCellStyle7;
this.colHeadWords.HeaderText = "标题前缀";
this.colHeadWords.Name = "colHeadWords";
this.colHeadWords.ReadOnly = true;
@@ -509,8 +796,8 @@ namespace TemuKJD.KJDForms.ProductSelectForms
//
// colEndWords
//
dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colEndWords.DefaultCellStyle = dataGridViewCellStyle6;
dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colEndWords.DefaultCellStyle = dataGridViewCellStyle8;
this.colEndWords.HeaderText = "标题后缀";
this.colEndWords.Name = "colEndWords";
this.colEndWords.ReadOnly = true;
@@ -518,8 +805,8 @@ namespace TemuKJD.KJDForms.ProductSelectForms
//
// colFissionWords
//
dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colFissionWords.DefaultCellStyle = dataGridViewCellStyle7;
dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colFissionWords.DefaultCellStyle = dataGridViewCellStyle9;
this.colFissionWords.HeaderText = "裂变词";
this.colFissionWords.Name = "colFissionWords";
this.colFissionWords.ReadOnly = true;
@@ -531,6 +818,15 @@ namespace TemuKJD.KJDForms.ProductSelectForms
this.colAddTime.Name = "colAddTime";
this.colAddTime.ReadOnly = true;
//
// colSelectProd
//
this.colSelectProd.FillWeight = 60F;
this.colSelectProd.HeaderText = "商品直传";
this.colSelectProd.Name = "colSelectProd";
this.colSelectProd.ReadOnly = true;
this.colSelectProd.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colSelectProd.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
//
// col_edit
//
this.col_edit.FillWeight = 60F;
@@ -542,14 +838,14 @@ namespace TemuKJD.KJDForms.ProductSelectForms
//
// col_delete
//
this.col_delete.FillWeight = 40F;
this.col_delete.FillWeight = 38F;
this.col_delete.HeaderText = "删除";
this.col_delete.Name = "col_delete";
this.col_delete.ReadOnly = true;
//
// col_select_product
//
this.col_select_product.FillWeight = 40F;
this.col_select_product.FillWeight = 38F;
this.col_select_product.HeaderText = "认领";
this.col_select_product.Name = "col_select_product";
this.col_select_product.ReadOnly = true;
@@ -579,6 +875,10 @@ namespace TemuKJD.KJDForms.ProductSelectForms
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
this.splitContainer2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.pbLoading)).EndInit();
this.panel2.ResumeLayout(false);
this.panel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.numCount)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dgvSelectShop)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.dgvDbProduct)).EndInit();
this.ResumeLayout(false);
@@ -609,6 +909,24 @@ namespace TemuKJD.KJDForms.ProductSelectForms
private UserControls.ButtonEx btnSelect;
private System.Windows.Forms.ComboBox cmbSort;
private System.Windows.Forms.Label label6;
private DevComponents.DotNetBar.PanelEx btnImportHtml;
private System.Windows.Forms.Panel panel2;
private System.Windows.Forms.TextBox txtShopName;
private System.Windows.Forms.Label label7;
private System.Windows.Forms.TextBox txtShopId;
private System.Windows.Forms.Label label8;
private DevComponents.DotNetBar.PanelEx btnGetShop;
private DevComponents.DotNetBar.PanelEx btnCancel;
private DevComponents.DotNetBar.PanelEx btnAddToSelectDb;
private UserComponent.DataGridViewEx dgvSelectShop;
private System.Windows.Forms.DataGridViewCheckBoxColumn colCheck;
private System.Windows.Forms.DataGridViewTextBoxColumn colUserName;
private System.Windows.Forms.DataGridViewTextBoxColumn colSubUserName;
private System.Windows.Forms.DataGridViewTextBoxColumn colShopId;
private System.Windows.Forms.DataGridViewTextBoxColumn colShopName;
private System.Windows.Forms.DataGridViewTextBoxColumn colShopNotes;
private System.Windows.Forms.NumericUpDown numCount;
private System.Windows.Forms.Label lblProdName;
private System.Windows.Forms.DataGridViewCheckBoxColumn colSelect;
private System.Windows.Forms.DataGridViewTextBoxColumn col_db_id;
private System.Windows.Forms.DataGridViewTextBoxColumn col_product_name;
@@ -620,11 +938,13 @@ namespace TemuKJD.KJDForms.ProductSelectForms
private System.Windows.Forms.DataGridViewTextBoxColumn col_ext_code;
private System.Windows.Forms.DataGridViewTextBoxColumn colAddTimes;
private System.Windows.Forms.DataGridViewTextBoxColumn colSelectTotalCount;
private System.Windows.Forms.DataGridViewTextBoxColumn colProdGetType;
private System.Windows.Forms.DataGridViewTextBoxColumn col_notes;
private System.Windows.Forms.DataGridViewTextBoxColumn colHeadWords;
private System.Windows.Forms.DataGridViewTextBoxColumn colEndWords;
private System.Windows.Forms.DataGridViewTextBoxColumn colFissionWords;
private System.Windows.Forms.DataGridViewTextBoxColumn colAddTime;
private System.Windows.Forms.DataGridViewLinkColumn colSelectProd;
private System.Windows.Forms.DataGridViewLinkColumn col_edit;
private System.Windows.Forms.DataGridViewLinkColumn col_delete;
private System.Windows.Forms.DataGridViewLinkColumn col_select_product;
@@ -1,7 +1,7 @@
using AllBase;
using AllBase.Model.Result;
using AllBase.Model.Result.TemuResult;
using NaiBa.Util.Extension;
using NaiBa.Util.Winform.Extension;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
@@ -13,9 +13,11 @@ using System.Linq;
using System.Net;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using TemuKJD.BaseForms;
using TemuKJD.Extension;
using TemuKJD.KJDForms.ToolForms;
using TemuKJD.ToolForms;
using Work;
@@ -24,8 +26,8 @@ namespace TemuKJD.KJDForms.ProductSelectForms
{
public partial class DbProductListForm : LRBaseForm
{
ShopLoginInfo shop = null;
ShopLoginInfo shop = null; // 单店认领
List<ShopLoginInfo> lstAdminShopInfo = new List<ShopLoginInfo>(); // 服务端直传店铺列表
List<KJDDBProduct> lstTemuDbProduct = new List<KJDDBProduct>();
public DbProductListForm()
@@ -48,9 +50,12 @@ namespace TemuKJD.KJDForms.ProductSelectForms
this.dgvDbProduct.Columns["colHeadWords"].Visible = true;
this.dgvDbProduct.Columns["colEndWords"].Visible = true;
this.dgvDbProduct.Columns["colFissionWords"].Visible = true;
this.dgvDbProduct.Columns["colSelectProd"].Visible = true;
this.dgvDbProduct.Columns["colProdGetType"].Visible = true;
//this.dgvDbProduct.Columns["col_notes"].Visible = true;
//this.lblNotes.Visible = true;
//this.txtNotes.Visible = true;
this.btnImportHtml.Visible = true;
}
else
{
@@ -59,9 +64,12 @@ namespace TemuKJD.KJDForms.ProductSelectForms
this.dgvDbProduct.Columns["colHeadWords"].Visible = false;
this.dgvDbProduct.Columns["colEndWords"].Visible = false;
this.dgvDbProduct.Columns["colFissionWords"].Visible = false;
this.dgvDbProduct.Columns["colSelectProd"].Visible = false;
this.dgvDbProduct.Columns["colProdGetType"].Visible = false;
//this.dgvDbProduct.Columns["col_notes"].Visible = false;
//this.lblNotes.Visible = false;
//this.txtNotes.Visible = false;
this.btnImportHtml.Visible = false;
}
btnSelect.Visible = false;
@@ -76,6 +84,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
this.ucSplitPage1.PageChange += UcSplitPage1_PageChange;
this.dgvDbProduct.AddSelectorColumn("colSelect");
this.dgvDbProduct.AddImgColumn("colMainImg", "colImgUrl");
}
private void btnSearch_Click(object sender, EventArgs e)
@@ -110,14 +119,14 @@ namespace TemuKJD.KJDForms.ProductSelectForms
lstTemuDbProduct.AddRange(list);
this.ucSplitPage1.TotalPage = pageCount;
if (defaultBitmap == null)
defaultBitmap = new Bitmap(80, 80);
// 获取Bitmap的Graphics对象
using (Graphics g = Graphics.FromImage(defaultBitmap))
{
// 清除整个Bitmap为蓝色
g.Clear(Color.White);
}
//if (defaultBitmap == null)
// defaultBitmap = new Bitmap(80, 80);
//// 获取Bitmap的Graphics对象
//using (Graphics g = Graphics.FromImage(defaultBitmap))
//{
// // 清除整个Bitmap为白色
// g.Clear(Color.White);
//}
foreach (var prod in lstTemuDbProduct)
{
Invoke(new Action(() =>
@@ -126,19 +135,21 @@ namespace TemuKJD.KJDForms.ProductSelectForms
false,
prod.id,
prod.product_name,
prod?.main_img?.Replace("https", "http"),
defaultBitmap, // prod.main_img,
prod?.main_img?.Replace("https://", "http://").Replace("img.kwcdn.com", "img.cdnfe.com"),
DataGridViewExtension.defaultBitmap, // prod.main_img,
prod.spu_id,
prod.skc_id,
prod.cat_name,
prod.ext_code,
prod.select_count,
prod.select_total_count,
prod.product_get_type == 0 ? "母店采集" : "前端直采",
prod.notes,
prod.head_words,
prod.end_words,
prod.fission_words,
prod.add_time,
"商品直传",
"编辑",
"删除",
"认领");
@@ -149,68 +160,17 @@ namespace TemuKJD.KJDForms.ProductSelectForms
Invoke(new Action(() =>
{
ShowDgvImg();
this.pbLoading.Visible = false;
}));
});
}
Bitmap defaultBitmap = null;
void ShowDgvImg()
{
Task.Run(() =>
{
foreach (DataGridViewRow row in this.dgvDbProduct.Rows)
{
if (row.Index > 0 && row.Cells["colMainImg"].Displayed == false)
{
try
{
Invoke(new Action(() =>
{
row.Cells["colMainImg"].Value = defaultBitmap;
}));
}
catch
{
}
continue;
}
if (row.Cells["colMainImg"].Value != null && row.Cells["colMainImg"].Value != defaultBitmap)
continue;
Image image = null;
string imgUrl = row.Cells["colImgUrl"]?.Value.ParseToString();
string getImgError = "";
if (!string.IsNullOrWhiteSpace(imgUrl))
image = GetHtml.GetUrlImg(imgUrl, out getImgError);
if (!string.IsNullOrEmpty(getImgError))
//BaseMsgForm.ShowError("图片加载失败 " + getImgError);
image = TemuKJD.Properties.Resources.errpic;
try
{
Invoke(new Action(() =>
{
row.Cells["colMainImg"].Value = image;
}));
}
catch
{
}
}
});
}
public List<KJDDBProduct> GetProductList(out int pageCount, int page = 1, int pageSize = 200)
{
List<KJDDBProduct> list = new List<KJDDBProduct>();
pageCount = 1;
var url = BaseClass.BuildObjString("product/get_product_list");
if(shop!=null && shop.DbId.ParseToInt()!=0 )
url = BaseClass.BuildObjString("product/get_product_list");
var data = "";
Invoke(new Action(() =>
@@ -229,6 +189,11 @@ namespace TemuKJD.KJDForms.ProductSelectForms
data += "&get_select_count=true";
data += "&select_shop_id=" + shop.ShopId;
}
else if (BaseClass.SaLevel == 1) // 店铺非空管理状态允许查看后台采集和前端采集的所有商品
{
data += "&product_get_type=all";
}
if (this.cmbSort.Text == "认领总数")
{
data += "&sort_field=select_total_count";
@@ -323,7 +288,12 @@ namespace TemuKJD.KJDForms.ProductSelectForms
imgFrom.ShowDialog();
break;
case "认领":
Task.Run(() => { SelectProduct(new KJDDBProduct[] { dbProduct }); });
Task.Run(() => { SelectProduct(shop, new KJDDBProduct[] { dbProduct }); });
break;
case "商品直传":
panel2.Visible = true;
panel2.Tag = dbProduct;
lblProdName.Text = dbProduct.product_name;
break;
case "":
dgvDbProduct.Rows[e.RowIndex].Cells["colSelect"].Value = !(bool)dgvDbProduct.Rows[e.RowIndex].Cells["colSelect"].Value;
@@ -333,9 +303,15 @@ namespace TemuKJD.KJDForms.ProductSelectForms
}
}
private void SelectProduct(KJDDBProduct[] prods)
/// <summary>
/// 商品认领或者直传
/// </summary>
/// <param name="prods"></param>
/// <param name="prodSelectCount">商品上传(直传)次数</param>
/// <param name="isDbToDb">数据直传</param>
private void SelectProduct(ShopLoginInfo selectShop, KJDDBProduct[] prods, int prodSelectCount = 1, bool isDbToDb = false)
{
if (shop == null)
if (selectShop == null)
{
BaseMsgForm.ShowError("店铺不能为空!");
return;
@@ -350,7 +326,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
{
this.pbLoading.Visible = true;
this.statusBar.lblTaskStatus.Text = "正在认领...";
this.statusBar.pgbTaskProgress.Maximum = prods.Length;
this.statusBar.pgbTaskProgress.Maximum = prods.Length * prodSelectCount;
this.statusBar.UpdateProgressBar(0);
}));
@@ -358,19 +334,22 @@ namespace TemuKJD.KJDForms.ProductSelectForms
foreach (var prod in prods)
{
Invoke(new Action(() =>
{
this.statusBar.UpdateProgressBar(this.statusBar.pgbTaskProgress.Value + 1);
}));
if (prod == null)
{
Invoke(new Action(() =>
{
this.statusBar.UpdateProgressBar(this.statusBar.pgbTaskProgress.Value + prodSelectCount);
}));
errorMsg += "prod null; ";
continue;
}
if (shop.AddProductRemaining <=0)
if (selectShop.AddProductRemaining <= 0 && !isDbToDb) // 管理员发起的数据直传不消耗次数
{
Invoke(new Action(() =>
{
this.statusBar.UpdateProgressBar(this.statusBar.pgbTaskProgress.Value + prodSelectCount);
}));
if (!errorMsg.Contains("本月商品认领限额已用完"))
errorMsg += " 本月商品认领限额已用完,请下个月再操作!";
continue;
@@ -378,41 +357,52 @@ namespace TemuKJD.KJDForms.ProductSelectForms
try
{
var fissionProductName = GetFissionProductName(prod);
var url = BaseClass.BuildObjString("product/add_user_select_product");
var data = UserLogin.GetSignaturex() +
"&out_product_id=" + prod.id +
"&shop_id=" + shop.ShopId +
"&shop_account=" + shop.ShopAccount +
"&main_user_name=" + shop.UserName +
"&sub_user_name=" + shop.SubUserName +
"&add_product_remaining=" + shop.AddProductRemaining +
"&add_fission_product_name=" + GetHtml.UrlEncodeUtf8(fissionProductName) +
"&status=待上传";
var 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"))
for (int i = 0; i < prodSelectCount; i++)
{
errorMsg += prod.spu_id + " " + BaseRegex.GetStringJson(ref html, "msg") + "; ";
}
else
{
prod.select_count++;
prod.select_total_count++;
Invoke(new Action(() =>
{
var row = this.dgvDbProduct.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["col_db_id"].Value.ParseToInt() == prod.id);
if (row != null)
{
row.Cells["colAddTimes"].Value = prod.select_count;
row.Cells["colSelectTotalCount"].Value = prod.select_total_count;
}
this.statusBar.UpdateProgressBar(this.statusBar.pgbTaskProgress.Value + 1);
}));
shop.AddProductRemaining = shop.AddProductRemaining - 1;
var fissionProductName = GetFissionProductName(prod);
var url = BaseClass.BuildObjString("product/add_user_select_product");
var data = UserLogin.GetSignaturex() +
"&out_product_id=" + prod.id +
"&shop_id=" + selectShop.ShopId +
"&shop_account=" + selectShop.ShopAccount +
"&main_user_name=" + selectShop.UserName +
"&sub_user_name=" + selectShop.SubUserName;
if (!isDbToDb) // 管理员发起的数据直传不消耗次数,不计算认领次数
data += "&add_product_remaining=" + selectShop.AddProductRemaining;
data += "&add_fission_product_name=" + GetHtml.UrlEncodeUtf8(fissionProductName) +
"&status=待上传";
var 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 += prod.spu_id + " " + BaseRegex.GetStringJson(ref html, "msg") + "; ";
}
else
{
prod.select_count++;
prod.select_total_count++;
Invoke(new Action(() =>
{
var row = this.dgvDbProduct.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["col_db_id"].Value.ParseToInt() == prod.id);
if (row != null)
{
row.Cells["colAddTimes"].Value = prod.select_count;
row.Cells["colSelectTotalCount"].Value = prod.select_total_count;
}
}));
if (!isDbToDb) // 管理员发起的数据直传不消耗次数,不计算认领次数
selectShop.AddProductRemaining = selectShop.AddProductRemaining - 1;
}
Thread.Sleep(50);
}
}
catch (Exception ex) {
@@ -520,7 +510,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
{
this.btnSelect.Enabled = false;
Task.Run(() => {
SelectProduct(prodList);
SelectProduct(shop, prodList);
Invoke(new Action(() =>
{
this.btnSelect.Enabled = true;
@@ -535,7 +525,574 @@ namespace TemuKJD.KJDForms.ProductSelectForms
private void dgvDbProduct_Scroll(object sender, ScrollEventArgs e)
{
ShowDgvImg();
}
private void btnImportHtml_Click(object sender, EventArgs e)
{
var result = ImportHtmlProd();
if (result)
SearchDbProd(this.ucSplitPage1.CurrentPage);
}
bool ImportHtmlProd()
{
bool rst = true;
bool IsOperate = true;
this.btnImportHtml.Enabled = false;
//string text = "请导入保存为html的temu商品文件";
//BaseMsgForm.ShowInfo(text, "", FormLevel.LARGE);
OpenFileDialog openFileDialog = new OpenFileDialog();
openFileDialog.Filter = "html文件(*.html)|*.html";
openFileDialog.RestoreDirectory = true;
openFileDialog.FilterIndex = 1;
if (openFileDialog.ShowDialog() == DialogResult.OK)
{
using (StreamReader sr = new StreamReader(openFileDialog.FileName, System.Text.Encoding.UTF8))
{
string fileName = openFileDialog.FileName;
string importStr = sr.ReadToEnd().Trim();;
try
{
// 通用格式
if (importStr.Contains("window.__CHUNK_DATA__={};window.rawData=") &&
importStr.Contains(";document.dispatchEvent(new Event('XRenderInitialPropsLoaded'));"))
{
var jsonStr = importStr.Substring(importStr.IndexOf("window.__CHUNK_DATA__={};window.rawData=") + "window.__CHUNK_DATA__={};window.rawData=".Length);
jsonStr = jsonStr.Substring(0, jsonStr.IndexOf(";document.dispatchEvent(new Event('XRenderInitialPropsLoaded'));"));
var jObj = JObject.Parse(jsonStr);
var storeStr = JsonHelper.SerializeObject(jObj["store"]);
var clientProductInfo = JsonHelper.DeserializeJsonToObject<TemuWebClientProductInfo>(storeStr);
SaveClientProduct(clientProductInfo);
}
else
{
BaseMsgForm.ShowConfirm("未找到temu商品信息,请重新保存html后导入");
rst = false;
}
}
catch (Exception ex)
{
BaseMsgForm.ShowConfirm("导入temu商品信息错误:" + ex.Message);
rst = false;
}
}
}
this.btnImportHtml.Enabled = true;
return rst;
}
void SaveClientProduct(TemuWebClientProductInfo clientProdInfo)
{
TemuDetailProductInfo product = new TemuDetailProductInfo();
product.canEditSizeTemplate = true;
product.canEditSkuAccessories = true;
product.carouselImageI18nVOList = new List<object>();
product.carouselImageUrls = new List<string>();
foreach (var item in clientProdInfo.goods.bannerList)
{
product.carouselImageUrls.Add(item.url);
}
product.carouseVideoVOList = new List<carouseVideoVo>(); // todo: 查看带视频的商品主图如何上传
foreach (var item in clientProdInfo.goods.bannerList)
{
if (item.video != null)
{
string abc = "abcdefghijklmnoqprstuvwxyz123456789";
string strVid = "";
while(strVid.Length < 32)
{
strVid += abc[Randomx.GetId(abc.Length)];
}
product.carouseVideoVOList.Add(new carouseVideoVo()
{
coverUrl = item.video.url,
videoType = 1,
height = item.video.height,
width = item.video.width,
productId = null,
supplierId = clientProdInfo.goods.mallId,
coverUrlDisplay = null,
//vid = "goods-video-tag#pokis7uhk62rriiu46b472pa1azpn5ds",
//vid = "goods-video-tag#" + strVid,
videoUrl = item.video.videoUrl,
videoUrlDisplay = null,
});
}
}
product.categories = new TemuCategories();
product.categories.cat1 = new TemuCat() { catId = clientProdInfo.goods.catId1.ParseToLong() };
product.categories.cat2 = new TemuCat() { catId = clientProdInfo.goods.catId2.ParseToLong() };
product.categories.cat3 = new TemuCat() { catId = clientProdInfo.goods.catId3.ParseToLong() };
product.categories.cat4 = new TemuCat() { catId = clientProdInfo.goods.catId4.ParseToLong() };
product.categories.cat5 = new TemuCat() { catId = clientProdInfo.goods.catId5.ParseToLong() };
product.categories.cat6 = new TemuCat() { catId = clientProdInfo.goods.catId6.ParseToLong() };
product.categories.cat7 = new TemuCat() { catId = clientProdInfo.goods.catId7.ParseToLong() };
product.categories.cat8 = new TemuCat() { catId = clientProdInfo.goods.catId8.ParseToLong() };
product.categories.cat9 = new TemuCat() { catId = clientProdInfo.goods.catId9.ParseToLong() };
product.categories.cat10 = new TemuCat() { catId = clientProdInfo.goods.catId10.ParseToLong() };
var catId = clientProdInfo.goods.catId.ParseToLong();
if (product.categories.cat1.catId == 0 || product.categories.cat1.catId == catId)
product.categories.cat1.catId = catId;
else if (product.categories.cat2.catId == 0 || product.categories.cat2.catId == catId)
product.categories.cat2.catId = catId;
else if (product.categories.cat3.catId == 0 || product.categories.cat3.catId == catId)
product.categories.cat3.catId = catId;
else if (product.categories.cat4.catId == 0 || product.categories.cat4.catId == catId)
product.categories.cat4.catId = catId;
else if (product.categories.cat5.catId == 0 || product.categories.cat5.catId == catId)
product.categories.cat5.catId = catId;
else if (product.categories.cat6.catId == 0 || product.categories.cat6.catId == catId)
product.categories.cat6.catId = catId;
else if (product.categories.cat7.catId == 0 || product.categories.cat7.catId == catId)
product.categories.cat7.catId = catId;
else if (product.categories.cat8.catId == 0 || product.categories.cat8.catId == catId)
product.categories.cat8.catId = catId;
else if (product.categories.cat9.catId == 0 || product.categories.cat9.catId == catId)
product.categories.cat9.catId = catId;
else if (product.categories.cat10.catId == 0 || product.categories.cat10.catId == catId)
product.categories.cat10.catId = catId;
product.detailVideoVOList = new List<object>();
product.editTaskSupportI18nLanguages = null;
product.goodsAdvantageLabelVOList = new List<object>();
product.goodsI18nList = new List<object>();
product.goodsId = clientProdInfo.goods.goodsId;
product.goodsLayerDecorationCustomizeI18nVOList = new List<object>();
product.goodsLayerDecorationVOList = new List<TemuGoodsLayerDecorationVO>(); // 详情图
foreach (var floorItem in clientProdInfo.productDetail.floorList)
{
//if (floorItem.type != 1)
// continue;
TemuGoodsLayerDecorationVO goodsLayerDecoration = new TemuGoodsLayerDecorationVO
{
floorId = null,
lang = "zh",
key = "DecImage",
//type = item.type == 1 ? "image" : "",
type = "image",
priority = 0,
contentList = new List<TemuContent>(),
};
foreach (var subItem in floorItem.items)
{
goodsLayerDecoration.contentList.Add(new TemuContent()
{
height = subItem.height,
width = subItem.width,
imgUrl = subItem.url,
text = "",
});
}
product.goodsLayerDecorationVOList.Add(goodsLayerDecoration);
}
//productDetailFlatList
product.goodsModelList = null;
product.guideFilePageImages = new List<object>();
product.imageLanguageList = null;
product.inProcessAddSizeSpecEditTask = null;
product.inProcessEditTaskList = new List<object>();
product.isImproveSalesInfo = true;
product.mainParentSpecIds = new List<object>();
product.materialImgUrl = clientProdInfo.goods.hdThumbUrl;
if (string.IsNullOrEmpty(product.materialImgUrl))
product.materialImgUrl = clientProdInfo.goods.thumbUrl;
if (string.IsNullOrEmpty(product.materialImgUrl))
product.materialImgUrl = product.carouselImageUrls.FirstOrDefault();
product.outerPackageImages = new List<TemuOuterPackageImage>(); // 获取不到图片,填第一张主图又会报错,此处不填,到上货时上传第一张主图
//product.outerPackageImages.Add(new TemuOuterPackageImage()
//{
// imageUrl = product.carouselImageUrls.FirstOrDefault(),
// signedImageUrl = product.carouselImageUrls.FirstOrDefault(),
//});
product.productAuditDraftVO = null;
product.productCategoryPredictList = null;
product.productCreateTime = BaseClass.DateTimeToTimestampMilliseconds(DateTime.Now); // 此处获取不到上架时间,直接填写导入时间。
product.productGuideFileI18nList = new List<object>();
product.productGuideFileNewVOList = new List<object>();
product.productGuideFileRejectVO = null;
product.productI18nList = new List<object>();
product.productId = clientProdInfo.goods.goodsId; // 此处获取不到productId,直接填前台goodsId
product.productImageProcessExtVOList = new List<TemuProductImageProcessExtVO>(); // 这个数据好像没用,暂时不填
product.productLocalExtAttr = new TemuProductLocalExtAttr() { materialMultiLanguages = new List<object>() };
product.productName = clientProdInfo.goods.goodsName;
product.productNonAuditExtAttr = new TemuProductNonAuditExtAttr()
{
california65WarningInfoVO = new TemuCalifornia65WarningInfoVO() { california65ChemicalNames = null, california65WarningType = null },
cosmeticInfoVO = new TemuCosmeticInfoVO() { propertyInfoList = null },
productCatManagement = null,
};
product.productPropertyList = new List<TemuProductProperty>();
foreach(var prop in clientProdInfo.goodsProperty)
{
foreach (var propVal in prop.values)
{
product.productPropertyList.Add(new TemuProductProperty() // todo: 上货的时候根据 refPid propName propValue 去匹配vid、pid等
{
refPid = prop.refPid,
propName = prop.key,
propValue = propVal,
valueUnit = "",
valueExtendInfo = "",
numberInputValue = "",
pid = null,
templatePid = null,
vid = null,
});
}
}
product.productSaleExtAttr = new TemuProductSaleExtAttr();
product.productSkcList = new List<TemuProductSkc>();
TemuProductSkc skcInfo = new TemuProductSkc();
product.productSkcList.Add(skcInfo);
skcInfo.bomId = null;
skcInfo.colorImageUrl = null;
skcInfo.extCode = clientProdInfo.goods.itemId;
skcInfo.matchSelected = true;
skcInfo.previewImgUrls = product.carouselImageUrls.Take(1).ToList();
skcInfo.productSkcCarouselImageI18nVOList = new List<object>();
skcInfo.productSkcId = clientProdInfo.goods.goodsId; // 此处获取不到SkcId,直接填前台goodsId
skcInfo.productSkcImageExtList = new List<TemuProductSkcImageExt>();
skcInfo.productSkcImageExtList.Add(new TemuProductSkcImageExt()
{
imgUrl = skcInfo.previewImgUrls.FirstOrDefault(),
imgTag = 0,
isOcr = null,
});
skcInfo.productSkcImageProcessExtVOList = new List<TemuProductSkcImageExt>();
skcInfo.productSkcImageProcessExtVOList.Add(new TemuProductSkcImageExt()
{
imgUrl = skcInfo.previewImgUrls.FirstOrDefault(),
imgTag = 0,
isOcr = null,
});
skcInfo.productSkcSpecList = new List<TemuProductSkcSpec>();
skcInfo.productSkcSpecList.Add(new TemuProductSkcSpec
{
parentSpecId = 0,
parentSpecName = "",
specId = 0,
specName = "",
unitSpecName = null,
});
skcInfo.productSkcWhExtAttr = new TemuProductSkcWhExtAttr() { isBasePlate = 0, };
skcInfo.productSkuList = new List<TemuProductSku>();
foreach (var sku in clientProdInfo.sku)
{
TemuProductSku skuInfo = new TemuProductSku();
skcInfo.productSkuList.Add(skuInfo);
skuInfo.currencyType = "CNY";
skuInfo.extCode = sku.skuExt.Keys.Contains("skuModel") ? sku.skuExt["skuModel"] : "";
skuInfo.productSkuId = sku.skuId;
skuInfo.productSkuImageProcessExtVOList = new List<TemuProductSkuImageProcessExtVO>();
skuInfo.productSkuImageProcessExtVOList.Add(new TemuProductSkuImageProcessExtVO()
{
imgTag = 0,
imgUrl = sku.thumbUrl,
isOcr = false
});
skuInfo.productSkuMultiPack = new TemuProductSkuMultiPack()
{
skuClassification = 1,
numberOfPieces = 1,
pieceUnitCode = 1,
individuallyPacked = null,
mixedType = null,
numberOfPiecesNew = null,
pieceNewUnitCode = null,
productSkuNetContent = null,
totalNetContent = null,
};
skuInfo.productSkuNonAuditExtAttr = null;
skuInfo.productSkuQuantity = null;
skuInfo.productSkuSaleExtAttr = new TemuProductSkuSaleExtAttr()
{
productSkuAccessories = new TemuProductSkuAccessories() { productSkuAccessories = new List<object>() },
productSkuNetContent = new TemuProductSkuNetContent(),
};
skuInfo.productSkuSensitiveApprove = new TemuProductSkuSensitiveApprove
{
productSkuId = sku.skuId,
sensitiveCateProblem = false,
sensitiveLimitProblem = false,
};
skuInfo.productSkuSpecList = new List<TemuProductSkuSpec>();
foreach(var spec in sku.specs)
{
skuInfo.productSkuSpecList.Add(new TemuProductSkuSpec()
{
parentSpecId = spec.specKeyId,
parentSpecName = spec.specKey,
specId = spec.specValueId,
specName = spec.specValue,
unitSpecName = null,
});
}
skuInfo.productSkuSuggestedPrice = new TemuProductSkuSuggestedPrice()
{
specialSuggestedPrice = "NA",
};
skuInfo.productSkuThumbUrlI18nVOList = new List<object>();
skuInfo.productSkuUsSuggestedPrice = new TemuProductSkuUsSuggestedPrice();
skuInfo.productSkuWhExtAttr = new TemuProductSkuWhExtAttr()
{
productSkuVolume = new TemuProductSkuVolume()
{
len = 300,
width = 200,
height = 100,
},
productSkuWeight = new TemuProductSkuWeight()
{
value = 500000,
},
productSkuBarCodes = new List<object>(),
productSkuSensitiveAttr = new TemuProductSkuSensitiveAttr()
{
isForce2Normal = false,
force2NormalTypes = null,
isSensitive = 0,
sensitiveList = new List<object>(),
sensitiveTypes = new List<object>(),
},
productSkuSensitiveLimit = new TemuProductSkuSensitiveLimit(),
};
skuInfo.siteReferPriceList = null;
skuInfo.siteSupplierPrices = null;
skuInfo.supplierPrice = (sku.salePrice * GetExchangeRate(sku.normalPriceStr.ParseToString())).ParseToInt();
skuInfo.thumbUrl = sku.thumbUrl;
}
skcInfo.skcStatus = 11;
product.productSpecPropertyVOS = new List<TemuProductSpecPropertyVO>(); // 此处如果不填商品无法提交到未发布
foreach (var sku in clientProdInfo.sku)
{
foreach (var spec in sku.specs)
{
if (product.productSpecPropertyVOS.Any(s => s.specId == spec.specValueId && s.parentSpecId == spec.specKeyId))
continue;
product.productSpecPropertyVOS.Add(new TemuProductSpecPropertyVO()
{
parentSpecId = spec.specKeyId,
//parentSpecName = spec.specKey,
specId = spec.specValueId,
//specName = spec.specValue,
vid = 0,
refPid = 0,
pid = 0,
templatePid = 0,
propName = spec.specKey,
propValue = spec.specValue,
valueUnit = "",
valueGroupId = 0,
valueGroupName = "",
valueExtendInfo = "",
numberInputValue = "",
});
}
}
product.productType = 1;
product.productWarehouseRoute = null;
product.productWhExtAttr = new TemuProductWhExtAttr()
{
outerGoodsUrl = "",
productCatConfig = null,
productFragileLabelAttr = new TemuProductFragileLabelAttr() { isFragile = false, },
sensitiveTransNormalFiles = new List<object>(),
// 包装形状和包装类型
productOuterPackage = new TemuProductOuterPackage() { packageShape = 0, packageType = 0, },
// 商品产地 6广东 31浙江
productOrigin = new TemuProductOrigin() { countryName = "China", countryShortName = "CN", region2Id = 43000000000006, },
productOriginCertFiles = new List<object>(),
copyFromProductId = null,
personalizationSwitch = null,
newProductCatMisplace = new TemuNewProductCatMisplace() { feedback = null, matchMisplace = false, recCategoriesList = new List<object>(), },
semiManagedSiteMode = null,
};
product.showSizeTemplateIds = null;
product.sizeTemplateId = null;
product.sizeTemplateIds = null;
product.skcQcAdjustmentNote = null;
product.sourceType = 0;
product.supplierId = clientProdInfo.goods.mallId;
product.supplierSourceType = 1000;
product.temuSupplier = true;
product.vehicleLibraryRelationDTOList = null;
string result = JsonHelper.SerializeObject(product);
string sizeRst = "";
// 读取数据库是否有相同商品
var url = BaseClass.BuildObjString("product/get_product_list");
var data = "";
data = UserLogin.GetSignaturex() +
"&page=" + 1 +
"&page_size=" + 1;
data += "&search_spu=" + product?.productId;
if (BaseClass.SaLevel == 1) // 店铺非空管理状态允许查看后台采集和前端采集的所有商品
{
data += "&product_get_type=all";
}
//data += "&search_skc=" + product?.productSkcList?.FirstOrDefault()?.productSkcId;
int dbId = 0;
var 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"))
{
dbId = BaseRegex.GetIntJson(ref html, "id");
}
if (dbId > 0 && BaseMsgForm.ShowConfirm("数据库已存在相同ID的商品,是否覆盖?(选择否新增一条数据)").DialogResult == DialogResult.OK)
{
url = BaseClass.BuildObjString("product/mdy_db_product");
data = UserLogin.GetSignaturex() +
"&db_id=" + dbId;
data += "&product_json=" + HttpUtility.UrlEncode(result, Encoding.UTF8);
data += "&size_json=" + HttpUtility.UrlEncode(sizeRst, Encoding.UTF8);
data += "&original_json=" + HttpUtility.UrlEncode(JsonHelper.SerializeObject(clientProdInfo), 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"))
{
string msg = "商品保存失败!请检查html文件:" + BaseRegex.GetStringJson(ref html, "msg");
BaseMsgForm.ShowError(msg);
}
else
{
BaseMsgForm.ShowInfo("选品商品保存成功!");
}
}
else
{
url = BaseClass.BuildObjString("product/add_product");
data = Work.UserLogin.GetSignaturex() +
"&spu_id=" + product?.productId +
"&skc_id=" + product?.productSkcList?.FirstOrDefault()?.productSkcId +
"&cat_id=" + clientProdInfo.goods.catId.ParseToLong() +
"&cat_name=" + HttpUtility.UrlEncode(clientProdInfo.crumbOptList.LastOrDefault()?.title, Encoding.UTF8) +
"&ext_code=" + HttpUtility.UrlEncode(product?.productSkcList?.FirstOrDefault()?.extCode, Encoding.UTF8) +
"&product_name=" + HttpUtility.UrlEncode(product?.productName, Encoding.UTF8) +
"&product_json=" + HttpUtility.UrlEncode(result, Encoding.UTF8) +
"&size_json=" + HttpUtility.UrlEncode(sizeRst, Encoding.UTF8) +
"&original_json=" + HttpUtility.UrlEncode(JsonHelper.SerializeObject(clientProdInfo), Encoding.UTF8) +
"&main_img=" + HttpUtility.UrlEncode(product?.carouselImageUrls?.FirstOrDefault(), Encoding.UTF8) +
"&product_get_type=1"; // 0母店采集 1前端直采 不填默认0
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 = "商品保存失败!请检查html文件:" + BaseRegex.GetStringJson(ref html, "msg");
BaseMsgForm.ShowError(msg);
}
else
{
BaseMsgForm.ShowInfo("选品商品保存成功!");
}
}
}
decimal GetExchangeRate(string inputStr)
{
if (inputStr.StartsWith("CA$"))
return 5.1m;
if (inputStr.StartsWith("US$"))
return 7.1m;
return 1;
}
private void dgvSelectShop_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if (e.ColumnIndex < 0 || e.RowIndex < 0)
return;
string headerText = dgvSelectShop.Columns[e.ColumnIndex].HeaderText;
if (headerText == "选择")
{
foreach (DataGridViewRow row in dgvSelectShop.Rows)
{
row.Cells["colCheck"].Value = false;
}
dgvSelectShop.Rows[e.RowIndex].Cells["colCheck"].Value = true;
}
}
private void btnCancel_Click(object sender, EventArgs e)
{
panel2.Visible = false;
}
private void btnGetShop_Click(object sender, EventArgs e)
{
this.pbLoading.Visible = true;
this.dgvSelectShop.Rows.Clear();
this.lstAdminShopInfo.Clear();
Task.Run(() =>
{
int pageCount;
var list = AdminForms.AdminShopListForm.Instance.AdminGetServerShopLst(out pageCount, "", "", "",
txtShopId.Text.Trim(), txtShopName.Text.Trim(), 1, 10);
lstAdminShopInfo.AddRange(list);
this.ucSplitPage1.TotalPage = pageCount;
foreach (var shop in lstAdminShopInfo)
{
Invoke(new Action(() =>
{
int rowIndex = this.dgvSelectShop.Rows.Add(
false,
shop.UserName,
shop.SubUserName,
shop.ShopId,
shop.ShopAccount,
shop.Notes);
if (rowIndex == 0)
{
this.dgvSelectShop.Rows[rowIndex].Cells["colCheck"].Value = true;
}
}));
}
Invoke(new Action(() =>
{
this.pbLoading.Visible = false;
}));
});
}
private void btnAddToSelectDb_Click(object sender, EventArgs e)
{
KJDDBProduct dbProduct = panel2.Tag as KJDDBProduct;
if (dbProduct == null)
return;
var selectShopId = this.dgvSelectShop.Rows.Cast<DataGridViewRow>()
.FirstOrDefault(r => r.Cells["colCheck"].Value.ParseToBool() == true)?.Cells["colShopId"].Value.ParseToString();
var selectShop = lstAdminShopInfo.FirstOrDefault(s => s.ShopId == selectShopId);
if (!string.IsNullOrEmpty(selectShopId) && selectShop != null)
{
this.btnSelect.Enabled = false;
Task.Run(() => {
SelectProduct(selectShop, new KJDDBProduct[] { dbProduct }, numCount.Value.ParseToInt(), true);
Invoke(new Action(() =>
{
this.btnSelect.Enabled = true;
}));
});
}
else
{
BaseMsgForm.ShowError("未选择店铺!");
}
}
}
}
@@ -117,6 +117,24 @@
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="colCheck.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colUserName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colSubUserName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colShopId.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colShopName.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colShopNotes.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colSelect.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
@@ -150,6 +168,9 @@
<metadata name="colSelectTotalCount.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colProdGetType.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="col_notes.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
@@ -165,6 +186,9 @@
<metadata name="colAddTime.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colSelectProd.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="col_edit.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
@@ -37,8 +37,11 @@
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.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DbProductSelectListManageForm));
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.txtNotChangeMainImg = new System.Windows.Forms.TextBox();
this.chkNotChangeMainImg = new TemuKJD.UserComponent.UcCheckBox(this.components);
this.chkAiSkuAndMainImg = new TemuKJD.UserComponent.UcCheckBox(this.components);
this.chkLongTitle = new TemuKJD.UserComponent.UcCheckBox(this.components);
this.chkSameExtcodeRandomMainImg = new TemuKJD.UserComponent.UcCheckBox(this.components);
@@ -130,6 +133,7 @@
this.colLogin = new System.Windows.Forms.DataGridViewLinkColumn();
this.colImportCookies = new System.Windows.Forms.DataGridViewLinkColumn();
this.colCopyCookies = new System.Windows.Forms.DataGridViewLinkColumn();
this.colProdGetType = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colSpuId = new System.Windows.Forms.DataGridViewLinkColumn();
this.colSkcId = new System.Windows.Forms.DataGridViewLinkColumn();
this.colImgUrl = new System.Windows.Forms.DataGridViewTextBoxColumn();
@@ -150,8 +154,6 @@
this.colOpResult = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ucSplitPage1 = new TemuKJD.UserControls.UcSplitPage();
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
this.chkNotChangeMainImg = new TemuKJD.UserComponent.UcCheckBox(this.components);
this.txtNotChangeMainImg = new System.Windows.Forms.TextBox();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
@@ -235,6 +237,31 @@
this.splitContainer1.SplitterDistance = 125;
this.splitContainer1.TabIndex = 2;
//
// txtNotChangeMainImg
//
this.txtNotChangeMainImg.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.txtNotChangeMainImg.Location = new System.Drawing.Point(1440, 97);
this.txtNotChangeMainImg.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2);
this.txtNotChangeMainImg.Name = "txtNotChangeMainImg";
this.txtNotChangeMainImg.ReadOnly = true;
this.txtNotChangeMainImg.Size = new System.Drawing.Size(36, 23);
this.txtNotChangeMainImg.TabIndex = 700;
this.txtNotChangeMainImg.Text = "5";
//
// chkNotChangeMainImg
//
this.chkNotChangeMainImg.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.chkNotChangeMainImg.AutoSize = true;
this.chkNotChangeMainImg.Checked = true;
this.chkNotChangeMainImg.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkNotChangeMainImg.Location = new System.Drawing.Point(1410, 98);
this.chkNotChangeMainImg.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.chkNotChangeMainImg.Name = "chkNotChangeMainImg";
this.chkNotChangeMainImg.Size = new System.Drawing.Size(151, 21);
this.chkNotChangeMainImg.TabIndex = 699;
this.chkNotChangeMainImg.Text = "第 张主图不替换";
this.chkNotChangeMainImg.UseVisualStyleBackColor = true;
//
// chkAiSkuAndMainImg
//
this.chkAiSkuAndMainImg.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
@@ -856,7 +883,7 @@
"核价成功",
"核价成功(重复)",
"重复"});
this.cmbNotes.Location = new System.Drawing.Point(917, 5);
this.cmbNotes.Location = new System.Drawing.Point(917, 8);
this.cmbNotes.Margin = new System.Windows.Forms.Padding(0);
this.cmbNotes.Name = "cmbNotes";
this.cmbNotes.Size = new System.Drawing.Size(65, 25);
@@ -881,7 +908,7 @@
"已上传",
"草稿箱",
"全部"});
this.cmbStatus.Location = new System.Drawing.Point(814, 5);
this.cmbStatus.Location = new System.Drawing.Point(814, 8);
this.cmbStatus.Margin = new System.Windows.Forms.Padding(0);
this.cmbStatus.Name = "cmbStatus";
this.cmbStatus.Size = new System.Drawing.Size(65, 25);
@@ -1248,7 +1275,7 @@
"全部",
"重上",
"已买"});
this.cmbUserNotes.Location = new System.Drawing.Point(1044, 5);
this.cmbUserNotes.Location = new System.Drawing.Point(1044, 8);
this.cmbUserNotes.Margin = new System.Windows.Forms.Padding(0);
this.cmbUserNotes.Name = "cmbUserNotes";
this.cmbUserNotes.Size = new System.Drawing.Size(65, 25);
@@ -1500,6 +1527,7 @@
this.colLogin,
this.colImportCookies,
this.colCopyCookies,
this.colProdGetType,
this.colSpuId,
this.colSkcId,
this.colImgUrl,
@@ -1551,14 +1579,15 @@
this.colSupplierId.HeaderText = "店铺Id";
this.colSupplierId.Name = "colSupplierId";
this.colSupplierId.ReadOnly = true;
this.colSupplierId.Width = 120;
this.colSupplierId.Width = 110;
//
// colSupplierName
//
dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colSupplierName.DefaultCellStyle = dataGridViewCellStyle3;
this.colSupplierName.HeaderText = "店铺名称";
this.colSupplierName.Name = "colSupplierName";
this.colSupplierName.ReadOnly = true;
this.colSupplierName.Width = 110;
//
// colInShop
//
@@ -1576,21 +1605,28 @@
//
// colImportCookies
//
this.colImportCookies.HeaderText = "导入Cookie";
this.colImportCookies.HeaderText = "导入Cook";
this.colImportCookies.Name = "colImportCookies";
this.colImportCookies.ReadOnly = true;
this.colImportCookies.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colImportCookies.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colImportCookies.Width = 80;
this.colImportCookies.Width = 70;
//
// colCopyCookies
//
this.colCopyCookies.HeaderText = "复制Cookie";
this.colCopyCookies.HeaderText = "复制Cook";
this.colCopyCookies.Name = "colCopyCookies";
this.colCopyCookies.ReadOnly = true;
this.colCopyCookies.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colCopyCookies.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colCopyCookies.Width = 80;
this.colCopyCookies.Width = 70;
//
// colProdGetType
//
this.colProdGetType.HeaderText = "商品来源";
this.colProdGetType.Name = "colProdGetType";
this.colProdGetType.ReadOnly = true;
this.colProdGetType.Width = 65;
//
// colSpuId
//
@@ -1628,28 +1664,28 @@
//
// colProductName
//
dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colProductName.DefaultCellStyle = dataGridViewCellStyle3;
dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colProductName.DefaultCellStyle = dataGridViewCellStyle4;
this.colProductName.HeaderText = "商品标题";
this.colProductName.Name = "colProductName";
this.colProductName.ReadOnly = true;
this.colProductName.Width = 160;
this.colProductName.Width = 150;
//
// colProductCat
//
dataGridViewCellStyle4.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colProductCat.DefaultCellStyle = dataGridViewCellStyle4;
dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colProductCat.DefaultCellStyle = dataGridViewCellStyle5;
this.colProductCat.HeaderText = "商品类目";
this.colProductCat.Name = "colProductCat";
this.colProductCat.ReadOnly = true;
this.colProductCat.Width = 72;
this.colProductCat.Width = 70;
//
// colExtCode
//
this.colExtCode.HeaderText = "商品货号";
this.colExtCode.Name = "colExtCode";
this.colExtCode.ReadOnly = true;
this.colExtCode.Width = 125;
this.colExtCode.Width = 122;
//
// colStatus
//
@@ -1669,21 +1705,21 @@
//
// colAddTime
//
dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colAddTime.DefaultCellStyle = dataGridViewCellStyle5;
dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colAddTime.DefaultCellStyle = dataGridViewCellStyle6;
this.colAddTime.HeaderText = "认领时间";
this.colAddTime.Name = "colAddTime";
this.colAddTime.ReadOnly = true;
this.colAddTime.Width = 65;
this.colAddTime.Width = 63;
//
// colMdyTime
//
dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colMdyTime.DefaultCellStyle = dataGridViewCellStyle6;
dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colMdyTime.DefaultCellStyle = dataGridViewCellStyle7;
this.colMdyTime.HeaderText = "上传时间";
this.colMdyTime.Name = "colMdyTime";
this.colMdyTime.ReadOnly = true;
this.colMdyTime.Width = 65;
this.colMdyTime.Width = 63;
//
// colSubSa
//
@@ -1694,8 +1730,8 @@
//
// colSubSaNick
//
dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colSubSaNick.DefaultCellStyle = dataGridViewCellStyle7;
dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colSubSaNick.DefaultCellStyle = dataGridViewCellStyle8;
this.colSubSaNick.HeaderText = "二级超管";
this.colSubSaNick.Name = "colSubSaNick";
this.colSubSaNick.ReadOnly = true;
@@ -1710,8 +1746,8 @@
//
// colNotes
//
dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colNotes.DefaultCellStyle = dataGridViewCellStyle8;
dataGridViewCellStyle9.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colNotes.DefaultCellStyle = dataGridViewCellStyle9;
this.colNotes.HeaderText = "备注";
this.colNotes.Name = "colNotes";
this.colNotes.ReadOnly = true;
@@ -1764,31 +1800,6 @@
this.statusBar.Size = new System.Drawing.Size(1558, 25);
this.statusBar.TabIndex = 5;
//
// chkNotChangeMainImg
//
this.chkNotChangeMainImg.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.chkNotChangeMainImg.AutoSize = true;
this.chkNotChangeMainImg.Checked = true;
this.chkNotChangeMainImg.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkNotChangeMainImg.Location = new System.Drawing.Point(1410, 98);
this.chkNotChangeMainImg.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.chkNotChangeMainImg.Name = "chkNotChangeMainImg";
this.chkNotChangeMainImg.Size = new System.Drawing.Size(151, 21);
this.chkNotChangeMainImg.TabIndex = 699;
this.chkNotChangeMainImg.Text = "第 张主图不替换";
this.chkNotChangeMainImg.UseVisualStyleBackColor = true;
//
// txtNotChangeMainImg
//
this.txtNotChangeMainImg.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.txtNotChangeMainImg.Location = new System.Drawing.Point(1440, 97);
this.txtNotChangeMainImg.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2);
this.txtNotChangeMainImg.Name = "txtNotChangeMainImg";
this.txtNotChangeMainImg.ReadOnly = true;
this.txtNotChangeMainImg.Size = new System.Drawing.Size(36, 23);
this.txtNotChangeMainImg.TabIndex = 700;
this.txtNotChangeMainImg.Text = "5";
//
// DbProductSelectListManageForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -1881,32 +1892,6 @@
private UserComponent.UcCheckBox chkFission;
private System.Windows.Forms.ComboBox cmbUserNotes;
private System.Windows.Forms.Label label12;
private System.Windows.Forms.DataGridViewCheckBoxColumn colSelect;
private System.Windows.Forms.DataGridViewTextBoxColumn colSelectId;
private System.Windows.Forms.DataGridViewTextBoxColumn colSupplierId;
private System.Windows.Forms.DataGridViewTextBoxColumn colSupplierName;
private System.Windows.Forms.DataGridViewLinkColumn colInShop;
private System.Windows.Forms.DataGridViewLinkColumn colLogin;
private System.Windows.Forms.DataGridViewLinkColumn colImportCookies;
private System.Windows.Forms.DataGridViewLinkColumn colCopyCookies;
private System.Windows.Forms.DataGridViewLinkColumn colSpuId;
private System.Windows.Forms.DataGridViewLinkColumn colSkcId;
private System.Windows.Forms.DataGridViewTextBoxColumn colImgUrl;
private System.Windows.Forms.DataGridViewImageColumn colProductSkcPic;
private System.Windows.Forms.DataGridViewTextBoxColumn colProductName;
private System.Windows.Forms.DataGridViewTextBoxColumn colProductCat;
private System.Windows.Forms.DataGridViewTextBoxColumn colExtCode;
private System.Windows.Forms.DataGridViewTextBoxColumn colStatus;
private System.Windows.Forms.DataGridViewLinkColumn colDraftId;
private System.Windows.Forms.DataGridViewTextBoxColumn colAddTime;
private System.Windows.Forms.DataGridViewTextBoxColumn colMdyTime;
private System.Windows.Forms.DataGridViewTextBoxColumn colSubSa;
private System.Windows.Forms.DataGridViewTextBoxColumn colSubSaNick;
private System.Windows.Forms.DataGridViewTextBoxColumn colUserNotes;
private System.Windows.Forms.DataGridViewTextBoxColumn colNotes;
private System.Windows.Forms.DataGridViewLinkColumn colEditNotes;
private System.Windows.Forms.DataGridViewLinkColumn colDelete;
private System.Windows.Forms.DataGridViewTextBoxColumn colOpResult;
private System.Windows.Forms.Label label13;
private System.Windows.Forms.ComboBox cmbNotes;
private DevComponents.DotNetBar.PanelEx btnDel;
@@ -1953,5 +1938,32 @@
private DevComponents.DotNetBar.PanelEx pnlError;
private UserComponent.UcCheckBox chkNotChangeMainImg;
private System.Windows.Forms.TextBox txtNotChangeMainImg;
private System.Windows.Forms.DataGridViewCheckBoxColumn colSelect;
private System.Windows.Forms.DataGridViewTextBoxColumn colSelectId;
private System.Windows.Forms.DataGridViewTextBoxColumn colSupplierId;
private System.Windows.Forms.DataGridViewTextBoxColumn colSupplierName;
private System.Windows.Forms.DataGridViewLinkColumn colInShop;
private System.Windows.Forms.DataGridViewLinkColumn colLogin;
private System.Windows.Forms.DataGridViewLinkColumn colImportCookies;
private System.Windows.Forms.DataGridViewLinkColumn colCopyCookies;
private System.Windows.Forms.DataGridViewTextBoxColumn colProdGetType;
private System.Windows.Forms.DataGridViewLinkColumn colSpuId;
private System.Windows.Forms.DataGridViewLinkColumn colSkcId;
private System.Windows.Forms.DataGridViewTextBoxColumn colImgUrl;
private System.Windows.Forms.DataGridViewImageColumn colProductSkcPic;
private System.Windows.Forms.DataGridViewTextBoxColumn colProductName;
private System.Windows.Forms.DataGridViewTextBoxColumn colProductCat;
private System.Windows.Forms.DataGridViewTextBoxColumn colExtCode;
private System.Windows.Forms.DataGridViewTextBoxColumn colStatus;
private System.Windows.Forms.DataGridViewLinkColumn colDraftId;
private System.Windows.Forms.DataGridViewTextBoxColumn colAddTime;
private System.Windows.Forms.DataGridViewTextBoxColumn colMdyTime;
private System.Windows.Forms.DataGridViewTextBoxColumn colSubSa;
private System.Windows.Forms.DataGridViewTextBoxColumn colSubSaNick;
private System.Windows.Forms.DataGridViewTextBoxColumn colUserNotes;
private System.Windows.Forms.DataGridViewTextBoxColumn colNotes;
private System.Windows.Forms.DataGridViewLinkColumn colEditNotes;
private System.Windows.Forms.DataGridViewLinkColumn colDelete;
private System.Windows.Forms.DataGridViewTextBoxColumn colOpResult;
}
}
@@ -121,6 +121,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
{
this.ucSplitPage1.PageChange += UcSplitPage1_PageChange;
this.dgvSelectProduct.AddSelectorColumn("colSelect");
this.dgvSelectProduct.AddImgColumn("colProductSkcPic", "colImgUrl");
dgvSelectProduct.Columns["colSubSaNick"].Visible = false;
dgvSelectProduct.Columns["colDelete"].Visible = false;
@@ -202,14 +203,14 @@ namespace TemuKJD.KJDForms.ProductSelectForms
var shopIdLst = list.Select(p => p.shop_id).Distinct().ToList();
shopLst = ShopBLL.AdminGetServerShopLstByIds(shopIdLst);
if (defaultBitmap == null)
defaultBitmap = new Bitmap(80, 80);
// 获取Bitmap的Graphics对象
using (Graphics g = Graphics.FromImage(defaultBitmap))
{
// 清除整个Bitmap为蓝色
g.Clear(Color.White);
}
//if (defaultBitmap == null)
// defaultBitmap = new Bitmap(80, 80);
//// 获取Bitmap的Graphics对象
//using (Graphics g = Graphics.FromImage(defaultBitmap))
//{
// // 清除整个Bitmap为白色
// g.Clear(Color.White);
//}
foreach (var prodSelect in lstAdminTemuDBProductSelect)
{
Invoke(new Action(() =>
@@ -223,10 +224,11 @@ namespace TemuKJD.KJDForms.ProductSelectForms
shopLst.FirstOrDefault(s=>s.ShopId == prodSelect.shop_id)?.LoginStatus2 == "国际版在线" ? "在线" : "登录",
"导入Cookie",
"复制Cookie",
prodSelect.product_get_type == 0 ? "母店采集" : "前端直采",
prodSelect.spu_id,
prodSelect.skc_id,
prodSelect.main_img.Replace("https:","http:"),
defaultBitmap,//prod.main_img,
prodSelect.main_img.Replace("https://","http://").Replace("img.kwcdn.com", "img.cdnfe.com"),
DataGridViewExtension.defaultBitmap,//prod.main_img,
prodSelect.fission_product_name,
prodSelect.cat_name,
prodSelect.ext_code,
@@ -248,63 +250,13 @@ namespace TemuKJD.KJDForms.ProductSelectForms
Invoke(new Action(() =>
{
ShowDgvImg();
this.pbLoading.Visible = false;
}));
});
}
Bitmap defaultBitmap = null;
void ShowDgvImg()
{
Task.Run(() =>
{
foreach (DataGridViewRow row in this.dgvSelectProduct.Rows)
{
if (row.Index > 0 && row.Cells["colProductSkcPic"].Displayed == false)
{
try
{
Invoke(new Action(() =>
{
row.Cells["colProductSkcPic"].Value = defaultBitmap;
}));
}
catch
{
}
continue;
}
if (row.Cells["colProductSkcPic"].Value != null && row.Cells["colProductSkcPic"].Value != defaultBitmap)
continue;
Image image = null;
string imgUrl = row.Cells["colImgUrl"]?.Value.ParseToString();
string getImgError = "";
if (!string.IsNullOrWhiteSpace(imgUrl))
image = GetHtml.GetUrlImg(imgUrl, out getImgError);
if (!string.IsNullOrEmpty(getImgError))
//BaseMsgForm.ShowError("图片加载失败 " + getImgError);
image = TemuKJD.Properties.Resources.errpic;
try
{
Invoke(new Action(() =>
{
row.Cells["colProductSkcPic"].Value = image;
}));
}
catch
{
}
}
});
}
private void dgvSelectProduct_Scroll(object sender, ScrollEventArgs e)
{
ShowDgvImg();
}
public List<TemuDBProductSelect> GetSelectProductList(out int pageCount, int page = 1, int pageSize = 50)
@@ -476,6 +428,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
break;
case "导入Cookie":
case "导入Cook":
{
var shop = GetShop(shopId);
ShopUpdateCookieForm updateCookieForm = new ShopUpdateCookieForm(shop, SetCookieFromEnum.sa, "国内版");
@@ -484,6 +437,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
}
break;
case "复制Cookie":
case "复制Cook":
{
var shop = GetShop(shopId);
string cookJs = "";
@@ -961,6 +915,36 @@ namespace TemuKJD.KJDForms.ProductSelectForms
return "上传失败 " + html;
}
if (dbProd.product_get_type == 1)
{
var catRst = GetCatPathList(shop, prodParam.productDraftId.ParseToString(), catId.ParseToString());
if (catRst.Contains("\"success\":true"))
{
var regex = BaseRegex.GetMatchRegex(ref catRst, "\\\"catId\\\":\\d{1,10}");
if (regex.Count > 0)
{
var cats = regex.Cast<Match>().Select(m => m.Value.ParseToString().Replace("\"catId\":", "").ParseToLong()).ToList();
if (!cats.Any(c => c <= 0))
{
while (cats.Count < 10)
cats.Add(0);
prodParam.cat1Id = cats[0];
prodParam.cat2Id = cats[1];
prodParam.cat3Id = cats[2];
prodParam.cat4Id = cats[3];
prodParam.cat5Id = cats[4];
prodParam.cat6Id = cats[5];
prodParam.cat7Id = cats[6];
prodParam.cat8Id = cats[7];
prodParam.cat9Id = cats[8];
prodParam.cat10Id = cats[9];
}
}
}
}
// 查询获取商品属性模板
List<TemuCategoryTemplateInfo> categoryTemplateList = new List<TemuCategoryTemplateInfo>();
var propTemplateRst = QueryCategoryTemplate(shop, prodParam.productDraftId.ParseToString(), catId.ParseToString());
if (propTemplateRst.Contains("\"success\":true"))
@@ -1067,7 +1051,15 @@ namespace TemuKJD.KJDForms.ProductSelectForms
};
goodsLayerDecorationItem.contentList.Add(contentItem);
}
prodParam.goodsLayerDecorationReqs.Add(goodsLayerDecorationItem);
if (goodsLayerDecorationItem != null && !(goodsLayerDecorationItem.contentList?.FirstOrDefault()?.imgUrl).ParseToString().IsNullOrEmpty())
prodParam.goodsLayerDecorationReqs.Add(goodsLayerDecorationItem);
else
{
}
}
for (int i = 0; i < prodParam.goodsLayerDecorationReqs.Count; i++)
{
prodParam.goodsLayerDecorationReqs[i].priority = i;
}
prodParam.goodsModelReqs = prodInfo.goodsModelList != null ? prodInfo.goodsModelList : new List<object>();
prodParam.materialImgUrl = prodInfo.materialImgUrl;
@@ -1080,15 +1072,45 @@ namespace TemuKJD.KJDForms.ProductSelectForms
prodInfo.productLocalExtAttr.materialMultiLanguages : new List<object>();
prodParam.personalizationSwitch = prodInfo.productWhExtAttr.personalizationSwitch.ParseToInt();
var carouseVideoVOList = JsonHelper.SerializeObject(prodInfo.carouseVideoVOList);
prodParam.productCarouseVideoReqList = JsonHelper.DeserializeJsonToList<productCarouseVideoReqItem>(carouseVideoVOList);
// 主图视频
var videoList = new List<carouseVideoVo>();
if (prodInfo.carouseVideoVOList != null)
{
videoList = prodInfo.carouseVideoVOList.ToList();
foreach(var video in videoList)
{
if (video.vid.IsNullOrEmpty() && !video.videoUrl.IsNullOrEmpty() && !video.coverUrl.IsNullOrEmpty())
{
var downloadPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Downloads\\Video");
if (!Directory.Exists(downloadPath))
Directory.CreateDirectory(downloadPath);
var videoUrl = video.videoUrl.Replace("https://", "http://").Replace("goods-vod.kwcdn.com", "goods-vod.cdnfe.com");
var extName = videoUrl.Split('.').LastOrDefault();
var videoFullName = downloadPath + "\\MainVideo." + extName;
if (GetHtml.DownloadFile(videoUrl, videoFullName))
{
var mainVideoRst = UploadMainVideo(shop, prodParam.productDraftId.ParseToString(), videoFullName);
if (mainVideoRst.Contains("\"success\":false"))
return mainVideoRst;
video.videoUrl = BaseRegex.GetStringJson(ref mainVideoRst, "url");
video.vid = BaseRegex.GetStringJson(ref mainVideoRst, "vid");
video.coverUrl = BaseRegex.GetStringJson(ref mainVideoRst, "cover");
}
}
}
videoList = videoList.Where(v => !v.vid.IsNullOrEmpty()).ToList();
}
var carouseVideoVOListStr = JsonHelper.SerializeObject(videoList);
prodParam.productCarouseVideoReqList = JsonHelper.DeserializeJsonToList<productCarouseVideoReqItem>(carouseVideoVOListStr);
if (prodParam.productCarouseVideoReqList == null)
prodParam.productCarouseVideoReqList = new List<productCarouseVideoReqItem>();
//此处打开商品编辑详情无法获取到,如何查询存疑
//此处打开商品编辑详情无法获取到,如何查询存疑,暂时手动填写
prodParam.productComplianceStatementReq = new ProductComplianceStatementReq
{
protocolVersion = "V1.0",
protocolUrl = "https://bdl.cdnfe.com/upload_bdl/seller-protocol/00f56a69-7bee-4768-8cef-e1682ffd58e3.html",
//protocolVersion = "V1.0",
//protocolUrl = "https://bdl.cdnfe.com/upload_bdl/seller-protocol/00f56a69-7bee-4768-8cef-e1682ffd58e3.html",
protocolVersion = "V2.0",
protocolUrl = "https://dl.kwcdn.com/seller-public-file-us-tag/2079f603b6/56888d17d8166a6700c9f3e82972e813.html",
};
prodParam.productDetailVideoReqList = prodInfo.detailVideoVOList;
prodParam.productGuideFileI18nReqs = prodInfo.productGuideFileI18nList;
@@ -1205,6 +1227,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
};
//内容存疑
prodParam.productOriginCertFileReqs = new List<object>();
//产品包装图
prodParam.productOuterPackageImageReqs = new List<ProductOuterPackageImageReqsItem>();
foreach (var picInfo in prodInfo.outerPackageImages)
{
@@ -1213,6 +1236,24 @@ namespace TemuKJD.KJDForms.ProductSelectForms
imageUrl = picInfo.imageUrl,
});
}
//如果原商品采集源没有包装图,主图第一张转包装图
if (prodParam.productOuterPackageImageReqs.Count == 0)
{
//var downloadPath = Application.StartupPath + "\\temp\\downloads\\image";
var downloadPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), "Downloads\\Image");
if (!Directory.Exists(downloadPath))
Directory.CreateDirectory(downloadPath);
var imgUrl = prodParam.carouselImageUrls.FirstOrDefault().ParseToString().Replace("https://", "http://").Replace("img.kwcdn.com", "img.cdnfe.com");
var extName = imgUrl.Split('.').LastOrDefault();
var imgFullName = downloadPath + "\\PackageImage." + extName;
if (GetHtml.DownloadFile(imgUrl, imgFullName))
{
var packageImgUrl = UploadOuterPackageImg(shop, prodParam.productDraftId.ParseToString(), imgFullName);
if (packageImgUrl.Contains("\"success\":false"))
return packageImgUrl;
prodParam.productOuterPackageImageReqs.Add(new ProductOuterPackageImageReqsItem() { imageUrl = packageImgUrl, });
}
}
prodParam.productOuterPackageReq = new ProductOuterPackageReq()
{
packageShape = prodInfo.productWhExtAttr.productOuterPackage.packageShape,
@@ -1221,7 +1262,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
prodParam.productPropertyReqs = new List<ProductPropertyReqsItem>();
foreach (var propInfo in prodInfo.productPropertyList)
{
prodParam.productPropertyReqs.Add(new ProductPropertyReqsItem
var propReqsItem = new ProductPropertyReqsItem
{
numberInputValue = propInfo.numberInputValue,
pid = propInfo.pid,
@@ -1232,57 +1273,100 @@ namespace TemuKJD.KJDForms.ProductSelectForms
valueExtendInfo = propInfo.valueExtendInfo,
valueUnit = propInfo.valueUnit,
vid = propInfo.vid,
});
};
// 客户端采集的数据 产地、商品编号等信息的refPid为空不放在后台商品属性
if (propReqsItem.refPid != null)
prodParam.productPropertyReqs.Add(propReqsItem);
}
if (prodParam.productPropertyReqs.Any(p => p.propValue == "织物" && p.propName == "鞋面材料") &&
!prodParam.productPropertyReqs.Any(p => p.propName == "织物材质成分"))
foreach(var prop in prodParam.productPropertyReqs)
{
prodParam.productPropertyReqs.Add(new ProductPropertyReqsItem
if (prop.pid.IsNullOrEmpty())
{
valueUnit = "",
propValue = "人造纤维",
propName = "织物材质成分",
refPid = 7550,
vid = 329529,
controlType = 1,
pid = 2335,
templatePid = 1580208,
valueExtendInfo = ""
});
var propTemp = categoryTemplateList.FirstOrDefault(p => p.refPid == prop.refPid);
if (propTemp != null)
{
if (propTemp.templatePid == 882613) // 成分(带%的参数)
{
}
prop.pid = propTemp.pid;
prop.templatePid = propTemp.templatePid;
prop.valueUnit = propTemp.valueUnit.FirstOrDefault().ParseToString();
if (prop.propValue.Contains("%"))
{
prop.valueUnit = "%";
// 获取成分百分比
string propValueStr = prop.propValue;
var regex = BaseRegex.GetMatchRegex(ref propValueStr, "\\d{1,3}(\\.\\d{1,2})?%");
string numberValue = BaseRegex.GetMatchRegex(ref propValueStr, "\\d{1,3}%")[0]?.Groups[0]?.Value;
if (!string.IsNullOrEmpty(numberValue))
{
prop.propValue = propValueStr.Replace(numberValue, "").Trim();
prop.numberInputValue = numberValue.Replace("%", "");
}
}
if (propTemp.values != null)
prop.vid = (propTemp.values.FirstOrDefault(v => v.value == prop.propValue)?.vid).ParseToLong();
//if (prop.vid == null)
// prop.vid = 0;
prop.valueExtendInfo = "";
}
}
}
var prop = categoryTemplateList.FirstOrDefault(p => p.name.Contains("内里是否加绒"));
if (prop != null && prop.required == true && !prodParam.productPropertyReqs.Any(p => p.propName == prop.name))
prodParam.productPropertyReqs.RemoveAll(p => p.vid == null);
// 处理特殊情况
if (1 == 1)
{
if (lstExtCodeFleeceInShoes.Contains(dbProd.ext_code) ||
lstExtCodeFleeceInShoes.Any(c => (dbProd.ext_code.Contains("-" + c))))
if (prodParam.productPropertyReqs.Any(p => p.propValue == "织物" && p.propName == "鞋面材料") &&
!prodParam.productPropertyReqs.Any(p => p.propName == "织物材质成分"))
{
prodParam.productPropertyReqs.Add(new ProductPropertyReqsItem
{
valueUnit = "",
propValue = "是",
propName = "内里是否加绒",
refPid = prop.refPid.ParseToLong(),
vid = 404104,
propValue = "人造纤维",
propName = "织物材质成分",
refPid = 7550,
vid = 329529,
controlType = 1,
pid = prop.pid.ParseToLong(),
templatePid = prop.templatePid,
pid = 2335,
templatePid = 1580208,
valueExtendInfo = ""
});
}
else
var propTemp = categoryTemplateList.FirstOrDefault(p => p.name.Contains("内里是否加绒"));
if (propTemp != null && propTemp.required == true && !prodParam.productPropertyReqs.Any(p => p.propName == propTemp.name))
{
prodParam.productPropertyReqs.Add(new ProductPropertyReqsItem
if (lstExtCodeFleeceInShoes.Contains(dbProd.ext_code) ||
lstExtCodeFleeceInShoes.Any(c => (dbProd.ext_code.Contains("-" + c))))
{
valueUnit = "",
propValue = "否",
propName = "内里是否加绒",
refPid = prop.refPid.ParseToLong(),
vid = 404105,
controlType = 1,
pid = prop.pid.ParseToLong(),
templatePid = prop.templatePid,
valueExtendInfo = ""
});
prodParam.productPropertyReqs.Add(new ProductPropertyReqsItem
{
valueUnit = "",
propValue = "是",
propName = "内里是否加绒",
refPid = propTemp.refPid.ParseToLong(),
vid = 404104,
controlType = 1,
pid = propTemp.pid.ParseToLong(),
templatePid = propTemp.templatePid,
valueExtendInfo = ""
});
}
else
{
prodParam.productPropertyReqs.Add(new ProductPropertyReqsItem
{
valueUnit = "",
propValue = "否",
propName = "内里是否加绒",
refPid = propTemp.refPid.ParseToLong(),
vid = 404105,
controlType = 1,
pid = propTemp.pid.ParseToLong(),
templatePid = propTemp.templatePid,
valueExtendInfo = ""
});
}
}
}
prodParam.productSaleExtAttrReq = new ProductSaleExtAttrReq
@@ -1331,13 +1415,14 @@ namespace TemuKJD.KJDForms.ProductSelectForms
skcItem.mainProductSkuSpecReqs = new List<MainProductSkuSpecReqsItem>();
foreach (var skuSpecInfo in skcInfo.productSkcSpecList)
{
skcItem.mainProductSkuSpecReqs.Add(new MainProductSkuSpecReqsItem
var specReqsItem = new MainProductSkuSpecReqsItem
{
parentSpecId = skuSpecInfo.parentSpecId,
parentSpecName = skuSpecInfo.parentSpecName,
specId = skuSpecInfo.specId,
specName = skuSpecInfo.specName,
});
};
skcItem.mainProductSkuSpecReqs.Add(specReqsItem);
}
skcItem.previewImgUrls = skcInfo.previewImgUrls;
skcItem.productSkcCarouselImageI18nReqs = skcInfo.productSkcCarouselImageI18nVOList;
@@ -1456,6 +1541,10 @@ namespace TemuKJD.KJDForms.ProductSelectForms
JsonHelper.SerializeObject(skuInfo.productSkuMultiPack.totalNetContent)),
individuallyPacked = skuInfo.productSkuMultiPack.individuallyPacked,
};
if (skuItem.productSkuMultiPackReq.productSkuNetContentReq == null)
skuItem.productSkuMultiPackReq.productSkuNetContentReq = new ProductSkuNetContentReq();
if (skuItem.productSkuMultiPackReq.totalNetContent == null)
skuItem.productSkuMultiPackReq.totalNetContent = new ProductSkuNetContentReq();
// 如果母店为多件但没有指定是否独立包装,强制指定非独立包装
var packReq = skuItem.productSkuMultiPackReq as ProductSkuMultiPackReq2;
if (packReq.skuClassification > 1 && packReq.individuallyPacked == null)
@@ -1490,8 +1579,26 @@ namespace TemuKJD.KJDForms.ProductSelectForms
parentSpecName = skuSpecInfo.parentSpecName,
specId = skuSpecInfo.specId,
specName = skuSpecInfo.specName,
vid = prodParam.productSpecPropertyReqs.FirstOrDefault(p => p.specId == skuSpecInfo.specId)?.vid,
vid = prodParam.productSpecPropertyReqs.FirstOrDefault(p => p.specId == skuSpecInfo.specId)?.vid, //可以不填
};
if (dbProd.product_get_type == 1) // 直采商品重新生成sku
{
string draftId = prodParam.productDraftId.ParseToString();
string parentSpecId = skuSpecItem.parentSpecId.ParseToString();
var rst = QueryOrAddSpec(shop, draftId, parentSpecId, skuSpecItem.specName);
Thread.Sleep(Randomx.GetId(50, 100));
if (rst.Contains("\"success\":true"))
{
long specId = BaseRegex.GetLongJson(ref rst, "specId");
if (specId > 0)
{
skuSpecItem.specId = specId;
}
}
}
//前后缀映射
if (skuSpecInfo.parentSpecName == "颜色" && skuNameDic[skuSpecItem.specName] != skuSpecItem.specName)
{
@@ -1624,7 +1731,9 @@ namespace TemuKJD.KJDForms.ProductSelectForms
aiSkuImgInfo = aiImgInfoDic[skuInfo.productSkuSpecList[0].specId.ParseToString()];
else
{
var aiSkuImgLst = DouBaoImgCefForm.GetSkuImgList(prodInfo.productId.ParseToString(), skuInfo.productSkuSpecList[0].specId.ParseToString());
string productId = prodInfo.productId.ParseToString();
string specId = skuInfo.productSkuSpecList[0].specId.ParseToString();
var aiSkuImgLst = DouBaoImgCefForm.GetSkuImgList(productId, specId, 5, true);
if (aiSkuImgLst.Count > 0)
{
aiImgInfoList.AddRange(aiSkuImgLst);
@@ -2201,13 +2310,19 @@ namespace TemuKJD.KJDForms.ProductSelectForms
#endregion
}
/// <summary>
/// 上传自定义图片
/// </summary>
/// <param name="shop"></param>
/// <param name="productDraftId"></param>
/// <returns></returns>
string GetCustomImg(ShopLoginInfo shop, string productDraftId)
{
var sImgPath = this.lstCustomImg[Randomx.GetId(lstCustomImg.Count)];
if (dicCustomImg.Keys.Contains(sImgPath))
return dicCustomImg[sImgPath];
var md5CheckRst = CheckImgMd5(shop, productDraftId, "", BaseClass.GetFileMd5(sImgPath));
var md5CheckRst = CheckImgMd5(shop, productDraftId, BaseClass.GetFileMd5(sImgPath));
if (!md5CheckRst.Contains("\"success\":true"))
{
var error = BaseRegex.GetStringJson(ref md5CheckRst, "errorMsg");
@@ -2215,12 +2330,12 @@ namespace TemuKJD.KJDForms.ProductSelectForms
error = BaseRegex.GetStringJson(ref md5CheckRst, "error_msg");
return "{\"success\":false,\"status\":\"未上传\"," +
"\"productDraftId\":\"" + productDraftId + "\"," +
"\"errMsg\":\"草稿箱上传失败 " + error + "\"}";
"\"errMsg\":\"草稿箱上传失败,初始化图片上传失败 " + error + "\"}";
}
var materialId = BaseRegex.GetStringJson(ref md5CheckRst, "id");
if (string.IsNullOrEmpty(materialId))
{
var imgUpSignRst = GetImgUpSign(shop, productDraftId);
var imgUpSignRst = GetUploadSign(shop, productDraftId);
string signature = BaseRegex.GetStringJson(ref imgUpSignRst, "signature");
if (string.IsNullOrEmpty(signature))
{
@@ -2234,7 +2349,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
var uploadImgRst = UploadImage(shop, productDraftId, sImgPath, signature);
var imgUrl = BaseRegex.GetStringJson(ref uploadImgRst, "url");
if (string.IsNullOrEmpty(signature))
if (string.IsNullOrEmpty(imgUrl))
{
var error = BaseRegex.GetStringJson(ref uploadImgRst, "errorMsg");
if (string.IsNullOrEmpty(error))
@@ -2251,7 +2366,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
{
var existImgRst = this.GetExistImg(shop, productDraftId, materialId);
string imgUrl = BaseRegex.GetStringJson(ref existImgRst, "imgUrl");
if (string.IsNullOrEmpty(materialId))
if (string.IsNullOrEmpty(imgUrl))
{
var error = BaseRegex.GetStringJson(ref existImgRst, "errorMsg");
if (string.IsNullOrEmpty(error))
@@ -2266,6 +2381,147 @@ namespace TemuKJD.KJDForms.ProductSelectForms
}
}
/// <summary>
/// 上传外包装图片
/// </summary>
/// <param name="shop"></param>
/// <param name="productDraftId"></param>
/// <param name="sImgPath"></param>
/// <returns></returns>
string UploadOuterPackageImg(ShopLoginInfo shop, string productDraftId, string sImgPath)
{
var imgUpSignRst = GetUploadSign(shop, productDraftId, "product-material-private-tag");
string signature = BaseRegex.GetStringJson(ref imgUpSignRst, "signature");
if (string.IsNullOrEmpty(signature))
{
var error = BaseRegex.GetStringJson(ref imgUpSignRst, "errorMsg");
if (string.IsNullOrEmpty(error))
error = BaseRegex.GetStringJson(ref imgUpSignRst, "error_msg");
return "{\"success\":false,\"status\":\"未上传\"," +
"\"productDraftId\":\"" + productDraftId + "\"," +
"\"errMsg\":\"草稿箱上传失败,获取图片上传signature失败 " + error + "\"}";
}
var uploadImgRst = UploadImage(shop, productDraftId, sImgPath, signature, "product-material-private-tag");
var imgUrl = BaseRegex.GetStringJson(ref uploadImgRst, "url");
if (string.IsNullOrEmpty(imgUrl))
{
var error = BaseRegex.GetStringJson(ref uploadImgRst, "errorMsg");
if (string.IsNullOrEmpty(error))
error = BaseRegex.GetStringJson(ref uploadImgRst, "error_msg");
return "{\"success\":false,\"status\":\"未上传\"," +
"\"productDraftId\":\"" + productDraftId + "\"," +
"\"errMsg\":\"草稿箱上传失败,上传图片失败 " + error + "\"}";
}
return imgUrl;
}
/// <summary>
/// 上传主图视频
/// </summary>
/// <param name="shop"></param>
/// <param name="productDraftId"></param>
/// <param name="sVideoPath"></param>
/// <returns></returns>
string UploadMainVideo(ShopLoginInfo shop, string productDraftId, string sVideoPath)
{
var fileMd5 = BaseClass.GetFileMd5(sVideoPath).ToLower();
var md5CheckRst = CheckImgMd5(shop, productDraftId, fileMd5, 0);
if (!md5CheckRst.Contains("\"success\":true"))
{
var error = BaseRegex.GetStringJson(ref md5CheckRst, "errorMsg");
if (string.IsNullOrEmpty(error))
error = BaseRegex.GetStringJson(ref md5CheckRst, "error_msg");
return "{\"success\":false,\"status\":\"未上传\"," +
"\"productDraftId\":\"" + productDraftId + "\"," +
"\"errMsg\":\"草稿箱上传失败,初始化视频上传失败 " + error + "\"}";
}
var videoId = BaseRegex.GetStringJson(ref md5CheckRst, "id");
if (string.IsNullOrEmpty(videoId))
{
if (sVideoPath == null)
sVideoPath = "";
string fileName = sVideoPath.Split('\\').LastOrDefault();
var createMRst = CreateMaterial(shop, productDraftId, fileName, fileMd5);
if (!createMRst.Contains("\"success\":true"))
{
var error = BaseRegex.GetStringJson(ref createMRst, "errorMsg");
if (string.IsNullOrEmpty(error))
error = BaseRegex.GetStringJson(ref createMRst, "error_msg");
return "{\"success\":false,\"status\":\"未上传\"," +
"\"productDraftId\":\"" + productDraftId + "\"," +
"\"errMsg\":\"草稿箱上传失败,新建上传视频失败 " + error + "\"}";
}
videoId = BaseRegex.GetStringJson(ref createMRst, "id");
var imgUpSignRst = GetUploadSign(shop, productDraftId, "goods-video-tag");
string signature = BaseRegex.GetStringJson(ref imgUpSignRst, "signature");
if (string.IsNullOrEmpty(signature))
{
var error = BaseRegex.GetStringJson(ref imgUpSignRst, "errorMsg");
if (string.IsNullOrEmpty(error))
error = BaseRegex.GetStringJson(ref imgUpSignRst, "error_msg");
return "{\"success\":false,\"status\":\"未上传\"," +
"\"productDraftId\":\"" + productDraftId + "\"," +
"\"errMsg\":\"草稿箱上传失败,获取视频上传签名失败 " + error + "\"}";
}
var uploadImgRst = UploadFile(shop, productDraftId, sVideoPath, signature, fileMd5);
Thread.Sleep(Randomx.GetId(50, 100));
var videoBaseUrl = BaseRegex.GetStringJson(ref uploadImgRst, "url");
if (string.IsNullOrEmpty(videoBaseUrl))
{
var error = BaseRegex.GetStringJson(ref videoBaseUrl, "errorMsg");
if (string.IsNullOrEmpty(error))
error = BaseRegex.GetStringJson(ref videoBaseUrl, "error_msg");
return "{\"success\":false,\"status\":\"未上传\"," +
"\"productDraftId\":\"" + productDraftId + "\"," +
"\"errMsg\":\"草稿箱上传失败,视频文件上传失败 " + error + "\"}";
}
var editVideoRst = EditMaterial(shop, productDraftId, videoId, videoBaseUrl, fileName.Split('.').FirstOrDefault().ParseToString());
if (!editVideoRst.Contains("\"success\":true"))
{
var error = BaseRegex.GetStringJson(ref editVideoRst, "errorMsg");
if (string.IsNullOrEmpty(error))
error = BaseRegex.GetStringJson(ref editVideoRst, "error_msg");
return "{\"success\":false,\"status\":\"未上传\"," +
"\"productDraftId\":\"" + productDraftId + "\"," +
"\"errMsg\":\"草稿箱上传失败,编辑上传视频失败 " + error + "\"}";
}
}
var videoUrl = "";
var vId = "";
var videoCover = "";
for (int i = 0; i < 20; i++)
{
Thread.Sleep(1000);
var existVideoRst = GetExistVideo(shop, productDraftId, videoId);
if (!existVideoRst.Contains("\"success\":true"))
{
var error = BaseRegex.GetStringJson(ref existVideoRst, "errorMsg");
if (string.IsNullOrEmpty(error))
error = BaseRegex.GetStringJson(ref existVideoRst, "error_msg");
return "{\"success\":false,\"status\":\"未上传\"," +
"\"productDraftId\":\"" + productDraftId + "\"," +
"\"errMsg\":\"草稿箱上传失败,获取上传视频结果失败 " + error + "\"}";
}
videoUrl = BaseRegex.GetStringJson(ref existVideoRst, "destMaterialUrl");
vId = BaseRegex.GetStringJson(ref existVideoRst, "vid");
videoCover = BaseRegex.GetStringJson(ref existVideoRst, "firstImageUrl");
if (!string.IsNullOrEmpty(videoUrl) && !string.IsNullOrEmpty(vId) && !string.IsNullOrEmpty(videoCover))
break;
}
if (string.IsNullOrEmpty(videoUrl) || string.IsNullOrEmpty(vId))
{
return "{\"success\":false,\"status\":\"未上传\"," +
"\"productDraftId\":\"" + productDraftId + "\"," +
"\"errMsg\":\"草稿箱上传失败,获取上传视频结果失败\"}";
}
return "{\"url\":\"" + videoUrl + "\",\"vid\":\"" + vId + "\",\"cover\":\"" + videoCover + "\"}";
}
/// <summary>
/// 上传主图或sku等的Ai图片
/// </summary>
@@ -2276,7 +2532,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
/// <returns></returns>
string UploadAiSkuImg(ShopLoginInfo shop, string productDraftId, string imgBase64, string imgMd5)
{
var md5CheckRst = CheckImgMd5(shop, productDraftId, "", imgMd5);
var md5CheckRst = CheckImgMd5(shop, productDraftId, imgMd5.ToLower());
if (!md5CheckRst.Contains("\"success\":true"))
{
var error = BaseRegex.GetStringJson(ref md5CheckRst, "errorMsg");
@@ -2289,7 +2545,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
var materialId = BaseRegex.GetStringJson(ref md5CheckRst, "id");
if (string.IsNullOrEmpty(materialId))
{
var imgUpSignRst = GetImgUpSign(shop, productDraftId);
var imgUpSignRst = GetUploadSign(shop, productDraftId);
string signature = BaseRegex.GetStringJson(ref imgUpSignRst, "signature");
if (string.IsNullOrEmpty(signature))
{
@@ -2335,7 +2591,7 @@ namespace TemuKJD.KJDForms.ProductSelectForms
var uploadImgRst = UploadImage(shop, productDraftId, sImgPath, signature);
var imgUrl = BaseRegex.GetStringJson(ref uploadImgRst, "url");
if (string.IsNullOrEmpty(signature))
if (string.IsNullOrEmpty(imgUrl))
{
var error = BaseRegex.GetStringJson(ref uploadImgRst, "errorMsg");
if (string.IsNullOrEmpty(error))
@@ -2364,6 +2620,23 @@ namespace TemuKJD.KJDForms.ProductSelectForms
}
}
private string CreateMaterial(ShopLoginInfo shop, string draftId, string materialName, string materialMd5)
{
string url = "https://agentseller.temu.com/phoenix-mms/material/create";
string refere = "https://agentseller.temu.com/goods/edit?productDraftId=" + draftId + "&from=productDraftList";
string body = @"{""folderId"":0,""createDetailList"":[{""materialType"":0,""materialMd5"":""" + materialMd5 + @""",""materialName"":""" +
materialName + @"""}]}";
return HttpResponseBLL.PostResponse2(shop, url, body, refere);
}
private string EditMaterial(ShopLoginInfo shop, string draftId, string materialId, string materialUrl, string materialName)
{
string url = "https://agentseller.temu.com/phoenix-mms/material/edit";
string refere = "https://agentseller.temu.com/goods/edit?productDraftId=" + draftId + "&from=productDraftList";
string body = @"{""id"":" + materialId + @",""url"":""" + materialUrl + @""",""materialName"":""" + materialName +
@""",""uploadStatus"":1,""materialType"":0}";
return HttpResponseBLL.PostResponse2(shop, url, body, refere);
}
private string AddDraft(ShopLoginInfo shop, string catId)
{
//string url = "https://seller.kuajingmaihuo.com/bg-visage-mms/product/draft/add";
@@ -2374,6 +2647,14 @@ namespace TemuKJD.KJDForms.ProductSelectForms
return HttpResponseBLL.PostResponse2(shop, url, body, refere);
}
private string GetCatPathList(ShopLoginInfo shop, string draftId, string catId)
{
string url = "https://agentseller.temu.com/anniston-agent-seller/category/path/list";
string refere = "https://agentseller.temu.com/goods/edit?productDraftId=" + draftId + "&from=productDraftList";
string body = @"{""catIds"":[" + catId + @"],""showCatEnName"":true}";
return HttpResponseBLL.PostResponse2(shop, url, body, refere);
}
private string CreateSizeSpec(ShopLoginInfo shop, string draftId, TemuSizeSpecParam sizeParam)
{
//string url = "https://seller.kuajingmaihuo.com/bg-anniston-mms/sizespec/createSizeSpec";
@@ -2434,10 +2715,10 @@ namespace TemuKJD.KJDForms.ProductSelectForms
return HttpResponseBLL.PostResponse2(shop, url, body, refere);
}
private string CheckImgMd5(ShopLoginInfo shop, string draftId, string parentSpecId, string fileMd5)
private string CheckImgMd5(ShopLoginInfo shop, string draftId, string fileMd5, int materialType = 1) // 1图片 0视频
{
string url = "https://agentseller.temu.com/phoenix-mms/material/queryByMd5";
string body = @"{""materialType"":1,""md5IdList"":[""" + fileMd5 + @"""]}";
string body = @"{""materialType"":" + materialType + @",""md5IdList"":[""" + fileMd5 + @"""]}";
string refere = "https://agentseller.temu.com/goods/edit?productDraftId=" + draftId + "&from=menu&st_time="
+ BaseClass.DateTimeToTimestampSeconds(DateTime.Now);
@@ -2454,29 +2735,47 @@ namespace TemuKJD.KJDForms.ProductSelectForms
""materialIdList"":[" + materialId + @"],""folderId"":0,""minMaterialHeight"":800,""minMaterialWidth"":800,""maxMaterialSize"":2097152,
""proportion"":""1:1"",""proportionList"":[""1:1""],""badTagList"":[""ZH_HANS""]}";
body = "{\"pageInfo\":{\"pageNo\":1,\"pageSize\":50},\"uploadStatusList\":[3],\"materialIdList\":[250822757735044],\"folderId\":0,\"minMaterialHeight\":800,\"minMaterialWidth\":800,\"maxMaterialSize\":2097152,\"proportion\":\"1:1\",\"proportionList\":[\"1:1\"],\"badTagList\":[\"ZH_HANS\"]}";
//body = "{\"pageInfo\":{\"pageNo\":1,\"pageSize\":50},\"uploadStatusList\":[3],\"materialIdList\":[250822757735044],\"folderId\":0,\"minMaterialHeight\":800,\"minMaterialWidth\":800,\"maxMaterialSize\":2097152,\"proportion\":\"1:1\",\"proportionList\":[\"1:1\"],\"badTagList\":[\"ZH_HANS\"]}";
string refere = "https://agentseller.temu.com/goods/edit?productDraftId=" + draftId + "&from=menu&st_time="
+ BaseClass.DateTimeToTimestampSeconds(DateTime.Now);
return HttpResponseBLL.PostResponse2(shop, url, body, refere);
}
private string GetImgUpSign(ShopLoginInfo shop, string draftId)
private string GetExistVideo(ShopLoginInfo shop, string draftId, string materialId)
{
string url = "https://agentseller.temu.com/general_auth/get_signature?sdk_version=js-0.0.49&tag_name=product-material-tag&scene_id=agent-seller";
string body = @"{""bucket_tag"":""product-material-tag""}";
string url = "https://agentseller.temu.com/phoenix-mms/material/pageQuery";
string body = @"{""pageInfo"":{""pageNo"":1,""pageSize"":1},""videoIdList"":[" + materialId + @"]}";
string refere = "https://agentseller.temu.com/goods/edit?productDraftId=" + draftId + "&from=productDraftList";
return HttpResponseBLL.PostResponse2(shop, url, body, refere);
}
/// <summary>
///
/// </summary>
/// <param name="shop"></param>
/// <param name="draftId"></param>
/// <param name="bucket_tag">product-material-tag 商品图片; product-material-private-tag 商品包装图</param>
/// <returns></returns>
private string GetUploadSign(ShopLoginInfo shop, string draftId, string bucket_tag = "product-material-tag")
{
string url = "https://agentseller.temu.com/general_auth/get_signature?sdk_version=js-0.0.49&tag_name=" + bucket_tag + "&scene_id=agent-seller";
string body = @"{""bucket_tag"":""" + bucket_tag + @"""}";
string refere = "https://agentseller.temu.com/goods/edit?productDraftId=" + draftId + "&from=menu&st_time="
+ BaseClass.DateTimeToTimestampSeconds(DateTime.Now);
if (bucket_tag == "product-material-private-tag" || bucket_tag == "goods-video-tag")
refere = "https://agentseller.temu.com/goods/edit?productDraftId=" + draftId + "&from=productDraftList";
return HttpResponseBLL.PostResponse2(shop, url, body, refere);
}
private string UploadImage(ShopLoginInfo shop, string draftId, string fileFullName, string uploadSign)
private string UploadImage(ShopLoginInfo shop, string draftId, string fileFullName, string uploadSign, string tag_name = "product-material-tag")
{
if (fileFullName == null)
fileFullName = "";
string fileName = fileFullName.Split('\\').LastOrDefault();
string url = "https://agentseller.temu.com/api/galerie/v3/store_image?sdk_version=js-0.0.49&tag_name=product-material-tag";
string url = "https://agentseller.temu.com/api/galerie/v3/store_image?sdk_version=js-0.0.49&tag_name=" + tag_name;
string boundary = "----WebKitFormBoundarybJAaZCwJYanqPxhq";
string body = @"------WebKitFormBoundarybJAaZCwJYanqPxhq
Content-Disposition: form-data; name=""url_width_height""
@@ -2495,10 +2794,49 @@ Content-Disposition: form-data; name=""upload_sign""
";
string refere = "https://agentseller.temu.com/goods/edit?productDraftId=" + draftId + "&from=menu&st_time="
+ BaseClass.DateTimeToTimestampSeconds(DateTime.Now);
if (tag_name == "product-material-private-tag")
refere = "https://agentseller.temu.com/goods/edit?productDraftId=" + draftId + "&from=productDraftList";
return HttpResponseBLL.PostResponseUpload(shop, url, body, refere, boundary);
}
private string UploadFile(ShopLoginInfo shop, string draftId, string fileFullName, string uploadSign, string fileMd5, string tag_name = "goods-video-tag")
{
string abc = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
string boundaryRandom = "";
while (boundaryRandom.Length < 16)
boundaryRandom += abc[Randomx.GetId(abc.Length)];
if (fileFullName == null)
fileFullName = "";
string fileName = fileFullName.Split('\\').LastOrDefault();
string url = "https://agentseller.temu.com/api/galerie/v1/store_video?sdk_version=js-0.0.49&tag_name=" + tag_name;
string boundary = "----WebKitFormBoundaryeZuqpVO6jYOF5Y6S";
//boundary = "----WebKitFormBoundary" + boundaryRandom;
string body = @"--" + boundary + @"
Content-Disposition: form-data; name=""file""; filename=""" + fileName + @"""
Content-Type: video/mp4
<!>" + fileFullName + @"<!>
--" + boundary + @"
Content-Disposition: form-data; name=""create_media""
true
--" + boundary + @"
Content-Disposition: form-data; name=""content_md5""
" + fileMd5 + @"
--" + boundary + @"
Content-Disposition: form-data; name=""sign""
" + uploadSign + @"
--" + boundary + @"--
";
string refere = "https://agentseller.temu.com/goods/edit?productDraftId=8873526416&from=productDraftList";
var result = HttpResponseBLL.PostResponseUpload(shop, url, body, refere, boundary);
return result;
}
private string translate(ShopLoginInfo shop, string text)
{
string url = "https://fanyi.baidu.com/ait/text/translate";
@@ -141,6 +141,9 @@
<metadata name="colCopyCookies.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colProdGetType.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colSpuId.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>