temu推单相关功能
This commit is contained in:
1 parent
165df61234
commit
b05de6797e
27 files changed
+4561
-315
No files matched your search
@@ -21,6 +21,7 @@ using TemuKJD.KJDForms.ShopForms;
|
||||
using Work;
|
||||
using TemuKJD.KJDForms.JITForms;
|
||||
using AllBase.Helper;
|
||||
using NaiBa.Util;
|
||||
|
||||
namespace TemuKJD.KJDForms.AdminForms
|
||||
{
|
||||
@@ -31,9 +32,9 @@ namespace TemuKJD.KJDForms.AdminForms
|
||||
PriceCheckConfig priceCheckConfig = null;
|
||||
List<PriceCheckFilterConfig> lstPriceCheckFilterConfig = new List<PriceCheckFilterConfig>();
|
||||
public CancellationTokenSource cancellationTokenSource { get; set; } = null;
|
||||
public List<ShopLoginInfo> lstAdminShopInfo { get; set; } = new List<ShopLoginInfo>();
|
||||
public List<TemuForChainProductInfo> lstCheckPriceInfo = new List<TemuForChainProductInfo>();
|
||||
public List<CateSizeWeightConfig> lstCateSizeWeightConfig = new List<CateSizeWeightConfig>();
|
||||
public ConcurrentList<ShopLoginInfo> lstAdminShopInfo { get; set; } = new ConcurrentList<ShopLoginInfo>();
|
||||
public ConcurrentList<TemuForChainProductInfo> lstCheckPriceInfo = new ConcurrentList<TemuForChainProductInfo>();
|
||||
public ConcurrentList<CateSizeWeightConfig> lstCateSizeWeightConfig = new ConcurrentList<CateSizeWeightConfig>();
|
||||
|
||||
public AdminProductPriceCheckForm()
|
||||
{
|
||||
@@ -80,16 +81,18 @@ namespace TemuKJD.KJDForms.AdminForms
|
||||
pnlRestoreSizeAndNumber.Visible = false;
|
||||
btnRestoreSizeAndNumber.Text = "还原核价设置";
|
||||
|
||||
this.numJudgeLen.Value = 15;
|
||||
this.numJudgeWeight.Value = 150;
|
||||
this.numLen1.Value = 8;
|
||||
this.numLen2.Value = 8;
|
||||
this.numWidth1.Value = 7;
|
||||
this.numWidth2.Value = 7;
|
||||
this.numHeight1.Value = 6;
|
||||
this.numHeight2.Value = 6;
|
||||
this.numWeight1.Value = 6;
|
||||
this.numWeight2.Value = 6;
|
||||
this.numJudgeLen.Value = 26;
|
||||
this.numJudgeWeight.Value = 201;
|
||||
this.numLen1.Value = 25;
|
||||
this.numLen2.Value = 25;
|
||||
this.numWidth1.Value = 20;
|
||||
this.numWidth2.Value = 20;
|
||||
this.numHeight1.Value = 8;
|
||||
this.numHeight2.Value = 8;
|
||||
this.numWeight1.Value = 200;
|
||||
this.numWeight2.Value = 200;
|
||||
|
||||
btnSearchPrice3.Visible = false;
|
||||
}
|
||||
|
||||
if (IsClientJit)
|
||||
@@ -762,6 +765,20 @@ namespace TemuKJD.KJDForms.AdminForms
|
||||
this.dgvPriceCheck.Columns["colCancel"].Visible = false;
|
||||
this.dgvPriceCheck.Columns["colCancelWithTitleWrong"].Visible = true;
|
||||
SearchPrice("待创建首单");
|
||||
//SearchPrice("已发布到站点");
|
||||
}
|
||||
|
||||
private void btnSearchPrice3_Click(object sender, EventArgs e)
|
||||
{
|
||||
this.pnlDetailOperate1.Visible = false;
|
||||
this.btnMutliOk.Visible = false;
|
||||
this.btnMutliCancel.Visible = false;
|
||||
this.pnlMutliCancelWithTitleWrong.Visible = false;
|
||||
this.pnlMutliCancelWithTitleWrong.Location = btnMutliOk.Location;
|
||||
this.dgvPriceCheck.Columns["colOk"].Visible = false;
|
||||
this.dgvPriceCheck.Columns["colCancel"].Visible = false;
|
||||
this.dgvPriceCheck.Columns["colCancelWithTitleWrong"].Visible = false;
|
||||
SearchPrice("已发布到站点");
|
||||
}
|
||||
|
||||
private void SearchPrice(string type = "待卖家确认")
|
||||
@@ -1055,6 +1072,8 @@ namespace TemuKJD.KJDForms.AdminForms
|
||||
body += "\"priceReviewStatusList\":[1],\"secondarySelectStatusList\":[7],";
|
||||
else if (type == "待创建首单")
|
||||
body += "\"secondarySelectStatusList\":[10],";
|
||||
else if (type == "已发布到站点")
|
||||
body += "\"secondarySelectStatusList\":[12],\"supplierTodoTypeList\":[],";
|
||||
body += "\"supplierTodoTypeList\":[],";
|
||||
if (!string.IsNullOrEmpty(prodSkcIds))
|
||||
body += "\"productSkcIdList\":[" + prodSkcIds + "],";
|
||||
@@ -1145,7 +1164,7 @@ namespace TemuKJD.KJDForms.AdminForms
|
||||
/// <param name="shop"></param>
|
||||
/// <param name="productId"></param>
|
||||
/// <returns></returns>
|
||||
private string editPriceProductSizeAndNumberBatchAdd(ShopLoginInfo shop, string productId)
|
||||
public static string editPriceProductSizeAndNumberBatchAdd(ShopLoginInfo shop, string productId)
|
||||
{
|
||||
string url = "https://agentseller.temu.com/lich-mms/audit/edit/task/product/batchAdd";
|
||||
string body = @"{""bizIdType"":1,""bizIds"":[" + productId + @"],""productEditItems"":[{""editItem"":4,""editAdvice"":""优化""},{""editItem"":8,""editAdvice"":""优化""}]}";
|
||||
@@ -1153,7 +1172,7 @@ namespace TemuKJD.KJDForms.AdminForms
|
||||
return HttpResponseBLL.PostResponse2(shop, url, body, referer);
|
||||
}
|
||||
|
||||
private string editPriceProductSizeAndNumberTaskQuery(ShopLoginInfo shop, string productId)
|
||||
public static string editPriceProductSizeAndNumberTaskQuery(ShopLoginInfo shop, string productId)
|
||||
{
|
||||
string url = "https://agentseller.temu.com/lich-mms/audit/edit/task/product/pageQuery";
|
||||
string body = @"{""page"":1,""pageSize"":10,""editTaskAggStatuses"":[1],""productIdList"":[" + productId + "]}";
|
||||
@@ -1161,7 +1180,7 @@ namespace TemuKJD.KJDForms.AdminForms
|
||||
return HttpResponseBLL.PostResponse2(shop, url, body, referer);
|
||||
}
|
||||
|
||||
private string editPriceProductQuery(ShopLoginInfo shop, string prodId, string taskUid)
|
||||
public static string editPriceProductQuery(ShopLoginInfo shop, string prodId, string taskUid)
|
||||
{
|
||||
string url = "https://agentseller.temu.com/visage-agent-seller/product/query";
|
||||
string body = @"{""productId"":" + prodId + @",""productEditTaskUid"":""" + taskUid + @"""}";
|
||||
@@ -1169,14 +1188,25 @@ namespace TemuKJD.KJDForms.AdminForms
|
||||
return HttpResponseBLL.PostResponse2(shop, url, body, refere);
|
||||
}
|
||||
|
||||
private string queryProductSizeAndWeightConfig(ShopLoginInfo shop, string taskUid, string productId)
|
||||
public static string queryProductSizeAndWeightConfig(ShopLoginInfo shop, string taskUid, string productId, string catId)
|
||||
{
|
||||
string url = "https://agentseller.temu.com/anniston-agent-seller/product/check/common/queryConfig";
|
||||
string body = "{}";
|
||||
string referer = "https://agentseller.temu.com/goods/edit?from=platform&productId=" + productId + "&taskUid=" + taskUid;
|
||||
return HttpResponseBLL.PostResponse2(shop, url, body, referer);
|
||||
}
|
||||
private string editPriceProductSizeAndNumber(ShopLoginInfo shop, string taskUid, string productId, string data)
|
||||
|
||||
public static string queryCatSizeAndWeightConfig(ShopLoginInfo shop, string taskUid, string productId, string catId)
|
||||
{
|
||||
string url = "https://agentseller.temu.com/anniston-agent-seller/product/check/common/queryConfig";
|
||||
url = "https://agentseller.temu.com/anniston-agent-seller/product/check/cat/queryConfig";
|
||||
string body = "{}";
|
||||
body = @"{""catId"":" + catId + "}";
|
||||
string referer = "https://agentseller.temu.com/goods/edit?from=platform&productId=" + productId + "&taskUid=" + taskUid;
|
||||
referer = "https://agentseller.temu.com/goods/edit?from=productList&productId=" + productId;
|
||||
return HttpResponseBLL.PostResponse2(shop, url, body, referer);
|
||||
}
|
||||
public static string editPriceProductSizeAndNumber(ShopLoginInfo shop, string taskUid, string productId, string data)
|
||||
{
|
||||
string url = "https://agentseller.temu.com/visage-agent-seller/product/edit/task/reply";
|
||||
//string body = @"{""productId"":4432690492,""taskUid"":""8de73095-733e-4cdf-8fbd-3ddd8d9dff18"",""taskVersion"":0,""refuseEdit"":false,""productName"":""男士轻便 EVA 拖鞋,带钩环后跟带 ,舒适的露趾拖鞋,适合室内和室外使用,家居拖鞋,易于使用的魔鬼毡扣带扣,洞洞鞋,家居拖鞋,带钩环扣件,适合室内和室外使用,带扣凉鞋,后厨工专用鞋简约款两用,适合室内/室外使用,春夏凉鞋,EVA 拖鞋,适合19个不同的搭配风格""}";
|
||||
@@ -1865,7 +1895,7 @@ namespace TemuKJD.KJDForms.AdminForms
|
||||
|
||||
if (cateSizeWeightConfig == null)
|
||||
{
|
||||
var url = BaseClass.BuildObjString("product/get_cate_size_weight_config");
|
||||
var url = BaseClass.BuildObjString("product/get_cate_size_weight_config_v2");
|
||||
var data = UserLogin.GetSignaturex() +
|
||||
"&cat_id=" + catId;
|
||||
html = GetHtml.PostUtf8(url, data);
|
||||
@@ -1877,7 +1907,7 @@ namespace TemuKJD.KJDForms.AdminForms
|
||||
{
|
||||
var jArr = JObject.Parse(html)["data"];
|
||||
cateSizeWeightConfig = JsonHelper.DeserializeJsonToObject<CateSizeWeightConfig>(jArr.ToString());
|
||||
if (lstCateSizeWeightConfig != null)
|
||||
if (cateSizeWeightConfig != null)
|
||||
lstCateSizeWeightConfig.Add(cateSizeWeightConfig);
|
||||
}
|
||||
catch { }
|
||||
@@ -1887,36 +1917,57 @@ namespace TemuKJD.KJDForms.AdminForms
|
||||
if (cateSizeWeightConfig == null)
|
||||
{
|
||||
//查询接口尺寸重量限制
|
||||
html = queryProductSizeAndWeightConfig(shop, taskUid.ParseToString(), price.productId.ParseToString());
|
||||
html = queryProductSizeAndWeightConfig(shop, taskUid.ParseToString(), price.productId.ParseToString(), catId.ParseToString());
|
||||
var html1 = queryCatSizeAndWeightConfig(shop, taskUid.ParseToString(), price.productId.ParseToString(), catId.ParseToString());
|
||||
if (!string.IsNullOrEmpty(html1) && html1.Contains("length"))
|
||||
html = html1;
|
||||
//{"success":true,"errorCode":1000000,"errorMsg":null,"result":{"common":{"operatorId":null,"operatorName":null,"operatorType":null,"checkSideRelation":false,"noticeSideEquation":false,"length":{"min":10,"max":2999},"width":{"min":5,"max":2999},"height":{"min":2,"max":2999},"weight":{"min":2000,"max":99999000}}}}
|
||||
Thread.Sleep(Randomx.GetId(25, 75));
|
||||
commonSleep();
|
||||
if (html.Contains("\"success\":true"))
|
||||
{
|
||||
JObject jObj = JObject.Parse(html);
|
||||
cateSizeWeightConfig = new CateSizeWeightConfig() { catId = catId.ToString() };
|
||||
cateSizeWeightConfig.minLen = jObj["result"]["common"]["length"]["min"].ParseToInt();
|
||||
cateSizeWeightConfig.maxLen = jObj["result"]["common"]["length"]["max"].ParseToInt();
|
||||
cateSizeWeightConfig.minWidth = jObj["result"]["common"]["width"]["min"].ParseToInt();
|
||||
cateSizeWeightConfig.maxWidth = jObj["result"]["common"]["width"]["max"].ParseToInt();
|
||||
cateSizeWeightConfig.minHeight = jObj["result"]["common"]["height"]["min"].ParseToInt();
|
||||
cateSizeWeightConfig.maxHeight = jObj["result"]["common"]["height"]["max"].ParseToInt();
|
||||
cateSizeWeightConfig.minWeight = jObj["result"]["common"]["weight"]["min"].ParseToInt();
|
||||
cateSizeWeightConfig.maxWeight = jObj["result"]["common"]["weight"]["max"].ParseToInt();
|
||||
lstCateSizeWeightConfig.Add(cateSizeWeightConfig);
|
||||
try
|
||||
{
|
||||
JObject jObj = JObject.Parse(html);
|
||||
cateSizeWeightConfig = new CateSizeWeightConfig() { catId = catId.ToString() };
|
||||
if (html.Contains("common"))
|
||||
{
|
||||
cateSizeWeightConfig.minLen = jObj["result"]["common"]["length"]["min"].ParseToInt();
|
||||
cateSizeWeightConfig.maxLen = jObj["result"]["common"]["length"]["max"].ParseToInt();
|
||||
cateSizeWeightConfig.minWidth = jObj["result"]["common"]["width"]["min"].ParseToInt();
|
||||
cateSizeWeightConfig.maxWidth = jObj["result"]["common"]["width"]["max"].ParseToInt();
|
||||
cateSizeWeightConfig.minHeight = jObj["result"]["common"]["height"]["min"].ParseToInt();
|
||||
cateSizeWeightConfig.maxHeight = jObj["result"]["common"]["height"]["max"].ParseToInt();
|
||||
cateSizeWeightConfig.minWeight = jObj["result"]["common"]["weight"]["min"].ParseToInt();
|
||||
cateSizeWeightConfig.maxWeight = jObj["result"]["common"]["weight"]["max"].ParseToInt();
|
||||
}
|
||||
else
|
||||
{
|
||||
cateSizeWeightConfig.minLen = jObj["result"]["length"]["min"].ParseToInt();
|
||||
cateSizeWeightConfig.maxLen = jObj["result"]["length"]["max"].ParseToInt();
|
||||
cateSizeWeightConfig.minWidth = jObj["result"]["width"]["min"].ParseToInt();
|
||||
cateSizeWeightConfig.maxWidth = jObj["result"]["width"]["max"].ParseToInt();
|
||||
cateSizeWeightConfig.minHeight = jObj["result"]["height"]["min"].ParseToInt();
|
||||
cateSizeWeightConfig.maxHeight = jObj["result"]["height"]["max"].ParseToInt();
|
||||
cateSizeWeightConfig.minWeight = jObj["result"]["weight"]["min"].ParseToInt();
|
||||
cateSizeWeightConfig.maxWeight = jObj["result"]["weight"]["max"].ParseToInt();
|
||||
}
|
||||
lstCateSizeWeightConfig.Add(cateSizeWeightConfig);
|
||||
|
||||
var url = BaseClass.BuildObjString("product/add_cate_size_weight_config");
|
||||
var data = UserLogin.GetSignaturex();
|
||||
data += "&cat_id=" + catId;
|
||||
data += "&minLen=" + cateSizeWeightConfig.minLen;
|
||||
data += "&maxLen=" + cateSizeWeightConfig.maxLen;
|
||||
data += "&minWidth=" + cateSizeWeightConfig.minWidth;
|
||||
data += "&maxWidth=" + cateSizeWeightConfig.maxWidth;
|
||||
data += "&minHeight=" + cateSizeWeightConfig.minHeight;
|
||||
data += "&maxHeight=" + cateSizeWeightConfig.maxHeight;
|
||||
data += "&minWeight=" + cateSizeWeightConfig.minWeight;
|
||||
data += "&maxWeight=" + cateSizeWeightConfig.maxWeight;
|
||||
html = GetHtml.PostUtf8(url, data);
|
||||
var url = BaseClass.BuildObjString("product/add_cate_size_weight_config_v2");
|
||||
var data = UserLogin.GetSignaturex();
|
||||
data += "&cat_id=" + catId;
|
||||
data += "&minLen=" + cateSizeWeightConfig.minLen;
|
||||
data += "&maxLen=" + cateSizeWeightConfig.maxLen;
|
||||
data += "&minWidth=" + cateSizeWeightConfig.minWidth;
|
||||
data += "&maxWidth=" + cateSizeWeightConfig.maxWidth;
|
||||
data += "&minHeight=" + cateSizeWeightConfig.minHeight;
|
||||
data += "&maxHeight=" + cateSizeWeightConfig.maxHeight;
|
||||
data += "&minWeight=" + cateSizeWeightConfig.minWeight;
|
||||
data += "&maxWeight=" + cateSizeWeightConfig.maxWeight;
|
||||
html = GetHtml.PostUtf8(url, data);
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1942,16 +1993,18 @@ namespace TemuKJD.KJDForms.AdminForms
|
||||
}
|
||||
}
|
||||
|
||||
// 设置长宽高
|
||||
if (len < cateSizeWeightConfig.minLen) len = cateSizeWeightConfig.minLen;
|
||||
if (len > cateSizeWeightConfig.maxLen) len = cateSizeWeightConfig.maxLen;
|
||||
if (width < cateSizeWeightConfig.minWidth) width = cateSizeWeightConfig.minWidth;
|
||||
if (width > cateSizeWeightConfig.maxWidth) width = cateSizeWeightConfig.maxWidth;
|
||||
if (height < cateSizeWeightConfig.minHeight) height = cateSizeWeightConfig.minHeight;
|
||||
if (height > cateSizeWeightConfig.maxHeight) height = cateSizeWeightConfig.maxHeight;
|
||||
if (weight < cateSizeWeightConfig.minWeight) weight = cateSizeWeightConfig.minWeight;
|
||||
if (weight > cateSizeWeightConfig.maxWeight) weight = cateSizeWeightConfig.maxWeight;
|
||||
|
||||
if (cateSizeWeightConfig != null)
|
||||
{
|
||||
// 设置长宽高
|
||||
if (len < cateSizeWeightConfig.minLen) len = cateSizeWeightConfig.minLen;
|
||||
if (len > cateSizeWeightConfig.maxLen) len = cateSizeWeightConfig.maxLen;
|
||||
if (width < cateSizeWeightConfig.minWidth) width = cateSizeWeightConfig.minWidth;
|
||||
if (width > cateSizeWeightConfig.maxWidth) width = cateSizeWeightConfig.maxWidth;
|
||||
if (height < cateSizeWeightConfig.minHeight) height = cateSizeWeightConfig.minHeight;
|
||||
if (height > cateSizeWeightConfig.maxHeight) height = cateSizeWeightConfig.maxHeight;
|
||||
if (weight < cateSizeWeightConfig.minWeight) weight = cateSizeWeightConfig.minWeight;
|
||||
if (weight > cateSizeWeightConfig.maxWeight) weight = cateSizeWeightConfig.maxWeight;
|
||||
}
|
||||
|
||||
//JObject jPost = new JObject();
|
||||
//jPost.Add("productId", price.productId);
|
||||
|
||||
Reference in new issue
Block a user