From a568c685ee315539607c3e4a8bdb1dc6b5441b9b Mon Sep 17 00:00:00 2001 From: wule Date: Tue, 11 Aug 2026 02:19:09 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E8=B4=A8=E5=9B=BE=E4=B8=8A=E6=AC=A1?= =?UTF-8?q?=E4=BC=A075%=20=20=E6=89=8B=E8=A1=A8=E4=B8=8A=E4=BC=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AllBase/AllBase.csproj | 1 + AllBase/BaseClass.cs | 2 +- .../DBModel/wx_qualification_image_info.cs | 20 ++ .../WxModel/wx_qualification_image_info.cs | 1 + .../KJD_WebService/WXProductService.asmx.cs | 14 +- .../DouBaoTitleFissionCefForm.Designer.cs | 43 ++-- .../WXAdminQualificationImageForm.Designer.cs | 120 ++++++---- .../WXAdminQualificationImageForm.cs | 78 +++--- .../WXAdminQualificationImageForm.resx | 6 + .../ProductForms/WXDBProdUploadForm.cs | 223 +++++++++++------- 10 files changed, 307 insertions(+), 201 deletions(-) create mode 100644 AllBase/Model/DBModel/wx_qualification_image_info.cs diff --git a/AllBase/AllBase.csproj b/AllBase/AllBase.csproj index e5dbd25..5f4f98c 100644 --- a/AllBase/AllBase.csproj +++ b/AllBase/AllBase.csproj @@ -192,6 +192,7 @@ + diff --git a/AllBase/BaseClass.cs b/AllBase/BaseClass.cs index 3eda8f8..939645f 100644 --- a/AllBase/BaseClass.cs +++ b/AllBase/BaseClass.cs @@ -31,7 +31,7 @@ namespace AllBase /// /// 版本ID /// - public static int VersionCount = 1272; + public static int VersionCount = 1273; public static string MainPath = "29wx"; //public static string MainPath = "29wx"; //public static string MainPath = "29pdd"; diff --git a/AllBase/Model/DBModel/wx_qualification_image_info.cs b/AllBase/Model/DBModel/wx_qualification_image_info.cs new file mode 100644 index 0000000..e30598b --- /dev/null +++ b/AllBase/Model/DBModel/wx_qualification_image_info.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace AllBase.Model.DBModel +{ + public class wx_qualification_image_info + { + public int id { get; set; } + public string cat_name { get; set; } + public string img_md5 { get; set; } + public string img_base64 { get; set; } + public string img_thumb_base64 { get; set; } + public string txt_margin { get; set; } + public DateTime add_time { get; set; } + public DateTime mdy_time { get; set; } + } +} diff --git a/KJDService/KJD_WebService/Model/WxModel/wx_qualification_image_info.cs b/KJDService/KJD_WebService/Model/WxModel/wx_qualification_image_info.cs index 73e0a2b..c6faed6 100644 --- a/KJDService/KJD_WebService/Model/WxModel/wx_qualification_image_info.cs +++ b/KJDService/KJD_WebService/Model/WxModel/wx_qualification_image_info.cs @@ -10,6 +10,7 @@ namespace KJD_Web.Model.WxModel public int id { get; set; } public string img_md5 { get; set; } public string img_base64 { get; set; } + public string img_thumb_base64 { get; set; } public string txt_margin { get; set; } public DateTime add_time { get; set; } public DateTime mdy_time { get; set; } diff --git a/KJDService/KJD_WebService/WXProductService.asmx.cs b/KJDService/KJD_WebService/WXProductService.asmx.cs index 637f0d8..e3db5f7 100644 --- a/KJDService/KJD_WebService/WXProductService.asmx.cs +++ b/KJDService/KJD_WebService/WXProductService.asmx.cs @@ -322,7 +322,19 @@ namespace KJD_Web Context.Response.Write(result); Context.Response.End(); } - + + [WebMethod] + public void wx_get_qualification_image() + { + string jsontext = GetRequestJsonString(); + + var result = jsontext; + result = new WXProductManage().WXGetQualificationImage(jsontext); + + Context.Response.Write(result); + Context.Response.End(); + } + [WebMethod] public void e57_get_freight_template() { diff --git a/TEMUKJD/ToolForms/DouBaoTitleFissionCefForm.Designer.cs b/TEMUKJD/ToolForms/DouBaoTitleFissionCefForm.Designer.cs index 6cef0e1..72a4e60 100644 --- a/TEMUKJD/ToolForms/DouBaoTitleFissionCefForm.Designer.cs +++ b/TEMUKJD/ToolForms/DouBaoTitleFissionCefForm.Designer.cs @@ -55,6 +55,7 @@ namespace TemuKJD.ToolForms this.textBox1 = new System.Windows.Forms.TextBox(); this.splitContainer2 = new System.Windows.Forms.SplitContainer(); this.splitContainer3 = new System.Windows.Forms.SplitContainer(); + this.chkWithTitle = new TemuKJD.UserComponent.UcCheckBox(this.components); this.btnBatchCreateFissionTitle = new DevComponents.DotNetBar.PanelEx(); this.pbLoading2 = new System.Windows.Forms.PictureBox(); this.dgvDbProduct = new TemuKJD.UserComponent.DataGridViewEx(); @@ -82,7 +83,7 @@ namespace TemuKJD.ToolForms 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(); - this.chkWithTitle = new TemuKJD.UserComponent.UcCheckBox(this.components); + this.label1 = new System.Windows.Forms.Label(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); @@ -273,6 +274,7 @@ namespace TemuKJD.ToolForms // // splitContainer3.Panel1 // + this.splitContainer3.Panel1.Controls.Add(this.label1); this.splitContainer3.Panel1.Controls.Add(this.chkWithTitle); this.splitContainer3.Panel1.Controls.Add(this.btnBatchCreateFissionTitle); this.splitContainer3.Panel1MinSize = 0; @@ -284,16 +286,28 @@ namespace TemuKJD.ToolForms this.splitContainer3.Panel2.Controls.Add(this.dgvDbProduct); this.splitContainer3.Panel2MinSize = 0; this.splitContainer3.Size = new System.Drawing.Size(357, 626); - this.splitContainer3.SplitterDistance = 94; + this.splitContainer3.SplitterDistance = 112; this.splitContainer3.TabIndex = 0; // + // chkWithTitle + // + this.chkWithTitle.AutoSize = true; + this.chkWithTitle.Checked = true; + this.chkWithTitle.CheckState = System.Windows.Forms.CheckState.Checked; + this.chkWithTitle.Location = new System.Drawing.Point(11, 41); + this.chkWithTitle.Name = "chkWithTitle"; + this.chkWithTitle.Size = new System.Drawing.Size(215, 21); + this.chkWithTitle.TabIndex = 1132; + this.chkWithTitle.Text = "提问时附带商品标题(防止数据不符)"; + this.chkWithTitle.UseVisualStyleBackColor = true; + // // btnBatchCreateFissionTitle // this.btnBatchCreateFissionTitle.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled; this.btnBatchCreateFissionTitle.Cursor = System.Windows.Forms.Cursors.Hand; this.btnBatchCreateFissionTitle.DisabledBackColor = System.Drawing.Color.Empty; this.btnBatchCreateFissionTitle.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134))); - this.btnBatchCreateFissionTitle.Location = new System.Drawing.Point(21, 20); + this.btnBatchCreateFissionTitle.Location = new System.Drawing.Point(11, 12); this.btnBatchCreateFissionTitle.Name = "btnBatchCreateFissionTitle"; this.btnBatchCreateFissionTitle.Size = new System.Drawing.Size(135, 23); this.btnBatchCreateFissionTitle.Style.Alignment = System.Drawing.StringAlignment.Center; @@ -315,7 +329,7 @@ namespace TemuKJD.ToolForms // this.pbLoading2.Anchor = System.Windows.Forms.AnchorStyles.None; this.pbLoading2.Image = global::TemuKJD.Properties.Resources.loading_blue; - this.pbLoading2.Location = new System.Drawing.Point(153, 241); + this.pbLoading2.Location = new System.Drawing.Point(153, 232); this.pbLoading2.Name = "pbLoading2"; this.pbLoading2.Size = new System.Drawing.Size(50, 50); this.pbLoading2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; @@ -373,7 +387,7 @@ namespace TemuKJD.ToolForms this.dgvDbProduct.ReadOnly = true; this.dgvDbProduct.RowHeadersWidth = 30; this.dgvDbProduct.RowTemplate.Height = 23; - this.dgvDbProduct.Size = new System.Drawing.Size(357, 528); + this.dgvDbProduct.Size = new System.Drawing.Size(357, 510); this.dgvDbProduct.TabIndex = 10; this.dgvDbProduct.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvDbProduct_CellContentClick); // @@ -589,17 +603,15 @@ namespace TemuKJD.ToolForms this.col_select_product.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; this.col_select_product.Visible = false; // - // chkWithTitle + // label1 // - this.chkWithTitle.AutoSize = true; - this.chkWithTitle.Checked = true; - this.chkWithTitle.CheckState = System.Windows.Forms.CheckState.Checked; - this.chkWithTitle.Location = new System.Drawing.Point(21, 53); - this.chkWithTitle.Name = "chkWithTitle"; - this.chkWithTitle.Size = new System.Drawing.Size(215, 21); - this.chkWithTitle.TabIndex = 1132; - this.chkWithTitle.Text = "提问时附带商品标题(防止数据不符)"; - this.chkWithTitle.UseVisualStyleBackColor = true; + this.label1.AutoSize = true; + this.label1.ForeColor = System.Drawing.SystemColors.ControlDarkDark; + this.label1.Location = new System.Drawing.Point(8, 69); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(320, 34); + this.label1.TabIndex = 1136; + this.label1.Text = "备注:至少需要生成30个以上标题(少于30程序执行错误),\r\n   建议生成50个以上标题,防止识别错误。"; // // DouBaoTitleFissionCefForm // @@ -685,5 +697,6 @@ namespace TemuKJD.ToolForms private System.Windows.Forms.DataGridViewLinkColumn col_delete; private System.Windows.Forms.DataGridViewLinkColumn col_select_product; private UserComponent.UcCheckBox chkWithTitle; + private System.Windows.Forms.Label label1; } } \ No newline at end of file diff --git a/TEMUKJD/WXForms/AdminForms/WXAdminQualificationImageForm.Designer.cs b/TEMUKJD/WXForms/AdminForms/WXAdminQualificationImageForm.Designer.cs index 88d4cb6..6a93d1c 100644 --- a/TEMUKJD/WXForms/AdminForms/WXAdminQualificationImageForm.Designer.cs +++ b/TEMUKJD/WXForms/AdminForms/WXAdminQualificationImageForm.Designer.cs @@ -41,11 +41,6 @@ namespace TemuKJD.WXForms.AdminForms this.btnEmpty = new DevComponents.DotNetBar.PanelEx(); this.pbLoading = new System.Windows.Forms.PictureBox(); this.dgvShop = new TemuKJD.UserComponent.DataGridViewEx(); - this.colSelect = new System.Windows.Forms.DataGridViewCheckBoxColumn(); - this.colCat1Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); - this.colChangeImage = new System.Windows.Forms.DataGridViewLinkColumn(); - this.colDelete = new System.Windows.Forms.DataGridViewLinkColumn(); - this.colMsg = new System.Windows.Forms.DataGridViewTextBoxColumn(); this.splitContainer2 = new System.Windows.Forms.SplitContainer(); this.splitContainer3 = new System.Windows.Forms.SplitContainer(); this.txtBottom = new System.Windows.Forms.TextBox(); @@ -65,6 +60,13 @@ namespace TemuKJD.WXForms.AdminForms this.ucSplitPage1 = new TemuKJD.UserControls.UcSplitPage(); this.statusBar = new TemuKJD.UserControls.StatusBarUserControl(); this.panel3 = new System.Windows.Forms.Panel(); + this.colSelect = new System.Windows.Forms.DataGridViewCheckBoxColumn(); + this.colCat1Name = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colImgMd5 = new System.Windows.Forms.DataGridViewTextBoxColumn(); + this.colImg = new System.Windows.Forms.DataGridViewImageColumn(); + this.colChangeImage = new System.Windows.Forms.DataGridViewLinkColumn(); + this.colDelete = new System.Windows.Forms.DataGridViewLinkColumn(); + this.colMsg = new System.Windows.Forms.DataGridViewTextBoxColumn(); ((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit(); this.splitContainer1.Panel1.SuspendLayout(); this.splitContainer1.Panel2.SuspendLayout(); @@ -229,6 +231,8 @@ namespace TemuKJD.WXForms.AdminForms this.dgvShop.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] { this.colSelect, this.colCat1Name, + this.colImgMd5, + this.colImg, this.colChangeImage, this.colDelete, this.colMsg}); @@ -244,44 +248,6 @@ namespace TemuKJD.WXForms.AdminForms this.dgvShop.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvShop_CellContentClick); this.dgvShop.CellMouseDown += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dgvShop_CellMouseDown); // - // colSelect - // - this.colSelect.FillWeight = 16F; - this.colSelect.HeaderText = "选"; - this.colSelect.Name = "colSelect"; - this.colSelect.ReadOnly = true; - this.colSelect.Resizable = System.Windows.Forms.DataGridViewTriState.True; - this.colSelect.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; - // - // colCat1Name - // - this.colCat1Name.FillWeight = 70F; - this.colCat1Name.HeaderText = "类目名称"; - this.colCat1Name.Name = "colCat1Name"; - this.colCat1Name.ReadOnly = true; - // - // colChangeImage - // - this.colChangeImage.FillWeight = 46F; - this.colChangeImage.HeaderText = "更改图片"; - this.colChangeImage.Name = "colChangeImage"; - this.colChangeImage.ReadOnly = true; - this.colChangeImage.Resizable = System.Windows.Forms.DataGridViewTriState.True; - this.colChangeImage.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; - // - // colDelete - // - this.colDelete.FillWeight = 46F; - this.colDelete.HeaderText = "删除"; - this.colDelete.Name = "colDelete"; - this.colDelete.ReadOnly = true; - // - // colMsg - // - this.colMsg.HeaderText = "操作结果"; - this.colMsg.Name = "colMsg"; - this.colMsg.ReadOnly = true; - // // splitContainer2 // this.splitContainer2.BackColor = System.Drawing.Color.White; @@ -540,6 +506,62 @@ namespace TemuKJD.WXForms.AdminForms this.panel3.Size = new System.Drawing.Size(1271, 576); this.panel3.TabIndex = 35; // + // colSelect + // + this.colSelect.FillWeight = 16F; + this.colSelect.HeaderText = "选"; + this.colSelect.Name = "colSelect"; + this.colSelect.ReadOnly = true; + this.colSelect.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.colSelect.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + // + // colCat1Name + // + this.colCat1Name.FillWeight = 70F; + this.colCat1Name.HeaderText = "类目名称"; + this.colCat1Name.Name = "colCat1Name"; + this.colCat1Name.ReadOnly = true; + // + // colImgMd5 + // + this.colImgMd5.FillWeight = 50F; + this.colImgMd5.HeaderText = "图片码"; + this.colImgMd5.Name = "colImgMd5"; + this.colImgMd5.ReadOnly = true; + // + // colImg + // + this.colImg.FillWeight = 40F; + this.colImg.HeaderText = "图片"; + this.colImg.ImageLayout = System.Windows.Forms.DataGridViewImageCellLayout.Zoom; + this.colImg.Name = "colImg"; + this.colImg.ReadOnly = true; + this.colImg.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.colImg.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + // + // colChangeImage + // + this.colChangeImage.FillWeight = 46F; + this.colChangeImage.HeaderText = "编辑图片"; + this.colChangeImage.Name = "colChangeImage"; + this.colChangeImage.ReadOnly = true; + this.colChangeImage.Resizable = System.Windows.Forms.DataGridViewTriState.True; + this.colChangeImage.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic; + // + // colDelete + // + this.colDelete.FillWeight = 46F; + this.colDelete.HeaderText = "删除"; + this.colDelete.Name = "colDelete"; + this.colDelete.ReadOnly = true; + this.colDelete.Visible = false; + // + // colMsg + // + this.colMsg.HeaderText = "操作结果"; + this.colMsg.Name = "colMsg"; + this.colMsg.ReadOnly = true; + // // WXAdminQualificationImageForm // this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None; @@ -594,11 +616,6 @@ namespace TemuKJD.WXForms.AdminForms private System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; private System.Windows.Forms.Panel panel4; private System.Windows.Forms.SplitContainer splitContainer3; - private System.Windows.Forms.DataGridViewCheckBoxColumn colSelect; - private System.Windows.Forms.DataGridViewTextBoxColumn colCat1Name; - private System.Windows.Forms.DataGridViewLinkColumn colChangeImage; - private System.Windows.Forms.DataGridViewLinkColumn colDelete; - private System.Windows.Forms.DataGridViewTextBoxColumn colMsg; private System.Windows.Forms.PictureBox pictureBox1; private System.Windows.Forms.Label label1; private System.Windows.Forms.ComboBox comboBox1; @@ -613,5 +630,12 @@ namespace TemuKJD.WXForms.AdminForms private System.Windows.Forms.TextBox txtLeft; private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label2; + private System.Windows.Forms.DataGridViewCheckBoxColumn colSelect; + private System.Windows.Forms.DataGridViewTextBoxColumn colCat1Name; + private System.Windows.Forms.DataGridViewTextBoxColumn colImgMd5; + private System.Windows.Forms.DataGridViewImageColumn colImg; + private System.Windows.Forms.DataGridViewLinkColumn colChangeImage; + private System.Windows.Forms.DataGridViewLinkColumn colDelete; + private System.Windows.Forms.DataGridViewTextBoxColumn colMsg; } } \ No newline at end of file diff --git a/TEMUKJD/WXForms/AdminForms/WXAdminQualificationImageForm.cs b/TEMUKJD/WXForms/AdminForms/WXAdminQualificationImageForm.cs index 5d7cdb0..272dd21 100644 --- a/TEMUKJD/WXForms/AdminForms/WXAdminQualificationImageForm.cs +++ b/TEMUKJD/WXForms/AdminForms/WXAdminQualificationImageForm.cs @@ -1,4 +1,5 @@ using AllBase; +using AllBase.Model.DBModel; using AllBase.Model.Param.TemuProductManage; using AllBase.Model.Result; using NaiBa.Util; @@ -22,6 +23,7 @@ using TemuKJD.BLL; using TemuKJD.Extension; using TemuKJD.WXForms.ShopForms; using Work; +using Work.BLL.Tools; namespace TemuKJD.WXForms.AdminForms { @@ -33,7 +35,7 @@ namespace TemuKJD.WXForms.AdminForms get { if (inst == null) inst = new WXAdminQualificationImageForm(); return inst; } set { inst = value; } } - public static ConcurrentList lstAdminShopInfo { get; set; } = new ConcurrentList(); + public static ConcurrentList lstWxQualificationImageInfo { get; set; } = new ConcurrentList(); public WXAdminQualificationImageForm() { @@ -73,59 +75,37 @@ namespace TemuKJD.WXForms.AdminForms { this.pbLoading.Visible = true; this.dgvShop.Rows.Clear(); - lstAdminShopInfo.Clear(); + lstWxQualificationImageInfo.Clear(); })); } else { this.pbLoading.Visible = true; this.dgvShop.Rows.Clear(); - lstAdminShopInfo.Clear(); + lstWxQualificationImageInfo.Clear(); } Task.Run(() => { int pageCount; decimal seconds = 0; var list = AdminGetServerQualificationImageLst(out pageCount, out seconds, page, ucSplitPage1.PageSize); - lstAdminShopInfo.AddRange(list); + lstWxQualificationImageInfo.AddRange(list); this.ucSplitPage1.TotalPage = pageCount; - foreach (var shop in lstAdminShopInfo) + foreach (var image in lstWxQualificationImageInfo) { Invoke(new Action(() => { int rowIndex = this.dgvShop.Rows.Add( - shopIdList.Contains(shop.ShopId + shop.UserName), - shop.LoginName, - shop.ShopId, - shop.ShopAccount, - shop.Notes, - shop.GroupName, - "-", - shop.AddProductRemaining, - "+", - //"±", - shop.Cookies, - shop.UserName, - shop.SubUserName, - shop.UploadAccount, - shop.BuyAccount, - shop.ChatAccount, - "", - "进入", - "检测", - string.IsNullOrWhiteSpace(shop.LoginStatus) ? "未登录" : shop.LoginStatus.Trim(), - string.IsNullOrWhiteSpace(shop.LoginStatus2) ? "国际版未登录" : shop.LoginStatus2.Trim(), - "购买", - "多重登录", - shop.ApiAuthStatus, - shop.BuyApiAuth.ApiAuthStatus, - "导入Cookie", - "复制Cookie", - "上传", - shop.OperateSubSaName, + false, + image.cat_name, + image.img_md5, + Base64ChangeImgUrl.Base64ToImage(image.img_thumb_base64), "编辑", "删除"); + + var row = dgvShop.Rows[rowIndex]; + row.Height = 60; })); } @@ -165,6 +145,7 @@ namespace TemuKJD.WXForms.AdminForms if (e.ColumnIndex < 0 || e.RowIndex < 0) return; string headerText = dgvShop.Columns[e.ColumnIndex].HeaderText; + var row = dgvShop.Rows[e.RowIndex]; switch (headerText) { @@ -185,12 +166,13 @@ namespace TemuKJD.WXForms.AdminForms //if (ShopBLL.AdminDelServerShop(shop)) // SearchImg(this.ucSplitPage1.CurrentPage); break; - case "更改图片": - IsOperate = true; + case "编辑图片": + var image = lstWxQualificationImageInfo.FirstOrDefault(i => i.img_md5 == row.Cells["colImgMd5"].Value.ParseToString()); + if (image != null) { - //UploadProduct(shop); + image.img_base64.IsNullOrEmpty(); + } - IsOperate = false; break; case "": dgvShop.Rows[e.RowIndex].Cells["colSelect"].Value = !(bool)dgvShop.Rows[e.RowIndex].Cells["colSelect"].Value; @@ -215,32 +197,28 @@ namespace TemuKJD.WXForms.AdminForms return shopNameList; } - public List AdminGetServerQualificationImageLst(out int pageCount, out decimal seconds, int page = 1, int pageSize = 50) + public List AdminGetServerQualificationImageLst(out int pageCount, out decimal seconds, int page = 1, int pageSize = 50) { - List list = new List(); + List list = new List(); pageCount = 1; seconds = 0; - var url = BaseClass.BuildObjString("shop/admin_get_server_qualification_image_list"); + var url = BaseClass.BuildObjString("product/wx_get_qualification_image"); var data = UserLogin.GetSignaturex() + "&page=" + page + - "&page_size=" + pageSize + - "&search_cat_name=" + txtCatName.Text.Trim(); - if (BaseClass.SaLevel > 1) - data += "&operate_sub_sa_name=" + BaseClass.UserName; + "&page_size=" + pageSize; + data += "&is_detail=true"; var html = GetHtml.PostUtf8(url, data); - if (string.IsNullOrEmpty(html) - || !html.Contains("shop_id") || !html.Contains("shop_account") || !html.Contains("login_pass")) - { + if (!html.Contains("\"code\":200")) return list; - } int count = BaseRegex.GetIntJson(ref html, "count"); pageCount = Math.Ceiling(1.0 * count / pageSize).ParseToInt(); pageCount = Math.Max(pageCount, 1); seconds = BaseRegex.GetDecimalJson(ref html, "seconds"); - return ShopBLL.DeserializationShop(html); + JObject jObj = JsonHelper.JObjectParse(html); + return JsonHelper.DeserializeJsonToList(jObj["data"].ParseToString()); } private void dgvShop_CellMouseDown(object sender, DataGridViewCellMouseEventArgs e) diff --git a/TEMUKJD/WXForms/AdminForms/WXAdminQualificationImageForm.resx b/TEMUKJD/WXForms/AdminForms/WXAdminQualificationImageForm.resx index cbbdede..dd7e498 100644 --- a/TEMUKJD/WXForms/AdminForms/WXAdminQualificationImageForm.resx +++ b/TEMUKJD/WXForms/AdminForms/WXAdminQualificationImageForm.resx @@ -123,6 +123,12 @@ True + + True + + + True + True diff --git a/TEMUKJD/WXForms/ProductForms/WXDBProdUploadForm.cs b/TEMUKJD/WXForms/ProductForms/WXDBProdUploadForm.cs index dc3cc17..5efeb62 100644 --- a/TEMUKJD/WXForms/ProductForms/WXDBProdUploadForm.cs +++ b/TEMUKJD/WXForms/ProductForms/WXDBProdUploadForm.cs @@ -2556,6 +2556,11 @@ namespace TemuKJD.WXForms.ProductForms // 微信商品使用类目缓存 if (!dbProd.wx_cat_leaf.IsNullOrZero()) { + if (dbProd.wx_cat_3 == 7370) + dbProd.wx_cat_3 = 547591; + if (dbProd.wx_cat_leaf == 7370) + dbProd.wx_cat_leaf = 547591; + if (!dbProd.wx_cat_1.IsNullOrZero()) aiCateIdLst.Add(dbProd.wx_cat_1.ParseToLong()); if (!dbProd.wx_cat_2.IsNullOrZero()) @@ -2649,6 +2654,13 @@ namespace TemuKJD.WXForms.ProductForms cell.Value = "正在生成类目模板"; })); } + + if (aiCateIdLst.LastOrDefault() == 7370) + { + aiCateIdLst.RemoveAt(aiCateIdLst.Count - 1); + aiCateIdLst.Add(547591); + } + string getCateRst = WXUpload.getCategoryOnShelf(shop, aiCateIdLst); if (!getCateRst.Contains("\"code\":0")) { @@ -2675,8 +2687,11 @@ namespace TemuKJD.WXForms.ProductForms } // 获取叶子类目id + long leafCatId = (upProdParam.product.info.category.LastOrDefault()?.catId).ParseToLong(); //哲学经典著作 var bound = GlobalConfig.WxCatBoundList.FirstOrDefault(b => b.leaf_id == leafCatId); + if (leafCatId == 547591) + bound = GlobalConfig.WxCatBoundList.FirstOrDefault(b => b.leaf_id == 7370); if (bound == null) return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"获取类目保证金失败\"}"; var maxBount = txtFilterBoundMax.Text.Trim().ParseToInt(); @@ -2684,97 +2699,111 @@ namespace TemuKJD.WXForms.ProductForms if (bound.cat_bound < minBount || bound.cat_bound > maxBount ) return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"类目保证金(" + bound.cat_bound + ")超过过滤限制(" + minBount + "-" + maxBount + ")\"}"; - // 检测是否有类目上传权限 - var cateUpCheckRst = WXUpload.batchCheckCategoryRelation(shop, leafCatId); - //"{\"code\":0,\"list\":[{\"category_id\":\"1427\",\"result\":0,\"no_auth_reason_type\":0}]}" - //"{\"code\":0,\"list\":[{\"category_id\":\"7486\",\"result\":0,\"no_auth_reason_type\":0}]}" - if (!cateUpCheckRst.Contains("\"code\":0") && !cateUpCheckRst.Contains("\"success\":true")) + var spBrandId = ""; + if (leafCatId == 547591) { - var error = BaseRegex.GetStringJson(ref cateUpCheckRst, "msg"); - if (string.IsNullOrEmpty(error)) - error = cateUpCheckRst; - return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"类目校验错误 " + error + "\"}"; + var rst = WXUpload.getMixBrand(shop, leafCatId.ToString()); + // 先写死 + spBrandId = 10914219.ToString(); + // 国表定向类目 + upProdParam.product.info.brandId = spBrandId.ParseToLong(); } - if (!cateUpCheckRst.Contains("\"result\":1")) + else { - if (aiCateIdLst.FirstOrDefault() == 10000215) - { - //@"{""categoryInfo"":{""categories"":[{""id"":10000215},{""id"":10000222},{""id"":7483}],""categoryDeposit"":""1000.00"",""isNewApplyCat"":true,""licenseGroupList"":[{""licenseGroupId"":""1"",""license"":{""licenseId"":""4"",""cosIdList"":[""1771897594802-oM5657FQAaKYlf2uP300NBgx9HYY-0581""],""licenseFieldList"":[{""key"":""audit_license_registration_no"",""value"":""YB23509020049441""},{""key"":""search_url"",""value"":""""}],""isReuse"":true}}],""ruleVersion"":5234,""certificate"":[]},""brandIdList"":[],""leafCategoryId"":7483,""reuse"":0,""applyType"":""normalApply""}"; - var getCatDataRst = WXUpload.getSingleCategoryData(shop, leafCatId, aiCateIdLst); - if (!getCatDataRst.Contains("\"code\":0") && !getCatDataRst.Contains("\"success\":true")) - { - return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"类目申请失败 查询类目资质文件失败" + "\"}"; - } - WXCateAuthParam wxCateAuthParam = new WXCateAuthParam(); - wxCateAuthParam.leafCategoryId = leafCatId; - wxCateAuthParam.categoryInfo.categoryDeposit = bound.cat_bound.ToString("0.00"); - wxCateAuthParam.categoryInfo.ruleVersion = BaseRegex.GetIntJson(ref getCatDataRst, "ruleVersion"); - foreach (var cateId in aiCateIdLst) - { - wxCateAuthParam.categoryInfo.categories.Add(new WXCateId() { id = cateId }); - } - try - { - if (!JsonHelper.JObjectParse(getCatDataRst)["reuseApplyData"].IsJTokenNullOrEmpty()) - { - var jlicenseGroupList = JsonHelper.JObjectParse(getCatDataRst)["reuseApplyData"]["catInfo"]["licenseGroupList"]; - var licenseGroupListStr = JsonHelper.SerializeObject(jlicenseGroupList); - wxCateAuthParam.categoryInfo.licenseGroupList = JsonHelper.DeserializeJsonToList(licenseGroupListStr); - } - else - { - var licenseGroup = new licenseGroup(); - wxCateAuthParam.categoryInfo.licenseGroupList.Add(licenseGroup); - licenseGroup.license.licenseId = "4"; - var cosIdList = "[" + BaseRegex.GetMatchRegexString(ref getCatDataRst, "\"cosIdList\":\\[([\\s\\S]*?)\\]") + "]"; - licenseGroup.license.cosIdList = JsonHelper.DeserializeJsonToList(cosIdList); - var licenseFieldList = "[" + BaseRegex.GetMatchRegexString(ref getCatDataRst, "\"licenseFieldList\":\\[([\\s\\S]*?)\\]") + "]"; - licenseGroup.license.licenseFieldList = JsonHelper.DeserializeJsonToList(licenseFieldList); - } - var authCateRst = WXUpload.wxCateAuth(shop, aiCateIdLst, wxCateAuthParam); - if (!authCateRst.Contains("\"code\":0") && !authCateRst.Contains("\"success\":true")) - { - var error = BaseRegex.GetStringJson(ref authCateRst, "msg"); - if (string.IsNullOrEmpty(error)) - error = BaseRegex.GetStringJson(ref authCateRst, "errmsg"); - if (string.IsNullOrEmpty(error)) - error = authCateRst; - return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"类目申请失败 " + error + "\"}"; - } - Thread.Sleep(Randomx.GetId(5000, 7000)); - cateUpCheckRst = WXUpload.batchCheckCategoryRelation(shop, leafCatId); - if (!cateUpCheckRst.Contains("\"code\":0") && !cateUpCheckRst.Contains("\"success\":true")) - { - var error = BaseRegex.GetStringJson(ref cateUpCheckRst, "msg"); - if (string.IsNullOrEmpty(error)) - error = cateUpCheckRst; - return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"类目申请校验错误 " + error + "\"}"; - } - if (!cateUpCheckRst.Contains("\"result\":1")) - return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"类目申请审核中 请稍后再试\"}"; - } - catch - { - return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"类目申请失败 复用资质文件失败,请重新提交资质文件" + "\"}"; - } - //return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"类目申请失败 请手动申请资质类目" + "\"}"; - } - else + // 检测是否有类目上传权限 + var cateUpCheckRst = WXUpload.batchCheckCategoryRelation(shop, leafCatId); + //"{\"code\":0,\"list\":[{\"category_id\":\"1427\",\"result\":0,\"no_auth_reason_type\":0}]}" + //"{\"code\":0,\"list\":[{\"category_id\":\"7486\",\"result\":0,\"no_auth_reason_type\":0}]}" + if (!cateUpCheckRst.Contains("\"code\":0") && !cateUpCheckRst.Contains("\"success\":true")) { - Thread.Sleep(Randomx.GetId(1000, 2000)); - var cateAuthorRst = WXUpload.addFinderCategoryV2(shop, leafCatId); - if (!cateAuthorRst.Contains("\"code\":0") && !cateAuthorRst.Contains("\"success\":true")) + var error = BaseRegex.GetStringJson(ref cateUpCheckRst, "msg"); + if (string.IsNullOrEmpty(error)) + error = cateUpCheckRst; + return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"类目校验错误 " + error + "\"}"; + } + if (!cateUpCheckRst.Contains("\"result\":1")) + { + if (aiCateIdLst.FirstOrDefault() == 10000215) { - var error = BaseRegex.GetStringJson(ref cateAuthorRst, "msg"); - if (string.IsNullOrEmpty(error)) - error = BaseRegex.GetStringJson(ref cateAuthorRst, "errmsg"); - if (string.IsNullOrEmpty(error)) - error = cateAuthorRst; - return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"类目申请错误 " + error + "\"}"; + //@"{""categoryInfo"":{""categories"":[{""id"":10000215},{""id"":10000222},{""id"":7483}],""categoryDeposit"":""1000.00"",""isNewApplyCat"":true,""licenseGroupList"":[{""licenseGroupId"":""1"",""license"":{""licenseId"":""4"",""cosIdList"":[""1771897594802-oM5657FQAaKYlf2uP300NBgx9HYY-0581""],""licenseFieldList"":[{""key"":""audit_license_registration_no"",""value"":""YB23509020049441""},{""key"":""search_url"",""value"":""""}],""isReuse"":true}}],""ruleVersion"":5234,""certificate"":[]},""brandIdList"":[],""leafCategoryId"":7483,""reuse"":0,""applyType"":""normalApply""}"; + var getCatDataRst = WXUpload.getSingleCategoryData(shop, leafCatId, aiCateIdLst); + if (!getCatDataRst.Contains("\"code\":0") && !getCatDataRst.Contains("\"success\":true")) + { + return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"类目申请失败 查询类目资质文件失败" + "\"}"; + } + + WXCateAuthParam wxCateAuthParam = new WXCateAuthParam(); + wxCateAuthParam.leafCategoryId = leafCatId; + wxCateAuthParam.categoryInfo.categoryDeposit = bound.cat_bound.ToString("0.00"); + wxCateAuthParam.categoryInfo.ruleVersion = BaseRegex.GetIntJson(ref getCatDataRst, "ruleVersion"); + foreach (var cateId in aiCateIdLst) + { + wxCateAuthParam.categoryInfo.categories.Add(new WXCateId() { id = cateId }); + } + try + { + if (!JsonHelper.JObjectParse(getCatDataRst)["reuseApplyData"].IsJTokenNullOrEmpty()) + { + var jlicenseGroupList = JsonHelper.JObjectParse(getCatDataRst)["reuseApplyData"]["catInfo"]["licenseGroupList"]; + var licenseGroupListStr = JsonHelper.SerializeObject(jlicenseGroupList); + wxCateAuthParam.categoryInfo.licenseGroupList = JsonHelper.DeserializeJsonToList(licenseGroupListStr); + } + else + { + var licenseGroup = new licenseGroup(); + wxCateAuthParam.categoryInfo.licenseGroupList.Add(licenseGroup); + licenseGroup.license.licenseId = "4"; + var cosIdList = "[" + BaseRegex.GetMatchRegexString(ref getCatDataRst, "\"cosIdList\":\\[([\\s\\S]*?)\\]") + "]"; + licenseGroup.license.cosIdList = JsonHelper.DeserializeJsonToList(cosIdList); + var licenseFieldList = "[" + BaseRegex.GetMatchRegexString(ref getCatDataRst, "\"licenseFieldList\":\\[([\\s\\S]*?)\\]") + "]"; + licenseGroup.license.licenseFieldList = JsonHelper.DeserializeJsonToList(licenseFieldList); + } + var authCateRst = WXUpload.wxCateAuth(shop, aiCateIdLst, wxCateAuthParam); + if (!authCateRst.Contains("\"code\":0") && !authCateRst.Contains("\"success\":true")) + { + var error = BaseRegex.GetStringJson(ref authCateRst, "msg"); + if (string.IsNullOrEmpty(error)) + error = BaseRegex.GetStringJson(ref authCateRst, "errmsg"); + if (string.IsNullOrEmpty(error)) + error = authCateRst; + return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"类目申请失败 " + error + "\"}"; + } + Thread.Sleep(Randomx.GetId(5000, 7000)); + cateUpCheckRst = WXUpload.batchCheckCategoryRelation(shop, leafCatId); + if (!cateUpCheckRst.Contains("\"code\":0") && !cateUpCheckRst.Contains("\"success\":true")) + { + var error = BaseRegex.GetStringJson(ref cateUpCheckRst, "msg"); + if (string.IsNullOrEmpty(error)) + error = cateUpCheckRst; + return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"类目申请校验错误 " + error + "\"}"; + } + if (!cateUpCheckRst.Contains("\"result\":1")) + return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"类目申请审核中 请稍后再试\"}"; + } + catch + { + return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"类目申请失败 复用资质文件失败,请重新提交资质文件" + "\"}"; + } + //return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"类目申请失败 请手动申请资质类目" + "\"}"; + } + else + { + Thread.Sleep(Randomx.GetId(1000, 2000)); + var cateAuthorRst = WXUpload.addFinderCategoryV2(shop, leafCatId); + if (!cateAuthorRst.Contains("\"code\":0") && !cateAuthorRst.Contains("\"success\":true")) + { + var error = BaseRegex.GetStringJson(ref cateAuthorRst, "msg"); + if (string.IsNullOrEmpty(error)) + error = BaseRegex.GetStringJson(ref cateAuthorRst, "errmsg"); + if (string.IsNullOrEmpty(error)) + error = cateAuthorRst; + return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"类目申请错误 " + error + "\"}"; + } } } } + #endregion #region ai短标题 // ai获取短标题 @@ -4116,7 +4145,19 @@ namespace TemuKJD.WXForms.ProductForms //// } //// } ////} - //else + // 坚果炒货类,系统返回的试规格/净含量但是要求填规格 + if ((upProdParam.product.info?.category?.FirstOrDefault()?.name == "食品饮料" || prodInfo.detail?.cats?.FirstOrDefault() == "食品饮料") && + (upProdParam.product.info?.category?.LastOrDefault()?.name == "坚果炒货" || upProdParam.product.info?.category?.LastOrDefault()?.name == "果干")) + { + if (!prodInfo.detail.sku.FirstOrDefault().spec.Any(s => s.parent_name == "规格")) + { + foreach (var sku in prodInfo.detail.sku) + { + sku.spec.FirstOrDefault().parent_name = "规格"; + } + } + } + else { var leafCat = upProdParam.product.info.category.LastOrDefault(); if (leafCat?.catInfo?.saleAttr?.attr != null) @@ -4960,7 +5001,7 @@ namespace TemuKJD.WXForms.ProductForms foreach (var propParam in upProdParam.product.info.param) { - if (propParam.categorys[0].name.Contains("食品名称")) + if (propParam.categorys[0].name.Contains("食品名称") && !propParam.categorys[1].name.Contains("见包装") && !propParam.categorys[1].name.Contains("见外包装")) foodName = "食品名称:" + propParam.categorys[1].name; else if (propParam.categorys[0].name.Contains("生产企业名称") && !propParam.categorys[1].name.Contains("见包装") && !propParam.categorys[1].name.Contains("见外包装")) companyName = "生产商名称:" + propParam.categorys[1].name; @@ -7068,11 +7109,21 @@ Content-Type: image/jpeg return result; } - public static string getCategoryOnShelf(ShopLoginInfo shop, List catIdLst) + public static string getCategoryOnShelf(ShopLoginInfo shop, List catIdLst, string brandId = "2100000000") { string url = "https://store.weixin.qq.com/shop-faas/mmchannelstradecategory/cgi/product/getCategoryOnShelfV2?token=&lang=zh_CN"; string referer = "https://store.weixin.qq.com/shop/goods/entry"; - string body = @"{""catIdList"":[" + string.Join(",", catIdLst) + @"],""brandId"":2100000000}"; + string body = @"{""catIdList"":[" + string.Join(",", catIdLst) + @"],""brandId"":" + brandId + "}"; + var result = WXHttpResponseBLL.WeiXinPostResponse(shop, url, body, referer); + return result; + } + + public static string getMixBrand(ShopLoginInfo shop, string catId = "547591") + { + //{"code":0,"brandRequire":1,"bizuinBrandList":[{"brandId":"10914219","chName":"名圣","enName":"","classificationNo":"14","tradeMarkSymbol":1,"registerDetails":{"registrant":"广州哇晓商贸有限责任公司","registerNo":"88879184","startTime":"1786254874","endTime":"2098915200","isPermanent":false},"applicationDetails":{},"grantType":2,"grantDetails":{"grantCertifications":["1786181562555-oRVwX2XGcQYT_YI7RbfnMdcXF3Cs-1512"],"grantLevel":"1","startTime":"0","endTime":"1820332800","isPermanent":false,"brandOwnerType":2},"status":3,"createTime":"1786254883","updateTime":"1786359925","auditInfo":{"auditId":"11736892187","auditStatus":3,"auditTimestamp":1786359925,"submitTimestamp":1786254882},"version":1,"outsideShopType":0,"outsideShopNikename":"","isNewApply":1,"specialQualification":["1786181592374-oRVwX2XGcQYT_YI7RbfnMdcXF3Cs-3202"],"innerBrand":{"id":"10914219","name":"名圣","cnName":"名圣","enName":"","group":0,"certificateNumber":"88879184","status":0,"disableScene":0,"brandStoreName":"","brandLevel":1,"remark":"","brandLevelAuditStatus":2,"brandLevelAuditId":"11839403256"}},{"brandId":"10796790","chName":"嘉飞","enName":"","classificationNo":"21","tradeMarkSymbol":1,"registerDetails":{"registrant":"佛山曜叶科技有限公司","registerNo":"32799300","startTime":"1786019090","endTime":"1870732800","isPermanent":false},"applicationDetails":{},"grantType":2,"grantDetails":{"grantCertifications":["1786010853000-oRVwX2XGcQYT_YI7RbfnMdcXF3Cs-6420"],"grantLevel":"10001","startTime":"0","endTime":"1798560000","isPermanent":false,"brandOwnerType":2},"status":3,"createTime":"1786010877","updateTime":"1786019115","auditInfo":{"auditId":"11582110870","auditStatus":3,"auditTimestamp":1786019115,"submitTimestamp":1786019104},"version":3,"outsideShopType":0,"outsideShopNikename":"","isNewApply":0,"specialQualification":["1786010862808-oRVwX2XGcQYT_YI7RbfnMdcXF3Cs-7538"],"innerBrand":{"id":"10796790","name":"嘉飞","cnName":"嘉飞","enName":"","group":0,"certificateNumber":"32799300","status":0,"disableScene":0,"brandStoreName":"","brandLevel":1,"remark":"","brandLevelAuditStatus":2,"brandLevelAuditId":"8194702850"}}],"mixBrandList":[{"brandId":"10914219","chName":"名圣","enName":"","classificationNo":"14","tradeMarkSymbol":1,"registerDetails":{"registrant":"广州哇晓商贸有限责任公司","registerNo":"88879184","startTime":"1786254874","endTime":"2098915200","isPermanent":false},"applicationDetails":{},"grantType":2,"grantDetails":{"grantCertifications":["1786181562555-oRVwX2XGcQYT_YI7RbfnMdcXF3Cs-1512"],"grantLevel":"1","startTime":"0","endTime":"1820332800","isPermanent":false,"brandOwnerType":2},"status":3,"createTime":"1786254883","updateTime":"1786359925","auditInfo":{"auditId":"11736892187","auditStatus":3,"auditTimestamp":1786359925,"submitTimestamp":1786254882},"version":1,"outsideShopType":0,"outsideShopNikename":"","isNewApply":1,"specialQualification":["1786181592374-oRVwX2XGcQYT_YI7RbfnMdcXF3Cs-3202"],"innerBrand":{"id":"10914219","name":"名圣","cnName":"名圣","enName":"","group":0,"certificateNumber":"88879184","status":0,"disableScene":0,"brandStoreName":"","brandLevel":1,"remark":"","brandLevelAuditStatus":2,"brandLevelAuditId":"11839403256"}}],"categoryType":1} + string url = "https://store.weixin.qq.com/shop-faas/mmchannelstradecategory/cgi/getMixBrand?token=&lang=zh_CN"; + string referer = "https://store.weixin.qq.com/shop/goods/entry"; + string body = @"{""categoryId"":""" + catId + @"""}"; var result = WXHttpResponseBLL.WeiXinPostResponse(shop, url, body, referer); return result; }