删除不合适的仓库 优化订单和售后单读取
This commit is contained in:
1 parent
6f7aa58ac1
commit
13b68fa64e
53 files changed
+14843
-820
No files matched your search
@@ -31,12 +31,13 @@ using System.Windows.Documents;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Animation;
|
||||
using System.Windows.Media.Imaging;
|
||||
using System.Windows.Navigation;
|
||||
using System.Windows.Shapes;
|
||||
using System.Xml.Linq;
|
||||
using Work;
|
||||
using Work.BLL;
|
||||
using Work._29Tools.BLL;
|
||||
|
||||
namespace _29WxOrderWpf
|
||||
{
|
||||
@@ -58,6 +59,8 @@ namespace _29WxOrderWpf
|
||||
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ucWindowBox.SetWindowMax();
|
||||
|
||||
new Thread(AutoAntiGrabbingMechanism).Start(); // 反抓包
|
||||
|
||||
#region 弹出登录窗口
|
||||
@@ -199,7 +202,7 @@ namespace _29WxOrderWpf
|
||||
|
||||
private void BaseWindow_Closing(object sender, System.ComponentModel.CancelEventArgs e)
|
||||
{
|
||||
if (BaseMsgWindow.ShowConfirm(this, "是否关闭软件?", "退出微信小店订单管理").DialogResult == true)
|
||||
if (BaseMsgWindow.ShowConfirm("是否关闭软件?", "退出微信小店订单管理").DialogResult == true)
|
||||
Process.GetCurrentProcess().Kill();
|
||||
else
|
||||
e.Cancel = true;
|
||||
@@ -213,6 +216,8 @@ namespace _29WxOrderWpf
|
||||
if (isReadShop)
|
||||
return;
|
||||
|
||||
var tList = new List<Task>();
|
||||
var cList = new List<int>();
|
||||
List<ShopLoginInfo> list = new List<ShopLoginInfo>();
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
@@ -244,21 +249,67 @@ namespace _29WxOrderWpf
|
||||
{
|
||||
var shop = ShopBLL.DeserializationShop(jObj);
|
||||
|
||||
var shopExist = list.Where(l => l.ShopId == shop.ShopId).ToList();
|
||||
if (shopExist != null)
|
||||
shopExist.Remove(shop);
|
||||
|
||||
var shopExist = list.LastOrDefault(l => l.ShopId == shop.ShopId);
|
||||
while (shopExist != null)
|
||||
{
|
||||
shop.Is29Supplier = shopExist.Is29Supplier;
|
||||
shop.IsSelect = shopExist.IsSelect;
|
||||
shop.IsFilter = shopExist.IsFilter;
|
||||
list.Remove(shopExist);
|
||||
}
|
||||
// 更新店铺 // 代发管理中更新
|
||||
//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))
|
||||
{
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
GlobalConfig.ShopLoginList.Add(shop);
|
||||
}));
|
||||
|
||||
var t = Task.Run(() =>
|
||||
{
|
||||
while (cList.Count > 20) { Thread.Sleep(100); }
|
||||
cList.Add(1);
|
||||
try
|
||||
{
|
||||
if (shop.LoginStatus == "登录成功")
|
||||
{
|
||||
var is29SupplierRst = WxOrderSupplierBLL.GetWxSupplierList(shop);
|
||||
if (!is29SupplierRst.Contains("\"code\":0"))
|
||||
is29SupplierRst = WxOrderSupplierBLL.GetWxSupplierList(shop);
|
||||
if (is29SupplierRst.Contains("\"code\":0") && is29SupplierRst.Contains("\"name\":\"29供货商\""))
|
||||
{
|
||||
shop.Is29Supplier = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
ShopBLL.CheckShopLogin(shop);
|
||||
shop.Is29Supplier = false;
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Dispatcher.Invoke(new Action(() =>
|
||||
{
|
||||
foreach (var shop in GlobalConfig.ShopLoginList.Where(s => !list.Any(ss => ss.ShopId == s.ShopId)).ToList())
|
||||
@@ -272,6 +323,8 @@ namespace _29WxOrderWpf
|
||||
}));
|
||||
isReadShop = false;
|
||||
hasReadShop = true;
|
||||
|
||||
while (tList.Where(ta => !ta.IsFaulted && !ta.IsCompleted).Count() >= 1) { tList.RemoveAll(ta => ta.IsFaulted || ta.IsCompleted || ta.IsCanceled); Thread.Sleep(100); }
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
Reference in new issue
Block a user