pdd上货逻辑继续优化 temu选品数据店铺筛选功能

This commit is contained in:
wule committed 2025-09-19 22:55:19 +08:00
1 parent 0e6a034d5f
commit b868c718f0
19 files changed
+562 -271

No files matched your search

@@ -59,8 +59,11 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.pbLoading = new System.Windows.Forms.PictureBox();
this.dgvDbProduct = new TemuKJD.UserComponent.DataGridViewEx();
this.ucSplitPage1 = new TemuKJD.UserControls.UcSplitPage();
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
this.colSelect = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.col_db_id = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colFromShopId = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.col_product_name = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colImgUrl = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colMainImg = new System.Windows.Forms.DataGridViewImageColumn();
@@ -75,11 +78,10 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.colEndWords = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colFissionWords = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colAddTime = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colMdyTime = new System.Windows.Forms.DataGridViewTextBoxColumn();
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.ucSplitPage1 = new TemuKJD.UserControls.UcSplitPage();
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
@@ -110,8 +112,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.splitContainer1.Panel1.Controls.Add(this.lblNotes);
this.splitContainer1.Panel1.Controls.Add(this.txtSPU);
this.splitContainer1.Panel1.Controls.Add(this.label5);
this.splitContainer1.Panel1.Controls.Add(this.txtSKC);
this.splitContainer1.Panel1.Controls.Add(this.label1);
this.splitContainer1.Panel1.Controls.Add(this.pnlEmpty);
this.splitContainer1.Panel1.Controls.Add(this.btnSearch);
this.splitContainer1.Panel1.Controls.Add(this.txtExtCode);
@@ -153,7 +153,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.cmbSort.Items.AddRange(new object[] {
"入库时间",
"认领总数"});
this.cmbSort.Location = new System.Drawing.Point(1001, 15);
this.cmbSort.Location = new System.Drawing.Point(887, 16);
this.cmbSort.Name = "cmbSort";
this.cmbSort.Size = new System.Drawing.Size(79, 25);
this.cmbSort.TabIndex = 448;
@@ -179,7 +179,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
// txtNotes
//
this.txtNotes.Location = new System.Drawing.Point(683, 16);
this.txtNotes.Location = new System.Drawing.Point(569, 17);
this.txtNotes.Name = "txtNotes";
this.txtNotes.Size = new System.Drawing.Size(90, 23);
this.txtNotes.TabIndex = 439;
@@ -187,7 +187,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
// lblNotes
//
this.lblNotes.AutoSize = true;
this.lblNotes.Location = new System.Drawing.Point(649, 19);
this.lblNotes.Location = new System.Drawing.Point(535, 20);
this.lblNotes.Name = "lblNotes";
this.lblNotes.Size = new System.Drawing.Size(44, 17);
this.lblNotes.TabIndex = 440;
@@ -195,7 +195,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
// txtSPU
//
this.txtSPU.Location = new System.Drawing.Point(44, 16);
this.txtSPU.Location = new System.Drawing.Point(57, 16);
this.txtSPU.Name = "txtSPU";
this.txtSPU.Size = new System.Drawing.Size(90, 23);
this.txtSPU.TabIndex = 434;
@@ -205,32 +205,34 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.label5.AutoSize = true;
this.label5.Location = new System.Drawing.Point(11, 19);
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(43, 17);
this.label5.Size = new System.Drawing.Size(57, 17);
this.label5.TabIndex = 435;
this.label5.Text = "SPU:";
this.label5.Text = "商品ID:";
//
// txtSKC
//
this.txtSKC.Location = new System.Drawing.Point(171, 16);
this.txtSKC.Location = new System.Drawing.Point(87, 80);
this.txtSKC.Name = "txtSKC";
this.txtSKC.Size = new System.Drawing.Size(90, 23);
this.txtSKC.TabIndex = 432;
this.txtSKC.Visible = false;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(138, 19);
this.label1.Location = new System.Drawing.Point(54, 83);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(43, 17);
this.label1.TabIndex = 433;
this.label1.Text = "SKC:";
this.label1.Visible = false;
//
// pnlEmpty
//
this.pnlEmpty.CanvasColor = System.Drawing.SystemColors.Control;
this.pnlEmpty.ColorSchemeStyle = DevComponents.DotNetBar.eDotNetBarStyle.StyleManagerControlled;
this.pnlEmpty.DisabledBackColor = System.Drawing.Color.Empty;
this.pnlEmpty.Location = new System.Drawing.Point(843, 14);
this.pnlEmpty.Location = new System.Drawing.Point(729, 15);
this.pnlEmpty.Name = "pnlEmpty";
this.pnlEmpty.Size = new System.Drawing.Size(56, 26);
this.pnlEmpty.Style.Alignment = System.Drawing.StringAlignment.Center;
@@ -256,7 +258,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.btnSearch.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
this.btnSearch.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.btnSearch.ForeColor = System.Drawing.Color.White;
this.btnSearch.Location = new System.Drawing.Point(782, 14);
this.btnSearch.Location = new System.Drawing.Point(668, 15);
this.btnSearch.Margin = new System.Windows.Forms.Padding(2);
this.btnSearch.Name = "btnSearch";
this.btnSearch.Size = new System.Drawing.Size(56, 26);
@@ -267,7 +269,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
// txtExtCode
//
this.txtExtCode.Location = new System.Drawing.Point(555, 16);
this.txtExtCode.Location = new System.Drawing.Point(441, 17);
this.txtExtCode.Name = "txtExtCode";
this.txtExtCode.Size = new System.Drawing.Size(90, 23);
this.txtExtCode.TabIndex = 429;
@@ -275,7 +277,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(521, 19);
this.label4.Location = new System.Drawing.Point(407, 20);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(44, 17);
this.label4.TabIndex = 430;
@@ -283,7 +285,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
// txtProdName
//
this.txtProdName.Location = new System.Drawing.Point(427, 16);
this.txtProdName.Location = new System.Drawing.Point(313, 17);
this.txtProdName.Name = "txtProdName";
this.txtProdName.Size = new System.Drawing.Size(90, 23);
this.txtProdName.TabIndex = 427;
@@ -291,7 +293,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(393, 19);
this.label3.Location = new System.Drawing.Point(279, 20);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(44, 17);
this.label3.TabIndex = 428;
@@ -299,7 +301,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
// txtCat
//
this.txtCat.Location = new System.Drawing.Point(299, 16);
this.txtCat.Location = new System.Drawing.Point(185, 17);
this.txtCat.Name = "txtCat";
this.txtCat.Size = new System.Drawing.Size(90, 23);
this.txtCat.TabIndex = 425;
@@ -307,7 +309,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(265, 19);
this.label2.Location = new System.Drawing.Point(151, 20);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(44, 17);
this.label2.TabIndex = 426;
@@ -316,7 +318,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
// label6
//
this.label6.AutoSize = true;
this.label6.Location = new System.Drawing.Point(944, 19);
this.label6.Location = new System.Drawing.Point(830, 20);
this.label6.Name = "label6";
this.label6.Size = new System.Drawing.Size(68, 17);
this.label6.TabIndex = 449;
@@ -333,6 +335,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
// splitContainer2.Panel1
//
this.splitContainer2.Panel1.Controls.Add(this.pbLoading);
this.splitContainer2.Panel1.Controls.Add(this.txtSKC);
this.splitContainer2.Panel1.Controls.Add(this.label1);
this.splitContainer2.Panel1.Controls.Add(this.dgvDbProduct);
this.splitContainer2.Panel1.Padding = new System.Windows.Forms.Padding(4, 0, 4, 0);
//
@@ -376,6 +380,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.dgvDbProduct.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.colSelect,
this.col_db_id,
this.colFromShopId,
this.col_product_name,
this.colImgUrl,
this.colMainImg,
@@ -390,6 +395,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.colEndWords,
this.colFissionWords,
this.colAddTime,
this.colMdyTime,
this.col_edit,
this.col_delete,
this.col_select_product});
@@ -403,6 +409,31 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.dgvDbProduct.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvDbProduct_CellContentClick);
this.dgvDbProduct.Scroll += new System.Windows.Forms.ScrollEventHandler(this.dgvDbProduct_Scroll);
//
// ucSplitPage1
//
this.ucSplitPage1.CurrentPage = 1;
this.ucSplitPage1.Dock = System.Windows.Forms.DockStyle.Right;
this.ucSplitPage1.IsShowPageSize = false;
this.ucSplitPage1.Location = new System.Drawing.Point(996, 0);
this.ucSplitPage1.Margin = new System.Windows.Forms.Padding(0);
this.ucSplitPage1.Name = "ucSplitPage1";
this.ucSplitPage1.Padding = new System.Windows.Forms.Padding(0, 0, 1, 0);
this.ucSplitPage1.PageSize = 50;
this.ucSplitPage1.Size = new System.Drawing.Size(362, 25);
this.ucSplitPage1.TabIndex = 6;
this.ucSplitPage1.TotalPage = 1;
//
// statusBar
//
this.statusBar.BackColor = System.Drawing.Color.White;
this.statusBar.Dock = System.Windows.Forms.DockStyle.Fill;
this.statusBar.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.statusBar.Location = new System.Drawing.Point(0, 0);
this.statusBar.Margin = new System.Windows.Forms.Padding(0);
this.statusBar.Name = "statusBar";
this.statusBar.Size = new System.Drawing.Size(1358, 25);
this.statusBar.TabIndex = 5;
//
// colSelect
//
this.colSelect.FillWeight = 26F;
@@ -414,16 +445,24 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
// col_db_id
//
this.col_db_id.FillWeight = 50F;
this.col_db_id.HeaderText = "数据库Id";
this.col_db_id.Name = "col_db_id";
this.col_db_id.ReadOnly = true;
this.col_db_id.Visible = false;
//
// colFromShopId
//
this.colFromShopId.HeaderText = "来源店铺Id";
this.colFromShopId.Name = "colFromShopId";
this.colFromShopId.ReadOnly = true;
this.colFromShopId.Visible = false;
//
// col_product_name
//
dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.col_product_name.DefaultCellStyle = dataGridViewCellStyle3;
this.col_product_name.FillWeight = 200F;
this.col_product_name.FillWeight = 150F;
this.col_product_name.HeaderText = "标题";
this.col_product_name.Name = "col_product_name";
this.col_product_name.ReadOnly = true;
@@ -447,7 +486,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
// col_spu_id
//
this.col_spu_id.HeaderText = "SPU Id";
this.col_spu_id.HeaderText = "商品Id";
this.col_spu_id.Name = "col_spu_id";
this.col_spu_id.ReadOnly = true;
//
@@ -456,6 +495,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.col_skc_id.HeaderText = "SKC Id";
this.col_skc_id.Name = "col_skc_id";
this.col_skc_id.ReadOnly = true;
this.col_skc_id.Visible = false;
//
// col_cat_name
//
@@ -520,10 +560,18 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
// colAddTime
//
this.colAddTime.FillWeight = 80F;
this.colAddTime.HeaderText = "入库时间";
this.colAddTime.Name = "colAddTime";
this.colAddTime.ReadOnly = true;
//
// colMdyTime
//
this.colMdyTime.FillWeight = 80F;
this.colMdyTime.HeaderText = "更新时间";
this.colMdyTime.Name = "colMdyTime";
this.colMdyTime.ReadOnly = true;
//
// col_edit
//
this.col_edit.FillWeight = 60F;
@@ -549,31 +597,6 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.col_select_product.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.col_select_product.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
//
// ucSplitPage1
//
this.ucSplitPage1.CurrentPage = 1;
this.ucSplitPage1.Dock = System.Windows.Forms.DockStyle.Right;
this.ucSplitPage1.IsShowPageSize = false;
this.ucSplitPage1.Location = new System.Drawing.Point(996, 0);
this.ucSplitPage1.Margin = new System.Windows.Forms.Padding(0);
this.ucSplitPage1.Name = "ucSplitPage1";
this.ucSplitPage1.Padding = new System.Windows.Forms.Padding(0, 0, 1, 0);
this.ucSplitPage1.PageSize = 50;
this.ucSplitPage1.Size = new System.Drawing.Size(362, 25);
this.ucSplitPage1.TabIndex = 6;
this.ucSplitPage1.TotalPage = 1;
//
// statusBar
//
this.statusBar.BackColor = System.Drawing.Color.White;
this.statusBar.Dock = System.Windows.Forms.DockStyle.Fill;
this.statusBar.Font = new System.Drawing.Font("微软雅黑", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
this.statusBar.Location = new System.Drawing.Point(0, 0);
this.statusBar.Margin = new System.Windows.Forms.Padding(0);
this.statusBar.Name = "statusBar";
this.statusBar.Size = new System.Drawing.Size(1358, 25);
this.statusBar.TabIndex = 5;
//
// PDDDBProdListForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -593,6 +616,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.splitContainer2.Panel1.ResumeLayout(false);
this.splitContainer2.Panel1.PerformLayout();
this.splitContainer2.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
this.splitContainer2.ResumeLayout(false);
@@ -627,8 +651,10 @@ namespace TemuKJD.PDDForms.ProductSelectForms
private UserControls.ButtonEx btnSelect;
private System.Windows.Forms.ComboBox cmbSort;
private System.Windows.Forms.Label label6;
private UserControls.ButtonEx btnDelSelect;
private System.Windows.Forms.DataGridViewCheckBoxColumn colSelect;
private System.Windows.Forms.DataGridViewTextBoxColumn col_db_id;
private System.Windows.Forms.DataGridViewTextBoxColumn colFromShopId;
private System.Windows.Forms.DataGridViewTextBoxColumn col_product_name;
private System.Windows.Forms.DataGridViewTextBoxColumn colImgUrl;
private System.Windows.Forms.DataGridViewImageColumn colMainImg;
@@ -643,9 +669,9 @@ namespace TemuKJD.PDDForms.ProductSelectForms
private System.Windows.Forms.DataGridViewTextBoxColumn colEndWords;
private System.Windows.Forms.DataGridViewTextBoxColumn colFissionWords;
private System.Windows.Forms.DataGridViewTextBoxColumn colAddTime;
private System.Windows.Forms.DataGridViewTextBoxColumn colMdyTime;
private System.Windows.Forms.DataGridViewLinkColumn col_edit;
private System.Windows.Forms.DataGridViewLinkColumn col_delete;
private System.Windows.Forms.DataGridViewLinkColumn col_select_product;
private UserControls.ButtonEx btnDelSelect;
}
}
@@ -42,6 +42,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
{
if (BaseClass.SaLevel == 1 && shop == null) // 一级管理员且不是选品状态
{
this.dgvDbProduct.Columns["col_db_id"].Visible = true;
this.dgvDbProduct.Columns["colFromShopId"].Visible = true;
this.dgvDbProduct.Columns["col_delete"].Visible = true;
this.dgvDbProduct.Columns["col_edit"].Visible = true;
this.dgvDbProduct.Columns["colHeadWords"].Visible = true;
@@ -55,6 +57,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
}
else
{
this.dgvDbProduct.Columns["col_db_id"].Visible = false;
this.dgvDbProduct.Columns["colFromShopId"].Visible = false;
this.dgvDbProduct.Columns["col_delete"].Visible = false;
this.dgvDbProduct.Columns["col_edit"].Visible = false;
this.dgvDbProduct.Columns["colHeadWords"].Visible = false;
@@ -128,6 +132,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
int rowIndex = this.dgvDbProduct.Rows.Add(
false,
prod.id,
prod.from_shop_id,
prod.product_name,
prod?.main_img?.Replace("https", "http"),
defaultBitmap, // prod.main_img,
@@ -141,7 +146,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
prod.head_words,
prod.end_words,
prod.fission_words,
prod.add_time,
prod.add_time.ToString("yy-MM-dd HH:mm"),
prod.mdy_time.ToString("yy-MM-dd HH:mm"),
"编辑",
"删除",
"认领");
@@ -123,6 +123,9 @@
<metadata name="col_db_id.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colFromShopId.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="col_product_name.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
@@ -165,6 +168,9 @@
<metadata name="colAddTime.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="colMdyTime.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="col_edit.UserAddedColumn" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
@@ -1260,7 +1260,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
content = (propInfo.values.FirstOrDefault()?.value).ParseToString(),
};
sleepTime = Randomx.GetId(500, 1500);
sleepTime = Randomx.GetId(500, 1399);
sleepTimeTotal += sleepTime;
Thread.Sleep(sleepTime);
if (!isChanceApi)
@@ -1419,6 +1419,42 @@ namespace TemuKJD.PDDForms.ProductSelectForms
prodParam.out_goods_sn = prodInfo.detail.out_goods_sn;
prodParam.oversea_goods = prodInfo.detail.oversea_goods == null ? new object() : prodInfo.detail.oversea_goods;
prodParam.prefillWhitePic = ""; // 白底图,需要研究如何获取
// 白底图
if (prodInfo.material1 != null && !string.IsNullOrEmpty(prodInfo.material1.online_material))
{
prodParam.prefillWhitePic = prodInfo.material1.online_material;
sleepTime = Randomx.GetId(500, 1440);
sleepTimeTotal += sleepTime;
Thread.Sleep(sleepTime);
var material_html = create_material(shop, prodParam.prefillWhitePic, 1, prodParam.cat_ids,
prodParam.goods_id.ParseToString(), prodParam.goods_commit_id);
if (!material_html.Contains("\"success\":true"))
{
var error = BaseRegex.GetStringJson(ref material_html, "error_msg");
if (string.IsNullOrEmpty(error))
error = material_html;
return "上传失败 " + error;
}
}
// 长图
if (prodInfo.material3 != null && !string.IsNullOrEmpty(prodInfo.material3.online_material))
{
//prodParam.prefillWhitePic = prodInfo.material3.online_material;
sleepTime = Randomx.GetId(500, 1399);
sleepTimeTotal += sleepTime;
Thread.Sleep(sleepTime);
var material_html = create_material(shop, prodInfo.material3.online_material, 3, prodParam.cat_ids,
prodParam.goods_id.ParseToString(), prodParam.goods_commit_id);
if (!material_html.Contains("\"success\":true"))
{
var error = BaseRegex.GetStringJson(ref material_html, "error_msg");
if (string.IsNullOrEmpty(error))
error = material_html;
return "上传失败 " + error;
}
}
prodParam.pre_sale_time = prodInfo.detail.pre_sale_time.ParseToString();
prodParam.privacy_delivery = prodInfo.detail.privacy_delivery;
prodParam.processing_charges = prodInfo.detail.processing_charges.ParseToInt();
@@ -1650,6 +1686,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
var specModule = prodCatTemplateInfo.spec_module;
var specProp = prodCatTemplateInfo.spec_module.properties.FirstOrDefault(p => p.name_alias == skuSpec.parent_name);
var defaultPropValue = specProp.values.FirstOrDefault();
var defaultGroup = (defaultPropValue?.group) == null ? 2 : defaultPropValue.group.id;
var specPropValue = specProp.values.FirstOrDefault(v => v.value == skuSpec.spec_name);
if (specProp != null)
{
@@ -1665,7 +1703,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
spec_id = skuSpec.spec_id,
note = "",
img_url = "",
group_id = 1, //specPropValue == null ? 2 : (specPropValue?.group?.id).ParseToInt(),
group_id = /*2, */ (specPropValue?.group?.id) == null ? defaultGroup : (specPropValue.group.id).ParseToInt(),
template_module_id = specModule.id,
};
prodParam.goods_properties.Add(spec_prop);
@@ -1684,6 +1722,8 @@ namespace TemuKJD.PDDForms.ProductSelectForms
var specModule = prodCatTemplateInfo.spec_module;
var specProp = prodCatTemplateInfo.spec_module.properties.FirstOrDefault(p => p.name_alias == skuSpec.parent_name);
var defaultPropValue = specProp.values.FirstOrDefault();
var defaultGroup = (defaultPropValue?.group) == null ? 3 : defaultPropValue.group.id;
var specPropValue = specProp.values.FirstOrDefault(v => v.value == skuSpec.spec_name);
if (specProp != null)
{
@@ -1699,7 +1739,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
spec_id = skuSpec.spec_id,
note = "",
img_url = "",
group_id = 2, //specPropValue == null ? 2 : (specPropValue?.group?.id).ParseToInt(),
group_id = /*3, */ (specPropValue?.group?.id) == null ? defaultGroup : (specPropValue.group.id).ParseToInt(),
template_module_id = specModule.id,
};
prodParam.goods_properties.Add(spec_prop);
@@ -2082,6 +2122,50 @@ namespace TemuKJD.PDDForms.ProductSelectForms
return result;
}
/// <summary>
/// 创建物料 1为白底图 whitepic
/// </summary>
/// <param name="shop"></param>
/// <param name="imgUrl"></param>
/// <param name="type"></param>
/// <param name="catList"></param>
/// <param name="goodsId"></param>
/// <param name="commitId"></param>
/// <returns></returns>
private string create_material(ShopLoginInfo shop, string imgUrl, int type, List<int?> catList, string goodsId, string commitId)
{
if (catList == null)
catList = new List<int?>();
while (catList.Count < 4)
catList.Add(null);
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/giraffe/mms/material/create"; // 商品已存在
url = "https://mms.pinduoduo.com/giraffe/mms/material/createDraft"; // 新建商品
string body = @"{""content"":""" + imgUrl + @""",""type"":" + type + @",""source"":2,""cat_id_1"":" + catList[0] +
@",""cat_id_2"":" + catList[1] + @",""cat_id_3"":" + catList[2] + @",""cat_id_4"":" + catList[3] + @",""goods_id"":" + goodsId + @"}";
string refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=add&from=category&id=" + commitId +
"&goods_id=" + goodsId + "&sourcePage=goodsList";
if (isChanceApi)
refere = "https://mms.pinduoduo.com/goods/goods_add/index?type=add&from=chance&id=" + commitId +
"&goods_id=" + goodsId + "&chance_tab=search&sourcePage=goodsListTopButton_CHANCE";
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 reusable_sizespec(ShopLoginInfo shop, string catId, string goodsId, string commitId)
{
var anti = shop.AntiContents.LastOrDefault().ParseToString();