供应商采集相关功能 10%

This commit is contained in:
wule committed 2026-01-23 19:09:56 +08:00
1 parent 84dbc94047
commit 1b15eda63c
12 files changed
+963 -62

No files matched your search

@@ -265,8 +265,8 @@ namespace TemuKJD.WXForms.ProductForms
private void btnRefreshShop_Click(object sender, EventArgs e)
{
pbLoadingShop.Visible = true;
RefreshShop();
RefreshDbProd();
RefreshShop();
}
private void UserSelectDbProductForm_VisibleChanged(object sender, EventArgs e)
@@ -276,6 +276,25 @@ namespace TemuKJD.WXForms.ProductForms
RefreshShop();
RefreshDbProd();
if (!isInit)
{
Task.Run(() =>
{
foreach (var shop in GlobalConfig.ShopLoginList)
{
//if (shop.LoginStatus == "登录成功")
//{
// var rst = WXUpload.scanProductPreview(shop);
// if (!rst.Contains("\"code\":0") && !rst.Contains("\"success\":true"))
// {
// WXShopListForm.Instance.CheckShopLogin(new string[] { shop.LoginName }, false);
// }
//}
}
});
}
isInit = true;
}
}
@@ -286,6 +305,10 @@ namespace TemuKJD.WXForms.ProductForms
{
PDDDBProdListForm.GetPDDProductGroup(cmbGroupFilter); // 同时刷新下商品分组
GetPddProductCate();
Invoke(new Action(() =>
{
pbLoadingShop.Visible = false;
}));
});
}
@@ -364,7 +387,8 @@ namespace TemuKJD.WXForms.ProductForms
canUse,
dicShopUpload.ContainsKey(shopEntity.ShopId) && dicShopUpload[shopEntity.ShopId].DicDayUploadCount.ContainsKey(day) ?
dicShopUpload[shopEntity.ShopId].DicDayUploadCount[day] : 0,
0,
dicShopUpload.ContainsKey(shopEntity.ShopId) && dicShopUpload[shopEntity.ShopId].OnSaleRefreshDay == DateTime.Now.ToString("yyyyMMdd").ParseToInt() ?
dicShopUpload[shopEntity.ShopId].OnSaleCount : 0,
shopEntity.AddProductRemaining,
string.Empty
);
@@ -379,6 +403,10 @@ namespace TemuKJD.WXForms.ProductForms
row.Cells["colLoginStatus"].Style.ForeColor = canUse ? Color.Green : Color.Red;
row.Cells["colCanUse"].Value = canUse;
row.Cells["colRemaining"].Value = shopEntity.AddProductRemaining;
row.Cells["colUploadCount"].Value = dicShopUpload.ContainsKey(shopEntity.ShopId) && dicShopUpload[shopEntity.ShopId].DicDayUploadCount.ContainsKey(day) ?
dicShopUpload[shopEntity.ShopId].DicDayUploadCount[day] : 0;
row.Cells["colOnSaleNum"].Value = dicShopUpload.ContainsKey(shopEntity.ShopId) && dicShopUpload[shopEntity.ShopId].OnSaleRefreshDay == DateTime.Now.ToString("yyyyMMdd").ParseToInt() ?
dicShopUpload[shopEntity.ShopId].OnSaleCount : 0;
}
}
@@ -2891,6 +2919,24 @@ Content-Type: application/octet-stream
var result = WXHttpResponseBLL.WeiXinPostResponse(shop, url, body, referer);
return result;
}
/// <summary>
/// 商品列表
/// </summary>
/// <param name="shop"></param>
/// <param name="status"></param>
/// <param name="pageNum"></param>
/// <param name="pageSize"></param>
/// <returns></returns>
public static string scanProductPreview(ShopLoginInfo shop, string status = "5", int pageNum = 1, int pageSize = 20)
{
string url = "https://store.weixin.qq.com/shop-faas/mmchannelstradeproductcore/cgi/goods/scanProductPreview?token=&lang=zh_CN";
string referer = "https://store.weixin.qq.com/shop/goods/list?currentTab=PRODUCT_STATUS_ALL";
string body = @"{""pageSize"":" + pageSize + @",""productStatus"":[-1],""productSource"":""[1,16,32]"",""searchSource"":1,""useNew"":true,""pageNum"":" + pageNum +
@",""status"":[" + status + @"]}";
var result = WXHttpResponseBLL.WeiXinPostResponse(shop, url, body, referer);
return result;
}
}
public class AddPriceRule