店铺列表读取bug修复
This commit is contained in:
1 parent
05a48bf605
commit
07f21e3831
5 files changed
+306
-127
No files matched your search
@@ -231,7 +231,6 @@ namespace _29WxOrderWpf
|
||||
return;
|
||||
|
||||
var tList = new List<Task>();
|
||||
var cList = new List<int>();
|
||||
List<ShopLoginInfo> list = new List<ShopLoginInfo>();
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
@@ -272,12 +271,6 @@ namespace _29WxOrderWpf
|
||||
list.Remove(shopExist);
|
||||
shopExist = list.LastOrDefault(l => l.ShopId == shop.ShopId);
|
||||
}
|
||||
// 更新店铺 // 代发管理中更新
|
||||
//foreach (var order in GlobalConfig.lstFilterOrder.Where(o => o.shop_id.ParseToString() == shop.ErpShopId).ToList())
|
||||
//{
|
||||
// foreach (var orderItem in order.orderItems)
|
||||
// orderItem.Shop = shop;
|
||||
//}
|
||||
list.Add(shop);
|
||||
|
||||
if (!GlobalConfig.ShopLoginList.Any(s => s.ShopId == shop.ShopId && !shop.is_point_shop_expire))
|
||||
@@ -286,55 +279,54 @@ namespace _29WxOrderWpf
|
||||
{
|
||||
GlobalConfig.ShopLoginList.Add(shop);
|
||||
}));
|
||||
|
||||
var t = Task.Run(() =>
|
||||
{
|
||||
while (cList.Count > 20)
|
||||
|
||||
Task.Run(() =>
|
||||
{
|
||||
while (tList.Count > 20)
|
||||
{
|
||||
tList.RemoveAll(ta => ta.IsFaulted || ta.IsCompleted || ta.IsCanceled);
|
||||
Thread.Sleep(100);
|
||||
}
|
||||
cList.Add(1);
|
||||
try
|
||||
{
|
||||
if (shop.LoginStatus == "登录成功")
|
||||
{
|
||||
shop.Is29Supplier = false;
|
||||
for (int i = 0; i < 100; i++)
|
||||
tList.Add(Task.Run(() =>
|
||||
{
|
||||
try
|
||||
{
|
||||
if (shop.LoginStatus == "登录成功")
|
||||
{
|
||||
var is29SupplierRst = WxOrderSupplierBLL.GetWxSupplierListV2(shop);
|
||||
if (!is29SupplierRst.Contains("\"code\":0"))
|
||||
is29SupplierRst = WxOrderSupplierBLL.GetWxSupplierListV2(shop);
|
||||
if (is29SupplierRst.Contains("\"code\":0") && is29SupplierRst.Contains("\"name\":\"29供货商\""))
|
||||
shop.Is29Supplier = false;
|
||||
for (int i = 0; i < 100; i++)
|
||||
{
|
||||
shop.Is29Supplier = true;
|
||||
break;
|
||||
var is29SupplierRst = WxOrderSupplierBLL.GetWxSupplierListV2(shop);
|
||||
if (!is29SupplierRst.Contains("\"code\":0"))
|
||||
is29SupplierRst = WxOrderSupplierBLL.GetWxSupplierListV2(shop);
|
||||
if (is29SupplierRst.Contains("\"code\":0") && is29SupplierRst.Contains("\"name\":\"29供货商\""))
|
||||
{
|
||||
shop.Is29Supplier = true;
|
||||
break;
|
||||
}
|
||||
else if (!is29SupplierRst.Contains("\"code\":0"))
|
||||
{
|
||||
ShopBLL.CheckShopLogin(shop);
|
||||
}
|
||||
int totalCount = BaseRegex.GetIntJson(ref is29SupplierRst, "totalCount");
|
||||
if (i * 20 >= totalCount)
|
||||
break;
|
||||
}
|
||||
else if (!is29SupplierRst.Contains("\"code\":0"))
|
||||
{
|
||||
ShopBLL.CheckShopLogin(shop);
|
||||
}
|
||||
int totalCount = BaseRegex.GetIntJson(ref is29SupplierRst, "totalCount");
|
||||
if (i * 20 >= totalCount)
|
||||
break;
|
||||
}
|
||||
|
||||
foreach (var order in GlobalConfig.lstFilterOrder.Where(o => o.shop_id.ParseToString() == shop.ErpShopId).ToList())
|
||||
{
|
||||
// 更新代发管理情况
|
||||
foreach (var orderItem in order.orderItems)
|
||||
Dispatcher.Invoke(new Action(() => { orderItem.UpdateOrderItemBuyButton(); }));
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
//if (cList.Count > 0)
|
||||
// cList.RemoveAt(0);
|
||||
});
|
||||
tList.Add(t);
|
||||
}
|
||||
foreach (var order in GlobalConfig.lstFilterOrder.Where(o => o.shop_id.ParseToString() == shop.ErpShopId).ToList())
|
||||
{
|
||||
// 更新代发管理情况
|
||||
foreach (var orderItem in order.orderItems)
|
||||
Dispatcher.Invoke(new Action(() => { orderItem.UpdateOrderItemBuyButton(); }));
|
||||
}
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
}
|
||||
}));
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
|
||||
Reference in new issue
Block a user