订单功能服务端新增 商品编辑功能优化等

This commit is contained in:
wule committed 2026-06-19 16:53:34 +08:00
1 parent 33eafd6781
commit f2534535f7
22 files changed
+911 -98

No files matched your search

@@ -466,9 +466,24 @@ namespace TemuKJD.WXForms.ProductForms
if (itemObj["serviceName"].ParseToString() == "店统领供应链-商品管理")
{
var expiresTick = itemObj["expireTime"].ParseToLong();
GlobalConfig.lstWxShopAuthInfo.Add(new AuthInfo() { ShopId = shop.ShopId, UpdateTime = DateTime.Now, ExpiresTime = BaseClass.StampToDateTime(expiresTick.ParseToInt()) });
Invoke(new Action(() => { BindShop(shop, selectIds, "已查询"); }));
return;
var WxShopAuthInfo = new AuthInfo() { ShopId = shop.ShopId, UpdateTime = DateTime.Now, ExpiresTime = BaseClass.StampToDateTime(expiresTick.ParseToInt()) };
if (WxShopAuthInfo.ExpiresTime > DateTime.Now)
{
GlobalConfig.lstWxShopAuthInfo.Add(WxShopAuthInfo);
Invoke(new Action(() => { BindShop(shop, selectIds, "已查询"); }));
return;
}
}
if (itemObj["serviceName"].ParseToString() == "东内部")
{
var expiresTick = itemObj["expireTime"].ParseToLong();
var WxShopAuthInfo = new AuthInfo() { ShopId = shop.ShopId, UpdateTime = DateTime.Now, ExpiresTime = BaseClass.StampToDateTime(expiresTick.ParseToInt()) };
if (WxShopAuthInfo.ExpiresTime > DateTime.Now)
{
GlobalConfig.lstWxShopAuthInfo.Add(WxShopAuthInfo);
Invoke(new Action(() => { BindShop(shop, selectIds, "已查询"); }));
return;
}
}
}
// 没找到指定服务
@@ -493,12 +493,12 @@ namespace TemuKJD.WXForms.ProductForms
{
var prodObjs = JsonHelper.JObjectParse(getProdOnSaleRst);
// 按商品id查询不需要
//if (page == 1 || 1 == 1)
//{
// var totalNum = prodObjs["totalNum"].ParseToInt();
// totalPage = Math.Ceiling(1m * totalNum / pageSize).ParseToInt();
//}
//nextKey = prodObjs["nextKey"].ParseToString();
if (page == 1 || 1 == 1)
{
var totalNum = prodObjs["totalNum"].ParseToInt();
totalPage = Math.Ceiling(1m * totalNum / pageSize).ParseToInt();
}
nextKey = prodObjs["nextKey"].ParseToString();
Invoke(new Action(() =>
{
this.pbLoading.Visible = true;
@@ -152,7 +152,7 @@ namespace TemuKJD.WXForms.ProductForms
SearchDbProd(1);
}
public void SearchDbProd(int page)
public void SearchDbProd(int page, string needKeepStatusText = "")
{
if (InvokeRequired)
{
@@ -256,6 +256,7 @@ namespace TemuKJD.WXForms.ProductForms
#if DEBUG
this.statusBar.lblTaskStatus.Text += ",耗时:" + seconds;
#endif
this.statusBar.lblTaskStatus.Text += needKeepStatusText;
}));
});
}
@@ -1093,19 +1094,37 @@ namespace TemuKJD.WXForms.ProductForms
foreach (var path in filePathLst)
{
string content = "";
string rst = "";
string rst = "商品未识别";
try
{
using (StreamReader sr = new StreamReader(path))
using (StreamReader sr = new StreamReader(path, Work.Api.UploadPinduoduoMain.GetFileEncoding(path)))
{
content = sr.ReadToEnd();
}
content = JsonHelper.SerializeObject(JsonHelper.JObjectParse(content));
if (content.Contains("\"spec_keys\"") && content.Contains("\"spec_values\"") && content.Contains("\"is_sku_pre_sale\""))
{
rst = new PDDProdFormConverter().PddFrontToPddBackConvert(content, true, null, true);
}
else if (content.Contains("\"destination_url\"") && content.Contains("\"destination_type\"") && content.Contains("\"pre_render_url\""))
//else if (content.Contains("\"destination_url\"") && content.Contains("\"destination_type\"") && content.Contains("\"pre_render_url\""))
//{
// rst = new PDDProdFormConverter().PddFrontToPddBackConvert2(content, true, null, true);
//}
//else if (content.Contains("\"goods_id\"") && content.Contains("\"goods_name\"") && content.Contains("\"gallery\"") &&
// content.Contains("\"priority\"") && content.Contains("\"enable_share\"") && content.Contains("\"decoration\"") &&
// content.Contains("\"goods_property\"") && content.Contains("\"ref_pid\"") && content.Contains("\"sku_id\"") &&
// content.Contains("\"quantity\"") && content.Contains("\"specs\"") && content.Contains("\"spec_key\"") &&
// content.Contains("\"spec_value\"") && content.Contains("\"group_price\"") && content.Contains("\"sku_price\"") &&
// content.Contains("img.pddpic.com") )
//{
// rst = new PDDProdFormConverter().PddFrontToPddBackConvert2(content, true, null, true);
//}
else if (content.Contains("\"goods_id\"") && content.Contains("\"goods_name\"") && content.Contains("\"gallery\"") &&
content.Contains("\"priority\"") && content.Contains("\"enable_share\"") && content.Contains("\"goods_property\"") &&
(content.Contains("\"ref_pid\"") || content.Contains("\"goods_property\":[]")) && content.Contains("\"sku_id\"") && content.Contains("\"quantity\"") &&
content.Contains("\"specs\"") && content.Contains("\"spec_key\"") && content.Contains("\"spec_value\"") &&
content.Contains("\"group_price\"") && content.Contains("img.pddpic.com"))
{
rst = new PDDProdFormConverter().PddFrontToPddBackConvert2(content, true, null, true);
}
@@ -1121,14 +1140,14 @@ namespace TemuKJD.WXForms.ProductForms
Invoke(new Action(() =>
{
this.statusBar.UpdateProgressBar(this.statusBar.pgbTaskProgress.Value + 1);
this.statusBar.lblTaskStatus.Text = "正在导入";
this.statusBar.lblTaskStatus.Text = "正在导入,尝试导入" + (successNum + failedNum) + ",成功" + successNum + ",失败" + failedNum;
}));
}
SearchDbProd(1);
SearchDbProd(1, " 导入完成,尝试导入" + (successNum + failedNum) + ",成功" + successNum + ",失败" + failedNum);
Invoke(new Action(() =>
{
pbLoading.Visible = false;
this.statusBar.lblTaskStatus.Text = "导入完成";
this.statusBar.lblTaskStatus.Text = "导入完成,尝试导入" + (successNum + failedNum) + ",成功" + successNum + ",失败" + failedNum;
BaseMsgForm.ShowInfo("导入完成!");
}));
});
@@ -116,7 +116,8 @@ namespace TemuKJD.WXForms.ShopForms
if (!this.Created)
break;
if (this.shop != null && currentUrl.TrimEnd('/') == shopMainUrl)
//if (this.shop != null && currentUrl.TrimEnd('/') == shopMainUrl)
if (this.shop != null && currentUrl.StartsWith( shopMainUrl))
{
if (!cefWebBrowser.GetBrowser().MainFrame.IsValid)
continue;
@@ -678,6 +679,7 @@ namespace TemuKJD.WXForms.ShopForms
{
var username = BaseRegex.GetStringJson(ref data, "username");
var maskMobile = BaseRegex.GetStringJson(ref data, "mobile");
var mall_name = BaseRegex.GetStringJson(ref data, "mall_name");
if (!string.IsNullOrEmpty(username) && !string.IsNullOrEmpty(maskMobile))
{
@@ -685,7 +687,7 @@ namespace TemuKJD.WXForms.ShopForms
if (string.IsNullOrWhiteSpace(maskMobile) || string.IsNullOrWhiteSpace(username))
return;
if (shop.LoginName.EndsWith(maskMobile) || shop.LoginName == username)
if (shop.LoginName.EndsWith(maskMobile) || shop.LoginName == username || shop.LoginName == mall_name)
{
lstShopCompany.Clear();
//var jObj = JObject.Parse(data);
@@ -709,6 +711,8 @@ namespace TemuKJD.WXForms.ShopForms
}
}
if (openType == EnumOpenType.manage && string.IsNullOrWhiteSpace(shop.MallId))
{
shop.MallId = BaseRegex.GetStringJson(ref data, "mall_id");