店铺退货包裹读取放到后台

This commit is contained in:
wule committed 2025-08-21 19:34:57 +08:00
1 parent 4693c42024
commit 2a4a3ef744
13 files changed
+1021 -377

No files matched your search

+35
View File
@@ -21,6 +21,7 @@ using System.Threading.Tasks;
using Work;
using Work.DouyinApiClass;
using AllBase.Model.Param.TemuProductManage;
using TemuKJD.KJDForms.ShopForms;
namespace TemuKJD
{
@@ -216,6 +217,40 @@ namespace TemuKJD
//}
});
#endregion
#region 读取库存信息
Task.Run(() =>
{
while (!IsShopInit)
{
Thread.Sleep(100);
}
ReturnPackageDetailForm retrunPackageForm = new ReturnPackageDetailForm(null);
retrunPackageForm.Show();
retrunPackageForm.Hide();
Dictionary<ShopLoginInfo, string> dicUpReturn = new Dictionary<ShopLoginInfo, string>();
while(true)
{
foreach(var shop in GlobalConfig.ShopLoginList)
{
if (string.IsNullOrEmpty(shop.ShopId))
continue;
if (dicUpReturn.Keys.Contains(shop) && dicUpReturn[shop] == DateTime.Now.ToString("yyyyMMdd")) //今日已获取过
continue;
var rst = retrunPackageForm.GetReturnPackage(shop, true);
if (rst == false && shop.LoginStatus == "登录成功" && shop.LoginStatus2 == "国际版在线")
{
dicUpReturn[shop] = DateTime.Now.ToString("yyyyMMdd");
}
}
Thread.Sleep(1000 * 60 * 60);
}
});
#endregion
}
public static void InitProxy()