1优化cookie登录检测逻辑 2调整标题重组逻辑不再强制前缀 3库存上传、选品上传显示提交时间 4备货管理使用双接口处理

This commit is contained in:
wule committed 2025-08-01 18:55:24 +08:00
1 parent c203c161a2
commit 7ea35b6866
22 files changed
+479 -490

No files matched your search

@@ -27,6 +27,8 @@ namespace TemuKJD.KJDForms.ProductForms
/// </summary>
public partial class SaleStockUpForm : BaseForm
{
public bool isNewService = false;
private CheckBox chkSelectAll = null;
//private CheckBox chkCheckAll = null;
public CancellationTokenSource cancellationTokenSource { get; set; } = null;
@@ -350,13 +352,16 @@ namespace TemuKJD.KJDForms.ProductForms
}
/// <summary>
/// 根据店铺获取备货单列表
/// 根据店铺获取备货单列表 首页--备货单管理--我的备货单
/// </summary>
/// <param name="shop"></param>
/// <param name="page"></param>
/// <returns></returns>
private string GetShopStockList(ShopLoginInfo shop, int page = 1, string type = "待创建")
{
if (isNewService)
return GetShopStockList2(shop, page, type);
page = Math.Max(page, 1);
string url = "https://seller.kuajingmaihuo.com/oms/bg/venom/api/supplier/purchase/manager/querySubOrderList";
string body;
@@ -370,14 +375,32 @@ namespace TemuKJD.KJDForms.ProductForms
return KJDHttpResponse.PostResponse(shop, url, body,refere);
}
private string GetShopStockList2(ShopLoginInfo shop, int page = 1, string type = "待创建")
{
page = Math.Max(page, 1);
string url = "https://agentseller.temu.com/mms/venom/api/supplier/purchase/manager/querySubOrderList";
string body;
if (type == "已送货")
body = @"{""pageNo"":" + page + @",""pageSize"":20,""urgencyType"":0,""isCustomGoods"":false,""statusList"":[2],""oneDimensionSort"":{""firstOrderByParam"":""realDeliverTime"",""firstOrderByDesc"":1}}"; //已送货
else
body = @"{""pageNo"":" + page + @",""pageSize"":20,""urgencyType"":0,""isCustomGoods"":false,""statusList"":[0],""oneDimensionSort"":{""firstOrderByParam"":""expectLatestDeliverTime"",""firstOrderByDesc"":0}}"; //待创建
string refere = "https://agentseller.temu.com/stock/fully-mgt/order-manage-urgency";
return KJDHttpResponse.PostResponse2(shop, url, body, refere);
}
/// <summary>
/// 取消待创建
/// 取消待创建备货单 首页--备货单管理--我的备货单
/// </summary>
/// <param name="shop"></param>
/// <param name="subPurchaseOrderSn"></param>
/// <returns></returns>
private string CancelSubPurchaseOrder(ShopLoginInfo shop, string subPurchaseOrderSn)
{
if (isNewService)
return CancelSubPurchaseOrder2(shop, subPurchaseOrderSn);
string url = "https://seller.kuajingmaihuo.com/oms/bg/venom/api/supplier/purchase/manager/batchCancelSubPurchaseOrder";
string body = "{\"subPurchaseOrderSnList\":[\"" + subPurchaseOrderSn + "\"]}";
string refere = "https://seller.kuajingmaihuo.com/main/order-manage";
@@ -385,8 +408,26 @@ namespace TemuKJD.KJDForms.ProductForms
return KJDHttpResponse.PostResponse(shop, url, body, refere);
}
private string CancelSubPurchaseOrder2(ShopLoginInfo shop, string subPurchaseOrderSn)
{
string url = "https://agentseller.temu.com/mms/venom/api/supplier/purchase/manager/batchCancelSubPurchaseOrder";
string body = "{\"subPurchaseOrderSnList\":[\"" + subPurchaseOrderSn + "\"]}";
string refere = "https://agentseller.temu.com/stock/fully-mgt/order-manage";
return KJDHttpResponse.PostResponse2(shop, url, body, refere);
}
/// <summary>
/// 查询销售列表
/// </summary>
/// <param name="shop"></param>
/// <param name="page"></param>
/// <returns></returns>
private string GetWarehouseList(ShopLoginInfo shop, int page = 1)
{
if (isNewService)
return GetWarehouseList2(shop, page);
page = Math.Max(page, 1);
string url = "https://seller.kuajingmaihuo.com/marvel-mms/cn/api/kiana/venom/sales/management/listWarehouse";
string body = @"{""pageNo"":" + page + @",""pageSize"":10,""isLack"":0,""selectStatusList"":[12],""priceAdjustRecentDays"":7}";
@@ -395,6 +436,16 @@ namespace TemuKJD.KJDForms.ProductForms
return KJDHttpResponse.PostResponse(shop, url, body, refere);
}
private string GetWarehouseList2(ShopLoginInfo shop, int page = 1)
{
page = Math.Max(page, 1);
string url = "https://agentseller.temu.com/mms/venom/api/supplier/sales/management/listWarehouse";
string body = @"{""pageNo"":" + page + @",""pageSize"":10,""isLack"":0,""selectStatusList"":[12],""priceAdjustRecentDays"":7}";
string refere = "https://agentseller.temu.com/stock/fully-mgt/sale-manage/main";
return KJDHttpResponse.PostResponse2(shop, url, body, refere);
}
/// <summary>
/// 查询单个商品申请备货条件
/// </summary>
@@ -403,13 +454,25 @@ namespace TemuKJD.KJDForms.ProductForms
/// <returns></returns>
private string QueryStockBaseInfo(ShopLoginInfo shop, SubOrderInfo subOrderInfo)
{
if (isNewService)
return QueryStockBaseInfo2(shop, subOrderInfo);
string url = "https://seller.kuajingmaihuo.com/oms/bg/venom/api/supplier/sales/management/queryStockBaseInfo";
string body = "{\"productSkcId\":" + subOrderInfo.productSkcId
+ ",\"warehouseGroupId\":" + subOrderInfo.warehouseGroupIdList.FirstOrDefault() + "}";
+ ",\"warehouseGroupId\":" + subOrderInfo.warehouseGroupIdList.FirstOrDefault() + "}";
string refere = "https://seller.kuajingmaihuo.com/main/sale-manage/main";
return KJDHttpResponse.PostResponse(shop, url, body, refere);
}
private string QueryStockBaseInfo2(ShopLoginInfo shop, SubOrderInfo subOrderInfo)
{
string url = "https://agentseller.temu.com/mms/venom/api/supplier/sales/management/queryStockBaseInfo";
string body = "{\"productSkcId\":" + subOrderInfo.productSkcId
+ ",\"warehouseGroupId\":" + subOrderInfo.warehouseGroupIdList.FirstOrDefault() + "}";
string refere = "https://agentseller.temu.com/stock/fully-mgt/sale-manage/main";
return KJDHttpResponse.PostResponse2(shop, url, body, refere);
}
/// <summary>
/// 单个商品申请备货
/// </summary>
@@ -418,6 +481,9 @@ namespace TemuKJD.KJDForms.ProductForms
/// <returns></returns>
private string CreateStockOrder(ShopLoginInfo shop, SubOrderInfo subOrderInfo)
{
if (isNewService)
return CreateStockOrder2(shop, subOrderInfo);
string url = "https://seller.kuajingmaihuo.com/oms/bg/venom/api/supplier/sales/management/createStockOrder";
string body = "{\"productSkcId\":" + subOrderInfo.productSkcId + "," +
"\"purchaseDetailList\":[";
@@ -432,6 +498,22 @@ namespace TemuKJD.KJDForms.ProductForms
return KJDHttpResponse.PostResponse(shop, url, body, refere);
}
private string CreateStockOrder2(ShopLoginInfo shop, SubOrderInfo subOrderInfo)
{
string url = "https://agentseller.temu.com/mms/venom/api/supplier/sales/management/createStockOrder";
string body = "{\"productSkcId\":" + subOrderInfo.productSkcId + "," +
"\"purchaseDetailList\":[";
foreach (var sku in subOrderInfo.skuQuantityDetailList)
{
if (sku.wantStockUpBound > 0)
body += "{\"productSkuId\":" + sku.productSkuId + ",\"productSkuPurchaseQuantity\":\"" + sku.wantStockUpBound + "\"},";
}
body = body.TrimEnd(',');
body += "],\"warehouseGroupId\":" + subOrderInfo.warehouseGroupIdList.FirstOrDefault() + "}";
string refere = "https://agentseller.temu.com/stock/fully-mgt/sale-manage/main";
return KJDHttpResponse.PostResponse2(shop, url, body, refere);
}
private void dgvShop_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
@@ -1042,5 +1124,10 @@ namespace TemuKJD.KJDForms.ProductForms
this.lblMinBound.Text = "备货量小于" + txtMinBound.Text.ParseToInt() + "按";
//this.chkIfLessMakeZero.Text = "平台允许备货数量小于" + txtMinBound.Text.ParseToInt() + "不备货";
}
private void chkNewService_CheckedChanged(object sender, EventArgs e)
{
this.isNewService = ucCheckBox1.Checked;
}
}
}