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

@@ -68,7 +68,7 @@
this.panelCopyCookies.StyleMouseOver.Alignment = System.Drawing.StringAlignment.Center;
this.panelCopyCookies.StyleMouseOver.BackColor2.Color = System.Drawing.Color.LightGray;
this.panelCopyCookies.TabIndex = 575;
this.panelCopyCookies.Text = "复制Cookies成功后点我";
this.panelCopyCookies.Text = "复制Cookie成功后点我";
this.panelCopyCookies.Click += new System.EventHandler(this.panelCopyCookies_Click);
//
// panelInstall
@@ -203,7 +203,7 @@
this.label5.Name = "label5";
this.label5.Size = new System.Drawing.Size(551, 12);
this.label5.TabIndex = 595;
this.label5.Text = "第三步:解除滑块之后,点击点我复制原滑块链接按钮,复制网址到浏览器中,按照下面指示复制cookies";
this.label5.Text = "第三步:解除滑块之后,点击点我复制原滑块链接按钮,复制网址到浏览器中,按照下面指示复制Cookie";
//
// pictureBox1
//
+68 -69
View File
@@ -70,6 +70,13 @@ namespace TemuKJD.KJDForms.ProductForms
this.btnStop = new DevComponents.DotNetBar.PanelEx();
this.label1 = new System.Windows.Forms.Label();
this.dgvShop = new TemuKJD.UserComponent.DataGridViewEx();
this.colSelect = new TemuKJD.UserComponent.UcDataGridViewCheckBoxColumn(this.components);
this.colShopLoginName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colShopId = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colShopName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colLoginStatus = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colCanUse = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.colMessage = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ucGroupBoxEx99 = new TemuKJD.UserComponent.UcGroupBoxEx(this.components);
this.cmbCity = new DevComponents.DotNetBar.Controls.ComboBoxEx();
this.cmbProvince = new DevComponents.DotNetBar.Controls.ComboBoxEx();
@@ -132,13 +139,6 @@ namespace TemuKJD.KJDForms.ProductForms
this.statusBar = new TemuKJD.UserControls.StatusBarUserControl();
this.panelEx1 = new DevComponents.DotNetBar.PanelEx();
this.btnClear = new DevComponents.DotNetBar.PanelEx();
this.colSelect = new TemuKJD.UserComponent.UcDataGridViewCheckBoxColumn(this.components);
this.colShopLoginName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colShopId = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colShopName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colLoginStatus = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.colCanUse = new System.Windows.Forms.DataGridViewCheckBoxColumn();
this.colMessage = new System.Windows.Forms.DataGridViewTextBoxColumn();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
@@ -221,17 +221,16 @@ namespace TemuKJD.KJDForms.ProductForms
//
// ucCheckBox1
//
this.ucCheckBox1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.ucCheckBox1.AutoSize = true;
this.ucCheckBox1.Checked = true;
this.ucCheckBox1.CheckState = System.Windows.Forms.CheckState.Checked;
this.ucCheckBox1.Location = new System.Drawing.Point(505, 28);
this.ucCheckBox1.Location = new System.Drawing.Point(557, 34);
this.ucCheckBox1.Name = "ucCheckBox1";
this.ucCheckBox1.Size = new System.Drawing.Size(69, 21);
this.ucCheckBox1.Size = new System.Drawing.Size(87, 21);
this.ucCheckBox1.TabIndex = 713;
this.ucCheckBox1.Text = "123456";
this.ucCheckBox1.Text = "使用新接口";
this.ucCheckBox1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter;
this.ucCheckBox1.UseVisualStyleBackColor = true;
this.ucCheckBox1.Visible = false;
this.ucCheckBox1.CheckedChanged += new System.EventHandler(this.chkNewService_CheckedChanged);
//
// flowLayoutPanel1
//
@@ -749,6 +748,62 @@ namespace TemuKJD.KJDForms.ProductForms
this.dgvShop.TabIndex = 6;
this.dgvShop.CellContentClick += new System.Windows.Forms.DataGridViewCellEventHandler(this.dgvShop_CellContentClick);
//
// colSelect
//
this.colSelect.HeaderText = "全选";
this.colSelect.Name = "colSelect";
this.colSelect.ReadOnly = true;
this.colSelect.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colSelect.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colSelect.Width = 28;
//
// colShopLoginName
//
this.colShopLoginName.HeaderText = "店铺登录名";
this.colShopLoginName.Name = "colShopLoginName";
this.colShopLoginName.ReadOnly = true;
this.colShopLoginName.Visible = false;
//
// colShopId
//
this.colShopId.HeaderText = "店铺Id";
this.colShopId.Name = "colShopId";
this.colShopId.ReadOnly = true;
this.colShopId.Visible = false;
this.colShopId.Width = 55;
//
// colShopName
//
this.colShopName.FillWeight = 150F;
this.colShopName.HeaderText = "店铺名称";
this.colShopName.Name = "colShopName";
this.colShopName.ReadOnly = true;
this.colShopName.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colShopName.Width = 75;
//
// colLoginStatus
//
this.colLoginStatus.HeaderText = "登录状态";
this.colLoginStatus.Name = "colLoginStatus";
this.colLoginStatus.ReadOnly = true;
this.colLoginStatus.Width = 65;
//
// colCanUse
//
this.colCanUse.HeaderText = "可用";
this.colCanUse.Name = "colCanUse";
this.colCanUse.ReadOnly = true;
this.colCanUse.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colCanUse.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colCanUse.Width = 28;
//
// colMessage
//
this.colMessage.HeaderText = "消息";
this.colMessage.Name = "colMessage";
this.colMessage.ReadOnly = true;
this.colMessage.Width = 120;
//
// ucGroupBoxEx99
//
this.ucGroupBoxEx99.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
@@ -1524,62 +1579,6 @@ namespace TemuKJD.KJDForms.ProductForms
this.btnClear.Text = "清空结果";
this.btnClear.Visible = false;
//
// colSelect
//
this.colSelect.HeaderText = "全选";
this.colSelect.Name = "colSelect";
this.colSelect.ReadOnly = true;
this.colSelect.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colSelect.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colSelect.Width = 28;
//
// colShopLoginName
//
this.colShopLoginName.HeaderText = "店铺登录名";
this.colShopLoginName.Name = "colShopLoginName";
this.colShopLoginName.ReadOnly = true;
this.colShopLoginName.Visible = false;
//
// colShopId
//
this.colShopId.HeaderText = "店铺Id";
this.colShopId.Name = "colShopId";
this.colShopId.ReadOnly = true;
this.colShopId.Visible = false;
this.colShopId.Width = 55;
//
// colShopName
//
this.colShopName.FillWeight = 150F;
this.colShopName.HeaderText = "店铺名称";
this.colShopName.Name = "colShopName";
this.colShopName.ReadOnly = true;
this.colShopName.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colShopName.Width = 75;
//
// colLoginStatus
//
this.colLoginStatus.HeaderText = "登录状态";
this.colLoginStatus.Name = "colLoginStatus";
this.colLoginStatus.ReadOnly = true;
this.colLoginStatus.Width = 65;
//
// colCanUse
//
this.colCanUse.HeaderText = "可用";
this.colCanUse.Name = "colCanUse";
this.colCanUse.ReadOnly = true;
this.colCanUse.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.colCanUse.SortMode = System.Windows.Forms.DataGridViewColumnSortMode.Automatic;
this.colCanUse.Width = 28;
//
// colMessage
//
this.colMessage.HeaderText = "消息";
this.colMessage.Name = "colMessage";
this.colMessage.ReadOnly = true;
this.colMessage.Width = 120;
//
// SaleStockUpForm
//
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.None;
@@ -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;
}
}
}