拼多多以图搜款上货 70% 拼多多接口上货和活动报名sku优化 微信店铺统计优化

This commit is contained in:
wule committed 2026-04-21 11:57:22 +08:00
1 parent 90d40a6fd4
commit 79a752027a
20 files changed
+1481 -263

No files matched your search

@@ -136,6 +136,7 @@ namespace TemuKJD.PDDForms.ProductForms.ActivityForms
this.btnClear = new DevComponents.DotNetBar.PanelEx();
this.panelEx1 = new DevComponents.DotNetBar.PanelEx();
this.panel1 = new System.Windows.Forms.Panel();
this.chkLowPrice = new TemuKJD.UserComponent.UcCheckBox(this.components);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
@@ -191,6 +192,7 @@ namespace TemuKJD.PDDForms.ProductForms.ActivityForms
| System.Windows.Forms.AnchorStyles.Right)));
this.ucGroupBoxEx2.BorderColor = System.Drawing.Color.FromArgb(((int)(((byte)(63)))), ((int)(((byte)(126)))), ((int)(((byte)(255)))));
this.ucGroupBoxEx2.BorderStyle = TemuKJD.UserComponent.UcGroupBoxEx.GroupBoxBorderStyle.ROUND;
this.ucGroupBoxEx2.Controls.Add(this.chkLowPrice);
this.ucGroupBoxEx2.Controls.Add(this.label6);
this.ucGroupBoxEx2.Controls.Add(this.txtMultiCnt);
this.ucGroupBoxEx2.Controls.Add(this.label5);
@@ -1516,6 +1518,18 @@ namespace TemuKJD.PDDForms.ProductForms.ActivityForms
this.panel1.TabIndex = 189;
this.panel1.Paint += new System.Windows.Forms.PaintEventHandler(this.panel1_Paint);
//
// chkLowPrice
//
this.chkLowPrice.AutoSize = true;
this.chkLowPrice.Checked = true;
this.chkLowPrice.CheckState = System.Windows.Forms.CheckState.Checked;
this.chkLowPrice.Location = new System.Drawing.Point(662, 90);
this.chkLowPrice.Name = "chkLowPrice";
this.chkLowPrice.Size = new System.Drawing.Size(71, 21);
this.chkLowPrice.TabIndex = 914;
this.chkLowPrice.Text = "低价sku";
this.chkLowPrice.UseVisualStyleBackColor = true;
//
// PDDAddActivityForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -1663,5 +1677,6 @@ namespace TemuKJD.PDDForms.ProductForms.ActivityForms
private System.Windows.Forms.TextBox txtSleepTime;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.TextBox txtMultiCnt;
private UserComponent.UcCheckBox chkLowPrice;
}
}
@@ -504,7 +504,7 @@ namespace TemuKJD.PDDForms.ProductForms.ActivityForms
}
PDDActivitySubmitParam actSubmitParam = new PDDActivitySubmitParam();
actSubmitParam.activity_id = pddActivitiPriceInfo.activity_id;
actSubmitParam.activity_id = 21365;
actSubmitParam.enroll_source_ctx.enroll_type = 3;
actSubmitParam.enroll_source_ctx.scene_full_coverage = "mmsActBatchEnrollV1";
actSubmitParam.enroll_source_ctx.source_type = "MMSActicon";
@@ -3051,6 +3051,7 @@ namespace TemuKJD.PDDForms.ProductForms.ActivityForms
//var skuParam = JsonHelper.DeserializeJsonToObject<sku_param>(JsonHelper.SerializeObject(skuGetRstInfo));
var skuParam = new sku_param();
skuParam.sku_id = skuGetRstInfo.skuId;
skuParam.out_sku_sn = skuGetRstInfo.outSkuSn;
skuParam.thumb_url = skuGetRstInfo.skuThumbUrl;
skuParam.quantity_delta = skuGetRstInfo.skuQuantity;
skuParam.spec = new List<spec_param>();
@@ -3175,6 +3176,7 @@ namespace TemuKJD.PDDForms.ProductForms.ActivityForms
}
}
}
prodParamLst.RemoveAll(p => goodsIds.Contains(p.goods_id));
goodsIds = new List<long?>();
// 编辑部分sku价格不可报价商品
@@ -3205,6 +3207,7 @@ namespace TemuKJD.PDDForms.ProductForms.ActivityForms
});
}
}
var mdyQuantityRst = increase_prod_stock_quantity(shop, prodQuantity);
for (int i = 0; i < 5 && !mdyQuantityRst.Contains("\"success\":true"); i++)
{
@@ -3242,6 +3245,62 @@ namespace TemuKJD.PDDForms.ProductForms.ActivityForms
rowOperateLst = rowOperateLst.Where(r => prodParamLst.Any(p => p.goods_id == r.Cells["colSpuId"].Value.ParseToLong())).ToList();
}
if (chkLowPrice.Checked)
{
var goodsIds = new List<long?>();
foreach (var prodParam in prodParamLst)
{
var rws = rowOperateLst.Where(r => prodParam.goods_id == r.Cells["colSpuId"].Value.ParseToLong()).ToList();
Invoke(new Action(() =>
{
foreach (var rw in rws) rw.Cells["colOpResult"].Value += " 正在设置低价Sku";
}));
var lowPrice = prodParam.skus.Where(s => s.sku69_code != "yes" && s.quantity_delta != 0).ToList().Min(s => s.multi_price);
var skuTmp = prodParam.skus.Where(s => s.sku69_code != "yes" && s.quantity_delta != 0).ToList().FirstOrDefault(s => s.multi_price == lowPrice);
var skuTmpLst = prodParam.skus.Where(s => s.spec[0].spec_id == skuTmp.spec[0].spec_id && s.multi_price == lowPrice).ToList();
PddEditProdStockQuantity prodQuantity = new PddEditProdStockQuantity();
prodQuantity.data = new List<quantityData>();
foreach (var sku in skuTmpLst)
{
prodQuantity.data.Add(new quantityData()
{
beforeQuantity = sku.quantity_delta,
goodsId = prodParam.goods_id,
quantity = -sku.quantity_delta + 1,
skuId = sku.sku_id,
});
var prodInfo = lstActListProdInfo.FirstOrDefault(a => a.goods_id == prodParam.goods_id).productInfo;
var skuInfo = prodInfo.detail.sku.FirstOrDefault(s => s.out_sku_sn == sku.out_sku_sn);
if (skuInfo != null)
sku.multi_price = skuInfo.multi_price;
}
var mdyQuantityRst = increase_prod_stock_quantity(shop, prodQuantity);
for (int i = 0; i < 5 && !mdyQuantityRst.Contains("\"success\":true"); i++)
{
Thread.Sleep(Randomx.GetId(500, 1500));
mdyQuantityRst = increase_prod_stock_quantity(shop, prodQuantity);
}
if (!mdyQuantityRst.Contains("\"success\":true"))
{
goodsIds.Add(prodParam.goods_id);
var error = BaseRegex.GetStringJson(ref mdyQuantityRst, "error_msg");
if (string.IsNullOrEmpty(error))
error = mdyQuantityRst;
Invoke(new Action(() =>
{
foreach (var rw in rws)
rw.Cells["colOpResult"].Value = rw.Cells["colOpResult"].Value.ParseToString().Replace("正在优化商品以报名活动", "商品优化失败 " + error);
}));
continue;
}
}
}
string activityRsts = SignActivity(shop, prodParamLst, sign22347, sign20981, sign21365, sign15996, sign23513, sign23730, sign23456);
failList = JsonHelper.DeserializeJsonToList<AddActivityFailInfo>(activityRsts);
foreach (var prodParam in prodParamLst)
@@ -772,7 +772,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
"",
"是",
"否"});
this.cmbPddRelation.Location = new System.Drawing.Point(743, 5);
this.cmbPddRelation.Location = new System.Drawing.Point(743, 7);
this.cmbPddRelation.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.cmbPddRelation.Name = "cmbPddRelation";
this.cmbPddRelation.Size = new System.Drawing.Size(47, 25);
@@ -827,7 +827,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
this.cmbCat2.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.cmbCat2.FormattingEnabled = true;
this.cmbCat2.Location = new System.Drawing.Point(278, 77);
this.cmbCat2.Location = new System.Drawing.Point(278, 75);
this.cmbCat2.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.cmbCat2.Name = "cmbCat2";
this.cmbCat2.Size = new System.Drawing.Size(46, 25);
@@ -912,7 +912,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
"机会商品",
"以图搜品",
"外部数据"});
this.cmbSourceType.Location = new System.Drawing.Point(278, 42);
this.cmbSourceType.Location = new System.Drawing.Point(278, 40);
this.cmbSourceType.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.cmbSourceType.Name = "cmbSourceType";
this.cmbSourceType.Size = new System.Drawing.Size(46, 25);
@@ -958,7 +958,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
"",
"是",
"否"});
this.cmbWxCat.Location = new System.Drawing.Point(622, 7);
this.cmbWxCat.Location = new System.Drawing.Point(622, 5);
this.cmbWxCat.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.cmbWxCat.Name = "cmbWxCat";
this.cmbWxCat.Size = new System.Drawing.Size(47, 25);
@@ -980,7 +980,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.cmbSort.Items.AddRange(new object[] {
"入库时间",
"认领总数"});
this.cmbSort.Location = new System.Drawing.Point(381, 42);
this.cmbSort.Location = new System.Drawing.Point(381, 40);
this.cmbSort.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.cmbSort.Name = "cmbSort";
this.cmbSort.Size = new System.Drawing.Size(46, 25);
@@ -1056,7 +1056,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
this.cmbGroupFilter.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.cmbGroupFilter.FormattingEnabled = true;
this.cmbGroupFilter.Location = new System.Drawing.Point(175, 42);
this.cmbGroupFilter.Location = new System.Drawing.Point(175, 40);
this.cmbGroupFilter.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.cmbGroupFilter.Name = "cmbGroupFilter";
this.cmbGroupFilter.Size = new System.Drawing.Size(46, 25);
@@ -1071,7 +1071,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
"是",
"否",
"导出未拉回"});
this.cmbExportToOutServer.Location = new System.Drawing.Point(622, 42);
this.cmbExportToOutServer.Location = new System.Drawing.Point(622, 40);
this.cmbExportToOutServer.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.cmbExportToOutServer.Name = "cmbExportToOutServer";
this.cmbExportToOutServer.Size = new System.Drawing.Size(47, 25);
@@ -1107,7 +1107,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
"安全商品",
"违规商品",
"未校验"});
this.cmbWxSafe.Location = new System.Drawing.Point(501, 42);
this.cmbWxSafe.Location = new System.Drawing.Point(501, 40);
this.cmbWxSafe.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.cmbWxSafe.Name = "cmbWxSafe";
this.cmbWxSafe.Size = new System.Drawing.Size(47, 25);
@@ -1149,7 +1149,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
this.cmbCat1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.cmbCat1.FormattingEnabled = true;
this.cmbCat1.Location = new System.Drawing.Point(175, 77);
this.cmbCat1.Location = new System.Drawing.Point(175, 75);
this.cmbCat1.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.cmbCat1.Name = "cmbCat1";
this.cmbCat1.Size = new System.Drawing.Size(46, 25);
@@ -1171,7 +1171,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
//
this.cmbCat3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Left | System.Windows.Forms.AnchorStyles.Right)));
this.cmbCat3.FormattingEnabled = true;
this.cmbCat3.Location = new System.Drawing.Point(381, 77);
this.cmbCat3.Location = new System.Drawing.Point(381, 75);
this.cmbCat3.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.cmbCat3.Name = "cmbCat3";
this.cmbCat3.Size = new System.Drawing.Size(46, 25);
@@ -1268,7 +1268,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
"是",
"否",
"修复回传未拉回"});
this.cmbHasReturn.Location = new System.Drawing.Point(743, 42);
this.cmbHasReturn.Location = new System.Drawing.Point(743, 40);
this.cmbHasReturn.Margin = new System.Windows.Forms.Padding(0, 3, 3, 3);
this.cmbHasReturn.Name = "cmbHasReturn";
this.cmbHasReturn.Size = new System.Drawing.Size(47, 25);
@@ -332,6 +332,7 @@ namespace TemuKJD.PDDForms.ProductSelectForms
this.btnSeachPicUp.StyleMouseOver.BackColor2.Color = System.Drawing.Color.FromArgb(((int)(((byte)(25)))), ((int)(((byte)(102)))), ((int)(((byte)(255)))));
this.btnSeachPicUp.TabIndex = 845;
this.btnSeachPicUp.Text = "以图搜款";
this.btnSeachPicUp.Visible = false;
this.btnSeachPicUp.Click += new System.EventHandler(this.btnSeachPicUp_Click);
//
// txtMultiPcsSku4
File diff suppressed because it is too large. Load diff
+10 -13
View File
@@ -38,19 +38,13 @@ namespace TemuKJD.PDDForms.ShopForms
#region 服务端店铺管理
public static void UpdateShop()
{
// 获取本地店铺和服务端店铺。将服务端相关信息与本地店铺合并后暂时存在内存中(不保存敏感信息)。
// GlobalConfig.ShopLoginList = new ConcurrentList<ShopLoginInfo>();
// 获取服务端店铺
var serverShopList = PDDShopListForm.GetServerShop();
//var localShopList = new ConcurrentList<ShopLoginInfo>();
//localShopList.AddRange(serverShopList);
GlobalConfig.ShopLoginList.RemoveAll(s => !serverShopList.Any(ss => ss.LoginName == s.LoginName && ss.ShopId == ss.ShopId));
GlobalConfig.ShopLoginList.RemoveAll(s => !serverShopList.Any(ss => ss.UserName == s.UserName && ss.ShopId == s.ShopId));
foreach (var serverShop in serverShopList)
{
var localShop = serverShopList.FirstOrDefault(s => s.LoginName == serverShop.LoginName && s.ShopId == serverShop.ShopId);
if (localShop == null)
GlobalConfig.ShopLoginList.Add(serverShop);
else
var localShop = GlobalConfig.ShopLoginList.FirstOrDefault(s => s.LoginName == serverShop.LoginName && s.ShopId == serverShop.ShopId);
if (localShop != null)
{
localShop.ShopAccount = serverShop.ShopAccount;
localShop.LoginName = serverShop.LoginName;
@@ -77,11 +71,13 @@ namespace TemuKJD.PDDForms.ShopForms
localShop.AntiContents = serverShop.AntiContents;
localShop.AddProductRemaining = serverShop.AddProductRemaining;
localShop.OperateSubSaName = serverShop.OperateSubSaName;
if (localShop.TrialUploadCount < 0)
localShop.TrialUploadCount = 0;
localShop.TrialUploadCount = Math.Max(0, serverShop.TrialUploadCount);
}
else
{
GlobalConfig.ShopLoginList.Add(serverShop);
}
}
//PddApiHelper.GetPddLocalTokens();
PddApiHelper.GetShopClientInfo();
}
@@ -865,10 +861,11 @@ namespace TemuKJD.PDDForms.ShopForms
if (currentPddClient != null)
{
PDDShopLoginForm shopLoginForm = new PDDShopLoginForm(shop);
//shopLoginForm.InitUrl = "https://fuwu.pinduoduo.com/service-market/auth?client_id=" + PddApi.clientId_pi_xiu_guan_jia + "&redirect_uri=" + GetHtml.UrlEncodeUtf8("http://po.e57.cn/login") + "?source=pdd_code&response_type=code";
//shopLoginForm.InitUrl = "https://fuwu.pinduoduo.com/service-market/auth?client_id=" + PddApi.clientId_pi_xiu_guan_jia + "&redirect_uri=" + GetHtml.UrlEncodeUtf8("http://po.e57.cn/login?source=pdd_code") + "&response_type=code";
//shopLoginForm.InitUrl = "https://fuwu.pinduoduo.com/service-market/auth?client_id=48e76c60853d47d8a4e2e631b6db26b5&redirect_uri=http%3A%2F%2Fxtjpd.jiaotian.vip%2Fpdd_token.html&response_type=code"
shopLoginForm.InitUrl = "https://fuwu.pinduoduo.com/service-market/auth?client_id=" + currentPddClient.client_id +
"&redirect_uri=" + currentPddClient.redirect_uri + "&response_type=code";
//shopLoginForm.InitUrl = "https://fuwu.pinduoduo.com/service-market/auth?client_id=" + PddApi.clientId_pi_xiu_guan_jia + "&redirect_uri=" + GetHtml.UrlEncodeUtf8("http://po.e57.cn/login?source=pdd_code_pixiu") + "&response_type=code";
shopLoginForm.openType = EnumOpenType.manage;
shopLoginForm.AuthClientId = currentPddClient.client_id;
shopLoginForm.SaveComplete += shopLoginForm_SaveComplete;