diff --git a/AllBase/BaseClass.cs b/AllBase/BaseClass.cs index 1a223d9..425259b 100644 --- a/AllBase/BaseClass.cs +++ b/AllBase/BaseClass.cs @@ -27,7 +27,7 @@ namespace AllBase /// /// 版本ID /// - public static int VersionCount = 967; + public static int VersionCount = 969; //public static int VersionCount = 613; /// diff --git a/KJDService/KJD_WebService/KJD_WebService.csproj.user b/KJDService/KJD_WebService/KJD_WebService.csproj.user index 4bcdc04..1b87364 100644 --- a/KJDService/KJD_WebService/KJD_WebService.csproj.user +++ b/KJDService/KJD_WebService/KJD_WebService.csproj.user @@ -8,7 +8,7 @@ - Release|Any CPU + Debug|Any CPU ShowAllFiles diff --git a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUserSelectForm.Designer.cs b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUserSelectForm.Designer.cs index 7bc9875..a31298e 100644 --- a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUserSelectForm.Designer.cs +++ b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUserSelectForm.Designer.cs @@ -40,6 +40,12 @@ namespace TemuKJD.PDDForms.ProductSelectForms System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.ucGroupBoxEx2 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components); + this.txtMultiPcsSku3 = new System.Windows.Forms.TextBox(); + this.txtMultiPcsSku2 = new System.Windows.Forms.TextBox(); + this.txtMultiPcsSku1 = new System.Windows.Forms.TextBox(); + this.chkMultiPcsSku = new TemuKJD.UserComponent.UcCheckBox(this.components); + this.txtEndWords = new System.Windows.Forms.TextBox(); + this.chkEndWords = new TemuKJD.UserComponent.UcCheckBox(this.components); this.chkChance = new TemuKJD.UserComponent.UcCheckBox(this.components); this.txtWaitSeconds = new System.Windows.Forms.TextBox(); this.chkRandomCompanyProd = new TemuKJD.UserComponent.UcCheckBox(this.components); @@ -63,11 +69,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms this.chkUpgradeVersion = new TemuKJD.UserComponent.UcCheckBox(this.components); this.btnStop = new DevComponents.DotNetBar.PanelEx(); this.chkKeepChanceGoodsImg = new TemuKJD.UserComponent.UcCheckBox(this.components); - this.pbSkuImg = new System.Windows.Forms.PictureBox(); - this.label19 = new System.Windows.Forms.Label(); - this.txtLowPriceSkuPrice = new System.Windows.Forms.TextBox(); - this.txtLowPriceSkuName = new System.Windows.Forms.TextBox(); - this.label18 = new System.Windows.Forms.Label(); this.txtAddTimesFake = new System.Windows.Forms.TextBox(); this.chkActivity = new TemuKJD.UserComponent.UcCheckBox(this.components); this.label17 = new System.Windows.Forms.Label(); @@ -89,12 +90,11 @@ namespace TemuKJD.PDDForms.ProductSelectForms this.label4 = new System.Windows.Forms.Label(); this.label9 = new System.Windows.Forms.Label(); this.chkStepAddPrice = new TemuKJD.UserComponent.UcCheckBox(this.components); - this.chkLowPriceSku = new TemuKJD.UserComponent.UcCheckBox(this.components); - this.lblLowPriceSkuImg = new System.Windows.Forms.Label(); this.label15 = new System.Windows.Forms.Label(); this.label11 = new System.Windows.Forms.Label(); this.line1 = new DevComponents.DotNetBar.Controls.Line(); this.line2 = new DevComponents.DotNetBar.Controls.Line(); + this.label26 = new System.Windows.Forms.Label(); this.ucGroupBoxEx4 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components); this.cmbCateFilter3 = new TemuKJD.UserComponent.UcComboBoxMutiSelect(); this.label25 = new System.Windows.Forms.Label(); @@ -143,6 +143,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms this.colCanUse = new System.Windows.Forms.DataGridViewCheckBoxColumn(); this.colRemaining = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colMessage = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.pbSkuImg = new System.Windows.Forms.PictureBox(); this.chk15996 = new TemuKJD.UserComponent.UcCheckBox(this.components); this.chk21365 = new TemuKJD.UserComponent.UcCheckBox(this.components); this.chk20981 = new TemuKJD.UserComponent.UcCheckBox(this.components); @@ -151,6 +152,12 @@ namespace TemuKJD.PDDForms.ProductSelectForms this.btnTest20981 = new DevComponents.DotNetBar.PanelEx(); this.pbLoading = new System.Windows.Forms.PictureBox(); this.chk22347 = new TemuKJD.UserComponent.UcCheckBox(this.components); + this.chkLowPriceSku = new TemuKJD.UserComponent.UcCheckBox(this.components); + this.lblLowPriceSkuImg = new System.Windows.Forms.Label(); + this.label18 = new System.Windows.Forms.Label(); + this.txtLowPriceSkuName = new System.Windows.Forms.TextBox(); + this.txtLowPriceSkuPrice = new System.Windows.Forms.TextBox(); + this.label19 = new System.Windows.Forms.Label(); this.dgvSelectProduct = new TemuKJD.UserComponent.DataGridViewEx(); this.colCheck = new System.Windows.Forms.DataGridViewCheckBoxColumn(); this.colSelectId = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -179,13 +186,14 @@ namespace TemuKJD.PDDForms.ProductSelectForms this.btnClear = new DevComponents.DotNetBar.PanelEx(); this.panelEx1 = new DevComponents.DotNetBar.PanelEx(); this.panel1 = new System.Windows.Forms.Panel(); + this.txtMultiPcsSku4 = new System.Windows.Forms.TextBox(); + this.label27 = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); this.splitContainer1.SuspendLayout(); this.ucGroupBoxEx2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pbUpgradeVersion)).BeginInit(); - ((System.ComponentModel.ISupportInitialize)(this.pbSkuImg)).BeginInit(); this.panel4.SuspendLayout(); this.panel3.SuspendLayout(); this.fPnlPriceRule.SuspendLayout(); @@ -202,6 +210,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms this.splitContainer2.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.pbShopLoading)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dgvShop)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbSkuImg)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.pbLoading)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.dgvSelectProduct)).BeginInit(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer4)).BeginInit(); @@ -237,6 +246,14 @@ namespace TemuKJD.PDDForms.ProductSelectForms | System.Windows.Forms.AnchorStyles.Right))); this.ucGroupBoxEx2.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); this.ucGroupBoxEx2.BorderStyle = TemuKJD.UserComponent.UcGroupBoxEx.GroupBoxBorderStyle.ROUND; + this.ucGroupBoxEx2.Controls.Add(this.txtMultiPcsSku4); + this.ucGroupBoxEx2.Controls.Add(this.label27); + this.ucGroupBoxEx2.Controls.Add(this.txtMultiPcsSku3); + this.ucGroupBoxEx2.Controls.Add(this.txtMultiPcsSku2); + this.ucGroupBoxEx2.Controls.Add(this.txtMultiPcsSku1); + this.ucGroupBoxEx2.Controls.Add(this.chkMultiPcsSku); + this.ucGroupBoxEx2.Controls.Add(this.txtEndWords); + this.ucGroupBoxEx2.Controls.Add(this.chkEndWords); this.ucGroupBoxEx2.Controls.Add(this.chkChance); this.ucGroupBoxEx2.Controls.Add(this.txtWaitSeconds); this.ucGroupBoxEx2.Controls.Add(this.chkRandomCompanyProd); @@ -260,11 +277,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms this.ucGroupBoxEx2.Controls.Add(this.chkUpgradeVersion); this.ucGroupBoxEx2.Controls.Add(this.btnStop); this.ucGroupBoxEx2.Controls.Add(this.chkKeepChanceGoodsImg); - this.ucGroupBoxEx2.Controls.Add(this.pbSkuImg); - this.ucGroupBoxEx2.Controls.Add(this.label19); - this.ucGroupBoxEx2.Controls.Add(this.txtLowPriceSkuPrice); - this.ucGroupBoxEx2.Controls.Add(this.txtLowPriceSkuName); - this.ucGroupBoxEx2.Controls.Add(this.label18); this.ucGroupBoxEx2.Controls.Add(this.txtAddTimesFake); this.ucGroupBoxEx2.Controls.Add(this.chkActivity); this.ucGroupBoxEx2.Controls.Add(this.label17); @@ -282,12 +294,11 @@ namespace TemuKJD.PDDForms.ProductSelectForms this.ucGroupBoxEx2.Controls.Add(this.label4); this.ucGroupBoxEx2.Controls.Add(this.label9); this.ucGroupBoxEx2.Controls.Add(this.chkStepAddPrice); - this.ucGroupBoxEx2.Controls.Add(this.chkLowPriceSku); - this.ucGroupBoxEx2.Controls.Add(this.lblLowPriceSkuImg); this.ucGroupBoxEx2.Controls.Add(this.label15); this.ucGroupBoxEx2.Controls.Add(this.label11); this.ucGroupBoxEx2.Controls.Add(this.line1); this.ucGroupBoxEx2.Controls.Add(this.line2); + this.ucGroupBoxEx2.Controls.Add(this.label26); this.ucGroupBoxEx2.Location = new System.Drawing.Point(523, 2); this.ucGroupBoxEx2.Name = "ucGroupBoxEx2"; this.ucGroupBoxEx2.Size = new System.Drawing.Size(1046, 140); @@ -295,6 +306,62 @@ namespace TemuKJD.PDDForms.ProductSelectForms this.ucGroupBoxEx2.TabStop = false; this.ucGroupBoxEx2.Text = "商品上传"; // + // txtMultiPcsSku3 + // + this.txtMultiPcsSku3.Location = new System.Drawing.Point(787, 109); + this.txtMultiPcsSku3.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2); + this.txtMultiPcsSku3.Name = "txtMultiPcsSku3"; + this.txtMultiPcsSku3.Size = new System.Drawing.Size(25, 23); + this.txtMultiPcsSku3.TabIndex = 870; + this.txtMultiPcsSku3.Text = "个"; + // + // txtMultiPcsSku2 + // + this.txtMultiPcsSku2.Location = new System.Drawing.Point(759, 109); + this.txtMultiPcsSku2.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2); + this.txtMultiPcsSku2.Name = "txtMultiPcsSku2"; + this.txtMultiPcsSku2.Size = new System.Drawing.Size(25, 23); + this.txtMultiPcsSku2.TabIndex = 868; + this.txtMultiPcsSku2.Text = "5"; + // + // txtMultiPcsSku1 + // + this.txtMultiPcsSku1.Location = new System.Drawing.Point(725, 109); + this.txtMultiPcsSku1.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2); + this.txtMultiPcsSku1.Name = "txtMultiPcsSku1"; + this.txtMultiPcsSku1.Size = new System.Drawing.Size(25, 23); + this.txtMultiPcsSku1.TabIndex = 867; + this.txtMultiPcsSku1.Text = "3"; + // + // chkMultiPcsSku + // + this.chkMultiPcsSku.AutoSize = true; + this.chkMultiPcsSku.Location = new System.Drawing.Point(661, 110); + this.chkMultiPcsSku.Name = "chkMultiPcsSku"; + this.chkMultiPcsSku.Size = new System.Drawing.Size(71, 21); + this.chkMultiPcsSku.TabIndex = 866; + this.chkMultiPcsSku.Text = "多件sku"; + this.chkMultiPcsSku.UseVisualStyleBackColor = true; + // + // txtEndWords + // + this.txtEndWords.Location = new System.Drawing.Point(599, 109); + this.txtEndWords.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2); + this.txtEndWords.Name = "txtEndWords"; + this.txtEndWords.Size = new System.Drawing.Size(54, 23); + this.txtEndWords.TabIndex = 865; + this.txtEndWords.Text = "批发"; + // + // chkEndWords + // + this.chkEndWords.AutoSize = true; + this.chkEndWords.Location = new System.Drawing.Point(531, 110); + this.chkEndWords.Name = "chkEndWords"; + this.chkEndWords.Size = new System.Drawing.Size(75, 21); + this.chkEndWords.TabIndex = 864; + this.chkEndWords.Text = "标题后缀"; + this.chkEndWords.UseVisualStyleBackColor = true; + // // chkChance // this.chkChance.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); @@ -419,6 +486,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms this.btnApiUpload.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255))))); this.btnApiUpload.TabIndex = 742; this.btnApiUpload.Text = "批量上传"; + this.btnApiUpload.Visible = false; this.btnApiUpload.Click += new System.EventHandler(this.btnApiUpload_Click); // // btnUpload @@ -599,61 +667,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms this.chkKeepChanceGoodsImg.UseVisualStyleBackColor = true; this.chkKeepChanceGoodsImg.CheckedChanged += new System.EventHandler(this.chkKeepChanceGoodsImg_CheckedChanged); // - // pbSkuImg - // - this.pbSkuImg.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; - this.pbSkuImg.Location = new System.Drawing.Point(810, 109); - this.pbSkuImg.Name = "pbSkuImg"; - this.pbSkuImg.Size = new System.Drawing.Size(25, 25); - this.pbSkuImg.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; - this.pbSkuImg.TabIndex = 664; - this.pbSkuImg.TabStop = false; - this.pbSkuImg.Click += new System.EventHandler(this.pbSkuImg_Click); - // - // label19 - // - this.label19.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.label19.AutoSize = true; - this.label19.Location = new System.Drawing.Point(743, 113); - this.label19.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0); - this.label19.Name = "label19"; - this.label19.Size = new System.Drawing.Size(20, 17); - this.label19.TabIndex = 663; - this.label19.Text = "元"; - // - // txtLowPriceSkuPrice - // - this.txtLowPriceSkuPrice.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.txtLowPriceSkuPrice.Location = new System.Drawing.Point(711, 110); - this.txtLowPriceSkuPrice.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2); - this.txtLowPriceSkuPrice.Name = "txtLowPriceSkuPrice"; - this.txtLowPriceSkuPrice.Size = new System.Drawing.Size(32, 23); - this.txtLowPriceSkuPrice.TabIndex = 658; - this.txtLowPriceSkuPrice.Text = "5"; - this.txtLowPriceSkuPrice.TextChanged += new System.EventHandler(this.txtLowPriceSkuPrice_TextChanged); - // - // txtLowPriceSkuName - // - this.txtLowPriceSkuName.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.txtLowPriceSkuName.Location = new System.Drawing.Point(607, 110); - this.txtLowPriceSkuName.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2); - this.txtLowPriceSkuName.Name = "txtLowPriceSkuName"; - this.txtLowPriceSkuName.Size = new System.Drawing.Size(50, 23); - this.txtLowPriceSkuName.TabIndex = 662; - this.txtLowPriceSkuName.Text = "福利款"; - this.txtLowPriceSkuName.TextChanged += new System.EventHandler(this.txtLowPriceSkuName_TextChanged); - // - // label18 - // - this.label18.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.label18.AutoSize = true; - this.label18.Location = new System.Drawing.Point(657, 113); - this.label18.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0); - this.label18.Name = "label18"; - this.label18.Size = new System.Drawing.Size(56, 17); - this.label18.TabIndex = 661; - this.label18.Text = "保底价格"; - // // txtAddTimesFake // this.txtAddTimesFake.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); @@ -958,30 +971,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms this.chkStepAddPrice.UseVisualStyleBackColor = true; this.chkStepAddPrice.CheckedChanged += new System.EventHandler(this.chkStepAddPrice_CheckedChanged); // - // chkLowPriceSku - // - this.chkLowPriceSku.AutoSize = true; - this.chkLowPriceSku.Location = new System.Drawing.Point(531, 110); - this.chkLowPriceSku.Name = "chkLowPriceSku"; - this.chkLowPriceSku.Size = new System.Drawing.Size(83, 21); - this.chkLowPriceSku.TabIndex = 660; - this.chkLowPriceSku.Text = "低价sku名"; - this.chkLowPriceSku.UseVisualStyleBackColor = true; - this.chkLowPriceSku.CheckedChanged += new System.EventHandler(this.chkLowPriceSku_CheckedChanged); - // - // lblLowPriceSkuImg - // - this.lblLowPriceSkuImg.AutoSize = true; - this.lblLowPriceSkuImg.Cursor = System.Windows.Forms.Cursors.Hand; - this.lblLowPriceSkuImg.ForeColor = System.Drawing.SystemColors.HotTrack; - this.lblLowPriceSkuImg.Location = new System.Drawing.Point(760, 113); - this.lblLowPriceSkuImg.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0); - this.lblLowPriceSkuImg.Name = "lblLowPriceSkuImg"; - this.lblLowPriceSkuImg.Size = new System.Drawing.Size(52, 17); - this.lblLowPriceSkuImg.TabIndex = 668; - this.lblLowPriceSkuImg.Text = "传sku图"; - this.lblLowPriceSkuImg.Click += new System.EventHandler(this.lblLowPriceSkuImg_Click); - // // label15 // this.label15.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); @@ -1022,6 +1011,16 @@ namespace TemuKJD.PDDForms.ProductSelectForms this.line2.TabIndex = 837; this.line2.Text = "line2"; // + // label26 + // + this.label26.AutoSize = true; + this.label26.Location = new System.Drawing.Point(749, 113); + this.label26.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0); + this.label26.Name = "label26"; + this.label26.Size = new System.Drawing.Size(13, 17); + this.label26.TabIndex = 869; + this.label26.Text = "-"; + // // ucGroupBoxEx4 // this.ucGroupBoxEx4.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) @@ -1568,6 +1567,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms // // splitContainer2.Panel2 // + this.splitContainer2.Panel2.Controls.Add(this.pbSkuImg); this.splitContainer2.Panel2.Controls.Add(this.chk15996); this.splitContainer2.Panel2.Controls.Add(this.chk21365); this.splitContainer2.Panel2.Controls.Add(this.chk20981); @@ -1576,6 +1576,12 @@ namespace TemuKJD.PDDForms.ProductSelectForms this.splitContainer2.Panel2.Controls.Add(this.btnTest20981); this.splitContainer2.Panel2.Controls.Add(this.pbLoading); this.splitContainer2.Panel2.Controls.Add(this.chk22347); + this.splitContainer2.Panel2.Controls.Add(this.chkLowPriceSku); + this.splitContainer2.Panel2.Controls.Add(this.lblLowPriceSkuImg); + this.splitContainer2.Panel2.Controls.Add(this.label18); + this.splitContainer2.Panel2.Controls.Add(this.txtLowPriceSkuName); + this.splitContainer2.Panel2.Controls.Add(this.txtLowPriceSkuPrice); + this.splitContainer2.Panel2.Controls.Add(this.label19); this.splitContainer2.Panel2.Controls.Add(this.dgvSelectProduct); this.splitContainer2.Panel2.Padding = new System.Windows.Forms.Padding(0, 0, 4, 0); this.splitContainer2.Size = new System.Drawing.Size(1571, 372); @@ -1724,6 +1730,18 @@ namespace TemuKJD.PDDForms.ProductSelectForms this.colMessage.Name = "colMessage"; this.colMessage.ReadOnly = true; // + // pbSkuImg + // + this.pbSkuImg.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle; + this.pbSkuImg.Location = new System.Drawing.Point(300, 49); + this.pbSkuImg.Name = "pbSkuImg"; + this.pbSkuImg.Size = new System.Drawing.Size(25, 25); + this.pbSkuImg.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Zoom; + this.pbSkuImg.TabIndex = 664; + this.pbSkuImg.TabStop = false; + this.pbSkuImg.Visible = false; + this.pbSkuImg.Click += new System.EventHandler(this.pbSkuImg_Click); + // // chk15996 // this.chk15996.AutoSize = true; @@ -1832,6 +1850,80 @@ namespace TemuKJD.PDDForms.ProductSelectForms this.chk22347.Visible = false; this.chk22347.CheckedChanged += new System.EventHandler(this.chkActivityDetail_CheckedChanged); // + // chkLowPriceSku + // + this.chkLowPriceSku.AutoSize = true; + this.chkLowPriceSku.Location = new System.Drawing.Point(21, 50); + this.chkLowPriceSku.Name = "chkLowPriceSku"; + this.chkLowPriceSku.Size = new System.Drawing.Size(83, 21); + this.chkLowPriceSku.TabIndex = 660; + this.chkLowPriceSku.Text = "低价sku名"; + this.chkLowPriceSku.UseVisualStyleBackColor = true; + this.chkLowPriceSku.Visible = false; + this.chkLowPriceSku.CheckedChanged += new System.EventHandler(this.chkLowPriceSku_CheckedChanged); + // + // lblLowPriceSkuImg + // + this.lblLowPriceSkuImg.AutoSize = true; + this.lblLowPriceSkuImg.Cursor = System.Windows.Forms.Cursors.Hand; + this.lblLowPriceSkuImg.ForeColor = System.Drawing.SystemColors.HotTrack; + this.lblLowPriceSkuImg.Location = new System.Drawing.Point(250, 53); + this.lblLowPriceSkuImg.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0); + this.lblLowPriceSkuImg.Name = "lblLowPriceSkuImg"; + this.lblLowPriceSkuImg.Size = new System.Drawing.Size(52, 17); + this.lblLowPriceSkuImg.TabIndex = 668; + this.lblLowPriceSkuImg.Text = "传sku图"; + this.lblLowPriceSkuImg.Visible = false; + this.lblLowPriceSkuImg.Click += new System.EventHandler(this.lblLowPriceSkuImg_Click); + // + // label18 + // + this.label18.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.label18.AutoSize = true; + this.label18.Location = new System.Drawing.Point(147, 53); + this.label18.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0); + this.label18.Name = "label18"; + this.label18.Size = new System.Drawing.Size(56, 17); + this.label18.TabIndex = 661; + this.label18.Text = "保底价格"; + this.label18.Visible = false; + // + // txtLowPriceSkuName + // + this.txtLowPriceSkuName.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.txtLowPriceSkuName.Location = new System.Drawing.Point(97, 50); + this.txtLowPriceSkuName.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2); + this.txtLowPriceSkuName.Name = "txtLowPriceSkuName"; + this.txtLowPriceSkuName.Size = new System.Drawing.Size(50, 23); + this.txtLowPriceSkuName.TabIndex = 662; + this.txtLowPriceSkuName.Text = "福利款"; + this.txtLowPriceSkuName.Visible = false; + this.txtLowPriceSkuName.TextChanged += new System.EventHandler(this.txtLowPriceSkuName_TextChanged); + // + // txtLowPriceSkuPrice + // + this.txtLowPriceSkuPrice.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.txtLowPriceSkuPrice.Location = new System.Drawing.Point(201, 50); + this.txtLowPriceSkuPrice.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2); + this.txtLowPriceSkuPrice.Name = "txtLowPriceSkuPrice"; + this.txtLowPriceSkuPrice.Size = new System.Drawing.Size(32, 23); + this.txtLowPriceSkuPrice.TabIndex = 658; + this.txtLowPriceSkuPrice.Text = "5"; + this.txtLowPriceSkuPrice.Visible = false; + this.txtLowPriceSkuPrice.TextChanged += new System.EventHandler(this.txtLowPriceSkuPrice_TextChanged); + // + // label19 + // + this.label19.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.label19.AutoSize = true; + this.label19.Location = new System.Drawing.Point(233, 53); + this.label19.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0); + this.label19.Name = "label19"; + this.label19.Size = new System.Drawing.Size(20, 17); + this.label19.TabIndex = 663; + this.label19.Text = "元"; + this.label19.Visible = false; + // // dgvSelectProduct // this.dgvSelectProduct.AllowUserToAddRows = false; @@ -2157,6 +2249,27 @@ namespace TemuKJD.PDDForms.ProductSelectForms this.panel1.TabIndex = 189; this.panel1.Paint += new System.Windows.Forms.PaintEventHandler(this.panel1_Paint); // + // txtMultiPcsSku4 + // + this.txtMultiPcsSku4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.txtMultiPcsSku4.Location = new System.Drawing.Point(849, 109); + this.txtMultiPcsSku4.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2); + this.txtMultiPcsSku4.Name = "txtMultiPcsSku4"; + this.txtMultiPcsSku4.Size = new System.Drawing.Size(25, 23); + this.txtMultiPcsSku4.TabIndex = 884; + this.txtMultiPcsSku4.Text = "1.1"; + // + // label27 + // + this.label27.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.label27.AutoSize = true; + this.label27.Location = new System.Drawing.Point(812, 112); + this.label27.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0); + this.label27.Name = "label27"; + this.label27.Size = new System.Drawing.Size(41, 17); + this.label27.TabIndex = 883; + this.label27.Text = "价格×"; + // // PDDDBProdUserSelectForm // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; @@ -2177,7 +2290,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms this.ucGroupBoxEx2.ResumeLayout(false); this.ucGroupBoxEx2.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.pbUpgradeVersion)).EndInit(); - ((System.ComponentModel.ISupportInitialize)(this.pbSkuImg)).EndInit(); this.panel4.ResumeLayout(false); this.panel3.ResumeLayout(false); this.panel3.PerformLayout(); @@ -2199,6 +2311,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms this.splitContainer2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.pbShopLoading)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dgvShop)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.pbSkuImg)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.pbLoading)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.dgvSelectProduct)).EndInit(); this.splitContainer4.Panel1.ResumeLayout(false); @@ -2352,5 +2465,14 @@ namespace TemuKJD.PDDForms.ProductSelectForms private System.Windows.Forms.DataGridViewLinkColumn ColDelete; private System.Windows.Forms.DataGridViewTextBoxColumn colAddTime; private System.Windows.Forms.DataGridViewTextBoxColumn colOpResult; + private System.Windows.Forms.TextBox txtMultiPcsSku1; + private UserComponent.UcCheckBox chkMultiPcsSku; + private System.Windows.Forms.TextBox txtEndWords; + private UserComponent.UcCheckBox chkEndWords; + private System.Windows.Forms.TextBox txtMultiPcsSku3; + private System.Windows.Forms.TextBox txtMultiPcsSku2; + private System.Windows.Forms.Label label26; + private System.Windows.Forms.TextBox txtMultiPcsSku4; + private System.Windows.Forms.Label label27; } } \ No newline at end of file diff --git a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUserSelectForm.cs b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUserSelectForm.cs index 275ab76..9ff8592 100644 --- a/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUserSelectForm.cs +++ b/TEMUKJD/PDDForms/ProductSelectForms/PDDDBProdUserSelectForm.cs @@ -1367,7 +1367,15 @@ namespace TemuKJD.PDDForms.ProductSelectForms prodParam.title_keywords = new List(); prodParam.title_recommend = null; try - { + { + Invoke(new Action(() => + { + if (cell != null) + { + cell.Value = "正在查询关键字"; + } + })); + Thread.Sleep(Randomx.GetId(10, 60)); string keywords_html = query_keywords(shop, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id, prodInfo.detail.cat_id.ParseToString(), prodInfo.detail.goods_name, prodInfo.detail.galleries.FirstOrDefault(g => g.type == 1).url, prodInfo.chance_tab); @@ -1384,89 +1392,17 @@ namespace TemuKJD.PDDForms.ProductSelectForms var hot_keywordsStr = JsonHelper.SerializeObject(hot_keywordsArr); prodParam.title_keywords = JsonHelper.DeserializeJsonToList(hot_keywordsStr); - Invoke(new Action(() => - { - if (cell != null) - { - cell.Value = "正在查询关键字"; - } - })); } catch (Exception ex) { } - if (dbProd.product_get_type_text == "厂商直采") + // 上传外部商品主图详情图图片 + Invoke(new Action(() => { - var queryRst = querySpecName(shop, prodInfo.detail.cat_id.ParseToLong(), prodParam.goods_id.ParseToString(), prodParam.goods_commit_id); - if (!queryRst.Contains("\"success\":true")) + if (cell != null) { - var error = BaseRegex.GetStringJson(ref queryRst, "error_msg"); - if (string.IsNullOrEmpty(error)) - error = queryRst; - return "商品sku属性编号获取失败 " + error; + cell.Value = "正在生成商品图片"; } - - Dictionary specNameDic = new Dictionary(); - foreach (var jObj in JsonHelper.JObjectParse(queryRst)["result"]) - { - string specStr = JsonHelper.SerializeObject(jObj); - var specId = BaseRegex.GetLongJson(ref specStr, "id"); - var specValue = BaseRegex.GetStringJson(ref specStr, "value"); - specNameDic[specId] = specValue; - } - - - foreach (var skuInfo in prodInfo.detail.sku) - { - foreach (var specInfo in skuInfo.spec) - { - specInfo.parent_id = 0; - specInfo.spec_id = 0; - } - } - - foreach (var skuInfo in prodInfo.detail.sku) - { - var index = 0; - foreach(var specInfo in skuInfo.spec) - { - long parent_id = 0; - try - { - parent_id = specNameDic.FirstOrDefault(s => s.Value == specInfo.parent_name).Key; - } - catch - { - } - if (parent_id == 0) - parent_id = specNameDic.ToList()[index].Key; - - specInfo.parent_id = parent_id; - specInfo.spec_id = prodInfo.detail.sku.FirstOrDefault(s => s.spec[index].spec_name == specInfo.spec_name && s.spec[index].spec_id > 0)?.spec[index].spec_id; - - if (specInfo.spec_id == null || specInfo.spec_id == 0) - { - // 根据修改过的spec_name获取spec_id - var changeSpecRst = get_spec_by_name(shop, specInfo.spec_name, specInfo.parent_id.ParseToLong(), prodInfo.detail.cat_id.ParseToInt(), - prodParam.goods_id.ParseToString(), prodParam.goods_commit_id, prodInfo.chance_tab); - Thread.Sleep(Randomx.GetId(50, 100)); - if (!changeSpecRst.Contains("\"success\":true")) - { - var error = BaseRegex.GetStringJson(ref changeSpecRst, "error_msg"); - if (string.IsNullOrEmpty(error)) - error = changeSpecRst; - return "商品sku属性编号获取失败 " + error; - } - else - { - specInfo.spec_id = BaseRegex.GetLongJson(ref changeSpecRst, "result"); - } - } - index++; - } - } - } - - // 上传外部商品图片 + })); foreach (var imgInfo in prodInfo.detail.galleries) { if (imgInfo.url.Contains("img.pddpic.com")) @@ -1497,7 +1433,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms } } - // 上传商品图片 + // 上传外部商品sku图片 foreach (var skuInfo in prodInfo.detail.sku) { if (skuInfo.thumb_url.Contains("img.pddpic.com")) @@ -1537,8 +1473,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms prodInfo.decoration = decoration; } - - prodParam.ai_goods_video = new List(); prodParam.ai_goods_video = new List(); prodParam.allergy_refund = prodInfo.detail.allergy_refund; @@ -1570,7 +1504,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms } - //PDDProdDecorationCommitParam decorationParam = new PDDProdDecorationCommitParam(); //decorationParam.goods_id = prodParam.goods_id; //decorationParam.goods_commit_id = prodParam.goods_commit_id.ParseToLong(); @@ -1622,8 +1555,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms //} - - prodParam.decorationDetail = prodInfo.decoration.floor_list; //prodParam.decorationPreview = ""; // 商品详情图,通过接口获取 prodParam.default_template_gray = true; @@ -1658,6 +1589,16 @@ namespace TemuKJD.PDDForms.ProductSelectForms prodParam.goods_desc = prodInfo.detail.goods_desc; //prodParam.goods_id = prodParam.goods_id; prodParam.goods_name = prodInfo.detail.goods_name; + + if (chkEndWords.Checked) + { + prodParam.goods_name = prodParam.goods_name + txtEndWords.Text.Trim(); + while (prodParam.goods_name.Length > 30) + { + prodParam.goods_name = prodParam.goods_name.Substring(1); + } + } + prodParam.goods_name_prefix = prodInfo.detail.goods_name_prefix; prodParam.goods_pattern = prodInfo.detail.goods_pattern; @@ -1811,6 +1752,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms prodParam.skus = new List(); // 生成基准未改价的sku列表 + #region 获取编辑sku string[] upgradeTxt = new string[] { "升级款#", "升级版#", "精品款#", "精品版#", "升级款", "升级版", "精品款", "精品版" }; List baseSkuParamLst = new List(); List skuInfoEditLst = new List(); @@ -1818,14 +1760,14 @@ namespace TemuKJD.PDDForms.ProductSelectForms { // 如果有编辑过的sku使用编辑过的sku skuInfoEditLst = JsonHelper.DeserializeJsonToList(dbProd.sku_edit_json); - bool hasNoSpecId = false; // 记录一下,后面把最新数据提交到服务器补全spec + //bool hasNoSpecId = false; // 记录一下,后面把最新数据提交到服务器补全spec + foreach (var skuInfo in skuInfoEditLst) { foreach (var specInfo in skuInfo.spec) { if (specInfo.spec_id.ParseToLong() == 0) { - hasNoSpecId = true; // 根据修改过的spec_name获取spec_id var changeSpecRst = get_spec_by_name(shop, specInfo.spec_name, specInfo.parent_id.ParseToLong(), prodInfo.detail.cat_id.ParseToInt(), prodParam.goods_id.ParseToString(), prodParam.goods_commit_id, prodInfo.chance_tab); @@ -1860,6 +1802,144 @@ namespace TemuKJD.PDDForms.ProductSelectForms // 否则使用原版sku skuInfoEditLst = JsonHelper.DeserializeJsonToList(JsonHelper.SerializeObject(prodInfo.detail.sku)); } + #endregion + + // 如果做活动多倍加价,补全到两个sku规格 + #region 其他sku调整 所有sku调整请在识别spec前做完 + if (chkActivity.Checked) + { + foreach (var skuInfo in skuInfoEditLst) + { + if (skuInfo.spec.Count == 1) + { + if (skuInfo.spec[0].parent_name != "规格") + skuInfo.spec.Add(new spec_item() { parent_name = "规格", spec_name = "默认规格" }); + else + skuInfo.spec.Add(new spec_item() { parent_name = "款式", spec_name = "默认款式" }); + } + } + } + + // 厂商直采specId是错的置空为0方便后面处理重新获取正确的 + if (dbProd.product_get_type_text == "厂商直采") + { + foreach (var skuInfo in skuInfoEditLst) + { + foreach (var skuSpec in skuInfo.spec) + { + skuSpec.parent_id = 0; + skuSpec.spec_id = 0; + } + } + } + #endregion + + #region 没有specId的商品重新识别specID + if (skuInfoEditLst.Any(s => s.spec.Any(sp => sp.parent_id.ParseToLong() == 0 || sp.spec_id.ParseToLong() == 0))) + { + Invoke(new Action(() => + { + if (cell != null) + { + cell.Value = "正在初始化Sku属性"; + } + })); + + var queryRst = querySpecName(shop, prodInfo.detail.cat_id.ParseToLong(), prodParam.goods_id.ParseToString(), prodParam.goods_commit_id); + if (!queryRst.Contains("\"success\":true")) + { + var error = BaseRegex.GetStringJson(ref queryRst, "error_msg"); + if (string.IsNullOrEmpty(error)) + error = queryRst; + return "商品sku属性编号获取失败 " + error; + } + + Dictionary specNameDic = new Dictionary(); + foreach (var jObj in JsonHelper.JObjectParse(queryRst)["result"]) + { + string specStr = JsonHelper.SerializeObject(jObj); + var specId = BaseRegex.GetLongJson(ref specStr, "id"); + var specValue = BaseRegex.GetStringJson(ref specStr, "value"); + specNameDic[specId] = specValue; + } + + foreach (var skuInfo in skuInfoEditLst) + { + var index = 0; + foreach (var specInfo in skuInfo.spec) + { + long parent_id = 0; + try + { + parent_id = specNameDic.FirstOrDefault(s => s.Value == specInfo.parent_name).Key; + } + catch + { + } + if (parent_id == 0) + parent_id = specNameDic.ToList()[index].Key; + + specInfo.parent_id = parent_id; + specInfo.spec_id = skuInfoEditLst.FirstOrDefault(s => s.spec[index].spec_name == specInfo.spec_name && s.spec[index].spec_id > 0)?.spec[index].spec_id; + + if (specInfo.spec_id == null || specInfo.spec_id == 0) + { + // 根据修改过的spec_name获取spec_id + var changeSpecRst = get_spec_by_name(shop, specInfo.spec_name, specInfo.parent_id.ParseToLong(), prodInfo.detail.cat_id.ParseToInt(), + prodParam.goods_id.ParseToString(), prodParam.goods_commit_id, prodInfo.chance_tab); + Thread.Sleep(Randomx.GetId(50, 100)); + if (!changeSpecRst.Contains("\"success\":true")) + { + var error = BaseRegex.GetStringJson(ref changeSpecRst, "error_msg"); + if (string.IsNullOrEmpty(error)) + error = changeSpecRst; + return "商品sku属性编号获取失败 " + error; + } + else + { + specInfo.spec_id = BaseRegex.GetLongJson(ref changeSpecRst, "result"); + } + } + index++; + } + } + } + #endregion + + #region 新版获取sku替换图 + string fakeImgUrl; + Image fakeImg = null; + if (chkActivity.Checked) + { + var url = BaseClass.BuildObjString("product/get_sku_replace_img_list_random"); + var data = ""; + data = UserLogin.GetSignaturex() + + "&page=" + 1 + + "&page_size=" + 1; + data += "&in_img_type=混淆图"; + var html = GetHtml.PostUtf8(url, data); + if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200")) + { + } + else + { + try + { + JObject jObj = JObject.Parse(html); + fakeImgUrl = jObj["data"].FirstOrDefault().ParseToString(); + + string getImgError = ""; + if (!fakeImgUrl.Contains("wst.wxapp.tc.qq.com")) + fakeImgUrl = fakeImgUrl.Replace("https://", "http://"); + fakeImg = GetHtml.GetUrlImg(fakeImgUrl, out getImgError); + } + catch + { + + } + } + } + #endregion Dictionary new_Sku_Img_Dic = new Dictionary(); foreach (var skuInfo in skuInfoEditLst) @@ -1895,6 +1975,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms skuParam.multi_price = dbProd.ext_code_price; } + #region 移除有升级款字样的sku if (pddUploadRule.IsUpgradeVersion) { // 查找原sku内是否有升级款类似字样 @@ -1925,10 +2006,14 @@ namespace TemuKJD.PDDForms.ProductSelectForms } } } + #endregion - if (pddUploadRule.IsSignActivity && 1 == 1) // 每张sku图都单独上传,(并在图片上画线,没有效果) + #region 活动修改sku图片,规格等 + if (pddUploadRule.IsSignActivity && 1 == 1) { - if (!new_Sku_Img_Dic.Keys.Contains(skuParam.thumb_url)) + // 活动的每个sku随机规格图都单独上传 + var new_thumb_url = ""; + //if (!new_Sku_Img_Dic.Keys.Contains(skuParam.thumb_url)) { string getImgError; var image = GetHtml.GetUrlImg(skuParam.thumb_url.Replace("https://", "http://"), out getImgError); @@ -1942,6 +2027,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms using (Graphics g = Graphics.FromImage(imageBg)) { g.DrawImage(image, new Rectangle(0, 0, imageBg.Width, imageBg.Height), 0, 0, image.Width, image.Height, GraphicsUnit.Pixel); + // 在图片上画线,尝试改变商品评估价格,没有效果 //Pen pen = new Pen(Color.White); //g.DrawLine(pen, Randomx.GetId(0, image.Width), Randomx.GetId(0, image.Height), Randomx.GetId(0, image.Width), Randomx.GetId(0, image.Height)); //pen = new Pen(Color.Blue); @@ -1949,6 +2035,12 @@ namespace TemuKJD.PDDForms.ProductSelectForms //pen = new Pen(Color.Green); //g.DrawLine(pen, Randomx.GetId(0, image.Width), Randomx.GetId(0, image.Height), Randomx.GetId(0, image.Width), Randomx.GetId(0, image.Height)); } + + // 新版画图,文字标在图片上 + float alpha = Math.Min(100, Math.Max(1, txtAlpha.Text.ParseToInt())) / 100f; + var text1 = skuParam.spec[0].spec_name; + var text2 = skuParam.spec[0].spec_name.Replace("无规格", "").Replace("默认规格", "").Replace("默认款式", ""); + imageBg = PddGetActivitySkuImg(out getImgError, skuParam.thumb_url, fakeImg, pbUpgradeVersion.Image, alpha, text1 + " " + text2, pddUploadRule); } catch (Exception ex) { @@ -1964,17 +2056,145 @@ namespace TemuKJD.PDDForms.ProductSelectForms } else { - var new_thumb_url = BaseRegex.GetStringJson(ref uploadUpgradeSkuImgRst, "url"); - new_Sku_Img_Dic[skuParam.thumb_url] = new_thumb_url; + new_thumb_url = BaseRegex.GetStringJson(ref uploadUpgradeSkuImgRst, "url"); + //new_Sku_Img_Dic[skuParam.thumb_url] = new_thumb_url; } } - skuParam.thumb_url = new_Sku_Img_Dic[skuParam.thumb_url]; + skuParam.thumb_url = new_thumb_url; // new_Sku_Img_Dic[skuParam.thumb_url]; skuParam.thumb_url_file_id = null; + + } + #endregion baseSkuParamLst.Add(skuParam); } + if (chkMultiPcsSku.Checked) + { + #region // 添加一个多件sku + //申请skuSpec + var multiPcsSku = JsonHelper.DeserializeJsonToObject(JsonHelper.SerializeObject(baseSkuParamLst.OrderByDescending(s => s.multi_price).FirstOrDefault())); + int min = txtMultiPcsSku1.Text.Trim().ParseToInt(); + int max = txtMultiPcsSku2.Text.Trim().ParseToInt() + 1; + if (max <= min) + max = min + 1; + multiPcsSku.spec[0].spec_name = multiPcsSku.spec[0].spec_name + Randomx.GetId(min, max) + txtMultiPcsSku3.Text.Trim(); + var newSpec = multiPcsSku.spec[0]; + + if (1 == 1) + { + var newSpecRst = get_spec_by_name(shop, newSpec.spec_name, newSpec.parent_id.ParseToLong(), prodInfo.detail.cat_id.ParseToInt(), + prodParam.goods_id.ParseToString(), prodParam.goods_commit_id, prodInfo.chance_tab); + if (!newSpecRst.Contains("\"success\":true")) + { + var error = BaseRegex.GetStringJson(ref newSpecRst, "error_msg"); + if (string.IsNullOrEmpty(error)) + error = newSpecRst; + return "设置低价sku失败 " + error; + } + else + { + newSpec.spec_id = BaseRegex.GetLongJson(ref newSpecRst, "result"); + } + + List first_spec_lst = new List(); + List second_spec_lst = new List(); + List new_sku_lst = new List(); + foreach (var sku in baseSkuParamLst) + { + if (sku.spec.Count > 0) + { + if (sku.spec[0].parent_id != newSpec.parent_id && !first_spec_lst.Any(s => s.spec_id == sku.spec[0].spec_id)) + { + first_spec_lst.Add(sku.spec[0]); + new_sku_lst.Add(JsonHelper.DeserializeJsonToObject(JsonHelper.SerializeObject(sku))); + } + } + if (sku.spec.Count > 1) + { + if (sku.spec[1].parent_id != newSpec.parent_id && !second_spec_lst.Any(s => s.spec_id == sku.spec[1].spec_id)) + { + second_spec_lst.Add(sku.spec[1]); + new_sku_lst.Add(JsonHelper.DeserializeJsonToObject(JsonHelper.SerializeObject(sku))); + } + } + } + if (new_sku_lst.Count == 0) + { + new_sku_lst.Add(JsonHelper.DeserializeJsonToObject(JsonHelper.SerializeObject(baseSkuParamLst.LastOrDefault()))); + } + foreach (var sku in new_sku_lst) + { + if (sku.spec.Count > 0 && sku.spec[0].parent_id == newSpec.parent_id) + { + sku.spec[0] = JsonHelper.DeserializeJsonToObject(JsonHelper.SerializeObject(newSpec)); + } + else if (sku.spec.Count > 1 && sku.spec[1].parent_id == newSpec.parent_id) + { + sku.spec[1] = JsonHelper.DeserializeJsonToObject(JsonHelper.SerializeObject(newSpec)); + } + sku.thumb_url = multiPcsSku.thumb_url; + sku.thumb_url_file_id = null; + sku.multi_price = (baseSkuParamLst.Max(s => s.multi_price) * txtMultiPcsSku4.Text.ParseToDecimal()).ParseToInt(); + sku.price = sku.multi_price + Math.Max(100, this.txtSinglePriceAdd.Text.Trim().ParseToDecimal() * 100).ParseToInt(); + sku.quantity_delta = 0; + baseSkuParamLst.Add(sku); + } + } + #endregion + } + + + List addPriceFakeSkuInfoLst = new List(); + Dictionary skuFakeSpecNameDic1 = new Dictionary(); + Dictionary skuFakeSpecNameDic2 = new Dictionary(); + if (1 == 1 && chkActivity.Checked == true) + { + foreach (var skuInfo in baseSkuParamLst) + { + if (skuInfo.spec.Count > 0) + { + if (skuFakeSpecNameDic1.Keys.Contains(skuInfo.spec[0].spec_name)) + skuInfo.spec[0].spec_name = skuFakeSpecNameDic1[skuInfo.spec[0].spec_name]; + else + { + skuFakeSpecNameDic1[skuInfo.spec[0].spec_name] = skuInfo.spec[0].parent_name + (skuFakeSpecNameDic1.Keys.Count + 1); + skuInfo.spec[0].spec_name = skuFakeSpecNameDic1[skuInfo.spec[0].spec_name]; + } + } + if (skuInfo.spec.Count > 1) + { + if (skuFakeSpecNameDic2.Keys.Contains(skuInfo.spec[1].spec_name)) + skuInfo.spec[1].spec_name = skuFakeSpecNameDic2[skuInfo.spec[1].spec_name]; + else + { + skuFakeSpecNameDic2[skuInfo.spec[1].spec_name] = "" + Randomx.GetId(50, 301) + "个 人买过 " + Randomx.GetId(3000, 12001) + "件 " + + skuInfo.spec[1].parent_name + (skuFakeSpecNameDic2.Keys.Count + 1); + skuInfo.spec[1].spec_name = skuFakeSpecNameDic2[skuInfo.spec[1].spec_name]; + } + } + + foreach (var specInfo in skuInfo.spec) + { + // 根据修改过的spec_name获取spec_id + var changeSpecRst = get_spec_by_name(shop, specInfo.spec_name, specInfo.parent_id.ParseToLong(), prodInfo.detail.cat_id.ParseToInt(), + prodParam.goods_id.ParseToString(), prodParam.goods_commit_id, prodInfo.chance_tab); + Thread.Sleep(Randomx.GetId(50, 100)); + if (!changeSpecRst.Contains("\"success\":true")) + { + var error = BaseRegex.GetStringJson(ref changeSpecRst, "error_msg"); + if (string.IsNullOrEmpty(error)) + error = changeSpecRst; + return "商品sku属性编号获取失败 " + error; + } + else + { + specInfo.spec_id = BaseRegex.GetLongJson(ref changeSpecRst, "result"); + } + } + } + } // 厂商直采获取推单运费模板 #region 获取推单运费模板,计算运费加价。 @@ -2025,7 +2245,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms var dataShip = Work.UserLogin.GetSignaturex() + "&coid=" + dbProd.skc_id; var shipRst = GetHtml.PostUtf8(urlShip, dataShip); if (string.IsNullOrEmpty(shipRst) || !shipRst.Contains("\"code\":0")) - shipRst = GetHtml.PostUtf8(urlShipping, dataShipping); + shipRst = GetHtml.PostUtf8(urlShip, dataShip); if (!shipRst.Contains("\"code\":0")) { var errMsg = BaseRegex.GetStringJson(ref shipRst, "msg"); @@ -2497,6 +2717,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms } } } + foreach (var sku in prodParam.skus) { if (sku.spec != null && sku.spec.Count > 1) @@ -2592,7 +2813,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms } } - string fakeImgUrl = ""; + fakeImgUrl = ""; if (1 == 1) // 商品先上高价sku图,参加活动后改回sku原图 { List skuImgStrLst = new List() @@ -2676,11 +2897,21 @@ namespace TemuKJD.PDDForms.ProductSelectForms //skuParam.quantity_delta = txtStockNum.Text.Trim().ParseToInt(); // 库存 var new_multi_price = skuParamInfo.multi_price + (shipPrice * defaultAddPriceRule.AddShippingFeeTimes).ParseToInt(); + // 使用货号价格做基础价 + if (chkUseExtCodePrice.Checked && dbProd.ext_code_price > 0) + { + new_multi_price = dbProd.ext_code_price + (shipPrice * defaultAddPriceRule.AddShippingFeeTimes).ParseToInt(); + } // 虚拟加价3倍 - skuParam.multi_price = (new_multi_price * this.txtAddTimesFake.Text.Trim().ParseToDecimal()).ParseToInt(); + //skuParam.multi_price = (new_multi_price * this.txtAddTimesFake.Text.Trim().ParseToDecimal()).ParseToInt(); + //if (isAddMorePriceFirst) // 先加后乘 + // skuParam.multi_price = (new_multi_price * this.txtAddTimesFake.Text.Trim().ParseToDecimal()).ParseToInt(); + //skuParam.price = skuParam.multi_price + Math.Max(100, this.txtSinglePriceAdd.Text.Trim().ParseToDecimal() * 100).ParseToInt(); + + skuParam.multi_price = (new_multi_price * this.txtAddTimesFake.Text.Trim().ParseToDecimal() + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100).ParseToInt(); if (isAddMorePriceFirst) // 先加后乘 - skuParam.multi_price = (new_multi_price * this.txtAddTimesFake.Text.Trim().ParseToDecimal()).ParseToInt(); + skuParam.multi_price = ((new_multi_price + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100) * this.txtAddTimesFake.Text.Trim().ParseToDecimal()).ParseToInt(); skuParam.price = skuParam.multi_price + Math.Max(100, this.txtSinglePriceAdd.Text.Trim().ParseToDecimal() * 100).ParseToInt(); //// 加邮费×倍率 放前面 @@ -2836,52 +3067,52 @@ namespace TemuKJD.PDDForms.ProductSelectForms // 复制一份商品使用sku替换图片 var prodParamHighPriceFakeSkuImg = JsonHelper.DeserializeJsonToObject(JsonHelper.SerializeObject(prodParamHighPrice)); - var fake_sku_img_dic = new Dictionary(); - bool upLoadFakeImgUrl = false; - foreach (var skuParam in prodParamHighPriceFakeSkuImg.skus) - { - if (upLoadFakeImgUrl) - { - if (!fake_sku_img_dic.Keys.Contains(skuParam.thumb_url)) - { - string getImgError; - var image = GetHtml.GetUrlImg(fakeImgUrl, out getImgError); - var imageBg = new Bitmap(image.Width, image.Height); - if (!string.IsNullOrEmpty(getImgError) || image == null) - { - return "设置替换sku失败 图片上传失败"; - } - try - { - using (Graphics g = Graphics.FromImage(imageBg)) - { - g.DrawImage(image, new Rectangle(0, 0, image.Width, image.Height), 0, 0, image.Width, image.Height, GraphicsUnit.Pixel); - } - } - catch (Exception ex) - { - return "修改替换sku图片失败 " + ex.Message; - } - string uploadUpgradeSkuImgRst = UploadProdSkuImg(shop, imageBg, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id, prodInfo.chance_tab); - if (!uploadUpgradeSkuImgRst.Contains("\"url\":\"https:")) - { - var error = BaseRegex.GetStringJson(ref uploadUpgradeSkuImgRst, "error_msg"); - if (string.IsNullOrEmpty(error)) - error = uploadUpgradeSkuImgRst; - return "上传替换sku图片失败 " + error; - } - else - { - var fake_thumb_url = BaseRegex.GetStringJson(ref uploadUpgradeSkuImgRst, "url"); - fake_sku_img_dic[skuParam.thumb_url] = fake_thumb_url; - } - } - skuParam.thumb_url = fake_sku_img_dic[skuParam.thumb_url]; - } - else - skuParam.thumb_url = fakeImgUrl; - skuParam.thumb_url_file_id = null; - } + //var fake_sku_img_dic = new Dictionary(); + //bool upLoadFakeImgUrl = false; + //foreach (var skuParam in prodParamHighPriceFakeSkuImg.skus) + //{ + // if (upLoadFakeImgUrl) + // { + // if (!fake_sku_img_dic.Keys.Contains(skuParam.thumb_url)) + // { + // string getImgError; + // var image = GetHtml.GetUrlImg(fakeImgUrl, out getImgError); + // var imageBg = new Bitmap(image.Width, image.Height); + // if (!string.IsNullOrEmpty(getImgError) || image == null) + // { + // return "设置替换sku失败 图片上传失败"; + // } + // try + // { + // using (Graphics g = Graphics.FromImage(imageBg)) + // { + // g.DrawImage(image, new Rectangle(0, 0, image.Width, image.Height), 0, 0, image.Width, image.Height, GraphicsUnit.Pixel); + // } + // } + // catch (Exception ex) + // { + // return "修改替换sku图片失败 " + ex.Message; + // } + // string uploadUpgradeSkuImgRst = UploadProdSkuImg(shop, imageBg, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id, prodInfo.chance_tab); + // if (!uploadUpgradeSkuImgRst.Contains("\"url\":\"https:")) + // { + // var error = BaseRegex.GetStringJson(ref uploadUpgradeSkuImgRst, "error_msg"); + // if (string.IsNullOrEmpty(error)) + // error = uploadUpgradeSkuImgRst; + // return "上传替换sku图片失败 " + error; + // } + // else + // { + // var fake_thumb_url = BaseRegex.GetStringJson(ref uploadUpgradeSkuImgRst, "url"); + // fake_sku_img_dic[skuParam.thumb_url] = fake_thumb_url; + // } + // } + // skuParam.thumb_url = fake_sku_img_dic[skuParam.thumb_url]; + // } + // else + // skuParam.thumb_url = fakeImgUrl; + // skuParam.thumb_url_file_id = null; + //} #endregion Invoke(new Action(() => @@ -3067,13 +3298,15 @@ namespace TemuKJD.PDDForms.ProductSelectForms { if (cell != null) { - cell.Value = "正在上传商品"; + cell.Value = "正在处理商品后续操作"; } })); - Thread.Sleep(Randomx.GetId(30000, 40000)); - Thread.Sleep(Randomx.GetId(6000, 12000)); + //Thread.Sleep(Randomx.GetId(30000, 40000)); + //Thread.Sleep(Randomx.GetId(15000, 20000)); + //Thread.Sleep(Randomx.GetId(15000, 20000)); + //Thread.Sleep(Randomx.GetId(6000, 12000)); - var ta = Task.Run(() => SignActivityInTask(shop, prodParam, prodParamHighPrice, prodParamHighPriceFakeSkuImg, cell, startTime)); + //var ta = Task.Run(() => SignActivityInTask(shop, prodParam, prodParamHighPrice, prodParamHighPriceFakeSkuImg, cell, startTime)); //ta.Wait(); } return "{\"success\":true,\"draftId\":" + prodParam.goods_id + ",\"status\":\"已上传\",\"msg\":\"上传成功\"}"; @@ -7104,9 +7337,9 @@ Content-Type: image/jpeg var imgBase64 = ""; float alpha = Math.Min(100, Math.Max(1, txtAlpha.Text.ParseToInt())) / 100f; if (chkActivity.Checked) - imgBase64 = PddGetImgBase64ForApi(out errMsg, img.url, fakeImg, pbUpgradeVersion.Image, alpha); + imgBase64 = PddGetActivitySkuImgBase64ForApi(out errMsg, img.url, fakeImg, pbUpgradeVersion.Image, alpha); else - imgBase64 = PddGetImgBase64ForApi(out errMsg, img.url, null); + imgBase64 = PddGetActivitySkuImgBase64ForApi(out errMsg, img.url, null); if (!string.IsNullOrEmpty(errMsg)) { return "主图初始化失败 " + errMsg; @@ -7172,9 +7405,9 @@ Content-Type: image/jpeg var imgBase64 = ""; float alpha = Math.Min(100, Math.Max(1, txtAlpha.Text.ParseToInt())) / 100f; if (chkActivity.Checked) - imgBase64 = PddGetImgBase64ForApi(out errMsg, img.url, fakeImg, null, alpha); + imgBase64 = PddGetActivitySkuImgBase64ForApi(out errMsg, img.url, fakeImg, null, alpha); else - imgBase64 = PddGetImgBase64ForApi(out errMsg, img.url, null); + imgBase64 = PddGetActivitySkuImgBase64ForApi(out errMsg, img.url, null); if (!string.IsNullOrEmpty(errMsg)) { @@ -7389,7 +7622,7 @@ Content-Type: image/jpeg var dataShip = Work.UserLogin.GetSignaturex() + "&coid=" + dbProd.skc_id; var shipRst = GetHtml.PostUtf8(urlShip, dataShip); if (string.IsNullOrEmpty(shipRst) || !shipRst.Contains("\"code\":0")) - shipRst = GetHtml.PostUtf8(urlShipping, dataShipping); + shipRst = GetHtml.PostUtf8(urlShip, dataShip); if (!shipRst.Contains("\"code\":0")) { var errMsg = BaseRegex.GetStringJson(ref shipRst, "msg"); @@ -7728,11 +7961,11 @@ Content-Type: image/jpeg //if (text1.Length + text2.Length <= 6) // text2 = "专柜品质 " + text2; // 专柜正品 //imgBase64 = PddGetImgBase64ForApi(out errMsg, addPriceSkuInfoLst[i].thumb_url, fakeImg, pbUpgradeVersion.Image, alpha, "到手 " + text1 + " " + text2); - imgBase64 = PddGetImgBase64ForApi(out errMsg, addPriceSkuInfoLst[i].thumb_url, fakeImg, pbUpgradeVersion.Image, alpha, text1 + " " + text2, pddUploadRule); + imgBase64 = PddGetActivitySkuImgBase64ForApi(out errMsg, addPriceSkuInfoLst[i].thumb_url, fakeImg, pbUpgradeVersion.Image, alpha, text1 + " " + text2, pddUploadRule); //imgBase64 = PddGetImgBase64ForApi(out errMsg, addPriceSkuInfoLst[i].thumb_url, fakeImg, pbUpgradeVersion.Image, alpha); } else - imgBase64 = PddGetImgBase64ForApi(out errMsg, addPriceSkuInfoLst[i].thumb_url); + imgBase64 = PddGetActivitySkuImgBase64ForApi(out errMsg, addPriceSkuInfoLst[i].thumb_url); if (!string.IsNullOrEmpty(errMsg)) { return "初始化Sku图片错误 " + errMsg; @@ -7977,6 +8210,14 @@ Content-Type: image/jpeg propInfo.values.FirstOrDefault().raw_value = "无品牌/无注册商标"; propInfo.values.FirstOrDefault().vid = 4643510; } + // 统一走无品牌 + if (propInfo.name == "品牌") + { + propInfo.values.FirstOrDefault().value = "无品牌/无注册商标"; + propInfo.values.FirstOrDefault().raw_value = "无品牌/无注册商标"; + propInfo.values.FirstOrDefault().vid = 4643510; + } + if (propInfo.name == "适用人群") { @@ -8100,7 +8341,7 @@ Content-Type: image/jpeg //foreach (var spec_prop in prodInfo.property.sku_properties) ... } - public static string PddGetImgBase64ForApi(out string errorMsg, string img_url, Image fakeImg = null, Image imgUp = null, float alpha = 0.05f, string text = "", PddUploadRule uploadRule = null, int imgWidth = 0, int imgHeight = 0) + public static Bitmap PddGetActivitySkuImg(out string errorMsg, string img_url, Image fakeImg = null, Image imgUp = null, float alpha = 0.05f, string text = "", PddUploadRule uploadRule = null, int imgWidth = 0, int imgHeight = 0) { errorMsg = ""; string imgBase64 = ""; @@ -8121,7 +8362,7 @@ Content-Type: image/jpeg if (image == null || !string.IsNullOrEmpty(getImgError)) { errorMsg = "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"初始化图片上传失败 " + getImgError + "\"}"; - return ""; + return null; } try { @@ -8328,6 +8569,26 @@ Content-Type: image/jpeg } } } + return imageBg; + } + catch (Exception ex) + { + errorMsg = "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"修改图片失败 " + ex.Message + "\"}"; + return null; + } + } + + public static string PddGetActivitySkuImgBase64ForApi(out string errorMsg, string img_url, Image fakeImg = null, Image imgUp = null, float alpha = 0.05f, string text = "", PddUploadRule uploadRule = null, int imgWidth = 0, int imgHeight = 0) + { + errorMsg = ""; + string imgBase64 = ""; + try + { + var imageBg = PddGetActivitySkuImg(out errorMsg, img_url, fakeImg, imgUp, alpha, text, uploadRule); + if (imageBg == null || !string.IsNullOrEmpty(errorMsg)) + { + return null; + } using (MemoryStream memoryStream = new MemoryStream()) { imageBg.Save(memoryStream, System.Drawing.Imaging.ImageFormat.Jpeg); @@ -8343,6 +8604,7 @@ Content-Type: image/jpeg } } + int WaitUploadTime = 10; private void txtWaitSeconds_TextChanged(object sender, EventArgs e) { diff --git a/TEMUKJD/WXForms/TalkForms/BuyerOrderListForm.Designer.cs b/TEMUKJD/WXForms/TalkForms/BuyerOrderListForm.Designer.cs index 63e9ed1..d4fada9 100644 --- a/TEMUKJD/WXForms/TalkForms/BuyerOrderListForm.Designer.cs +++ b/TEMUKJD/WXForms/TalkForms/BuyerOrderListForm.Designer.cs @@ -79,20 +79,6 @@ namespace TemuKJD.WXForms.TalkForms this.panelEx2 = new DevComponents.DotNetBar.PanelEx(); this.panelEx1 = new DevComponents.DotNetBar.PanelEx(); this.dgvPddBuyerOrder = new TemuKJD.UserComponent.DataGridViewEx(); - this.chkOnlyShowCurrentShop = new TemuKJD.UserComponent.UcCheckBox(this.components); - this.lblCurrentShop = new System.Windows.Forms.Label(); - this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); - this.btnFilter = new DevComponents.DotNetBar.PanelEx(); - this.label3 = new System.Windows.Forms.Label(); - this.pnlEmpty = new DevComponents.DotNetBar.PanelEx(); - this.label17 = new System.Windows.Forms.Label(); - this.txtMobile = new System.Windows.Forms.TextBox(); - this.txtOrderSn = new System.Windows.Forms.TextBox(); - this.label2 = new System.Windows.Forms.Label(); - this.dtpStartTime = new System.Windows.Forms.DateTimePicker(); - this.label14 = new System.Windows.Forms.Label(); - this.dtpEndTime = new System.Windows.Forms.DateTimePicker(); - this.statusBar = new TemuKJD.UserControls.StatusBarUserControl(); this.dataGridViewCheckBoxColumn1 = new System.Windows.Forms.DataGridViewCheckBoxColumn(); this.colOBuyerId = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colOBuyerName = new System.Windows.Forms.DataGridViewTextBoxColumn(); @@ -107,6 +93,21 @@ namespace TemuKJD.WXForms.TalkForms this.colOExpressId = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colOMsg = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.colSend = new System.Windows.Forms.DataGridViewLinkColumn(); + this.tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); + this.btnFilter = new DevComponents.DotNetBar.PanelEx(); + this.label3 = new System.Windows.Forms.Label(); + this.pnlEmpty = new DevComponents.DotNetBar.PanelEx(); + this.label17 = new System.Windows.Forms.Label(); + this.txtMobile = new System.Windows.Forms.TextBox(); + this.txtOrderSn = new System.Windows.Forms.TextBox(); + this.label2 = new System.Windows.Forms.Label(); + this.dtpStartTime = new System.Windows.Forms.DateTimePicker(); + this.label14 = new System.Windows.Forms.Label(); + this.dtpEndTime = new System.Windows.Forms.DateTimePicker(); + this.lblCurrentShop = new System.Windows.Forms.Label(); + this.chkOnlyShowCurrentShop = new TemuKJD.UserComponent.UcCheckBox(this.components); + this.statusBar = new TemuKJD.UserControls.StatusBarUserControl(); + this.chkPause = new TemuKJD.UserComponent.UcCheckBox(this.components); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); @@ -137,6 +138,7 @@ namespace TemuKJD.WXForms.TalkForms // // splitContainer1.Panel1 // + this.splitContainer1.Panel1.Controls.Add(this.chkPause); this.splitContainer1.Panel1.Controls.Add(this.btnCheck); this.splitContainer1.Panel1.Controls.Add(this.btnRefresh); this.splitContainer1.Panel1.Controls.Add(this.btnStopStop); @@ -206,9 +208,9 @@ namespace TemuKJD.WXForms.TalkForms this.btnStopStop.CanvasColor = System.Drawing.SystemColors.Control; this.btnStopStop.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.btnStopStop.DisabledBackColor = System.Drawing.Color.Empty; - this.btnStopStop.Location = new System.Drawing.Point(246, 39); + this.btnStopStop.Location = new System.Drawing.Point(297, 39); this.btnStopStop.Name = "btnStopStop"; - this.btnStopStop.Size = new System.Drawing.Size(118, 25); + this.btnStopStop.Size = new System.Drawing.Size(67, 25); this.btnStopStop.Style.Alignment = System.Drawing.StringAlignment.Center; this.btnStopStop.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255))))); this.btnStopStop.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255))))); @@ -713,31 +715,110 @@ namespace TemuKJD.WXForms.TalkForms this.dgvPddBuyerOrder.TabIndex = 886; this.dgvPddBuyerOrder.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvPddBuyerOrder_CellContentClick); // - // chkOnlyShowCurrentShop + // dataGridViewCheckBoxColumn1 // - this.chkOnlyShowCurrentShop.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.chkOnlyShowCurrentShop.AutoSize = true; - this.chkOnlyShowCurrentShop.Location = new System.Drawing.Point(30, 498); - this.chkOnlyShowCurrentShop.Name = "chkOnlyShowCurrentShop"; - this.chkOnlyShowCurrentShop.Size = new System.Drawing.Size(135, 21); - this.chkOnlyShowCurrentShop.TabIndex = 885; - this.chkOnlyShowCurrentShop.Text = "仅显示当前店铺订单"; - this.chkOnlyShowCurrentShop.UseVisualStyleBackColor = true; - this.chkOnlyShowCurrentShop.Visible = false; + this.dataGridViewCheckBoxColumn1.FillWeight = 26F; + this.dataGridViewCheckBoxColumn1.HeaderText = "选"; + this.dataGridViewCheckBoxColumn1.Name = "dataGridViewCheckBoxColumn1"; + this.dataGridViewCheckBoxColumn1.ReadOnly = true; + this.dataGridViewCheckBoxColumn1.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.dataGridViewCheckBoxColumn1.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; // - // lblCurrentShop + // colOBuyerId // - this.lblCurrentShop.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.lblCurrentShop.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.lblCurrentShop.ForeColor = System.Drawing.Color.DarkOrange; - this.lblCurrentShop.Location = new System.Drawing.Point(179, 498); - this.lblCurrentShop.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0); - this.lblCurrentShop.Name = "lblCurrentShop"; - this.lblCurrentShop.Size = new System.Drawing.Size(214, 17); - this.lblCurrentShop.TabIndex = 718; - this.lblCurrentShop.Text = "当前店铺:"; - this.lblCurrentShop.TextAlign = System.Drawing.ContentAlignment.TopRight; - this.lblCurrentShop.Visible = false; + this.colOBuyerId.HeaderText = "买手编号"; + this.colOBuyerId.Name = "colOBuyerId"; + this.colOBuyerId.ReadOnly = true; + this.colOBuyerId.Visible = false; + // + // colOBuyerName + // + this.colOBuyerName.FillWeight = 80F; + this.colOBuyerName.HeaderText = "买手名称"; + this.colOBuyerName.Name = "colOBuyerName"; + this.colOBuyerName.ReadOnly = true; + // + // colOPddOrderSn + // + this.colOPddOrderSn.HeaderText = "拍单订单号"; + this.colOPddOrderSn.Name = "colOPddOrderSn"; + this.colOPddOrderSn.ReadOnly = true; + // + // colOOrderTime + // + dataGridViewCellStyle11.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.colOOrderTime.DefaultCellStyle = dataGridViewCellStyle11; + this.colOOrderTime.FillWeight = 70F; + this.colOOrderTime.HeaderText = "拍单时间"; + this.colOOrderTime.Name = "colOOrderTime"; + this.colOOrderTime.ReadOnly = true; + // + // colOImgUrl + // + this.colOImgUrl.HeaderText = "图片路径"; + this.colOImgUrl.Name = "colOImgUrl"; + this.colOImgUrl.ReadOnly = true; + this.colOImgUrl.Visible = false; + // + // colOImg + // + this.colOImg.FillWeight = 35F; + this.colOImg.HeaderText = "订单图片"; + this.colOImg.ImageLayout = System.Windows.Forms.DataGridViewImageCellLayout.Zoom; + this.colOImg.Name = "colOImg"; + this.colOImg.ReadOnly = true; + this.colOImg.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.colOImg.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.colOImg.Visible = false; + // + // colOGoodsInfo + // + dataGridViewCellStyle12.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.colOGoodsInfo.DefaultCellStyle = dataGridViewCellStyle12; + this.colOGoodsInfo.FillWeight = 140F; + this.colOGoodsInfo.HeaderText = "商品信息"; + this.colOGoodsInfo.Name = "colOGoodsInfo"; + this.colOGoodsInfo.ReadOnly = true; + // + // colOOrderAmount + // + this.colOOrderAmount.FillWeight = 50F; + this.colOOrderAmount.HeaderText = "金额"; + this.colOOrderAmount.Name = "colOOrderAmount"; + this.colOOrderAmount.ReadOnly = true; + // + // dgvOStatus + // + this.dgvOStatus.HeaderText = "订单状态"; + this.dgvOStatus.Name = "dgvOStatus"; + this.dgvOStatus.ReadOnly = true; + // + // colOExpressName + // + this.colOExpressName.HeaderText = "物流名称"; + this.colOExpressName.Name = "colOExpressName"; + this.colOExpressName.ReadOnly = true; + // + // colOExpressId + // + this.colOExpressId.HeaderText = "物流单号"; + this.colOExpressId.Name = "colOExpressId"; + this.colOExpressId.ReadOnly = true; + // + // colOMsg + // + this.colOMsg.HeaderText = "其他信息"; + this.colOMsg.Name = "colOMsg"; + this.colOMsg.ReadOnly = true; + // + // colSend + // + this.colSend.FillWeight = 50F; + this.colSend.HeaderText = "发送"; + this.colSend.Name = "colSend"; + this.colSend.ReadOnly = true; + this.colSend.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.colSend.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; // // tableLayoutPanel1 // @@ -915,6 +996,32 @@ namespace TemuKJD.WXForms.TalkForms this.dtpEndTime.TabIndex = 813; this.dtpEndTime.Visible = false; // + // lblCurrentShop + // + this.lblCurrentShop.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.lblCurrentShop.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(134))); + this.lblCurrentShop.ForeColor = System.Drawing.Color.DarkOrange; + this.lblCurrentShop.Location = new System.Drawing.Point(179, 498); + this.lblCurrentShop.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0); + this.lblCurrentShop.Name = "lblCurrentShop"; + this.lblCurrentShop.Size = new System.Drawing.Size(214, 17); + this.lblCurrentShop.TabIndex = 718; + this.lblCurrentShop.Text = "当前店铺:"; + this.lblCurrentShop.TextAlign = System.Drawing.ContentAlignment.TopRight; + this.lblCurrentShop.Visible = false; + // + // chkOnlyShowCurrentShop + // + this.chkOnlyShowCurrentShop.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.chkOnlyShowCurrentShop.AutoSize = true; + this.chkOnlyShowCurrentShop.Location = new System.Drawing.Point(30, 498); + this.chkOnlyShowCurrentShop.Name = "chkOnlyShowCurrentShop"; + this.chkOnlyShowCurrentShop.Size = new System.Drawing.Size(135, 21); + this.chkOnlyShowCurrentShop.TabIndex = 885; + this.chkOnlyShowCurrentShop.Text = "仅显示当前店铺订单"; + this.chkOnlyShowCurrentShop.UseVisualStyleBackColor = true; + this.chkOnlyShowCurrentShop.Visible = false; + // // statusBar // this.statusBar.BackColor = System.Drawing.Color.White; @@ -926,110 +1033,16 @@ namespace TemuKJD.WXForms.TalkForms this.statusBar.Size = new System.Drawing.Size(1438, 25); this.statusBar.TabIndex = 5; // - // dataGridViewCheckBoxColumn1 + // chkPause // - this.dataGridViewCheckBoxColumn1.FillWeight = 26F; - this.dataGridViewCheckBoxColumn1.HeaderText = "选"; - this.dataGridViewCheckBoxColumn1.Name = "dataGridViewCheckBoxColumn1"; - this.dataGridViewCheckBoxColumn1.ReadOnly = true; - this.dataGridViewCheckBoxColumn1.Resizable = System.Windows.Forms.DataGridViewTriState.True; - this.dataGridViewCheckBoxColumn1.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; - // - // colOBuyerId - // - this.colOBuyerId.HeaderText = "买手编号"; - this.colOBuyerId.Name = "colOBuyerId"; - this.colOBuyerId.ReadOnly = true; - this.colOBuyerId.Visible = false; - // - // colOBuyerName - // - this.colOBuyerName.FillWeight = 80F; - this.colOBuyerName.HeaderText = "买手名称"; - this.colOBuyerName.Name = "colOBuyerName"; - this.colOBuyerName.ReadOnly = true; - // - // colOPddOrderSn - // - this.colOPddOrderSn.HeaderText = "拍单订单号"; - this.colOPddOrderSn.Name = "colOPddOrderSn"; - this.colOPddOrderSn.ReadOnly = true; - // - // colOOrderTime - // - dataGridViewCellStyle11.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.colOOrderTime.DefaultCellStyle = dataGridViewCellStyle11; - this.colOOrderTime.FillWeight = 70F; - this.colOOrderTime.HeaderText = "拍单时间"; - this.colOOrderTime.Name = "colOOrderTime"; - this.colOOrderTime.ReadOnly = true; - // - // colOImgUrl - // - this.colOImgUrl.HeaderText = "图片路径"; - this.colOImgUrl.Name = "colOImgUrl"; - this.colOImgUrl.ReadOnly = true; - this.colOImgUrl.Visible = false; - // - // colOImg - // - this.colOImg.FillWeight = 35F; - this.colOImg.HeaderText = "订单图片"; - this.colOImg.ImageLayout = System.Windows.Forms.DataGridViewImageCellLayout.Zoom; - this.colOImg.Name = "colOImg"; - this.colOImg.ReadOnly = true; - this.colOImg.Resizable = System.Windows.Forms.DataGridViewTriState.True; - this.colOImg.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; - this.colOImg.Visible = false; - // - // colOGoodsInfo - // - dataGridViewCellStyle12.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.colOGoodsInfo.DefaultCellStyle = dataGridViewCellStyle12; - this.colOGoodsInfo.FillWeight = 140F; - this.colOGoodsInfo.HeaderText = "商品信息"; - this.colOGoodsInfo.Name = "colOGoodsInfo"; - this.colOGoodsInfo.ReadOnly = true; - // - // colOOrderAmount - // - this.colOOrderAmount.FillWeight = 50F; - this.colOOrderAmount.HeaderText = "金额"; - this.colOOrderAmount.Name = "colOOrderAmount"; - this.colOOrderAmount.ReadOnly = true; - // - // dgvOStatus - // - this.dgvOStatus.HeaderText = "订单状态"; - this.dgvOStatus.Name = "dgvOStatus"; - this.dgvOStatus.ReadOnly = true; - // - // colOExpressName - // - this.colOExpressName.HeaderText = "物流名称"; - this.colOExpressName.Name = "colOExpressName"; - this.colOExpressName.ReadOnly = true; - // - // colOExpressId - // - this.colOExpressId.HeaderText = "物流单号"; - this.colOExpressId.Name = "colOExpressId"; - this.colOExpressId.ReadOnly = true; - // - // colOMsg - // - this.colOMsg.HeaderText = "其他信息"; - this.colOMsg.Name = "colOMsg"; - this.colOMsg.ReadOnly = true; - // - // colSend - // - this.colSend.FillWeight = 50F; - this.colSend.HeaderText = "发送"; - this.colSend.Name = "colSend"; - this.colSend.ReadOnly = true; - this.colSend.Resizable = System.Windows.Forms.DataGridViewTriState.True; - this.colSend.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + this.chkPause.AutoSize = true; + this.chkPause.Location = new System.Drawing.Point(246, 41); + this.chkPause.Name = "chkPause"; + this.chkPause.Size = new System.Drawing.Size(51, 21); + this.chkPause.TabIndex = 937; + this.chkPause.Text = "暂停"; + this.chkPause.UseVisualStyleBackColor = true; + this.chkPause.CheckedChanged += new System.EventHandler(this.chkPause_CheckedChanged); // // BuyerOrderListForm // @@ -1049,6 +1062,7 @@ namespace TemuKJD.WXForms.TalkForms this.KeyUp += new System.Windows.Forms.KeyEventHandler(this.PDDDBProdListForm_KeyUp); this.Controls.SetChildIndex(this.splitContainer2, 0); this.splitContainer1.Panel1.ResumeLayout(false); + this.splitContainer1.Panel1.PerformLayout(); this.splitContainer1.Panel2.ResumeLayout(false); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit(); this.splitContainer1.ResumeLayout(false); @@ -1137,5 +1151,6 @@ namespace TemuKJD.WXForms.TalkForms private System.Windows.Forms.DataGridViewTextBoxColumn colOExpressId; private System.Windows.Forms.DataGridViewTextBoxColumn colOMsg; private System.Windows.Forms.DataGridViewLinkColumn colSend; + private UserComponent.UcCheckBox chkPause; } } \ No newline at end of file diff --git a/TEMUKJD/WXForms/TalkForms/BuyerOrderListForm.cs b/TEMUKJD/WXForms/TalkForms/BuyerOrderListForm.cs index 08bbf4e..6e2534c 100644 --- a/TEMUKJD/WXForms/TalkForms/BuyerOrderListForm.cs +++ b/TEMUKJD/WXForms/TalkForms/BuyerOrderListForm.cs @@ -254,7 +254,7 @@ namespace TemuKJD.WXForms.TalkForms Task.Run(() => { - //SendOrderE57(order); + SendOrderE57(order); }); Invoke(new Action(() => @@ -412,6 +412,16 @@ namespace TemuKJD.WXForms.TalkForms Thread.Sleep(5000); while (true) { + if(chkPause.Checked) + { + Thread.Sleep(1000); + Invoke(new Action(() => + { + btnSearch.Text = "暂停自动刷新"; + })); + continue; + } + if (DateTime.Now > nextGetOrderTime) { nextGetOrderTime = DateTime.Now.AddMinutes(30); @@ -826,7 +836,10 @@ namespace TemuKJD.WXForms.TalkForms case "编辑/详情": break; case "发送": - SendOrderE57(order); + Task.Run(() => + { + SendOrderE57(order); + }); break; case "图片": ShowImgForm imgFrom = new ShowImgForm(dgvPddBuyerOrder.Rows[e.RowIndex].Cells["colImgUrl"].Value.ParseToString().Replace("?imageView2/2/w/90/h/90", "")); @@ -848,9 +861,9 @@ namespace TemuKJD.WXForms.TalkForms return; } // 已发货且没有运单号的属于已退货,不再发送 - if (order.order_status_prompt != "拼单成功,待发货" && string.IsNullOrEmpty(order.tracking_number)) + if (order.order_status_prompt != "拼单成功,待发货" && order.order_status_prompt != "免拼成功,待发货" && (string.IsNullOrEmpty(order.tracking_number) || string.IsNullOrEmpty(order.outExpressCompanyName))) { - order.sendStatus = "已发货无运单号"; + order.sendStatus = "已发货退货"; Invoke(new Action(() => { ShowOrder(order); @@ -872,14 +885,16 @@ namespace TemuKJD.WXForms.TalkForms //失败 已存在 //1505调用微信接口更新物流信息失败: 非法参数, 同运单号拦截 rid: 69d8ab9c-22baa3b1-67de0d95 var exportRst = WXHttpResponseBLL.e57PostResponse(url, dataStr, ""); - if(exportRst.Contains("SUCCESS") || exportRst.Contains("已存在") || exportRst.Contains("同运单号拦截")) + if (exportRst.Contains("发送失败 操作超时")) + WXHttpResponseBLL.e57PostResponse(url, dataStr, ""); + if (exportRst.Contains("SUCCESS") || exportRst.Contains("已存在") || exportRst.Contains("同运单号拦截") || exportRst.Contains("订单已绑定外采订单")) { order.sendStatus = "已发送"; NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_buyer_order", lstPddBuyerOrderInfoLite); } else if (exportRst != null && exportRst.Contains("") && exportRst.Contains("")) { - order.sendStatus = exportRst.Substring(exportRst.IndexOf("") + 5).Substring(0, exportRst.IndexOf("")); + order.sendStatus = exportRst.Substring(0, exportRst.IndexOf("")).Substring(exportRst.IndexOf("") + 5); NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_buyer_order", lstPddBuyerOrderInfoLite); } else @@ -918,6 +933,16 @@ namespace TemuKJD.WXForms.TalkForms if (dgvPddBuyerOrder.Height < 100) dgvPddBuyerOrder.Height = 100; } + + TimeSpan PauseTick = new TimeSpan(1); + private void chkPause_CheckedChanged(object sender, EventArgs e) + { + if (chkPause.Checked != true) + nextGetOrderTime = DateTime.Now + PauseTick; + else + PauseTick = nextGetOrderTime - DateTime.Now; + + } } public class YkdBuyerOrder diff --git a/TEMUKJD/WXForms/TalkForms/WxTalkForm.cs b/TEMUKJD/WXForms/TalkForms/WxTalkForm.cs index 6882f1f..f917fbc 100644 --- a/TEMUKJD/WXForms/TalkForms/WxTalkForm.cs +++ b/TEMUKJD/WXForms/TalkForms/WxTalkForm.cs @@ -120,7 +120,7 @@ namespace TemuKJD.WXForms.TalkForms #if DEBUG #else - ucTabControl1.TabPages.Remove(tabPage3); + //ucTabControl1.TabPages.Remove(tabPage3); #endif // 点击变绿的按钮