微信app采集

This commit is contained in:
wule committed 2026-03-26 21:34:59 +08:00
1 parent 52220daa8b
commit 2f61dc1cdd
67 files changed
+6197 -1118

No files matched your search

@@ -247,18 +247,24 @@ namespace TemuKJD.PDDForms.ProductSelectForms
{
canEdit = false;
string convertRst = "";
var ob = new PDDProdFormConverter().JstPddProdToPddConvert(out convertRst, dbProd);
var pInfo = new PDDProdFormConverter().JstPddProdToPddConvert(out convertRst, dbProd);
if (!string.IsNullOrEmpty(convertRst))
{
BaseMsgForm.ShowError("商品结构获取失败 " + convertRst);
return;
}
string exportData = dbProd.product_json;
var address = Path.Combine("D:\\", dbProd.spu_id + ".txt");
using (StreamWriter sw = new StreamWriter(Path.Combine("D:\\", dbProd.spu_id + ".txt"), false, Encoding.UTF8))
{
sw.Write(exportData);
}
}
if (dbProd.product_get_type_text == "微信店采")
{
canEdit = false;
string convertRst = "";
var ob = new PDDProdFormConverter().WXProdToPddConvert(out convertRst, dbProd);
var pInfo = new PDDProdFormConverter().WXProdToPddConvert(out convertRst, dbProd);
if (!string.IsNullOrEmpty(convertRst))
{
BaseMsgForm.ShowError("商品结构获取失败");
@@ -269,13 +275,26 @@ namespace TemuKJD.PDDForms.ProductSelectForms
{
canEdit = false;
string convertRst = "";
var ob = new PDDProdFormConverter()._1688ClientToPddConvert(out convertRst, dbProd);
var pInfo = new PDDProdFormConverter()._1688ClientToPddConvert(out convertRst, dbProd);
if (!string.IsNullOrEmpty(convertRst))
{
BaseMsgForm.ShowError("商品结构获取失败");
return;
}
}
#region 微信小店app
if (dbProd.product_get_type_text == "微信小店")
{
canEdit = false;
string convertRst = "";
var pInfo = new PDDProdFormConverter().WXClientToPddConvert(out convertRst, dbProd);
if (!string.IsNullOrEmpty(convertRst))
{
BaseMsgForm.ShowError("商品结构获取失败");
return;
}
}
#endregion
PDDDBProdEditDetailForm editDetailForm = new PDDDBProdEditDetailForm(this.dbProd);
if (!canEdit)
@@ -113,8 +113,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.chkPullAfterPush = new TemuKJD.UserComponent.UcCheckBox(this.components);
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.panelEx1 = new DevComponents.DotNetBar.PanelEx();
this.cmbSpProdType = new System.Windows.Forms.ComboBox();
this.btnGetAllCate = new DevComponents.DotNetBar.PanelEx();
this.cmbSpProdType = new System.Windows.Forms.ComboBox();
this.pnlEditExtCodePrice = new System.Windows.Forms.Panel();
this.lblExtCode = new System.Windows.Forms.Label();
this.panel2 = new System.Windows.Forms.Panel();
@@ -728,6 +728,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
"",
"厂商直采",
"1688厂家",
"微信小店",
"微信店采",
"母店采集",
"机会商品",
@@ -1167,8 +1168,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
// splitContainer2.Panel1
//
this.splitContainer2.Panel1.Controls.Add(this.panelEx1);
this.splitContainer2.Panel1.Controls.Add(this.cmbSpProdType);
this.splitContainer2.Panel1.Controls.Add(this.btnGetAllCate);
this.splitContainer2.Panel1.Controls.Add(this.cmbSpProdType);
this.splitContainer2.Panel1.Controls.Add(this.pnlEditExtCodePrice);
this.splitContainer2.Panel1.Controls.Add(this.pbLoading);
this.splitContainer2.Panel1.Controls.Add(this.btnSelect);
@@ -1190,7 +1191,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.panelEx1.Cursor = System.Windows.Forms.Cursors.Hand;
this.panelEx1.DisabledBackColor = System.Drawing.Color.Empty;
this.panelEx1.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.panelEx1.Location = new System.Drawing.Point(119, 33);
this.panelEx1.Location = new System.Drawing.Point(111, 33);
this.panelEx1.Name = "panelEx1";
this.panelEx1.Size = new System.Drawing.Size(121, 25);
this.panelEx1.Style.Alignment = System.Drawing.StringAlignment.Center;
@@ -1209,21 +1210,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.panelEx1.Visible = false;
this.panelEx1.Click += new System.EventHandler(this.btnCatBound_Click);
//
// cmbSpProdType
//
this.cmbSpProdType.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.cmbSpProdType.FormattingEnabled = true;
this.cmbSpProdType.Items.AddRange(new object[] {
"",
"普通商品",
"书籍"});
this.cmbSpProdType.Location = new System.Drawing.Point(82, 75);
this.cmbSpProdType.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.cmbSpProdType.Name = "cmbSpProdType";
this.cmbSpProdType.Size = new System.Drawing.Size(37, 25);
this.cmbSpProdType.TabIndex = 677;
this.cmbSpProdType.Visible = false;
//
// btnGetAllCate
//
this.btnGetAllCate.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
@@ -1246,8 +1232,24 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.btnGetAllCate.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnGetAllCate.TabIndex = 777;
this.btnGetAllCate.Text = "取微信全类目";
this.btnGetAllCate.Visible = false;
this.btnGetAllCate.Click += new System.EventHandler(this.btnGetAllCate_Click);
//
// cmbSpProdType
//
this.cmbSpProdType.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.cmbSpProdType.FormattingEnabled = true;
this.cmbSpProdType.Items.AddRange(new object[] {
"",
"普通商品",
"书籍"});
this.cmbSpProdType.Location = new System.Drawing.Point(82, 75);
this.cmbSpProdType.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.cmbSpProdType.Name = "cmbSpProdType";
this.cmbSpProdType.Size = new System.Drawing.Size(37, 25);
this.cmbSpProdType.TabIndex = 677;
this.cmbSpProdType.Visible = false;
//
// pnlEditExtCodePrice
//
this.pnlEditExtCodePrice.Anchor = System.Windows.Forms.AnchorStyles.None;
@@ -2,6 +2,7 @@
using AllBase.Helper;
using AllBase.Model.Param;
using AllBase.Model.Result;
using AllBase.Model.Result._1688;
using AllBase.Model.Result.PDDResult;
using AllBase.Model.Result.WXResult;
using NaiBa.Util;
@@ -25,6 +26,7 @@ using TemuKJD.BaseForms;
using TemuKJD.BLL;
using TemuKJD.Extension;
using TemuKJD.ToolForms;
using TemuKJD.WXForms.ProductForms;
using Work;
namespace TemuKJD.PDDForms.ProductSelectForms
@@ -1231,46 +1233,117 @@ namespace TemuKJD.PDDForms.ProductSelectForms
obj["head_imgs"] = new JArray();
var dbProd = PDDDBProdEditForm.GetPddProductDetail(prod.id.ParseToString());
var prodObj = JsonHelper.JObjectParse(dbProd.product_json);
List<string> mainImgLst3 = new List<string>();
if (dbProd.product_get_type_text == "厂商直采" && !prodObj["jstProd"].IsJTokenNullOrEmpty())
string productTitle = "";
if (dbProd.product_get_type_text == "厂商直采" || dbProd.product_get_type_text == "1688厂家" || dbProd.product_get_type_text == "微信小店")
{
var jstProd = JsonHelper.DeserializeJsonToObject<JSTListProductInfo>(JsonHelper.SerializeObject(prodObj["jstProd"]));
mainImgLst3 = jstProd.itemMainImage.Take(3).ToList();
bool is404 = false;
if (dbProd.product_get_type_text == "微信小店" && dbProd.wx_cat_leaf != null)
{
List<WxCatInfo> catInfoLst = new List<WxCatInfo>();
var cat = GlobalConfig.WxCatList.FirstOrDefault(c => c.cat_id == dbProd.wx_cat_leaf.ParseToString());
while(cat != null)
{
catInfoLst.Add(cat);
if (cat.level == 0)
break;
cat = GlobalConfig.WxCatList.FirstOrDefault(c => c.cat_id == cat.f_cat_id);
}
foreach (WxCatInfo wxCat in catInfoLst)
{
if (wxCat.level == 1)
{
dbProd.wx_cat_1 = wxCat.cat_id.ParseToLong();
dbProd.main_cat_id = wxCat.cat_id;
dbProd.main_cat_name = wxCat.name;
}
if (wxCat.level == 2)
{
dbProd.wx_cat_2 = wxCat.cat_id.ParseToLong();
}
if (wxCat.level == 3)
{
dbProd.wx_cat_3 = wxCat.cat_id.ParseToLong();
}
if (wxCat.leaf)
{
dbProd.wx_cat_leaf = wxCat.cat_id.ParseToLong();
dbProd.cat_id = wxCat.cat_id;
dbProd.cat_name = wxCat.name;
}
}
if (dbProd.wx_cat_1 != null && dbProd.wx_cat_leaf != null && catInfoLst.Any(c => c.cat_id == dbProd.wx_cat_1.ParseToString()))
{
goto mdyWxCat;
}
}
#region 非微信数据使用图片+标题识别类目
if (dbProd.product_get_type_text == "厂商直采")
{
var prodObj = JsonHelper.JObjectParse(dbProd.product_json);
var jstProd = JsonHelper.DeserializeJsonToObject<JSTListProductInfo>(JsonHelper.SerializeObject(prodObj["jstProd"]));
mainImgLst3 = jstProd.itemMainImage.Take(3).ToList();
productTitle = jstProd.itemName;
}
if (dbProd.product_get_type_text == "1688厂家")
{
var prod_json = dbProd.product_json;
var _1688Json = BaseRegex.GetOneJsonObjStrJson(ref prod_json, "_1688DetailData");
_1688ClientProductInfo _1688ClentProdInfo = JsonHelper.DeserializeJsonToObject<_1688ClientProductInfo>(_1688Json);
mainImgLst3 = _1688ClentProdInfo.mainImage.Take(3).ToList();
productTitle = _1688ClentProdInfo.offerDetail.subject.IsNullOrEmpty() ? _1688ClentProdInfo.tempModel.offerTitle : _1688ClentProdInfo.offerDetail.subject;
}
if (dbProd.product_get_type_text == "微信小店")
{
var wxxdData = JsonHelper.SerializeObject(JsonHelper.JObjectParse(dbProd.product_json)["wxxdData"]);
WXClientProductInfoLite wxClientProdInfo = JsonHelper.DeserializeJsonToObject<WXClientProductInfoLite>(wxxdData);
mainImgLst3 = wxClientProdInfo.info.head_img.Take(3).ToList();
productTitle = wxClientProdInfo.info.title;
}
//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);
var upDateRst = "";
for (int i = 0; i < 20 && upDateRst.Contains("access_token expired"); i++)
if (!img.Contains("wst.wxapp.tc.qq.com"))
{
token.mdyTime = DateTime.Now.AddDays(-100);
token = new WxApiBLL().GetRandomWxToken();
upDate += "&token=" + token.accessToken;
upDate += "&post_data=" + GetHtml.UrlEncodeUtf8("{\"img_url\":\"" + img.Replace("https://", "http://") + "\"}");
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);
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("图片格式不合法") || upDateRst.Contains("文件大小超出限制"))
if (img.Contains("wst.wxapp.tc.qq.com") || upDateRst.Contains("图片URL非法") || upDateRst.Contains("图片格式不合法") || upDateRst.Contains("文件大小超出限制"))
{
string errMsg = "";
var imgBase64 = WXForms.ProductForms.WXDBProdUploadForm.GetImgBase64ForApi(out errMsg, img, false, false, 800, 800);
var imgBase64 = WXDBProdUploadForm.GetImgBase64ForApi(out errMsg, img, false, false, 800, 800);
if (!string.IsNullOrEmpty(errMsg))
{
//break;
@@ -1302,7 +1375,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//}
}
obj["title"] = jstProd.itemName;
obj["title"] = productTitle;
string post_data = JsonHelper.SerializeObject(obj);
var url1 = BaseClass.BuildPDDObjString("product/wx_api_category_classify");
@@ -1344,9 +1417,12 @@ namespace TemuKJD.PDDForms.ProductSelectForms
dbProd.cat_name = GlobalConfig.WxCatList.FirstOrDefault(c => c.cat_id == dbProd.wx_cat_leaf.ParseToString()).name;
}
}
#endregion
}
if (dbProd.product_get_type_text == "厂商直采" && dbProd.wx_cat_1 != null && dbProd.wx_cat_leaf != null)
mdyWxCat:
if ((dbProd.product_get_type_text == "厂商直采" || dbProd.product_get_type_text == "1688厂家" || dbProd.product_get_type_text == "微信小店")
&& dbProd.wx_cat_1 != null && dbProd.wx_cat_leaf != null)
{
var row = dgvDbProduct.Rows.Cast<DataGridViewRow>().FirstOrDefault(r => r.Cells["col_spu_id"].Value.ParseToString() == dbProd.spu_id);
@@ -1362,6 +1438,14 @@ namespace TemuKJD.PDDForms.ProductSelectForms
"&cat_name=" + HttpUtility.UrlEncode(dbProd.cat_name, Encoding.UTF8) +
"&main_cat_id=" + dbProd.main_cat_id +
"&main_cat_name=" + HttpUtility.UrlEncode(dbProd.main_cat_name, Encoding.UTF8);
//// 临时将详细数据的销量赋值给列表并保存
//if (dbProd.product_get_type_text == "微信小店")
//{
// var wxxdData = JsonHelper.SerializeObject(JsonHelper.JObjectParse(dbProd.product_json)["wxxdData"]);
// WXClientProductInfoLite wxClientProdInfo = JsonHelper.DeserializeJsonToObject<WXClientProductInfoLite>(wxxdData);
// data += "&sale_count=" + wxClientProdInfo.info.total_sold_num +
// "&sale_count_text=" + wxClientProdInfo.info.total_sold_num;
//}
var html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
html = GetHtml.PostUtf8(url, data);
@@ -30,12 +30,12 @@ namespace TemuKJD.PDDForms.ProductSelectForms
private void InitializeComponent()
{
this.components = new System.ComponentModel.Container();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle7 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle8 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle9 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle10 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle11 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle12 = 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();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.ucGroupBoxEx2 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components);
this.label7 = new System.Windows.Forms.Label();
@@ -88,10 +88,16 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.chkLowPriceSku = new TemuKJD.UserComponent.UcCheckBox(this.components);
this.lblLowPriceSkuImg = new System.Windows.Forms.Label();
this.ucGroupBoxEx4 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components);
this.chkSkipQualification = new TemuKJD.UserComponent.UcCheckBox(this.components);
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.cmbSourceType = new System.Windows.Forms.ComboBox();
this.label8 = new System.Windows.Forms.Label();
this.btnClearFilter = new DevComponents.DotNetBar.PanelEx();
this.txtAddCount = new System.Windows.Forms.TextBox();
this.txtIdFilter = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.cmbCateFilter = new System.Windows.Forms.ComboBox();
this.panelEx2 = new DevComponents.DotNetBar.PanelEx();
this.label2 = new System.Windows.Forms.Label();
this.cmbGroupFilter = new System.Windows.Forms.ComboBox();
this.label20 = new System.Windows.Forms.Label();
@@ -99,8 +105,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.btnClearUpload = new DevComponents.DotNetBar.PanelEx();
this.lblWaitToUp = new System.Windows.Forms.Label();
this.lblGoodsCount = new System.Windows.Forms.Label();
this.txtAddCount = new System.Windows.Forms.TextBox();
this.panelEx2 = new DevComponents.DotNetBar.PanelEx();
this.label16 = new System.Windows.Forms.Label();
this.ucGroupBoxEx1 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components);
this.btnRefreshShop = new DevComponents.DotNetBar.PanelEx();
@@ -148,8 +152,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.btnClear = new DevComponents.DotNetBar.PanelEx();
this.panelEx1 = new DevComponents.DotNetBar.PanelEx();
this.panel1 = new System.Windows.Forms.Panel();
this.cmbSourceType = new System.Windows.Forms.ComboBox();
this.label8 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
@@ -161,6 +163,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.panel3.SuspendLayout();
this.fPnlPriceRule.SuspendLayout();
this.ucGroupBoxEx4.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.ucGroupBoxEx1.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).BeginInit();
this.splitContainer3.Panel1.SuspendLayout();
@@ -929,12 +932,16 @@ namespace TemuKJD.PDDForms.ProductSelectForms
| System.Windows.Forms.AnchorStyles.Left)));
this.ucGroupBoxEx4.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.ucGroupBoxEx4.BorderStyle = TemuKJD.UserComponent.UcGroupBoxEx.GroupBoxBorderStyle.ROUND;
this.ucGroupBoxEx4.Controls.Add(this.chkSkipQualification);
this.ucGroupBoxEx4.Controls.Add(this.pictureBox1);
this.ucGroupBoxEx4.Controls.Add(this.cmbSourceType);
this.ucGroupBoxEx4.Controls.Add(this.label8);
this.ucGroupBoxEx4.Controls.Add(this.btnClearFilter);
this.ucGroupBoxEx4.Controls.Add(this.txtAddCount);
this.ucGroupBoxEx4.Controls.Add(this.txtIdFilter);
this.ucGroupBoxEx4.Controls.Add(this.label1);
this.ucGroupBoxEx4.Controls.Add(this.cmbCateFilter);
this.ucGroupBoxEx4.Controls.Add(this.panelEx2);
this.ucGroupBoxEx4.Controls.Add(this.label2);
this.ucGroupBoxEx4.Controls.Add(this.cmbGroupFilter);
this.ucGroupBoxEx4.Controls.Add(this.label20);
@@ -942,8 +949,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.ucGroupBoxEx4.Controls.Add(this.btnClearUpload);
this.ucGroupBoxEx4.Controls.Add(this.lblWaitToUp);
this.ucGroupBoxEx4.Controls.Add(this.lblGoodsCount);
this.ucGroupBoxEx4.Controls.Add(this.txtAddCount);
this.ucGroupBoxEx4.Controls.Add(this.panelEx2);
this.ucGroupBoxEx4.Controls.Add(this.label16);
this.ucGroupBoxEx4.Location = new System.Drawing.Point(147, 2);
this.ucGroupBoxEx4.Name = "ucGroupBoxEx4";
@@ -952,16 +957,65 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.ucGroupBoxEx4.TabStop = false;
this.ucGroupBoxEx4.Text = "待传商品";
//
// chkSkipQualification
//
this.chkSkipQualification.Checked = true;
this.chkSkipQualification.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkSkipQualification.Location = new System.Drawing.Point(159, 76);
this.chkSkipQualification.Name = "chkSkipQualification";
this.chkSkipQualification.Size = new System.Drawing.Size(87, 21);
this.chkSkipQualification.TabIndex = 807;
this.chkSkipQualification.Text = "跳过资质商品";
this.chkSkipQualification.UseVisualStyleBackColor = true;
this.chkSkipQualification.Visible = false;
//
// pictureBox1
//
this.pictureBox1.Anchor = System.Windows.Forms.AnchorStyles.None;
this.pictureBox1.Image = global::TemuKJD.Properties.Resources.loading_blue;
this.pictureBox1.Location = new System.Drawing.Point(9, 106);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(24, 24);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage;
this.pictureBox1.TabIndex = 681;
this.pictureBox1.TabStop = false;
this.pictureBox1.Visible = false;
this.pictureBox1.Click += new System.EventHandler(this.pictureBox1_Click);
//
// cmbSourceType
//
this.cmbSourceType.FormattingEnabled = true;
this.cmbSourceType.Items.AddRange(new object[] {
"",
"厂商直采",
"母店采集",
"机会商品",
"外部数据"});
this.cmbSourceType.Location = new System.Drawing.Point(37, 74);
this.cmbSourceType.Name = "cmbSourceType";
this.cmbSourceType.Size = new System.Drawing.Size(92, 25);
this.cmbSourceType.TabIndex = 671;
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(8, 78);
this.label8.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(32, 17);
this.label8.TabIndex = 670;
this.label8.Text = "来源";
//
// btnClearFilter
//
this.btnClearFilter.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnClearFilter.CanvasColor = System.Drawing.SystemColors.Control;
this.btnClearFilter.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnClearFilter.DisabledBackColor = System.Drawing.Color.Empty;
this.btnClearFilter.Location = new System.Drawing.Point(254, 23);
this.btnClearFilter.Location = new System.Drawing.Point(254, 18);
this.btnClearFilter.Margin = new System.Windows.Forms.Padding(4, 2, 2, 2);
this.btnClearFilter.Name = "btnClearFilter";
this.btnClearFilter.Size = new System.Drawing.Size(48, 51);
this.btnClearFilter.Size = new System.Drawing.Size(48, 37);
this.btnClearFilter.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnClearFilter.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
this.btnClearFilter.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
@@ -978,9 +1032,18 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.btnClearFilter.Text = "清除\r\n筛选";
this.btnClearFilter.Click += new System.EventHandler(this.btnClearFilter_Click);
//
// txtAddCount
//
this.txtAddCount.Location = new System.Drawing.Point(172, 105);
this.txtAddCount.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2);
this.txtAddCount.Name = "txtAddCount";
this.txtAddCount.Size = new System.Drawing.Size(35, 23);
this.txtAddCount.TabIndex = 536;
this.txtAddCount.Text = "500";
//
// txtIdFilter
//
this.txtIdFilter.Location = new System.Drawing.Point(158, 51);
this.txtIdFilter.Location = new System.Drawing.Point(158, 47);
this.txtIdFilter.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2);
this.txtIdFilter.Name = "txtIdFilter";
this.txtIdFilter.Size = new System.Drawing.Size(92, 23);
@@ -989,7 +1052,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(130, 54);
this.label1.Location = new System.Drawing.Point(130, 50);
this.label1.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(32, 17);
@@ -999,114 +1062,18 @@ namespace TemuKJD.PDDForms.ProductSelectForms
// cmbCateFilter
//
this.cmbCateFilter.FormattingEnabled = true;
this.cmbCateFilter.Location = new System.Drawing.Point(158, 22);
this.cmbCateFilter.Location = new System.Drawing.Point(158, 18);
this.cmbCateFilter.Name = "cmbCateFilter";
this.cmbCateFilter.Size = new System.Drawing.Size(92, 25);
this.cmbCateFilter.TabIndex = 663;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(130, 26);
this.label2.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(32, 17);
this.label2.TabIndex = 662;
this.label2.Text = "类目";
//
// cmbGroupFilter
//
this.cmbGroupFilter.FormattingEnabled = true;
this.cmbGroupFilter.Location = new System.Drawing.Point(37, 22);
this.cmbGroupFilter.Name = "cmbGroupFilter";
this.cmbGroupFilter.Size = new System.Drawing.Size(92, 25);
this.cmbGroupFilter.TabIndex = 641;
//
// label20
//
this.label20.AutoSize = true;
this.label20.Location = new System.Drawing.Point(8, 25);
this.label20.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.label20.Name = "label20";
this.label20.Size = new System.Drawing.Size(32, 17);
this.label20.TabIndex = 570;
this.label20.Text = "分组";
//
// txtExtCodeFilter
//
this.txtExtCodeFilter.Location = new System.Drawing.Point(37, 51);
this.txtExtCodeFilter.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2);
this.txtExtCodeFilter.Name = "txtExtCodeFilter";
this.txtExtCodeFilter.Size = new System.Drawing.Size(92, 23);
this.txtExtCodeFilter.TabIndex = 555;
//
// btnClearUpload
//
this.btnClearUpload.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnClearUpload.CanvasColor = System.Drawing.SystemColors.Control;
this.btnClearUpload.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnClearUpload.DisabledBackColor = System.Drawing.Color.Empty;
this.btnClearUpload.Location = new System.Drawing.Point(242, 107);
this.btnClearUpload.Margin = new System.Windows.Forms.Padding(4, 2, 2, 2);
this.btnClearUpload.Name = "btnClearUpload";
this.btnClearUpload.Size = new System.Drawing.Size(60, 23);
this.btnClearUpload.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnClearUpload.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
this.btnClearUpload.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
this.btnClearUpload.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
this.btnClearUpload.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnClearUpload.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
this.btnClearUpload.Style.GradientAngle = 90;
this.btnClearUpload.StyleMouseDown.Alignment = System.Drawing.StringAlignment.Center;
this.btnClearUpload.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnClearUpload.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnClearUpload.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnClearUpload.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White;
this.btnClearUpload.TabIndex = 548;
this.btnClearUpload.Text = "清空待传";
this.btnClearUpload.Click += new System.EventHandler(this.btnClearUpload_Click);
//
// lblWaitToUp
//
this.lblWaitToUp.AutoSize = true;
this.lblWaitToUp.Cursor = System.Windows.Forms.Cursors.Hand;
this.lblWaitToUp.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Underline, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblWaitToUp.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.lblWaitToUp.Location = new System.Drawing.Point(132, 110);
this.lblWaitToUp.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.lblWaitToUp.Name = "lblWaitToUp";
this.lblWaitToUp.Size = new System.Drawing.Size(71, 17);
this.lblWaitToUp.TabIndex = 541;
this.lblWaitToUp.Text = "待上传 0 件";
this.lblWaitToUp.Click += new System.EventHandler(this.lblWaitToUp_Click);
//
// lblGoodsCount
//
this.lblGoodsCount.AutoSize = true;
this.lblGoodsCount.Location = new System.Drawing.Point(9, 110);
this.lblGoodsCount.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.lblGoodsCount.Name = "lblGoodsCount";
this.lblGoodsCount.Size = new System.Drawing.Size(71, 17);
this.lblGoodsCount.TabIndex = 537;
this.lblGoodsCount.Text = "产品库 0 件";
this.lblGoodsCount.Click += new System.EventHandler(this.lblGoodsCount_Click);
//
// txtAddCount
//
this.txtAddCount.Location = new System.Drawing.Point(158, 79);
this.txtAddCount.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2);
this.txtAddCount.Name = "txtAddCount";
this.txtAddCount.Size = new System.Drawing.Size(47, 23);
this.txtAddCount.TabIndex = 536;
this.txtAddCount.Text = "500";
//
// panelEx2
//
this.panelEx2.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.panelEx2.Cursor = System.Windows.Forms.Cursors.Hand;
this.panelEx2.DisabledBackColor = System.Drawing.Color.Empty;
this.panelEx2.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.panelEx2.Location = new System.Drawing.Point(209, 79);
this.panelEx2.Location = new System.Drawing.Point(209, 105);
this.panelEx2.Name = "panelEx2";
this.panelEx2.Size = new System.Drawing.Size(93, 23);
this.panelEx2.Style.Alignment = System.Drawing.StringAlignment.Center;
@@ -1124,10 +1091,97 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.panelEx2.Text = "随机添加商品";
this.panelEx2.Click += new System.EventHandler(this.btnRandomAdd_Click);
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(130, 22);
this.label2.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(32, 17);
this.label2.TabIndex = 662;
this.label2.Text = "类目";
//
// cmbGroupFilter
//
this.cmbGroupFilter.FormattingEnabled = true;
this.cmbGroupFilter.Location = new System.Drawing.Point(37, 18);
this.cmbGroupFilter.Name = "cmbGroupFilter";
this.cmbGroupFilter.Size = new System.Drawing.Size(92, 25);
this.cmbGroupFilter.TabIndex = 641;
//
// label20
//
this.label20.AutoSize = true;
this.label20.Location = new System.Drawing.Point(8, 21);
this.label20.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.label20.Name = "label20";
this.label20.Size = new System.Drawing.Size(32, 17);
this.label20.TabIndex = 570;
this.label20.Text = "分组";
//
// txtExtCodeFilter
//
this.txtExtCodeFilter.Location = new System.Drawing.Point(37, 47);
this.txtExtCodeFilter.Margin = new System.Windows.Forms.Padding(0, 2, 0, 2);
this.txtExtCodeFilter.Name = "txtExtCodeFilter";
this.txtExtCodeFilter.Size = new System.Drawing.Size(92, 23);
this.txtExtCodeFilter.TabIndex = 555;
//
// btnClearUpload
//
this.btnClearUpload.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.btnClearUpload.CanvasColor = System.Drawing.SystemColors.Control;
this.btnClearUpload.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.btnClearUpload.DisabledBackColor = System.Drawing.Color.Empty;
this.btnClearUpload.Location = new System.Drawing.Point(254, 59);
this.btnClearUpload.Margin = new System.Windows.Forms.Padding(4, 2, 2, 2);
this.btnClearUpload.Name = "btnClearUpload";
this.btnClearUpload.Size = new System.Drawing.Size(48, 37);
this.btnClearUpload.Style.Alignment = System.Drawing.StringAlignment.Center;
this.btnClearUpload.Style.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
this.btnClearUpload.Style.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(185)))), ((int)(((byte)(215)))), ((int)(((byte)(255)))));
this.btnClearUpload.Style.Border = DevComponents.DotNetBar.eBorderType.SingleLine;
this.btnClearUpload.Style.BorderColor.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnClearUpload.Style.ForeColor.ColorSchemePart = DevComponents.DotNetBar.eColorSchemePart.PanelText;
this.btnClearUpload.Style.GradientAngle = 90;
this.btnClearUpload.StyleMouseDown.Alignment = System.Drawing.StringAlignment.Center;
this.btnClearUpload.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.btnClearUpload.StyleMouseOver.BackColor1.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnClearUpload.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.btnClearUpload.StyleMouseOver.ForeColor.Color = System.Drawing.Color.White;
this.btnClearUpload.TabIndex = 548;
this.btnClearUpload.Text = "清空\r\n待传";
this.btnClearUpload.Click += new System.EventHandler(this.btnClearUpload_Click);
//
// lblWaitToUp
//
this.lblWaitToUp.AutoSize = true;
this.lblWaitToUp.Cursor = System.Windows.Forms.Cursors.Hand;
this.lblWaitToUp.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Underline, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.lblWaitToUp.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.lblWaitToUp.Location = new System.Drawing.Point(35, 118);
this.lblWaitToUp.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.lblWaitToUp.Name = "lblWaitToUp";
this.lblWaitToUp.Size = new System.Drawing.Size(71, 17);
this.lblWaitToUp.TabIndex = 541;
this.lblWaitToUp.Text = "待上传 0 件";
this.lblWaitToUp.Click += new System.EventHandler(this.lblWaitToUp_Click);
//
// lblGoodsCount
//
this.lblGoodsCount.AutoSize = true;
this.lblGoodsCount.Location = new System.Drawing.Point(35, 101);
this.lblGoodsCount.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.lblGoodsCount.Name = "lblGoodsCount";
this.lblGoodsCount.Size = new System.Drawing.Size(71, 17);
this.lblGoodsCount.TabIndex = 537;
this.lblGoodsCount.Text = "产品库 0 件";
this.lblGoodsCount.Click += new System.EventHandler(this.lblGoodsCount_Click);
//
// label16
//
this.label16.AutoSize = true;
this.label16.Location = new System.Drawing.Point(8, 54);
this.label16.Location = new System.Drawing.Point(8, 50);
this.label16.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.label16.Name = "label16";
this.label16.Size = new System.Drawing.Size(32, 17);
@@ -1219,19 +1273,19 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
this.dgvShop.AllowUserToAddRows = false;
this.dgvShop.AllowUserToDeleteRows = false;
dataGridViewCellStyle7.BackColor = System.Drawing.Color.WhiteSmoke;
this.dgvShop.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle7;
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)))));
dataGridViewCellStyle8.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle8.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle8.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle8.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle8.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle8.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle8.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvShop.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle8;
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,
@@ -1246,6 +1300,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.colMessage});
this.dgvShop.Dock = System.Windows.Forms.DockStyle.Fill;
this.dgvShop.Location = new System.Drawing.Point(4, 0);
this.dgvShop.MultiSelectCheckBox = true;
this.dgvShop.Name = "dgvShop";
this.dgvShop.ReadOnly = true;
this.dgvShop.RowHeadersWidth = 25;
@@ -1388,19 +1443,19 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
this.dgvSelectProduct.AllowUserToAddRows = false;
this.dgvSelectProduct.AllowUserToDeleteRows = false;
dataGridViewCellStyle9.BackColor = System.Drawing.Color.WhiteSmoke;
this.dgvSelectProduct.AlternatingRowsDefaultCellStyle = dataGridViewCellStyle9;
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)))));
dataGridViewCellStyle10.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle10.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle10.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
dataGridViewCellStyle10.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle10.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle10.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle10.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dgvSelectProduct.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle10;
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,
@@ -1427,6 +1482,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.colOpResult});
this.dgvSelectProduct.Dock = System.Windows.Forms.DockStyle.Fill;
this.dgvSelectProduct.Location = new System.Drawing.Point(0, 0);
this.dgvSelectProduct.MultiSelectCheckBox = true;
this.dgvSelectProduct.Name = "dgvSelectProduct";
this.dgvSelectProduct.ReadOnly = true;
this.dgvSelectProduct.RowTemplate.Height = 23;
@@ -1461,8 +1517,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
// colSupplierName
//
dataGridViewCellStyle11.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colSupplierName.DefaultCellStyle = dataGridViewCellStyle11;
dataGridViewCellStyle5.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colSupplierName.DefaultCellStyle = dataGridViewCellStyle5;
this.colSupplierName.Frozen = true;
this.colSupplierName.HeaderText = "店铺名称";
this.colSupplierName.Name = "colSupplierName";
@@ -1540,8 +1596,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
// colProductName
//
dataGridViewCellStyle12.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colProductName.DefaultCellStyle = dataGridViewCellStyle12;
dataGridViewCellStyle6.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.colProductName.DefaultCellStyle = dataGridViewCellStyle6;
this.colProductName.HeaderText = "商品标题";
this.colProductName.Name = "colProductName";
this.colProductName.ReadOnly = true;
@@ -1704,29 +1760,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.panel1.TabIndex = 189;
this.panel1.Paint += new System.Windows.Forms.PaintEventHandler(this.panel1_Paint);
//
// cmbSourceType
//
this.cmbSourceType.FormattingEnabled = true;
this.cmbSourceType.Items.AddRange(new object[] {
"",
"店铺采集",
"机会商品",
"外部数据"});
this.cmbSourceType.Location = new System.Drawing.Point(37, 78);
this.cmbSourceType.Name = "cmbSourceType";
this.cmbSourceType.Size = new System.Drawing.Size(92, 25);
this.cmbSourceType.TabIndex = 671;
//
// label8
//
this.label8.AutoSize = true;
this.label8.Location = new System.Drawing.Point(8, 82);
this.label8.Margin = new System.Windows.Forms.Padding(6, 0, 0, 0);
this.label8.Name = "label8";
this.label8.Size = new System.Drawing.Size(32, 17);
this.label8.TabIndex = 670;
this.label8.Text = "来源";
//
// PDDDBProdUserSelectForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -1735,6 +1768,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.Controls.Add(this.splitContainer1);
this.Controls.Add(this.panel1);
this.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.KeyPreview = true;
this.Name = "PDDDBProdUserSelectForm";
this.Text = "PDDDBProdUserSelectForm";
this.Load += new System.EventHandler(this.UserSelectDbProductForm_Load);
@@ -1754,6 +1788,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.fPnlPriceRule.PerformLayout();
this.ucGroupBoxEx4.ResumeLayout(false);
this.ucGroupBoxEx4.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ucGroupBoxEx1.ResumeLayout(false);
this.splitContainer3.Panel1.ResumeLayout(false);
this.splitContainer3.Panel2.ResumeLayout(false);
@@ -1891,5 +1926,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
private System.Windows.Forms.Label label6;
private System.Windows.Forms.ComboBox cmbSourceType;
private System.Windows.Forms.Label label8;
private System.Windows.Forms.PictureBox pictureBox1;
private UserComponent.UcCheckBox chkSkipQualification;
}
}
@@ -43,6 +43,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
"跑步鞋", "棉鞋", "高帮休闲鞋", "网面鞋", "勃肯鞋/软木鞋", "包头拖", "足部磨砂", "老爹鞋", "工装鞋", "豆豆鞋", "汉服鞋", "雨鞋" };
public CancellationTokenSource cancellationTokenSource { get; set; } = null;
public CancellationTokenSource cancelAddProd { get; set; } = null;
public bool IsLoadComplate { get; set; } = false;
bool isInit = false;
@@ -757,7 +758,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
prod.shop_account,
"登录",
"进店",
prod.spu_id,
//prod.spu_id,
BaseClass.SaLevel > 0 ? prod.spu_id : prod.spu_id.ParseToString().GetHashCode().ParseToString().Trim('-'),
prod.skc_id,
prod.main_img,
null,
@@ -765,7 +767,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
null,
prod.product_name, // 用户端显示商品原名
prod.cat_name,
prod.ext_code,
//prod.secret_spu_id == null ? prod.ext_code : prod.secret_spu_id,
BaseClass.SaLevel > 0 ? prod.ext_code : prod.ext_code.ParseToString().GetHashCode().ParseToString().Trim('-'),
prod.status,
prod.draft_id,
prod.notes,
@@ -813,6 +816,10 @@ namespace TemuKJD.PDDForms.ProductSelectForms
KJDDBProduct kjdDbProd = prod.kjdDbProduct;
if (kjdDbProd == null)
kjdDbProd = GetProductDetail(prod.out_product_Id.ToString());
if (!string.IsNullOrEmpty(kjdDbProd.secret_spu_id))
{
Invoke(new Action(()=> { row.Cells["colExtCode"].Value = kjdDbProd.secret_spu_id; }));
}
if (kjdDbProd == null || kjdDbProd.id == 0)
{
if (kjdDbProd?.id == 0)
@@ -916,13 +923,16 @@ namespace TemuKJD.PDDForms.ProductSelectForms
Invoke(new Action(() =>
{
row.Cells["colSkuFakeImgUrl"].Value = kjdDbProd.sku_img_replace_url;
if (row.Displayed)
if (chkActivity.Checked)
{
string getImgError = "";
Image img = GetHtml.GetUrlImg(kjdDbProd.sku_img_replace_url.Replace("https://", "http://"), out getImgError);
if (string.IsNullOrEmpty(getImgError))
row.Cells["colSkuFakeImg"].Value = img;
row.Cells["colSkuFakeImgUrl"].Value = kjdDbProd.sku_img_replace_url;
if (row.Displayed)
{
string getImgError = "";
Image img = GetHtml.GetUrlImg(kjdDbProd.sku_img_replace_url.Replace("https://", "http://"), out getImgError);
if (string.IsNullOrEmpty(getImgError))
row.Cells["colSkuFakeImg"].Value = img;
}
}
}));
@@ -1032,13 +1042,13 @@ namespace TemuKJD.PDDForms.ProductSelectForms
{
return "店铺为空或未登录!";
}
if (cell != null)
Invoke(new Action(() =>
{
Invoke(new Action(() =>
if (cell != null)
{
cell.Value = "正在初始化上传";
}));
}
}
}));
//testUploadProd(shop);
//return "测试上货";
@@ -1047,7 +1057,19 @@ namespace TemuKJD.PDDForms.ProductSelectForms
int sleepTime = 0;
int sleepTimeTotal = 0;
var prodInfo = JsonHelper.DeserializeJsonToObject<PDDProductInfo>(dbProd.product_json);
#region 将聚水潭产品数据格式进行转换成pdd格式统一上传,匹配加密的spuCode和skuCoke
if (dbProd.product_get_type_text == "厂商直采" && dbProd.sku_secret_json != null && dbProd.sku_secret_json.Contains("goodsId"))
{
string convertRst = "";
var pProd = new PDDProdFormConverter().JstPddProdToPddConvert(out convertRst, dbProd);
if (!string.IsNullOrEmpty(convertRst))
return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"商品查询错误 " + convertRst + "\"}";
}
#endregion
PDDProductInfo prodInfo = null;
prodInfo = JsonHelper.DeserializeJsonToObject<PDDProductInfo>(dbProd.product_json);
prodInfo.detail.galleries.RemoveAll(g => g.type == 6); // 视频暂时移除,以后再视情况加上
if (prodInfo.detail.cats == null || prodInfo.detail.cats.Where(c => !string.IsNullOrEmpty(c)).Count() == 0)
{
@@ -1222,13 +1244,14 @@ namespace TemuKJD.PDDForms.ProductSelectForms
}
}
if (cell != null)
Invoke(new Action(() =>
{
Invoke(new Action(() =>
if (cell != null)
{
cell.Value = "正在获取商品模板";
}));
}
}
}));
//商品属性模板
PDDProductTemplateInfo prodCatTemplateInfo = null;
Thread.Sleep(Randomx.GetId(10, 50));
@@ -1293,13 +1316,13 @@ namespace TemuKJD.PDDForms.ProductSelectForms
}
}
if (cell != null)
Invoke(new Action(() =>
{
Invoke(new Action(() =>
if (cell != null)
{
cell.Value = "正在获取运费模板";
}));
}
}
}));
//运费模板
string cost_template_html = get_cost_template(shop, prodInfo.detail.cat_ids, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id, prodInfo.chance_tab);
@@ -1336,16 +1359,150 @@ namespace TemuKJD.PDDForms.ProductSelectForms
var hot_keywordsStr = JsonHelper.SerializeObject(hot_keywordsArr);
prodParam.title_keywords = JsonHelper.DeserializeJsonToList<title_keyword_param>(hot_keywordsStr);
if (cell != null)
Invoke(new Action(() =>
{
Invoke(new Action(() =>
if (cell != null)
{
cell.Value = "正在查询关键字";
}));
}
}
}));
}
catch (Exception ex) { }
if (dbProd.product_get_type_text == "厂商直采")
{
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<long, string> specNameDic = new Dictionary<long, string>();
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 id = 0;
try
{
id = specNameDic.FirstOrDefault(s => s.Value == specInfo.parent_name).Key;
}
catch
{
}
if (id == 0)
id = specNameDic.ToList()[index].Key;
specInfo.parent_id = 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"))
continue;
string getImgError = "";
Image img = GetHtml.GetUrlImg(imgInfo.url, out getImgError);
if (!string.IsNullOrEmpty(getImgError))
{
//BaseMsgForm.ShowError(getImgError);
return "上传商品图片失败 " + getImgError;
}
string uploadUpgradeSkuImgRst = UploadProdSkuImg(shop, img, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id, prodInfo.chance_tab);
Thread.Sleep(Randomx.GetId(50, 200));
if (!uploadUpgradeSkuImgRst.Contains("\"url\":\"https:"))
{
var error = BaseRegex.GetStringJson(ref uploadUpgradeSkuImgRst, "error_msg");
if (string.IsNullOrEmpty(error))
error = uploadUpgradeSkuImgRst;
return "上传商品图片失败 " + error;
}
else
{
var upgrade_thumb_url = BaseRegex.GetStringJson(ref uploadUpgradeSkuImgRst, "url");
imgInfo.url = upgrade_thumb_url;
}
}
// 上传商品图片
foreach (var skuInfo in prodInfo.detail.sku)
{
if (skuInfo.thumb_url.Contains("img.pddpic.com"))
continue;
string getImgError = "";
Image img = GetHtml.GetUrlImg(skuInfo.thumb_url, out getImgError);
if (!string.IsNullOrEmpty(getImgError))
{
//BaseMsgForm.ShowError(getImgError);
return "上传商品图片失败 " + getImgError;
}
string uploadUpgradeSkuImgRst = UploadProdSkuImg(shop, img, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id, prodInfo.chance_tab);
Thread.Sleep(Randomx.GetId(50, 200));
if (!uploadUpgradeSkuImgRst.Contains("\"url\":\"https:"))
{
var error = BaseRegex.GetStringJson(ref uploadUpgradeSkuImgRst, "error_msg");
if (string.IsNullOrEmpty(error))
error = uploadUpgradeSkuImgRst;
return "上传商品图片失败 " + error;
}
else
{
var upgrade_thumb_url = BaseRegex.GetStringJson(ref uploadUpgradeSkuImgRst, "url");
skuInfo.thumb_url = upgrade_thumb_url;
}
}
// 根据详情图获取decoration装修模板
if (prodInfo.decoration == null || prodInfo.decoration.floor_list == null || prodInfo.decoration.floor_list.Count == 0)
{
@@ -1582,13 +1739,13 @@ namespace TemuKJD.PDDForms.ProductSelectForms
}
}
if (cell != null)
Invoke(new Action(() =>
{
Invoke(new Action(() =>
if (cell != null)
{
cell.Value = "正在编辑商品属性";
}));
}
}
}));
List<goods_property_param> goods_property_param_lst = new List<goods_property_param>();
goods_property_param_lst.Add(prop);
while (goods_property_param_lst.Count > 0)
@@ -1623,11 +1780,11 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//}
prodCatTemplateInfo.modules.FirstOrDefault()?.propertys.RemoveAll(p => p.ref_pid == subProperty.ref_pid); // 如果有二级属性,先要把原来的一级属性删掉
if (subProperty.values.content.Count > 1)
if (subProperty.values?.content?.Count > 1)
{
}
if (subProperty.required && subProperty.values.content.Count == 1)
if (subProperty.required && subProperty.values?.content?.Count == 1)
{
var propNew = new goods_property_param()
{
@@ -1678,6 +1835,29 @@ namespace TemuKJD.PDDForms.ProductSelectForms
}
}
if (propInfo.name == "品牌" && propInfo.values.FirstOrDefault()?.value == "其他家")
{
propInfo.values.FirstOrDefault().value = "无品牌/无注册商标";
propInfo.values.FirstOrDefault().raw_value = "无品牌/无注册商标";
propInfo.values.FirstOrDefault().vid = 4643510;
}
if (propInfo.name == "适用人群")
{
//if (!propInfo.values.All(v => propTemp.values.content.Any(c => c.value == v.value)))
//{
// continue;
//}
var propTempValue = propTemp.values.content.FirstOrDefault(v => propInfo.values.Any(pv => v.value.Contains(pv.value)));
if (propTempValue == null)
propTempValue = propTemp.values.content.FirstOrDefault(v => propInfo.values.Any(pv => v.value.Contains(pv.value)));
if (propTempValue == null)
continue;
propInfo.values.FirstOrDefault().value = propTempValue.value;
propInfo.values.FirstOrDefault().raw_value = propTempValue.value;
propInfo.values.FirstOrDefault().vid = propTempValue.vid;
}
//var prop = new goods_property_param()
var prop = new goods_spec_property_param()
{
@@ -1983,6 +2163,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
sku_id = skuInfo.sku_id,
thumb_url_file_id = skuInfo.thumb_url_file_id,
};
if (dbProd.product_get_type_text == "厂商直采" && skuInfo.quantity == 0)
skuParam.quantity_delta = 0;
if (chkUseExtCodePrice.Checked && dbProd.ext_code_price > 0)
{
skuParam.price = dbProd.ext_code_price + skuParam.price - skuParam.multi_price;
@@ -2069,13 +2251,123 @@ namespace TemuKJD.PDDForms.ProductSelectForms
baseSkuParamLst.Add(skuParam);
}
// 厂商直采获取推单运费模板
#region 获取推单运费模板,计算运费加价。
Invoke(new Action(() =>
{
if (cell != null)
{
cell.Value = "正在选取运费模板";
}
}));
var shippingTemplateJson = "";
var shipPrice = 0;
if (dbProd.product_get_type_text == "厂商直采" && dbProd.wx_cat_leaf != null)
{
var urlShipping = BaseClass.BuildWXObjString("product/wx_get_shipping_template");
var dataShipping = Work.UserLogin.GetSignaturex() +
"&coid=" + dbProd.skc_id;
var htmlShipping = GetHtml.PostUtf8(urlShipping, dataShipping);
if (string.IsNullOrEmpty(htmlShipping) || !htmlShipping.Contains("\"code\":200"))
htmlShipping = GetHtml.PostUtf8(urlShipping, dataShipping);
if (string.IsNullOrEmpty(htmlShipping) || !htmlShipping.Contains("\"code\":200"))
{
}
else
{
if (htmlShipping.Contains("\"data\":\"\""))
{
}
else
{
try
{
shippingTemplateJson = JsonHelper.SerializeObject(JsonHelper.JObjectParse(htmlShipping)["data"]);
}
catch
{
}
}
}
if (string.IsNullOrEmpty(shippingTemplateJson))
{
// 获取运费模板
var urlShip = BaseClass.BuildWXObjString("product/e57_get_freight_template");
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);
if (!shipRst.Contains("\"code\":0"))
{
var errMsg = BaseRegex.GetStringJson(ref shipRst, "msg");
if (string.IsNullOrEmpty(errMsg))
errMsg = shipRst;
return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"运费模板获取失败 " + errMsg + "\"}";
}
try
{
//[{"id":"204","warehouseNum":"15016108","freightType":0,"provinces":"香港特别行政区,台湾省,澳门特别行政区","freightPrice":9999900,"createBy":"vmslin","createTime":"2026-01-30T16:45:03+08:00","updateBy":"vmslin","updateTime":"2026-01-30T16:45:03+08:00"},{"id":"205","warehouseNum":"15016108","freightType":3,"provinces":"海南省,新疆维吾尔自治区,西藏自治区,内蒙古自治区","freightPrice":1530,"createBy":"vmslin","createTime":"2026-01-30T16:45:51+08:00","updateBy":"vmslin","updateTime":"2026-01-30T16:45:51+08:00"},{"id":"206","warehouseNum":"15016108","freightType":1,"provinces":"北京市,上海市","freightPrice":410,"createBy":"vmslin","createTime":"2026-01-30T16:46:04+08:00","updateBy":"vmslin","updateTime":"2026-01-30T16:46:04+08:00"},{"id":"207","warehouseNum":"15016108","freightType":1,"provinces":"安徽省,重庆市,福建省,广东省,甘肃省,广西壮族自治区,贵州省,河北省,湖北省,黑龙江省,河南省,湖南省,吉林省,江苏省,江西省,辽宁省,宁夏回族自治区,青海省,四川省,山东省,山西省,陕西省,天津市,云南省,浙江省","freightPrice":310,"createBy":"vmslin","createTime":"2026-01-30T16:46:17+08:00","updateBy":"vmslin","updateTime":"2026-01-30T16:46:17+08:00"}]
shippingTemplateJson = JsonHelper.SerializeObject(JsonHelper.JObjectParse(shipRst)["data"]);
if (shipRst.Contains("\"code\":0") && !string.IsNullOrEmpty(shippingTemplateJson))
{
urlShipping = BaseClass.BuildWXObjString("product/wx_add_mdy_shipping_template");
dataShipping = Work.UserLogin.GetSignaturex() +
"&coid=" + dbProd.skc_id +
"&shipping_template_json=" + shippingTemplateJson;
htmlShipping = GetHtml.PostUtf8(urlShipping, dataShipping);
if (string.IsNullOrEmpty(htmlShipping) || !htmlShipping.Contains("\"code\":200"))
htmlShipping = GetHtml.PostUtf8(urlShipping, dataShipping);
}
}
catch (Exception ex)
{
}
}
if (!string.IsNullOrEmpty(shippingTemplateJson))
{
try
{
int count = 0;
var shipObjs = JArray.Parse(shippingTemplateJson);
foreach (var shipObj in shipObjs)
{
var provincesStr = shipObj["provinces"].ParseToString();
if (provincesStr.Split(',').Length > count)
{
count = provincesStr.Split(',').Length;
shipPrice = shipObj["freightPrice"].ParseToInt();
}
}
}
catch (Exception ex)
{
return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"运费模板获取失败 " + ex.Message + "\"}";
}
}
if (shipPrice <= 0)
{
return "{\"success\":false,\"draftId\":0,\"status\":\"未上传\",\"errMsg\":\"运费模板获取失败 未获取到\"}";
}
}
#endregion
// 生成正常加价的sku列表
foreach (var skuParamInfo in baseSkuParamLst)
{
var skuParam = JsonHelper.DeserializeJsonToObject<sku_param>(JsonHelper.SerializeObject(skuParamInfo));
skuParam.multi_price = (skuParamInfo.multi_price * this.txtAddTimes.Text.Trim().ParseToDecimal() + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100).ParseToInt();
skuParam.price = (skuParamInfo.price * this.txtAddTimes.Text.Trim().ParseToDecimal() + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100).ParseToInt();
skuParam.quantity_delta = txtStockNum.Text.Trim().ParseToInt();
//上面已经给过值了,且厂商直采的上家缺货则保持缺货。
//skuParam.quantity_delta = txtStockNum.Text.Trim().ParseToInt();
skuParam.multi_price += shipPrice;
skuParam.price += shipPrice;
if (isAddMorePriceFirst) // 先加后乘
skuParam.multi_price = ((skuParamInfo.multi_price + this.txtAddMorePrice.Text.Trim().ParseToDecimal() * 100) * this.txtAddTimes.Text.Trim().ParseToDecimal()).ParseToInt();
@@ -2096,6 +2388,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
}
}
}
if (prodParam.market_price < skuParam.price + 1000)
{
prodParam.market_price = skuParam.price + 1000;
@@ -2652,9 +2945,13 @@ namespace TemuKJD.PDDForms.ProductSelectForms
{
var skuParam = JsonHelper.DeserializeJsonToObject<sku_param>(JsonHelper.SerializeObject(skuParamInfo));
skuParam.multi_price += shipPrice;
skuParam.price += shipPrice;
skuParam.multi_price = (skuParamInfo.multi_price * this.txtAddTimesFake.Text.Trim().ParseToDecimal()).ParseToInt();
skuParam.price = (skuParamInfo.price * this.txtAddTimesFake.Text.Trim().ParseToDecimal()).ParseToInt();
skuParam.quantity_delta = txtStockNum.Text.Trim().ParseToInt(); // 库存
//上面已经给过值了,且厂商直采的上家缺货则保持缺货。
//skuParam.quantity_delta = txtStockNum.Text.Trim().ParseToInt(); // 库存
if (isAddMorePriceFirst) // 先加后乘
skuParam.multi_price = ((skuParamInfo.multi_price) * this.txtAddTimesFake.Text.Trim().ParseToDecimal()).ParseToInt();
@@ -2857,13 +3154,13 @@ namespace TemuKJD.PDDForms.ProductSelectForms
}
#endregion
if (cell != null)
Invoke(new Action(() =>
{
Invoke(new Action(() =>
if (cell != null)
{
cell.Value = "正在保存商品";
}));
}
}
}));
var decorationRst = "";
#region 先随即提交一个带 preview_key 的,但是这个不起作用,后面再提交一个不带 preview_key 的才是真实的能查询到的商品详情信息
decorationRst = save_decoration(shop, decorationParam, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id, prodInfo.chance_tab);
@@ -3005,13 +3302,13 @@ namespace TemuKJD.PDDForms.ProductSelectForms
}
if (cell != null)
Invoke(new Action(() =>
{
Invoke(new Action(() =>
if (cell != null)
{
cell.Value = "正在提交商品";
}));
}
}
}));
Thread.Sleep(Randomx.GetId(20, 100));
//var str = JsonHelper.SerializeObject(prodParam);
var uploadRst = submit_goods_edit(shop, prodParam.goods_id.ParseToString(), prodParam.goods_commit_id, isChanceApi);
@@ -3036,13 +3333,13 @@ namespace TemuKJD.PDDForms.ProductSelectForms
if (pddUploadRule.IsSignActivity)
{
Thread.Sleep(10000);
if (cell != null)
Invoke(new Action(() =>
{
Invoke(new Action(() =>
if (cell != null)
{
cell.Value = "正在上传商品";
}));
}
}
}));
Thread.Sleep(Randomx.GetId(30000, 40000));
Thread.Sleep(Randomx.GetId(6000, 12000));
@@ -3059,13 +3356,13 @@ namespace TemuKJD.PDDForms.ProductSelectForms
var endTime = DateTime.Now;
var timeSpan = endTime - startTime;
var duration = timeSpan.TotalSeconds;
if (cell != null)
Invoke(new Action(() =>
{
Invoke(new Action(() =>
if (cell != null)
{
cell.Value = "商品已上传,进行后续操作中" + " " + duration.ParseToInt() + "秒";
}));
}
}
}));
bool sign20981 = chk20981.Checked;
bool sign22347 = chk22347.Checked;
bool sign15996 = chk15996.Checked;
@@ -3081,16 +3378,16 @@ namespace TemuKJD.PDDForms.ProductSelectForms
if (!getProdRst1.Contains(prodParamHighPriceFakeSkuImg.goods_id.ParseToString()) && !getProdRst2.Contains(prodParamHighPriceFakeSkuImg.goods_id.ParseToString()) &&
!getProdRst3.Contains(prodParamHighPriceFakeSkuImg.goods_id.ParseToString()) && !getProdRst4.Contains(prodParamHighPriceFakeSkuImg.goods_id.ParseToString()))
{
if (cell != null)
endTime = DateTime.Now;
timeSpan = endTime - startTime;
duration = timeSpan.TotalSeconds;
Invoke(new Action(() =>
{
endTime = DateTime.Now;
timeSpan = endTime - startTime;
duration = timeSpan.TotalSeconds;
Invoke(new Action(() =>
if (cell != null)
{
cell.Value = "上传错误,商品不存在" + " " + duration.ParseToInt() + "秒";
}));
}
}
}));
return;
}
else if (chk22347.Checked)
@@ -3098,16 +3395,16 @@ namespace TemuKJD.PDDForms.ProductSelectForms
// 如果报了直通车,判断商品自动加入直通车以后再放行(循环12次应该已加入,否则认为加入失败跳过)
for (int i = 0; i < 30 && !getProdRst2.Contains(prodParamHighPriceFakeSkuImg.goods_id.ParseToString()) && chk22347.Checked; i++)
{
if (cell != null)
endTime = DateTime.Now;
timeSpan = endTime - startTime;
duration = timeSpan.TotalSeconds;
Invoke(new Action(() =>
{
endTime = DateTime.Now;
timeSpan = endTime - startTime;
duration = timeSpan.TotalSeconds;
Invoke(new Action(() =>
if (cell != null)
{
cell.Value = "商品已上传,进行后续操作中" + " " + duration.ParseToInt() + "秒";
}));
}
}
}));
Thread.Sleep(60 * 1000);
//getProdRst1 = queryActivityGoodsEnabled(shop, prodParam.goods_id.ParseToString(), 22347, 0);
getProdRst2 = queryActivityGoodsEnabled(shop, prodParamHighPriceFakeSkuImg.goods_id.ParseToString(), 22347, 1);
@@ -3127,16 +3424,16 @@ namespace TemuKJD.PDDForms.ProductSelectForms
if (string.IsNullOrEmpty(error))
error = getProdIdRst;
if (cell != null)
endTime = DateTime.Now;
timeSpan = endTime - startTime;
duration = timeSpan.TotalSeconds;
Invoke(new Action(() =>
{
endTime = DateTime.Now;
timeSpan = endTime - startTime;
duration = timeSpan.TotalSeconds;
Invoke(new Action(() =>
if (cell != null)
{
cell.Value = "上传失败 校验上传失败 " + error + " " + duration.ParseToInt() + "秒";
}));
}
}
}));
return;
}
@@ -3201,7 +3498,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
skuParam.multi_price_in_yuan = ""; // 内部计算直接置空
skuParam.pre_sale_time = skuInfo.pre_sale_time;
skuParam.sku_id = skuInfo.sku_id;
foreach(var spec in skuParam.spec)
foreach (var spec in skuParam.spec)
{
spec.is_custom = spec.is_custom.ParseToInt();
}
@@ -3252,10 +3549,12 @@ namespace TemuKJD.PDDForms.ProductSelectForms
}));
var spec0NameLst = prodParamHighPriceFakeSkuImg.skus.Select(s => s.spec[0].spec_name).Distinct().ToList();
var spec0NameLst = prodParamHighPriceFakeSkuImg.skus.Select(s => s.spec[0].spec_name).Distinct().ToList();
int flag = 0;
foreach (var specName in spec0NameLst)
{
flag++;
endTime = DateTime.Now;
timeSpan = endTime - startTime;
duration = timeSpan.TotalSeconds;
@@ -3265,7 +3564,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
}));
List<int> signLst = new List<int>() { 20981, 15996, 21365, 22347 };
while (signLst.Count > 0)
while (signLst.Count > 0 && (flag == 1 || flag % 2 == 0 || spec0NameLst.LastOrDefault() == specName))
{
var signId = signLst[Randomx.GetId(0, signLst.Count)];
signLst.Remove(signId);
@@ -3321,70 +3620,75 @@ namespace TemuKJD.PDDForms.ProductSelectForms
fakeImgSku.thumb_url_file_id = null;
}
getProdIdRst = get_prod_commit_id(shop, prodParamHighPriceFakeSkuImg.goods_id.ParseToString(), false);
newCommitId = BaseRegex.GetStringJson(ref getProdIdRst, "goods_commit_id");
prodParamHighPriceFakeSkuImg.goods_commit_id = newCommitId;
if (string.IsNullOrEmpty(newCommitId) || !getProdIdRst.Contains("\"success\":true"))
if (1 == 1 && (flag % 2 == 0 || spec0NameLst.LastOrDefault() == specName))
{
var error = BaseRegex.GetStringJson(ref getProdIdRst, "error_msg");
if (string.IsNullOrEmpty(error))
error = getProdIdRst;
if (cell != null)
getProdIdRst = get_prod_commit_id(shop, prodParamHighPriceFakeSkuImg.goods_id.ParseToString(), false);
newCommitId = BaseRegex.GetStringJson(ref getProdIdRst, "goods_commit_id");
prodParamHighPriceFakeSkuImg.goods_commit_id = newCommitId;
if (string.IsNullOrEmpty(newCommitId) || !getProdIdRst.Contains("\"success\":true"))
{
var error = BaseRegex.GetStringJson(ref getProdIdRst, "error_msg");
if (string.IsNullOrEmpty(error))
error = getProdIdRst;
endTime = DateTime.Now;
timeSpan = endTime - startTime;
duration = timeSpan.TotalSeconds;
Invoke(new Action(() =>
{
cell.Value = "上传失败 校验上传失败 " + error + " " + duration.ParseToInt() + "秒";
if (cell != null)
{
cell.Value = "上传失败 校验上传失败 " + error + " " + duration.ParseToInt() + "秒";
}
}));
return;
}
return;
}
var reSaveProdRst = save_goods_edit(shop, prodParamHighPriceFakeSkuImg, prodParamHighPriceFakeSkuImg.goods_id.ParseToString(),
prodParamHighPriceFakeSkuImg.goods_commit_id, isChanceApi, "edit");
if (!reSaveProdRst.Contains("\"success\":true"))
{
var error = BaseRegex.GetStringJson(ref reSaveProdRst, "error_msg");
if (string.IsNullOrEmpty(error))
error = reSaveProdRst;
if (cell != null)
var reSaveProdRst = save_goods_edit(shop, prodParamHighPriceFakeSkuImg, prodParamHighPriceFakeSkuImg.goods_id.ParseToString(),
prodParamHighPriceFakeSkuImg.goods_commit_id, isChanceApi, "edit");
if (!reSaveProdRst.Contains("\"success\":true"))
{
var error = BaseRegex.GetStringJson(ref reSaveProdRst, "error_msg");
if (string.IsNullOrEmpty(error))
error = reSaveProdRst;
if (cell != null)
{
endTime = DateTime.Now;
timeSpan = endTime - startTime;
duration = timeSpan.TotalSeconds;
Invoke(new Action(() =>
{
cell.Value = "上传失败 保存失败 " + error + " " + duration.ParseToInt() + "秒";
}));
}
return;
}
Thread.Sleep(Randomx.GetId(20, 100));
var reUploadRst = submit_goods_edit(shop, prodParamHighPriceFakeSkuImg.goods_id.ParseToString(), prodParamHighPriceFakeSkuImg.goods_commit_id, isChanceApi, "edit");
if (!reUploadRst.Contains("\"success\":true"))
{
var error = BaseRegex.GetStringJson(ref reUploadRst, "error_msg");
if (string.IsNullOrEmpty(error))
error = reUploadRst;
endTime = DateTime.Now;
timeSpan = endTime - startTime;
duration = timeSpan.TotalSeconds;
Invoke(new Action(() =>
{
cell.Value = "上传失败 保存失败 " + error + " " + duration.ParseToInt() + "秒";
if (cell != null)
{
cell.Value = "上传失败 保存失败 " + error + " " + duration.ParseToInt() + "秒";
}
}));
return;
}
return;
Thread.Sleep(Randomx.GetId(12000, 15000));
}
Thread.Sleep(Randomx.GetId(20, 100));
var reUploadRst = submit_goods_edit(shop, prodParamHighPriceFakeSkuImg.goods_id.ParseToString(), prodParamHighPriceFakeSkuImg.goods_commit_id, isChanceApi, "edit");
if (!reUploadRst.Contains("\"success\":true"))
{
var error = BaseRegex.GetStringJson(ref reUploadRst, "error_msg");
if (string.IsNullOrEmpty(error))
error = reUploadRst;
if (cell != null)
{
endTime = DateTime.Now;
timeSpan = endTime - startTime;
duration = timeSpan.TotalSeconds;
Invoke(new Action(() =>
{
cell.Value = "上传失败 保存失败 " + error + " " + duration.ParseToInt() + "秒";
}));
}
return;
}
Thread.Sleep(Randomx.GetId(12000, 15000));
}
string activityErr = SignActivity(shop, prodParam, sign22347, sign20981, sign21365, sign15996);
@@ -3395,12 +3699,12 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//return "已上传 " + activityErr;
}
if (cell != null)
endTime = DateTime.Now;
timeSpan = endTime - startTime;
duration = timeSpan.TotalSeconds;
Invoke(new Action(() =>
{
endTime = DateTime.Now;
timeSpan = endTime - startTime;
duration = timeSpan.TotalSeconds;
Invoke(new Action(() =>
if (cell != null)
{
if (!string.IsNullOrEmpty(activityErr))
{
@@ -3410,8 +3714,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
{
cell.Value = "已成功上传" + " " + duration.ParseToInt() + "秒";
}
}));
}
}
}));
}
public void LoadActivityPage(ShopLoginInfo shop, PDDShopLoginForm loginForm = null)
@@ -4603,6 +4907,31 @@ Content-Disposition: form-data; name=""pic_operations""
return result;
}
private string querySpecName(ShopLoginInfo shop, long catId, string goodsId, string commitId)
{
var anti = shop.AntiContents.LastOrDefault().ParseToString();
if (shop.AntiContents.Count > 0)
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
string url = "https://mms.pinduoduo.com/glide/v2/mms/query/spec/name/list";
string body = @"{""cat_id"":" + catId + "}";
string refere = "https://mms.pinduoduo.com/goods/goods_add/index?id=" + commitId +
"&goods_id=" + goodsId + "&type=edit";
var result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
for (int i = 0; i < 5 && result.Contains("网络繁忙,请不要频繁操作"); i++)
{
shop.AntiContents.Remove(anti);
anti = shop.AntiContents.FirstOrDefault().ParseToString();
if (shop.AntiContents.Count > 0)
{
Thread.Sleep(Randomx.GetId(300, 500));
anti = shop.AntiContents[Randomx.GetId(shop.AntiContents.Count)];
result = HttpResponseBLL.PDDPostResponse(shop, url, body, refere, anti);
}
}
return result;
}
private string get_spec_by_name(ShopLoginInfo shop, string skuSpecName, long specParentId, int catId, string goodsId, string commitId, string chanceTab)
{
var anti = shop.AntiContents.LastOrDefault().ParseToString();
@@ -5673,19 +6002,30 @@ Content-Type: image/jpeg
private void btnRandomAdd_Click(object sender, EventArgs e)
{
int addCount = txtAddCount.Text.Trim().ParseToInt();
pictureBox1.Visible = true;
if (cancelAddProd != null)
cancelAddProd.Cancel();
cancelAddProd = new CancellationTokenSource();
Task.Run(() =>
{
int prodCount = 0;
List<KJDDBProduct> list = new List<KJDDBProduct>();
while (addCount > 0)
{
int prodCount = 0;
var list = GetRandomProductList(out prodCount, 1, 50);
if (cancelAddProd.IsCancellationRequested)
break;
// 等于50说明还有更多,不足50就不用再查了
if (list.Count == 0 || list.Count == 50)
{
list = GetRandomProductList(out prodCount, 1, 50);
Thread.Sleep(Randomx.GetId(50,100));
}
if (list.Count == 0) // 等于0要么库里没数据要么出错了,跳出
break;
Invoke(new Action(() =>
{
lblGoodsCount.Text = "产品库 " + prodCount + " 件";
}));
Thread.Sleep(Randomx.GetId(50,100));
foreach (var prod in list)
{
var selectProd = JsonHelper.DeserializeJsonToObject<TemuDBProductSelect>(JsonHelper.SerializeObject(prod));
@@ -5705,7 +6045,8 @@ Content-Type: image/jpeg
}
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_db_prod_upload_list", this.lstTemuDBProductSelect);
}
});
Invoke(new Action(() => { pictureBox1.Visible = false; }));
}, cancelAddProd.Token);
}
public List<KJDDBProduct> GetRandomProductList(out int totalCount, int page = 1, int pageSize = 50)
@@ -5729,6 +6070,19 @@ Content-Type: image/jpeg
data += "&in_groups=" + cmbGroupFilter.Text;
data += "&in_cates=" + cmbCateFilter.Text;
data += "&product_get_type=" + cmbSourceType.Text.Trim();
if (cmbSourceType.Text.Trim() == "厂商直采")
{
// 聚水潭商品 // 分销已设置,类目已识别
data += "&is_supplier_prod_ok=" + "已设置";
data += "&wx_safe_status=" + "安全商品,未校验";
}
if (cmbSourceType.Text == "厂商直采" && chkSkipQualification.Checked)
{
// 厂商直采普通店铺不要随特殊商品
data += "&wx_cat_1=" + string.Join(",", GlobalConfig.WxCatList.Where(c => c.level == 1 && !(c.name == "图书" || c.name == "食品饮料" || c.name == "成人用品"))
.Select(c => c.cat_id));
}
}));
var html = GetHtml.PostUtf8(url, data);
if (string.IsNullOrEmpty(html) || !html.Contains("\"code\":200"))
@@ -6084,6 +6438,12 @@ Content-Type: image/jpeg
NaiBa.Util.Helper.ConfigHelper.SaveConfig("pdd_upload_rule", pddUploadRule);
}
}
private void pictureBox1_Click(object sender, EventArgs e)
{
if (cancelAddProd != null)
cancelAddProd.Cancel();
}
}
public class AddPriceRule