选品上传翻译商品标题 库存上传逻辑优化提高直接上传成功率 拼多多优化限时限量优惠结束逻辑

This commit is contained in:
wule committed 2025-10-24 18:15:17 +08:00
1 parent 73f9fcd8bc
commit ab33a9c0c0
19 files changed
+856 -320

No files matched your search

@@ -196,9 +196,6 @@ namespace TemuKJD.PDDForms.ProductForms
row.Cells["colMessage"].Value = "";
}
if (PDDShopLoginForm.shopLoginInstance != null && PDDShopLoginForm.shopLoginInstance.IsDisposed != true)
PDDShopLoginForm.shopLoginInstance.Dispose();
ucGroupBoxEx2.Enabled = false;
cancellationTokenSource = new CancellationTokenSource();
Task.Run(() =>
@@ -209,9 +206,6 @@ namespace TemuKJD.PDDForms.ProductForms
foreach (var shopId in lstShopIdTemp)
{
int sleepTime = 0;
int sleepTimeTotal = 0;
this.Invoke(new Action(() =>
{
this.statusBar.lblTaskStatus.Text = "正在查询...";
@@ -295,7 +289,12 @@ namespace TemuKJD.PDDForms.ProductForms
List<string> skuSns = null;
if (!string.IsNullOrWhiteSpace(txtSkuSns.Text))
skuSns = new List<string>() { txtSkuSns.Text.Trim() };
string jsonStr = shop_goods_search(shop, goods_id_list, txtGoodsName.Text.Trim(), out_goods_sn_list, skuSns, isOnsale, page, pageSize);
long? minPrice = null, maxPrice = null;
if (!string.IsNullOrWhiteSpace(txtMinPrice.Text))
minPrice = (txtMinPrice.Text.Trim().ParseToDecimal() * 100).ParseToLong();
if (!string.IsNullOrWhiteSpace(txtMaxPrice.Text))
maxPrice = (txtMaxPrice.Text.Trim().ParseToDecimal() * 100).ParseToLong();
string jsonStr = shop_goods_search(shop, goods_id_list, txtGoodsName.Text.Trim(), out_goods_sn_list, skuSns, isOnsale, minPrice, maxPrice, page, pageSize);
if (jsonStr.Contains("繁忙") && tryCount < 5)
{
tryCount++;
@@ -411,7 +410,7 @@ namespace TemuKJD.PDDForms.ProductForms
private string shop_goods_search(ShopLoginInfo shop, List<string> goods_id_list, string goods_name,
List<string> out_goods_sn_list = null, List<string> out_sku_sns = null, int? isOnsale = null, int page=1, int pageSize = 100)
List<string> out_goods_sn_list = null, List<string> out_sku_sns = null, int? isOnsale = null, long? minPrice=null, long? maxPrice=null, int page=1, int pageSize = 100)
{
var anti = shop.AntiContents.LastOrDefault().ParseToString();
if (shop.AntiContents.Count > 0)
@@ -434,6 +433,15 @@ namespace TemuKJD.PDDForms.ProductForms
dicParam["out_sku_sns"] = out_sku_sns;
dicParam["sold_out"] = 0;
dicParam["size"] = pageSize;
if (minPrice != null || maxPrice != null)
{
long[] nArr = new long[] { 0, 1000000000 };
if (minPrice != null)
nArr[0] = minPrice.Value;
if (maxPrice != null)
nArr[1] = maxPrice.Value;
dicParam["sku_price_range"] = nArr;
}
string body = JsonHelper.SerializeObject(dicParam); //"{\"out_goods_sn_gray_flag\":true,\"pre_sale_type\":4,\"page\":1,\"shipment_time_type\":3,\"is_onsale\":1,\"sold_out\":0," + "\"size\":" + pageSize + "}";
string refere = "https://mms.pinduoduo.com/goods/goods_list?msfrom=mms_sidenav";
@@ -553,8 +561,6 @@ namespace TemuKJD.PDDForms.ProductForms
return;
}
if (PDDShopLoginForm.shopLoginInstance != null && PDDShopLoginForm.shopLoginInstance.IsDisposed != true)
PDDShopLoginForm.shopLoginInstance.Dispose();
ucGroupBoxEx2.Enabled = false;
cancellationTokenSource = new CancellationTokenSource();
Task.Run(() =>
@@ -672,8 +678,6 @@ namespace TemuKJD.PDDForms.ProductForms
return;
}
if (PDDShopLoginForm.shopLoginInstance != null && PDDShopLoginForm.shopLoginInstance.IsDisposed != true)
PDDShopLoginForm.shopLoginInstance.Dispose();
ucGroupBoxEx2.Enabled = false;
cancellationTokenSource = new CancellationTokenSource();
Task.Run(() =>
@@ -792,30 +796,25 @@ namespace TemuKJD.PDDForms.ProductForms
{
dicShopGetCount[shop] = 0;
while (PDDShopLoginForm.shopLoginInstance != null && !PDDShopLoginForm.shopLoginInstance.IsDisposed)
{
Thread.Sleep(500);
}
PDDShopLoginForm loginForm = null;
Invoke(new Action(() =>
{
this.panel1.SendToBack();
PDDShopLoginForm loginForm = new PDDShopLoginForm(shop);
loginForm = new PDDShopLoginForm(shop);
loginForm.TopLevel = false;
loginForm.openType = EnumOpenType.manage;
loginForm.WindowState = FormWindowState.Maximized;
loginForm.InitUrl = "https://mms.pinduoduo.com/home/";
loginForm.InitUrl = "https://mms.pinduoduo.com/goods/goods_list?msfrom=mms_sidenav";
loginForm.Dock = DockStyle.Fill;
this.panel1.Controls.Add(loginForm);
loginForm.Show();
}));
int sleepTime = Randomx.GetId(2000, 3000);
Thread.Sleep(sleepTime);
Thread.Sleep(Randomx.GetId(3000, 5000));
Invoke(new Action(() =>
{
if (PDDShopLoginForm.shopLoginInstance != null)
PDDShopLoginForm.shopLoginInstance.Dispose();
if (loginForm != null)
loginForm.Close();
}));
}
}
@@ -835,8 +834,6 @@ namespace TemuKJD.PDDForms.ProductForms
return;
}
if (PDDShopLoginForm.shopLoginInstance != null && PDDShopLoginForm.shopLoginInstance.IsDisposed != true)
PDDShopLoginForm.shopLoginInstance.Dispose();
ucGroupBoxEx2.Enabled = false;
cancellationTokenSource = new CancellationTokenSource();
Task.Run(() =>
@@ -984,5 +981,11 @@ namespace TemuKJD.PDDForms.ProductForms
{
}
private void pnlEmpty_Click(object sender, EventArgs e)
{
cmbStatus.Text = "在售";
txtSPU.Text = txtGoodsName.Text = txtExtCode.Text = txtSkuSns.Text = txtMinPrice.Text = txtMaxPrice.Text = "";
}
}
}