订单功能服务端新增 商品编辑功能优化等
This commit is contained in:
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("导入完成!");
|
||||
}));
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user