From ad509cfc664f50bb07ee337bfc681975f9b846bd Mon Sep 17 00:00:00 2001 From: wule_5900x Date: Thu, 30 Jul 2026 23:28:50 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E5=AE=A1=E5=90=8E=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E6=98=AF=E5=90=A6=E5=8A=A0=E5=85=A5=E6=8F=90=E5=AE=A1=E6=88=90?= =?UTF-8?q?=E5=8A=9F=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AllBase/BaseClass.cs | 2 +- .../WXDBProdUploadForm.Designer.cs | 97 +++++++++++-------- .../ProductForms/WXDBProdUploadForm.cs | 42 +++++++- 3 files changed, 95 insertions(+), 46 deletions(-) diff --git a/AllBase/BaseClass.cs b/AllBase/BaseClass.cs index eeae391..635d7d4 100644 --- a/AllBase/BaseClass.cs +++ b/AllBase/BaseClass.cs @@ -31,7 +31,7 @@ namespace AllBase /// /// 版本ID /// - public static int VersionCount = 1258; + public static int VersionCount = 1259; public static string MainPath = "29wx"; //public static string MainPath = "29wx"; //public static string MainPath = "29pdd"; diff --git a/TEMUKJD/WXForms/ProductForms/WXDBProdUploadForm.Designer.cs b/TEMUKJD/WXForms/ProductForms/WXDBProdUploadForm.Designer.cs index 2c86371..f7ad4f6 100644 --- a/TEMUKJD/WXForms/ProductForms/WXDBProdUploadForm.Designer.cs +++ b/TEMUKJD/WXForms/ProductForms/WXDBProdUploadForm.Designer.cs @@ -32,16 +32,17 @@ namespace TemuKJD.WXForms.ProductForms private void InitializeComponent() { this.components = new System.ComponentModel.Container(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle25 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle26 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle27 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle28 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle29 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle30 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle31 = new System.Windows.Forms.DataGridViewCellStyle(); - System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle32 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle6 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle(); + System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle(); this.splitContainer1 = new System.Windows.Forms.SplitContainer(); this.ucGroupBoxEx2 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components); + this.chkIsSubmitSuccess = new TemuKJD.UserComponent.UcCheckBox(this.components); this.txtStockNum = new System.Windows.Forms.TextBox(); this.txtShippingPriceTimes = new System.Windows.Forms.TextBox(); this.txtAddTimes = new System.Windows.Forms.TextBox(); @@ -306,6 +307,7 @@ namespace TemuKJD.WXForms.ProductForms this.ucGroupBoxEx2.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink; 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.chkIsSubmitSuccess); this.ucGroupBoxEx2.Controls.Add(this.txtStockNum); this.ucGroupBoxEx2.Controls.Add(this.txtShippingPriceTimes); this.ucGroupBoxEx2.Controls.Add(this.txtAddTimes); @@ -336,6 +338,17 @@ namespace TemuKJD.WXForms.ProductForms this.ucGroupBoxEx2.TabStop = false; this.ucGroupBoxEx2.Text = "商品上传"; // + // chkIsSubmitSuccess + // + this.chkIsSubmitSuccess.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.chkIsSubmitSuccess.AutoSize = true; + this.chkIsSubmitSuccess.Location = new System.Drawing.Point(700, 13); + this.chkIsSubmitSuccess.Name = "chkIsSubmitSuccess"; + this.chkIsSubmitSuccess.Size = new System.Drawing.Size(99, 21); + this.chkIsSubmitSuccess.TabIndex = 906; + this.chkIsSubmitSuccess.Text = "校验是否提审"; + this.chkIsSubmitSuccess.UseVisualStyleBackColor = true; + // // txtStockNum // this.txtStockNum.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); @@ -396,11 +409,11 @@ namespace TemuKJD.WXForms.ProductForms this.chkRemoveSpecialChar.AutoSize = true; this.chkRemoveSpecialChar.Checked = true; this.chkRemoveSpecialChar.CheckState = System.Windows.Forms.CheckState.Checked; - this.chkRemoveSpecialChar.Location = new System.Drawing.Point(788, 13); + this.chkRemoveSpecialChar.Location = new System.Drawing.Point(800, 13); this.chkRemoveSpecialChar.Name = "chkRemoveSpecialChar"; - this.chkRemoveSpecialChar.Size = new System.Drawing.Size(147, 21); + this.chkRemoveSpecialChar.Size = new System.Drawing.Size(135, 21); this.chkRemoveSpecialChar.TabIndex = 896; - this.chkRemoveSpecialChar.Text = "移除标题前部特殊符号"; + this.chkRemoveSpecialChar.Text = "移除标题前特殊符号"; this.chkRemoveSpecialChar.UseVisualStyleBackColor = true; // // label13 @@ -454,11 +467,12 @@ namespace TemuKJD.WXForms.ProductForms // chkRandomCompanyProd // this.chkRandomCompanyProd.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.chkRandomCompanyProd.AutoSize = true; this.chkRandomCompanyProd.Checked = true; this.chkRandomCompanyProd.CheckState = System.Windows.Forms.CheckState.Checked; - this.chkRandomCompanyProd.Location = new System.Drawing.Point(690, 13); + this.chkRandomCompanyProd.Location = new System.Drawing.Point(1032, 100); this.chkRandomCompanyProd.Name = "chkRandomCompanyProd"; - this.chkRandomCompanyProd.Size = new System.Drawing.Size(87, 21); + this.chkRandomCompanyProd.Size = new System.Drawing.Size(99, 21); this.chkRandomCompanyProd.TabIndex = 889; this.chkRandomCompanyProd.Text = "随机工厂商品"; this.chkRandomCompanyProd.UseVisualStyleBackColor = true; @@ -2539,19 +2553,19 @@ namespace TemuKJD.WXForms.ProductForms // this.dgvShop.AllowUserToAddRows = false; this.dgvShop.AllowUserToDeleteRows = false; - dataGridViewCellStyle25.BackColor = System.Drawing.Color.WhiteSmoke; - this.dgvShop.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle25; + dataGridViewCellStyle1.BackColor = System.Drawing.Color.WhiteSmoke; + this.dgvShop.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle1; this.dgvShop.AutoRowNumber = true; this.dgvShop.BackgroundColor = System.Drawing.Color.White; this.dgvShop.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); - dataGridViewCellStyle26.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle26.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle26.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle26.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle26.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle26.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle26.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.dgvShop.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle26; + 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))); + dataGridViewCellStyle2.ForeColor = System.Drawing.SystemColors.WindowText; + dataGridViewCellStyle2.SelectionBackColor = System.Drawing.SystemColors.Highlight; + dataGridViewCellStyle2.SelectionForeColor = System.Drawing.SystemColors.HighlightText; + dataGridViewCellStyle2.WrapMode = System.Windows.Forms.DataGridViewTriState.False; + this.dgvShop.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle2; this.dgvShop.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dgvShop.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.colSelect, @@ -2783,19 +2797,19 @@ namespace TemuKJD.WXForms.ProductForms // this.dgvSelectProduct.AllowUserToAddRows = false; this.dgvSelectProduct.AllowUserToDeleteRows = false; - dataGridViewCellStyle27.BackColor = System.Drawing.Color.WhiteSmoke; - this.dgvSelectProduct.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle27; + dataGridViewCellStyle3.BackColor = System.Drawing.Color.WhiteSmoke; + this.dgvSelectProduct.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle3; this.dgvSelectProduct.AutoRowNumber = true; this.dgvSelectProduct.BackgroundColor = System.Drawing.Color.White; this.dgvSelectProduct.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255))))); - dataGridViewCellStyle28.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft; - dataGridViewCellStyle28.BackColor = System.Drawing.SystemColors.Control; - dataGridViewCellStyle28.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - dataGridViewCellStyle28.ForeColor = System.Drawing.SystemColors.WindowText; - dataGridViewCellStyle28.SelectionBackColor = System.Drawing.SystemColors.Highlight; - dataGridViewCellStyle28.SelectionForeColor = System.Drawing.SystemColors.HighlightText; - dataGridViewCellStyle28.WrapMode = System.Windows.Forms.DataGridViewTriState.False; - this.dgvSelectProduct.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle28; + 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.dgvSelectProduct.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle4; this.dgvSelectProduct.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize; this.dgvSelectProduct.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.colCheck, @@ -2857,8 +2871,8 @@ namespace TemuKJD.WXForms.ProductForms // // colSupplierName // - dataGridViewCellStyle29.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.colSupplierName.DefaultCellStyle = dataGridViewCellStyle29; + dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.colSupplierName.DefaultCellStyle = dataGridViewCellStyle5; this.colSupplierName.Frozen = true; this.colSupplierName.HeaderText = "店铺名称"; this.colSupplierName.Name = "colSupplierName"; @@ -2938,8 +2952,8 @@ namespace TemuKJD.WXForms.ProductForms // // colProductName // - dataGridViewCellStyle30.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.colProductName.DefaultCellStyle = dataGridViewCellStyle30; + dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.colProductName.DefaultCellStyle = dataGridViewCellStyle6; this.colProductName.HeaderText = "商品标题"; this.colProductName.Name = "colProductName"; this.colProductName.ReadOnly = true; @@ -2947,8 +2961,8 @@ namespace TemuKJD.WXForms.ProductForms // // colProductCat // - dataGridViewCellStyle31.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.colProductCat.DefaultCellStyle = dataGridViewCellStyle31; + dataGridViewCellStyle7.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.colProductCat.DefaultCellStyle = dataGridViewCellStyle7; this.colProductCat.HeaderText = "商品类目"; this.colProductCat.Name = "colProductCat"; this.colProductCat.ReadOnly = true; @@ -3003,8 +3017,8 @@ namespace TemuKJD.WXForms.ProductForms // // colAddTime // - dataGridViewCellStyle32.WrapMode = System.Windows.Forms.DataGridViewTriState.True; - this.colAddTime.DefaultCellStyle = dataGridViewCellStyle32; + dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.True; + this.colAddTime.DefaultCellStyle = dataGridViewCellStyle8; this.colAddTime.HeaderText = "上传时间"; this.colAddTime.Name = "colAddTime"; this.colAddTime.ReadOnly = true; @@ -3360,5 +3374,6 @@ namespace TemuKJD.WXForms.ProductForms private System.Windows.Forms.Label lblGroupFilter; private System.Windows.Forms.ComboBox cmbNotes; private System.Windows.Forms.Label lblNotes; + private UserComponent.UcCheckBox chkIsSubmitSuccess; } } \ No newline at end of file diff --git a/TEMUKJD/WXForms/ProductForms/WXDBProdUploadForm.cs b/TEMUKJD/WXForms/ProductForms/WXDBProdUploadForm.cs index 48982f7..d8c91e9 100644 --- a/TEMUKJD/WXForms/ProductForms/WXDBProdUploadForm.cs +++ b/TEMUKJD/WXForms/ProductForms/WXDBProdUploadForm.cs @@ -1276,7 +1276,7 @@ namespace TemuKJD.WXForms.ProductForms result.Contains("提审次数已达上限") || result.Contains("拥金上货失败:需要开通优选联盟") || result.Contains("本店铺近期提审失败比例较高,已被限")) { shop.upLimitRetryCount++; - if (shop.upLimitRetryCount > 3) + if (shop.upLimitRetryCount >= 3) { shop.upLimitRetryCount = 0; @@ -1285,6 +1285,10 @@ namespace TemuKJD.WXForms.ProductForms Invoke(new Action(() => { shopRow.Cells["colSelect"].Value = false; })); } } + else + { + shop.upLimitRetryCount = Math.Max(0, shop.upLimitRetryCount - 1); + } // 图片重复的,修改图片缓存为空再传一次 if (result.Contains("10020225") || result.Contains("10020226")) { @@ -3358,9 +3362,9 @@ namespace TemuKJD.WXForms.ProductForms name = wxEditCategoryParam.name, catInfo = new catInfoParam() { - inputType = wxEditCategoryParam.catInfo.inputType, - isRequired = wxEditCategoryParam.catInfo.isRequired, - isCustomize = wxEditCategoryParam.catInfo.isCustomize, + inputType = wxEditCategoryParam?.catInfo?.inputType, + isRequired = wxEditCategoryParam?.catInfo?.isRequired, + isCustomize = wxEditCategoryParam?.catInfo?.isCustomize, } }; wxPropParam.categorys.Add(wxCategoryParam); @@ -5327,6 +5331,8 @@ namespace TemuKJD.WXForms.ProductForms if (!chkTestNoAuditUpload.Checked) { var uploadProdRst = WXUpload.upProductV2(shop, upProdParam); + //{"success":true,"retcode":209006,"errcode":209006,"productId":10001226244322,"productKey":{"productId":"10001226244322"}} // 提审成功 + //{"success":true,"retcode":0,"errcode":0,"productId":10001226095876,"productKey":{"productId":"10001226095876"}} // 未能提审 if (!uploadProdRst.Contains("\"code\":0") && !uploadProdRst.Contains("\"success\":true")) { var error = BaseRegex.GetStringJson(ref uploadProdRst, "msg"); @@ -5350,6 +5356,15 @@ namespace TemuKJD.WXForms.ProductForms commissionRstStr = "设置佣金比例失败 " + rst; } } + if (chkIsSubmitSuccess.Checked) + { + Thread.Sleep(Randomx.GetId(2000, 3001)); + var uploadCheckRst = WXUpload.SearchProductUpload(shop, upProdParam.product.productKey.productId); + if (uploadCheckRst.Contains("\"productList\":[]") || uploadCheckRst.Contains("\"totalNum\":0")) + { + return "{\"success\":false,\"draftId\":" + upProdParam.product.productKey.productId + ",\"status\":\"草稿箱\",\"errMsg\":\"上架提审失败 请检查是否在架商品数已达到上限或店铺受到其他限制\"}"; + } + } } else { @@ -6987,6 +7002,25 @@ Content-Type: image/jpeg return result; } + public static string checkProductUpload(ShopLoginInfo shop, string productId) + { + string url = "https://store.weixin.qq.com/shop-faas/mmchannelstradeproductcore/cgi/goods/checkUploadProductDraftStatus?token=&lang=zh_CN&productKey=%7B%22productId%22:" + + productId + "%7D&preview=false"; + string referer = "https://store.weixin.qq.com/shop/goods/entry?productId=" + productId + "&isUpdateAuditFree=0&source=list_edit&continueEditInfo=" + + "{%22isEditingContinued%22:false,%22lastEditDraftTime%22:0,%22listingTime%22:0}"; + var result = WXHttpResponseBLL.WeiXinGetResponse(shop, url, referer); + return result; + } + + public static string SearchProductUpload(ShopLoginInfo shop, string productId) + { + string url = "https://store.weixin.qq.com/shop-faas/mmchannelstradeproductcore/cgi/goods/searchProduct?token=&lang=zh_CN&pageSize=20&productStatus[]=-1" + + "&productSource=[1,16,32]&searchSource=1&useNew=true&fromProductManager=1&pageNum=1&status[]=2&spuId=" + productId; + string referer = "https://store.weixin.qq.com/shop/goods/list?currentTab=PRODUCT_STATUS_EDIT"; + var result = WXHttpResponseBLL.WeiXinGetResponse(shop, url, referer); + return result; + } + public static string upProductJObjectV2(ShopLoginInfo shop, string prodStr) {