商品选品 更新类目 子账户单独批量修改 及其他功能
This commit is contained in:
1 parent
8e919b0bd7
commit
52220daa8b
46 files changed
+4960
-211
No files matched your search
+73
-2
@@ -308,13 +308,14 @@ namespace TemuKJD
|
||||
Task.Run(()=>
|
||||
{
|
||||
ReadWxCate();
|
||||
ReadWxCateBound();
|
||||
//ReadWxCateBound();
|
||||
ReadWxCateBound60323();
|
||||
});
|
||||
}
|
||||
|
||||
void ReadWxCate()
|
||||
{
|
||||
string filePath = Path.Combine(Environment.CurrentDirectory, "temp\\wxCat");
|
||||
string filePath = Path.Combine(Environment.CurrentDirectory, "temp\\wxCat60323");
|
||||
if (!File.Exists(filePath))
|
||||
return;
|
||||
using (StreamReader sr = new StreamReader(filePath, System.Text.Encoding.UTF8))
|
||||
@@ -363,6 +364,76 @@ namespace TemuKJD
|
||||
GlobalConfig.WxCatBoundList = new ConcurrentList<WxCatBoundInfo>();
|
||||
}
|
||||
|
||||
void ReadWxCateBound60323()
|
||||
{
|
||||
string filePath = Path.Combine(Environment.CurrentDirectory, "temp\\wxCatBound60323");
|
||||
if (!File.Exists(filePath))
|
||||
return;
|
||||
try
|
||||
{
|
||||
var catTxts = FileBase.ReadAllLines(filePath);
|
||||
foreach (var catTxt in catTxts)
|
||||
{
|
||||
if (catTxt.StartsWith("一级类目"))
|
||||
continue;
|
||||
var catTxtArr = catTxt.Replace("阴臀倒膜", "阴臀倒模").Replace("会员卡劵", "会员卡券").Replace("车载扩展坞", "车载拓展坞").Replace(",桔/橘,", ",柑/桔/橘,")
|
||||
.Replace(",水果,李,", ",水果,李子,").Replace("方便粉/螺狮粉","方便粉/螺蛳粉").Replace(",政治/军事,", ",军事/政治,").Replace(",计算机与互联网,", ",计算机/互联网,")
|
||||
.Replace(",人偶/BJD/兵人,", ",手办/人偶/BJD/兵人,").Split(',');
|
||||
var catName1 = catTxtArr[0].Trim();
|
||||
var catName2 = catTxtArr[1].Trim();
|
||||
var catName3 = catTxtArr[2].Trim();
|
||||
var catName4 = catTxtArr[3].Trim();
|
||||
var fullCatName = catName1 + "/" + catName2 + "/" + catName3 + "/" + catName4;
|
||||
fullCatName = fullCatName.Trim('/', ' ');
|
||||
WxCatInfo wxCat1 = GlobalConfig.WxCatList.FirstOrDefault(c => c.name == catName1);
|
||||
WxCatInfo wxCat2 = null;
|
||||
WxCatInfo wxCat3 = null;
|
||||
WxCatInfo wxCat4 = null;
|
||||
if (wxCat1 != null && !string.IsNullOrWhiteSpace(catName2))
|
||||
{
|
||||
wxCat2 = GlobalConfig.WxCatList.FirstOrDefault(c => c.name == catName2 && c.f_cat_id == wxCat1.cat_id);
|
||||
}
|
||||
if (wxCat2 != null && !string.IsNullOrWhiteSpace(catName3))
|
||||
{
|
||||
wxCat3 = GlobalConfig.WxCatList.FirstOrDefault(c => c.name == catName3 && c.f_cat_id == wxCat2.cat_id);
|
||||
}
|
||||
if (wxCat3 != null && !string.IsNullOrWhiteSpace(catName4))
|
||||
{
|
||||
wxCat4 = GlobalConfig.WxCatList.FirstOrDefault(c => c.name == catName4 && c.f_cat_id == wxCat3.cat_id);
|
||||
}
|
||||
List<WxCatInfo> catLst = new List<WxCatInfo> { wxCat1, wxCat2, wxCat3, wxCat4 };
|
||||
var leafCat = catLst.LastOrDefault(c => c != null && c.leaf);
|
||||
|
||||
try
|
||||
{
|
||||
if (leafCat != null)
|
||||
{
|
||||
var catTmp = catLst.LastOrDefault(c => c != null);
|
||||
var x = GlobalConfig.WxCatList.Where(c => c.f_cat_id == catTmp.cat_id);
|
||||
var xx = string.Join(",", x.Select(s => s.name));
|
||||
|
||||
GlobalConfig.WxCatBoundList.Add(new WxCatBoundInfo()
|
||||
{
|
||||
cat_bound = catTxtArr[5].ParseToInt(),
|
||||
full_cat_name = fullCatName,
|
||||
leaf_id = leafCat.cat_id.ParseToLong(),
|
||||
leaf_name = catTxtArr[1],
|
||||
});
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
BaseMsgForm.ShowError("类目价格获取失败:" + ex.Message);
|
||||
}
|
||||
if (GlobalConfig.WxCatBoundList == null)
|
||||
GlobalConfig.WxCatBoundList = new ConcurrentList<WxCatBoundInfo>();
|
||||
}
|
||||
|
||||
public void SetTitle()
|
||||
{
|
||||
lblVersionInfo.Text = BaseClass.ToolName + " V" + BaseClass.Varsion + " - " + BaseClass.NickName;
|
||||
|
||||
Reference in new issue
Block a user