调整备货逻辑不允许品质分过低的商品自动备货(完成但尚未测试) 注释无用的相关接口(原小奶狗,小奶兔)

This commit is contained in:
wule committed 2025-08-18 19:19:42 +08:00
1 parent fceead357f
commit 8445ec1828
19 files changed
+865 -540

No files matched your search

+8 -8
View File
@@ -757,14 +757,14 @@ namespace Work.Api
public static void Ini()
{
string[] l = FileBase.ReadAllLines("taobao_cat.ico");
for (int i = 0; l != null && i < l.Length; i++)
{
if (!l[i].Contains("\t"))
continue;
string[] s = l[i].Split('\t');
TaobaoCat.Add(int.Parse(s[0]), s[1]);
}
//string[] l = FileBase.ReadAllLines("taobao_cat.ico");
//for (int i = 0; l != null && i < l.Length; i++)
//{
// if (!l[i].Contains("\t"))
// continue;
// string[] s = l[i].Split('\t');
// TaobaoCat.Add(int.Parse(s[0]), s[1]);
//}
}
}
}
+36 -36
View File
@@ -15,44 +15,44 @@ namespace Work.Api
public static void Ini()
{
if (DefaultProperties.Count == 0)
{
GetDefaultProperties();
}
//string file = FileBase.ReadAllText("mobelx.dll");
//if (string.IsNullOrEmpty(file))
// return;
//CatTemplate = JsonHelper.DeserializeJsonToObject<Dictionary<int, CatTemplateBase>>(file);
//if (CatTemplate == null)
// CatTemplate = new Dictionary<int, CatTemplateBase>();
//for (int i = 0; i < Properties.Count; i++)
//if (DefaultProperties.Count == 0)
//{
// Properties[i].value_unit = "";
// for (int j = 0; j < Properties[i].Values.Count; j++)
// {
// if (string.IsNullOrEmpty(Properties[i].Values[j].p_unit))
// Properties[i].Values[j].p_unit = "";
// }
// if (Properties[i].pid == 93)
// {
// for (int j = 0; j < Properties[i].cats.Count; j++)
// {
// if (Properties.Exists(p => p.pid == 59 && p.cats.Contains(Properties[i].cats[j])))
// continue;
// var m = new ModelBase();
// m.name = "中国国家强制性产品认证证书";
// m.name_all = "中国国家强制性产品认证证书";
// m.must = true;
// m.show_type = 1;
// m.template_pid = 33178;
// m.template_module_id = 7207;
// m.pid = 59;
// m.cats = Properties[i].cats;
// m.value_unit = "";
// Properties.Add(m);
// }
// }
// GetDefaultProperties();
//}
////string file = FileBase.ReadAllText("mobelx.dll");
////if (string.IsNullOrEmpty(file))
//// return;
////CatTemplate = JsonHelper.DeserializeJsonToObject<Dictionary<int, CatTemplateBase>>(file);
////if (CatTemplate == null)
//// CatTemplate = new Dictionary<int, CatTemplateBase>();
////for (int i = 0; i < Properties.Count; i++)
////{
//// Properties[i].value_unit = "";
//// for (int j = 0; j < Properties[i].Values.Count; j++)
//// {
//// if (string.IsNullOrEmpty(Properties[i].Values[j].p_unit))
//// Properties[i].Values[j].p_unit = "";
//// }
//// if (Properties[i].pid == 93)
//// {
//// for (int j = 0; j < Properties[i].cats.Count; j++)
//// {
//// if (Properties.Exists(p => p.pid == 59 && p.cats.Contains(Properties[i].cats[j])))
//// continue;
//// var m = new ModelBase();
//// m.name = "中国国家强制性产品认证证书";
//// m.name_all = "中国国家强制性产品认证证书";
//// m.must = true;
//// m.show_type = 1;
//// m.template_pid = 33178;
//// m.template_module_id = 7207;
//// m.pid = 59;
//// m.cats = Properties[i].cats;
//// m.value_unit = "";
//// Properties.Add(m);
//// }
//// }
////}
}
/// <summary>
/// 获取必填项
+51 -51
View File
@@ -22,58 +22,58 @@ namespace Work.CollectClass
/// </summary>
public void Get()
{
string url = BaseClass.LoginApiUrl + "taobao/筛选词.txt";
string path = "temp/notitleword.tjm";
string html;
if (FileBase.Exists(path))
html = FileBase.ReadAllText(path, Encoding.Default);
else
{
html = GetHtml.Utf8(url);
FileBase.WriteAllText(path, html, Encoding.Default);
}
if (string.IsNullOrEmpty(html))
{
LogSave.Add("链接云数据库失败");
return;
}
string[] l = html.Split('\n');
for (int i = 0; i < l.Length; i++)
{
string s = l[i].Trim();
if (string.IsNullOrEmpty(s) || s.Length < 2)
continue;
string num = BaseRegex.GetMatchRegexString(ref s, @"([\d]+)");
if (!string.IsNullOrEmpty(num) && num.Length == s.Length)
continue;
NoTitleWord.Add(s);
}
//string url = BaseClass.LoginApiUrl + "taobao/筛选词.txt";
//string path = "temp/notitleword.tjm";
//string html;
//if (FileBase.Exists(path))
// html = FileBase.ReadAllText(path, Encoding.Default);
//else
//{
// html = GetHtml.Utf8(url);
// FileBase.WriteAllText(path, html, Encoding.Default);
//}
//if (string.IsNullOrEmpty(html))
//{
// LogSave.Add("链接云数据库失败");
// return;
//}
//string[] l = html.Split('\n');
//for (int i = 0; i < l.Length; i++)
//{
// string s = l[i].Trim();
// if (string.IsNullOrEmpty(s) || s.Length < 2)
// continue;
// string num = BaseRegex.GetMatchRegexString(ref s, @"([\d]+)");
// if (!string.IsNullOrEmpty(num) && num.Length == s.Length)
// continue;
// NoTitleWord.Add(s);
//}
url = BaseClass.LoginApiUrl + "taobao/品牌词.txt";
path = "temp/nobrand.tjm";
if (FileBase.Exists(path))
html = FileBase.ReadAllText(path, Encoding.Default);
else
{
html = GetHtml.Utf8(url);
FileBase.WriteAllText(path, html, Encoding.Default);
}
if (string.IsNullOrEmpty(html))
{
LogSave.Add("链接云数据库失败");
return;
}
l = html.Split('\n');
for (int i = 0; i < l.Length; i++)
{
string s = l[i].Trim();
if (string.IsNullOrEmpty(s) || s.Length < 2)
continue;
string num = BaseRegex.GetMatchRegexString(ref s, @"([\d]+)");
if (!string.IsNullOrEmpty(num) && num.Length == s.Length)
continue;
NoBrand.Add(s);
}
//url = BaseClass.LoginApiUrl + "taobao/品牌词.txt";
//path = "temp/nobrand.tjm";
//if (FileBase.Exists(path))
// html = FileBase.ReadAllText(path, Encoding.Default);
//else
//{
// html = GetHtml.Utf8(url);
// FileBase.WriteAllText(path, html, Encoding.Default);
//}
//if (string.IsNullOrEmpty(html))
//{
// LogSave.Add("链接云数据库失败");
// return;
//}
//l = html.Split('\n');
//for (int i = 0; i < l.Length; i++)
//{
// string s = l[i].Trim();
// if (string.IsNullOrEmpty(s) || s.Length < 2)
// continue;
// string num = BaseRegex.GetMatchRegexString(ref s, @"([\d]+)");
// if (!string.IsNullOrEmpty(num) && num.Length == s.Length)
// continue;
// NoBrand.Add(s);
//}
}
}
+12 -12
View File
@@ -2112,18 +2112,18 @@ namespace Work.CollectClass
public static void GetServerCookies()
{
string url = BaseClass.LoginApiUrl + "?obj=upshopid/user_cookies";
string html = GetHtml.PostUtf8(url, "act=get_rand");
if (string.IsNullOrEmpty(html))
html = GetHtml.PostUtf8(url, "act=get_rand");
var m = BaseRegex.GetMatchRegex(ref html, "<user([^>]+?>)");
for (int i = 0; m != null && i < m.Count; i++)
{
string list = m[i].Groups[0].Value;
string mobile = BaseRegex.GetStringJson(ref list, "mobile");
string cookies = BaseRegex.GetStringJson(ref list, "cookies");
Mobiles.Add(new KeyValueBase(mobile, cookies));
}
//string url = BaseClass.LoginApiUrl + "?obj=upshopid/user_cookies";
//string html = GetHtml.PostUtf8(url, "act=get_rand");
//if (string.IsNullOrEmpty(html))
// html = GetHtml.PostUtf8(url, "act=get_rand");
//var m = BaseRegex.GetMatchRegex(ref html, "<user([^>]+?>)");
//for (int i = 0; m != null && i < m.Count; i++)
//{
// string list = m[i].Groups[0].Value;
// string mobile = BaseRegex.GetStringJson(ref list, "mobile");
// string cookies = BaseRegex.GetStringJson(ref list, "cookies");
// Mobiles.Add(new KeyValueBase(mobile, cookies));
//}
}
public static string GetRandomPDDAccessToken(Func<PinDuoDuoTokenInfo, bool> predicateToken)
+64 -61
View File
@@ -32,6 +32,7 @@ namespace Work
public static void InitProgress(int i)
{
Thread.Sleep(Randomx.GetId(10, 100));
InitPercent += i;
if (InitPercent > 100)
InitPercent = 100;
@@ -91,22 +92,22 @@ offCountPara,false;offProductPara,100;IrregularitiesPara,true;noNeerPara,true;no
Directory.Delete(System.Environment.CurrentDirectory + "\\data1", true);
});
//Task.Run(() => { Update(); InitProgress(1); });
Task.Run(() => { CheckUpdate(); InitProgress(1); });
Task.Run(() => { CheckUpdate(); InitProgress(2); });
Task.Run(() => { GetAuthConfig(); InitProgress(1); });
Task.Run(() => { CheckFiles(); IsCheckFilesFinish = true; InitProgress(1); });
Task.Run(() => { CheckFiles(); IsCheckFilesFinish = true; InitProgress(2); });
//Task.Run(() => { CheckUpdataFile(); });
Task.Run(() => { new Segment().GetWord(); InitProgress(1); });
//Task.Run(() => { new PinduoduoCatList().Get(); InitProgress(1); }); // pdd cat
Task.Run(() => { GetMacCode(); InitProgress(1); });
#if DEBUG
if (!File.Exists(System.Environment.CurrentDirectory + "\\TemuKJD.exe.choice.debug.tools"))
Task.Run(() => { new CheckHecker().Check(); InitProgress(1); }); // 防止破解
Task.Run(() => { new CheckHecker().Check(); InitProgress(2); }); // 防止破解
#else
Task.Run(() => { new CheckHecker().Check(); InitProgress(1); }); // 防止破解
Task.Run(() => { new CheckHecker().Check(); InitProgress(2); }); // 防止破解
#endif
Task.Run(() => { PinduoduoProductCollect.GetServerCookies(); InitProgress(1); });
Task.Run(() => { new LoadCloudData().Get(); InitProgress(1); }); // 加载云数据
Task.Run(() => { new BigDataBuild("").Ini(); InitProgress(1); }); // 加载云数据
Task.Run(() => { PinduoduoProductCollect.GetServerCookies(); InitProgress(2); });
Task.Run(() => { new LoadCloudData().Get(); InitProgress(2); }); // 加载云数据
Task.Run(() => { new BigDataBuild("").Ini(); InitProgress(2); }); // 加载云数据
new FromTitleToCat();
InitProgress(1);
@@ -288,26 +289,26 @@ offCountPara,false;offProductPara,100;IrregularitiesPara,true;noNeerPara,true;no
/// </summary>
private void Update()
{
string upfilepath = Application.StartupPath + "\\Updatex.exe";
File.WriteAllText(Application.StartupPath + "\\updateconfig.ini", BaseClass.VersionCount
+ "\r\nhttps://update.qixiaoke.com/littlerabbit_update/uploader.php");
if (File.Exists(upfilepath))
{
string fc = GetMD5(upfilepath);
if (fc != "001EC5642914325F1DCF6E69BBA90738")
{
GetHtml.DownloadFile("http://dl.qixiaoke.com/Update3.1.exe", upfilepath);
}
}
else//如果自动更新文件不存在,则强制更新主文件
GetHtml.DownloadFile("http://dl.qixiaoke.com/Update3.1.exe", upfilepath);
try
{
Process.Start(upfilepath);
}
catch
{
}
//string upfilepath = Application.StartupPath + "\\Updatex.exe";
//File.WriteAllText(Application.StartupPath + "\\updateconfig.ini", BaseClass.VersionCount
//+ "\r\nhttps://update.qixiaoke.com/littlerabbit_update/uploader.php");
//if (File.Exists(upfilepath))
//{
// string fc = GetMD5(upfilepath);
// if (fc != "001EC5642914325F1DCF6E69BBA90738")
// {
// GetHtml.DownloadFile("http://dl.qixiaoke.com/Update3.1.exe", upfilepath);
// }
//}
//else//如果自动更新文件不存在,则强制更新主文件
// GetHtml.DownloadFile("http://dl.qixiaoke.com/Update3.1.exe", upfilepath);
//try
//{
// Process.Start(upfilepath);
//}
//catch
//{
//}
InitProgress(1);
}
@@ -679,12 +680,14 @@ offCountPara,false;offProductPara,100;IrregularitiesPara,true;noNeerPara,true;no
Directory.CreateDirectory("x64");
if (!Directory.Exists("x86"))
Directory.CreateDirectory("x86");
if (!Directory.Exists("ru-ru"))
Directory.CreateDirectory("ru-ru");
//if (!Directory.Exists("ru-ru"))
// Directory.CreateDirectory("ru-ru");
if (!Directory.Exists("temp"))
Directory.CreateDirectory("temp");
if (!Directory.Exists("temp/image"))
Directory.CreateDirectory("temp/image");
//if (!Directory.Exists("temp/image"))
// Directory.CreateDirectory("temp/image");
/*
List<KeyValueBase> files = new List<KeyValueBase>();
files.Add(new KeyValueBase("标题包含过滤_new.txt", "config/标题包含过滤x.ini"));
files.Add(new KeyValueBase("标题过滤词_new.txt", "config/标题过滤词x.ini"));
@@ -804,7 +807,7 @@ offCountPara,false;offProductPara,100;IrregularitiesPara,true;noNeerPara,true;no
else
{
InitProgress(20);
}
}*/
Task.Run(() => { new AddressSetIni().Ini(); InitProgress(1); });
Task.Run(() => { new AddressSetIni().getAddress1688(); InitProgress(1); });
Task.Run(() => { FromTitleToCat.Ini(); InitProgress(1); });
@@ -815,32 +818,32 @@ offCountPara,false;offProductPara,100;IrregularitiesPara,true;noNeerPara,true;no
try
{
//加载违规商品Id
string idslines = File.ReadAllText("temp/ids.dll", Encoding.Default);
if (!string.IsNullOrEmpty(idslines))
{
foreach (string s in idslines.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries))
{
if (string.IsNullOrEmpty(s) || s == "0" || s.Contains("?") || s.Contains("@"))
continue;
if (s.Trim().Length < 2)
continue;
UploadPinduoduoMain.RuleIds.Add(s);
}
}
//加载违规商品标题
string tidslines = File.ReadAllText("temp/tids.dll", Encoding.Default);
if (!string.IsNullOrEmpty(tidslines))
{
foreach (string s in tidslines.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries))
{
if (string.IsNullOrEmpty(s) || s == "0")
continue;
if (s.Trim().Length < 2)
continue;
UploadPinduoduoMain.RuleTitles.Add(s);
}
}
////加载违规商品Id
//string idslines = File.ReadAllText("temp/ids.dll", Encoding.Default);
//if (!string.IsNullOrEmpty(idslines))
//{
// foreach (string s in idslines.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries))
// {
// if (string.IsNullOrEmpty(s) || s == "0" || s.Contains("?") || s.Contains("@"))
// continue;
// if (s.Trim().Length < 2)
// continue;
// UploadPinduoduoMain.RuleIds.Add(s);
// }
//}
////加载违规商品标题
//string tidslines = File.ReadAllText("temp/tids.dll", Encoding.Default);
//if (!string.IsNullOrEmpty(tidslines))
//{
// foreach (string s in tidslines.Split(new string[] { Environment.NewLine }, StringSplitOptions.RemoveEmptyEntries))
// {
// if (string.IsNullOrEmpty(s) || s == "0")
// continue;
// if (s.Trim().Length < 2)
// continue;
// UploadPinduoduoMain.RuleTitles.Add(s);
// }
//}
InitProgress(1);
}
@@ -865,7 +868,7 @@ offCountPara,false;offProductPara,100;IrregularitiesPara,true;noNeerPara,true;no
// AlibabaShop.NoTitleWords.Add(s.Trim());
// }
//
// InitProgress(1);
InitProgress(1);
//}
//lines = File.ReadAllText("config/属性过滤词x.ini", Encoding.Default);
@@ -882,7 +885,7 @@ offCountPara,false;offProductPara,100;IrregularitiesPara,true;noNeerPara,true;no
//AlibabaShop.NoPropWords.Add(s.Trim());
//}
//InitProgress(1);
InitProgress(1);
//}
//lines = File.ReadAllText("config/品牌属性过滤x.ini", Encoding.Default);
//if (!string.IsNullOrEmpty(lines))
@@ -898,7 +901,7 @@ offCountPara,false;offProductPara,100;IrregularitiesPara,true;noNeerPara,true;no
//AlibabaShop.NoBrandName.Add(s.Trim());
//}
//InitProgress(1);
InitProgress(1);
//}
//lines = File.ReadAllText("config/标题包含过滤x.ini", Encoding.Default);
//if (!string.IsNullOrEmpty(lines))
+33 -34
View File
@@ -40,42 +40,41 @@ namespace Work.ManageClass
}
public void getAddress1688()
{
string strContent = FileBase.ReadAllText("1688_address.tjm");
strContent = GetHtml.UrlDecode(strContent);
var m = BaseRegex.GetMatchRegex(ref strContent, @"{[^}]+?}");
for (int i = 0; m != null && i < m.Count; i++)
{
//string strContent = FileBase.ReadAllText("1688_address.tjm");
//strContent = GetHtml.UrlDecode(strContent);
//var m = BaseRegex.GetMatchRegex(ref strContent, @"{[^}]+?}");
//for (int i = 0; m != null && i < m.Count; i++)
//{
string addressContent = m[i].Groups[0].Value;
AddressBase a = new AddressBase();
string[] addressArray = addressContent.Split(',');
for (int j = 0; j < addressArray.Length; j++)
{
var itemMatch = BaseRegex.GetMatchRegex(ref addressArray[j], @"([\w\W]+?):([\w\W]+)");
string itemname = itemMatch[0].Groups[1].Value.Replace("{", "");
string itemvalue = itemMatch[0].Groups[2].Value.Replace("\"", "").Replace("}", "");
if (itemname == "a")
{
a.Id = int.Parse(itemvalue);
}
if (itemname == "n")
{
a.Name = itemvalue;
}
if (itemname == "p")
{
a.UpId = int.Parse(itemvalue);
}
}
AddressAllList.Add(a);
if (!Addressdic.ContainsKey(a.Id))
Addressdic.Add(a.Id, new List<AddressBase>());
if (!Addressdic.ContainsKey(a.UpId))
Addressdic.Add(a.UpId, new List<AddressBase>());
Addressdic[a.UpId].Add(a);
}
// string addressContent = m[i].Groups[0].Value;
// AddressBase a = new AddressBase();
// string[] addressArray = addressContent.Split(',');
// for (int j = 0; j < addressArray.Length; j++)
// {
// var itemMatch = BaseRegex.GetMatchRegex(ref addressArray[j], @"([\w\W]+?):([\w\W]+)");
// string itemname = itemMatch[0].Groups[1].Value.Replace("{", "");
// string itemvalue = itemMatch[0].Groups[2].Value.Replace("\"", "").Replace("}", "");
// if (itemname == "a")
// {
// a.Id = int.Parse(itemvalue);
// }
// if (itemname == "n")
// {
// a.Name = itemvalue;
// }
// if (itemname == "p")
// {
// a.UpId = int.Parse(itemvalue);
// }
// }
// AddressAllList.Add(a);
// if (!Addressdic.ContainsKey(a.Id))
// Addressdic.Add(a.Id, new List<AddressBase>());
// if (!Addressdic.ContainsKey(a.UpId))
// Addressdic.Add(a.UpId, new List<AddressBase>());
// Addressdic[a.UpId].Add(a);
//}
}
}
public class AddressBase