类目识别功能 多选功能优化 微信上货优化 微信客服信息识别优化等

This commit is contained in:
wule committed 2026-02-04 11:59:58 +08:00
1 parent c27063d704
commit a2a6719a99
31 files changed
+2223 -750

No files matched your search

@@ -54,20 +54,18 @@
this.label8 = new System.Windows.Forms.Label();
this.txtNotes = new DevComponents.DotNetBar.Controls.TextBoxX();
this.btnOk = new TemuKJD.UserControls.ButtonEx();
this.pnlSkuOption = new System.Windows.Forms.Panel();
this.panel2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.pnlSkuOption.SuspendLayout();
this.SuspendLayout();
//
// panel2
//
this.panel2.BackColor = System.Drawing.Color.White;
this.panel2.Controls.Add(this.btnBookImg);
this.panel2.Controls.Add(this.btnEditDetail);
this.panel2.Controls.Add(this.btnSelect);
this.panel2.Controls.Add(this.buttonEx1);
this.panel2.Controls.Add(this.pictureBox2);
this.panel2.Controls.Add(this.label9);
this.panel2.Controls.Add(this.btnOk);
this.panel2.Controls.Add(this.pnlSkuOption);
this.panel2.Controls.Add(this.label7);
this.panel2.Controls.Add(this.txtFissionWords);
this.panel2.Controls.Add(this.txtEndWords);
@@ -85,7 +83,6 @@
this.panel2.Controls.Add(this.pictureBox1);
this.panel2.Controls.Add(this.label8);
this.panel2.Controls.Add(this.txtNotes);
this.panel2.Controls.Add(this.btnOk);
this.panel2.Dock = System.Windows.Forms.DockStyle.Fill;
this.panel2.Location = new System.Drawing.Point(1, 33);
this.panel2.Name = "panel2";
@@ -98,7 +95,7 @@
this.btnBookImg.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnBookImg.DisabledBackColor = System.Drawing.Color.Empty;
this.btnBookImg.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnBookImg.Location = new System.Drawing.Point(341, 523);
this.btnBookImg.Location = new System.Drawing.Point(332, 37);
this.btnBookImg.Name = "btnBookImg";
this.btnBookImg.Size = new System.Drawing.Size(85, 26);
this.btnBookImg.Style.Alignment = System.Drawing.StringAlignment.Center;
@@ -123,7 +120,7 @@
this.btnEditDetail.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnEditDetail.DisabledBackColor = System.Drawing.Color.Empty;
this.btnEditDetail.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnEditDetail.Location = new System.Drawing.Point(341, 491);
this.btnEditDetail.Location = new System.Drawing.Point(332, 5);
this.btnEditDetail.Name = "btnEditDetail";
this.btnEditDetail.Size = new System.Drawing.Size(85, 26);
this.btnEditDetail.Style.Alignment = System.Drawing.StringAlignment.Center;
@@ -143,13 +140,12 @@
//
// btnSelect
//
this.btnSelect.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.btnSelect.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnSelect.Cursor = System.Windows.Forms.Cursors.Hand;
this.btnSelect.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSelect.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSelect.ForeColor = System.Drawing.Color.White;
this.btnSelect.Location = new System.Drawing.Point(90, 491);
this.btnSelect.Location = new System.Drawing.Point(79, 5);
this.btnSelect.Margin = new System.Windows.Forms.Padding(2);
this.btnSelect.Name = "btnSelect";
this.btnSelect.Size = new System.Drawing.Size(70, 26);
@@ -160,13 +156,12 @@
//
// buttonEx1
//
this.buttonEx1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonEx1.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.buttonEx1.Cursor = System.Windows.Forms.Cursors.Hand;
this.buttonEx1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.buttonEx1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.buttonEx1.ForeColor = System.Drawing.Color.White;
this.buttonEx1.Location = new System.Drawing.Point(90, 600);
this.buttonEx1.Location = new System.Drawing.Point(79, 114);
this.buttonEx1.Margin = new System.Windows.Forms.Padding(2);
this.buttonEx1.Name = "buttonEx1";
this.buttonEx1.Size = new System.Drawing.Size(70, 26);
@@ -178,8 +173,7 @@
//
// pictureBox2
//
this.pictureBox2.Anchor = System.Windows.Forms.AnchorStyles.Top;
this.pictureBox2.Location = new System.Drawing.Point(165, 491);
this.pictureBox2.Location = new System.Drawing.Point(154, 5);
this.pictureBox2.Name = "pictureBox2";
this.pictureBox2.Size = new System.Drawing.Size(136, 136);
this.pictureBox2.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
@@ -190,7 +184,7 @@
// label9
//
this.label9.AutoSize = true;
this.label9.Location = new System.Drawing.Point(19, 496);
this.label9.Location = new System.Drawing.Point(8, 10);
this.label9.Name = "label9";
this.label9.Size = new System.Drawing.Size(68, 17);
this.label9.TabIndex = 404;
@@ -387,7 +381,7 @@
this.btnOk.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnOk.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnOk.ForeColor = System.Drawing.Color.White;
this.btnOk.Location = new System.Drawing.Point(387, 601);
this.btnOk.Location = new System.Drawing.Point(400, 616);
this.btnOk.Margin = new System.Windows.Forms.Padding(2);
this.btnOk.Name = "btnOk";
this.btnOk.Size = new System.Drawing.Size(55, 26);
@@ -396,6 +390,19 @@
this.btnOk.UseVisualStyleBackColor = false;
this.btnOk.Click += new System.EventHandler(this.btnOk_Click);
//
// pnlSkuOption
//
this.pnlSkuOption.Controls.Add(this.label9);
this.pnlSkuOption.Controls.Add(this.btnBookImg);
this.pnlSkuOption.Controls.Add(this.pictureBox2);
this.pnlSkuOption.Controls.Add(this.buttonEx1);
this.pnlSkuOption.Controls.Add(this.btnSelect);
this.pnlSkuOption.Controls.Add(this.btnEditDetail);
this.pnlSkuOption.Location = new System.Drawing.Point(10, 483);
this.pnlSkuOption.Name = "pnlSkuOption";
this.pnlSkuOption.Size = new System.Drawing.Size(417, 147);
this.pnlSkuOption.TabIndex = 661;
//
// PDDDBProdEditForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -412,6 +419,8 @@
this.panel2.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox2)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.pnlSkuOption.ResumeLayout(false);
this.pnlSkuOption.PerformLayout();
this.ResumeLayout(false);
}
@@ -443,5 +452,6 @@
private UserControls.ButtonEx btnSelect;
private DevComponents.DotNetBar.PanelEx btnEditDetail;
private DevComponents.DotNetBar.PanelEx btnBookImg;
public System.Windows.Forms.Panel pnlSkuOption;
}
}
@@ -64,8 +64,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
private void btnOk_Click(object sender, EventArgs e)
{
//var url = BaseClass.BuildObjString("product/mdy_product_notes");
var url = BaseClass.BuildObjString("product/mdy_db_product");
//var url = BaseClass.BuildPDDObjString("product/mdy_product_notes");
var url = BaseClass.BuildPDDObjString("product/mdy_db_product");
var data = UserLogin.GetSignaturex() +
"&db_id=" + dbProd.id + "&notes=" + this.txtNotes.Text.Trim();
data += "&product_name=" + this.txtProductName.Text.Trim();
@@ -172,7 +172,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
}
string img_md5 = BaseClass.GetMd5(imgBase64);
var url = BaseClass.BuildObjString("product/add_sku_img_replace");
var url = BaseClass.BuildPDDObjString("product/add_sku_img_replace");
var data = UserLogin.GetSignaturex() +
"&product_db_id=" + dbProd.id;
data += "&img_base64=" + imgBase64;
@@ -213,7 +213,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
imgListForm.ShowDialog();
if (imgListForm.SelectDbImgId > 0)
{
var url = BaseClass.BuildObjString("product/mdy_prod_sku_img_replace_id");
var url = BaseClass.BuildPDDObjString("product/mdy_prod_sku_img_replace_id");
var data = UserLogin.GetSignaturex() +
"&product_db_id=" + dbProd.id;
data += "&img_db_id=" + imgListForm.SelectDbImgId;
@@ -780,6 +780,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.cmbWxSafe.FormattingEnabled = true;
this.cmbWxSafe.Items.AddRange(new object[] {
"",
"安全+未校验",
"安全商品",
"违规商品",
"未校验"});
@@ -788,6 +789,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.cmbWxSafe.Name = "cmbWxSafe";
this.cmbWxSafe.Size = new System.Drawing.Size(37, 25);
this.cmbWxSafe.TabIndex = 676;
this.cmbWxSafe.Text = "安全+未校验";
//
// lblWxSafe
//
@@ -90,7 +90,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
}
if (BaseClass.MainPath != "binxixi")
{
this.dgvDbProduct.Columns["col_edit"].Visible = false;
//this.dgvDbProduct.Columns["col_edit"].Visible = false;
}
btnSelect.Visible = false;
@@ -315,7 +315,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
"&search_ext_code=" + txtExtCode.Text.Trim() +
"&search_group=" + cmbGroupFilter.Text.Trim() +
"&search_prod_name=" + txtProdName.Text.Trim() +
"&wx_safe_status=" + cmbWxSafe.Text.Trim() +
"&wx_safe_status=" + cmbWxSafe.Text.Trim().Replace("安全+未校验", "安全商品,未校验") +
"&special_prod_type=" + cmbSpProdType.Text.Trim();
if (!string.IsNullOrEmpty(cmbWxCat.Text))
{
@@ -408,7 +408,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.cmbGroupFilter.Text = "";
this.cmbSort.Text = "入库时间";
this.cmbSourceType.Text = "";
this.cmbWxSafe.Text = "";
this.cmbWxSafe.Text = "安全+未校验";
this.cmbSpProdType.Text = "";
this.cmbWxCat.Text = "";
this.cmbExportToOutServer.Text = "";
@@ -432,6 +432,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
case "详情":
case "编辑/详情":
PDDDBProdEditForm editForm = new PDDDBProdEditForm(dbProduct);
if (BaseClass.MainPath != "binxixi")
editForm.pnlSkuOption.Visible = false;
editForm.ShowDialog();
dgvDbProduct.Rows[e.RowIndex].Cells["col_notes"].Value = dbProduct.notes;
dgvDbProduct.Rows[e.RowIndex].Cells["col_ext_code"].Value = dbProduct.ext_code;
@@ -1064,18 +1066,68 @@ namespace TemuKJD.PDDForms.ProductSelectForms
var dbProd = PDDDBProdEditForm.GetPddProductDetail(prod.id.ParseToString());
var prodObj = JsonHelper.JObjectParse(dbProd.product_json);
List<string> mainImgLst = new List<string>();
List<string> mainImgLst3 = new List<string>();
if (!prodObj["jstProd"].IsJTokenNullOrEmpty())
{
var jstProd = JsonHelper.DeserializeJsonToObject<JSTListProductInfo>(JsonHelper.SerializeObject(prodObj["jstProd"]));
mainImgLst = jstProd.itemMainImage.Take(3).ToList();
foreach (var img in mainImgLst)
mainImgLst3 = jstProd.itemMainImage.Take(3).ToList();
bool is404 = false;
foreach (var img in mainImgLst3)
{
// 盗链识别
var urlImg = BaseClass.BuildPDDObjString("product/wx_api_upload_image");
var upDate = UserLogin.GetSignaturex();
upDate += "&token=" + token.accessToken;
upDate += "&post_data=" + GetHtml.UrlEncodeUtf8("{\"img_url\":\"" + img + "\"}");
var upDateRst = GetHtml.PostUtf8(urlImg, upDate);
for (int i = 0; i < 20 && upDateRst.Contains("access_token expired"); i++)
{
token.mdyTime = DateTime.Now.AddDays(-100);
token = new WxApiBLL().GetRandomWxToken();
upDateRst = GetHtml.PostUtf8(urlImg, upDate);
}
if (upDateRst.Contains("原图url打开返回404"))
{
string in_db_ids = dbProd.id.ParseToString();
var url = BaseClass.BuildPDDObjString("product/mdy_db_product");
var data = UserLogin.GetSignaturex() +
"&in_db_ids=" + in_db_ids + "&wx_safe_status=违规商品";
if (dbProd.notes.IsNullOrEmpty())
data += "&notes=商品图片链接失效";
var html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
html = GetHtml.PostUtf8(url, data);
}
// 上传图片识别
if (upDateRst.Contains("图片格式不合法"))
{
string errMsg = "";
var imgBase64 = WXForms.ProductForms.WXDBProdUploadForm.GetImgBase64ForApi(out errMsg, img, false, false);
if (!string.IsNullOrEmpty(errMsg))
{
//break;
}
urlImg = BaseClass.BuildPDDObjString("product/wx_api_upload_image");
upDate = UserLogin.GetSignaturex();
upDate += "&token=" + token.accessToken;
//upDate += "&is_file=true";
//if (needAddRandomBlock || wantAddRandomBlock)
// upDate += "&random_code=true";
upDate += "&img_url=" + img;
upDate += "&img_base64=" + imgBase64;
upDateRst = GetHtml.PostUtf8(urlImg, upDate);
for (int i = 0; i < 20 && upDateRst.Contains("access_token expired"); i++)
{
token.mdyTime = DateTime.Now.AddDays(-100);
token = new WxApiBLL().GetRandomWxToken();
upDateRst = GetHtml.PostUtf8(urlImg, upDate);
}
}
var upImgUrl = BaseRegex.GetStringJson(ref upDateRst, "img_url");
(obj["head_imgs"] as JArray).Add(upImgUrl);
}
@@ -1156,6 +1208,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
if (row != null)
{
string catName = dbProd.cat_name;
string mainCatName = dbProd.main_cat_name ?? prod.main_cat_id;
if (dbProd.wx_cat_leaf != null)
{
var catN = GlobalConfig.WxCatList.FirstOrDefault(c => c.cat_id == dbProd.wx_cat_leaf.ParseToString())?.name;
@@ -1180,16 +1233,18 @@ namespace TemuKJD.PDDForms.ProductSelectForms
catName = catN + " >> " + catName;
}
}
if (prod.wx_cat_1 != null)
if (dbProd.wx_cat_1 != null)
{
var catN = GlobalConfig.WxCatList.FirstOrDefault(c => c.cat_id == dbProd.wx_cat_1.ParseToString())?.name;
if (!string.IsNullOrEmpty(catN))
{
catName = catN + " >> " + catName;
mainCatName = catN;
}
}
Invoke(new Action(() =>
{
row.Cells["colMainCate"].Value = mainCatName;
row.Cells["col_cat_name"].Value = catName;
}));
}