diff --git a/29WxOrderWpf/Ctrls/BuyerCtrls/PDDBuyerOrderReadCtrl.xaml.cs b/29WxOrderWpf/Ctrls/BuyerCtrls/PDDBuyerOrderReadCtrl.xaml.cs index 6c0e288..098ccc2 100644 --- a/29WxOrderWpf/Ctrls/BuyerCtrls/PDDBuyerOrderReadCtrl.xaml.cs +++ b/29WxOrderWpf/Ctrls/BuyerCtrls/PDDBuyerOrderReadCtrl.xaml.cs @@ -297,6 +297,10 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls { var url1 = url; var data1 = responseData; + if (data1.Contains("214874201671006")) + { + + } //if (data1.Contains("260415-154067299863696") || data1.Contains("待用户退回商品") || data1.Contains("已寄出,待商家处理") || data1.Contains("待商家处理退货申请") || data1.Contains("待用户拒收商品")) //{ @@ -356,8 +360,8 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls // 读订单 if (/*(cefAddress.Contains("orders.html")) &&*/ url1.StartsWith("https://mobile.yangkeduo.com/proxy/api/api/aristotle/order_list_v")) - { - Task.Run(() => + { + Task.Run(() => { CefReadBuyerOrder(url1, data1); }); @@ -444,6 +448,8 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls List GetOrderItemExtInfo(string out_order_nos) { + if (out_order_nos.IsNullOrEmpty()) + return new List(); var url3 = BaseClass.Build29WxObjString("order/wx_get_order_item_ext_info"); var data3 = UserLogin.GetSignaturex(); data3 += "&out_order_id_in=" + out_order_nos; @@ -467,7 +473,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls // 直接过滤掉仓库作废单 //transitOrderList = transitOrderList.Where(t => t.order_void_status != 1).ToList(); } - catch + catch (Exception ex) { transitOrderList = new List(); } @@ -614,9 +620,9 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls if (data.Contains("轻奢壁挂式香皂盒置物架卫生间沥水家居可拆卸收纳盒翻盖肥皂盒")) { - } + } - var buyer = GlobalConfig.PDDBuyerLoginList.FirstOrDefault(b => url.Contains(b.buyer_id)); + var buyer = GlobalConfig.PDDBuyerLoginList.FirstOrDefault(b => url.Contains(b.buyer_id)); if (buyer == null) return; @@ -649,7 +655,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls // 提取拼多多外采订单列表 var out_order_nos = string.Join(",", list.Select(bo => bo.order_sn)); - if (out_order_nos.Contains("260730-639463637281501")) + if (out_order_nos.Contains("260817-535832839751006")) { } @@ -686,7 +692,7 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls o.buyerId = buyer.buyer_id; o.buyerName = buyer.buyer_name; - if (o.order_sn == "260730-639463637281501") + if (o.order_sn == "260817-535832839751006") { } diff --git a/29WxOrderWpf/Ctrls/OrderCtrls/OrderListCtrl.xaml b/29WxOrderWpf/Ctrls/OrderCtrls/OrderListCtrl.xaml index e2f9152..a0e52e8 100644 --- a/29WxOrderWpf/Ctrls/OrderCtrls/OrderListCtrl.xaml +++ b/29WxOrderWpf/Ctrls/OrderCtrls/OrderListCtrl.xaml @@ -111,6 +111,7 @@ Grid.Column="4" Height="28" Margin="0,0,-6,0" + TextChanged="txtShopName_TextChanged" TextWrapping="NoWrap" WaterMark="全部店铺" /> + + - - - + + + /// OrderListCtrl.xaml 的交互逻辑 /// - public partial class OrderListCtrl : UserControl + public partial class OrderListCtrl : UserControl, INotifyPropertyChanged { public CheckBox chkSelectAll = null; - public OrderFilterConfig orderFilterConfig = null; + OrderFilterConfig _orderFilterConfig; + public OrderFilterConfig orderFilterConfig + { + get { return _orderFilterConfig; } + set { if (_orderFilterConfig != value) + _orderFilterConfig = value; + OnPropertyChanged(new PropertyChangedEventArgs("orderFilterConfig")); + } + } public bool IsAutoReadOrder = true; public DateTime nextGetOrderTime = DateTime.MinValue; public string strSearchAll { get; set; } = ""; - public ConcurrentList lstFilterOrderIds { get; set; } = new ConcurrentList(); - public ConcurrentList lstFilterRemarkText { get; set; } = new ConcurrentList(); public ShipGiftService _shipGiftService { get; } public OrderListCtrl() { @@ -77,8 +86,16 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls orderFilterConfig = NaiBa.Util.Helper.ConfigHelper.LoadConfig("wx_order_filter_config"); if (orderFilterConfig == null) orderFilterConfig = new OrderFilterConfig(); - this.txtFilterGoodsName.Text = string.Join(";", orderFilterConfig.FilterGoodsName); + this.txtFilterGoodsName.Text = string.Join(";", orderFilterConfig.lstFilterGoodsName); this.cmbFilterGoodsNameType.SelectedItem = cmbFilterGoodsNameType.Items.Cast().FirstOrDefault(tb => (tb.Content as TextBlock)?.Text == orderFilterConfig.FilterGoodsNameType); + orderFilterConfig.chkHideGreenFlagIsChecked = true; // 隐藏标记 + orderFilterConfig.chkNoMultiOrderIsChecked = true; // 多子订单不显示 + orderFilterConfig.chkOnlyWarehouseOrderIsChecked = true; // 过滤非本系统订单 + orderFilterConfig.chkTransitOrderIsChecked = true; // 云仓 + orderFilterConfig.chkDirectOrderIsChecked = true; // 直发 + orderFilterConfig.chkTransitChangeDirectOrderIsChecked = true; // 云改直 + orderFilterConfig.lstFilterOrderIds = new ConcurrentList(); + orderFilterConfig.lstFilterRemarkText = new ConcurrentList(); dateStart.SelectedDate = DateTime.Now.Date.AddDays(-7); dateEnd.SelectedDate = DateTime.Now.Date.AddDays(1).AddSeconds(-1); @@ -118,8 +135,11 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls if (DateTime.Now > nextGetOrderTime) { + Dispatcher.Invoke(new Action(() => + { + btnSearch.Content = "读单"; + })); GetOrder(); - nextGetOrderTime = DateTime.Now.AddMinutes(25); } Thread.Sleep(1000); @@ -158,6 +178,7 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls while (true && (IsAutoReadOrder || !string.IsNullOrEmpty(orderIds))) { + BottomMsg = "当前正在读取订单...,第" + (page + 1) + "页"; if (page >= totalPage) { break; @@ -185,9 +206,9 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls // 按过滤条件读取 已废弃 //if (filterGetCondition) //{ - // if (!string.IsNullOrEmpty(txtShopName.Text.Trim())) + // if (!string.IsNullOrEmpty(orderFilterConfig.txtFilterShopNameText)) // { - // var shopNames = txtShopName.Text.Trim().Split(';').Where(s => !s.IsNullOrEmpty()).ToList(); + // var shopNames = orderFilterConfig.txtFilterShopNameText.Split(';').Where(s => !s.IsNullOrEmpty()).ToList(); // shop_id = string.Join(",", GlobalConfig.ShopLoginList.Where(s => shopNames.Contains(s.ShopAccount)).Select(s => s.ErpShopId).Where(s => !s.IsNullOrEmpty())); // } //} @@ -357,10 +378,9 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls } } - Dispatcher.Invoke(new Action(() => - { - disPlayOrderTabOrderCount(); - })); + //Dispatcher.Invoke(new Action(() => { disPlayOrderTabOrderCount(); })); + disPlayOrderTabOrderCount(); + var totalCount = BaseRegex.GetIntJson(ref html, "count"); if (totalCount > 0) @@ -372,10 +392,12 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls } // 处理店铺后台物流异常单 + BottomMsg = "当前正在读取物流异常单..."; if (string.IsNullOrEmpty(orderIds)) GetShopWaybillExceptionOrder(); // 处理拒收单 + BottomMsg = "当前正在处理拒收单..."; if (string.IsNullOrEmpty(orderIds)) Task.Run(async () => { @@ -383,10 +405,12 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls }); // 处理中转仓退货包裹 + BottomMsg = "当前正在处理中转仓退回..."; if (string.IsNullOrEmpty(orderIds)) AutoUpdateTransitPackageToPddShop(); // 处理退货仓分销退货 + BottomMsg = "当前正在处理分销退货..."; if (string.IsNullOrEmpty(orderIds)) Task.Run(async () => { @@ -1066,61 +1090,53 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls public void disPlayOrderTabOrderCount() { - - var orders = string.Join("','", GlobalConfig.lstFilterOrder.Select(o => o.order_id)); - var orders1 = string.Join(",", GlobalConfig.lstFilterOrder.Select(o => o.order_id)); - - - - var tabItems = this.tabOrderType.Items.Cast(); - var tabItem = tabItems.FirstOrDefault(t => t.Header.ParseToString().StartsWith("待采购")); + //var orders = string.Join("','", GlobalConfig.lstFilterOrder.Select(o => o.order_id)); + //var orders1 = string.Join(",", GlobalConfig.lstFilterOrder.Select(o => o.order_id)); var userOrderLst = GlobalConfig.lstOrder.Where(o => GlobalConfig.ShopLoginList.Any(s => s.ErpShopId.ParseToLong() == o.shop_id)).ToList(); + + TabItem tabItem = null; + List tabItems = this.tabOrderType.Items.Cast().ToList(); + Dispatcher.Invoke(new Action(() => { tabItem = tabItems.FirstOrDefault(t => t.Header.ParseToString().StartsWith("待采购")); })); if (tabItem != null) { - var filteLstTmp = new ObservableCollection(userOrderLst.Where(o => !GetOrderIsFilter(o, "待采购"))); - //tabItem.Header = "待采购(" + userOrderLst.Where(r => r.IsWaitBuy).Count() + "|" + filteLstTmp.Where(r => r.IsWaitBuy).Count() + ")"; - tabItem.Header = "待采购(" + userOrderLst.Where(r => r.IsWaitBuy).Count() + "|" + filteLstTmp.Count() + ")"; + var filteLstTmp = userOrderLst.Where(o => !GetOrderIsFilter(o, "待采购")).ToList(); + Dispatcher.Invoke(new Action(() => { tabItem.Header = "待采购(" + userOrderLst.Where(r => r.IsWaitBuy).Count() + "|" + filteLstTmp.Count() + ")"; })); } - tabItem = tabItems.FirstOrDefault(t => t.Header.ParseToString().StartsWith("待发货")); + Dispatcher.Invoke(new Action(() => { tabItem = tabItems.FirstOrDefault(t => t.Header.ParseToString().StartsWith("待发货")); })); if (tabItem != null) { - var filteLstTmp = new ObservableCollection(userOrderLst.Where(o => !GetOrderIsFilter(o, "待发货"))); - //tabItem.Header = "待发货(" + userOrderLst.Where(r => r.IsWaitSend).Count() + "|" + filteLstTmp.Where(r => r.IsWaitSend).Count() + ")"; - tabItem.Header = "待发货(" + userOrderLst.Where(r => r.IsWaitSend).Count() + "|" + filteLstTmp.Count() + ")"; + var filteLstTmp = userOrderLst.Where(o => !GetOrderIsFilter(o, "待发货")).ToList(); + Dispatcher.Invoke(new Action(() => { tabItem.Header = "待发货(" + userOrderLst.Where(r => r.IsWaitSend).Count() + "|" + filteLstTmp.Count() + ")"; })); } - tabItem = tabItems.FirstOrDefault(t => t.Header.ParseToString().StartsWith("待收货")); + Dispatcher.Invoke(new Action(() => { tabItem = tabItems.FirstOrDefault(t => t.Header.ParseToString().StartsWith("待收货")); })); if (tabItem != null) { - var filteLstTmp = new ObservableCollection(userOrderLst.Where(o => !GetOrderIsFilter(o, "待收货"))); - //tabItem.Header = "待收货(" + userOrderLst.Where(r => r.IsWaitReceive).Count() + "|" + filteLstTmp.Where(r => r.IsWaitReceive).Count() + ")"; - tabItem.Header = "待收货(" + userOrderLst.Where(r => r.IsWaitReceive).Count() + "|" + filteLstTmp.Count() + ")"; + var filteLstTmp = userOrderLst.Where(o => !GetOrderIsFilter(o, "待收货")).ToList(); + Dispatcher.Invoke(new Action(() => { tabItem.Header = "待收货(" + userOrderLst.Where(r => r.IsWaitReceive).Count() + "|" + filteLstTmp.Count() + ")"; })); } - tabItem = tabItems.FirstOrDefault(t => t.Header.ParseToString().StartsWith("售后完成单")); + Dispatcher.Invoke(new Action(() => { tabItem = tabItems.FirstOrDefault(t => t.Header.ParseToString().StartsWith("售后完成单")); })); if (tabItem != null) { - var filteLstTmp = new ObservableCollection(userOrderLst.Where(o => !GetOrderIsFilter(o, "售后完成单"))); - //tabItem.Header = "售后完成单(" + userOrderLst.Where(r => r.IsRefund).Count() + "|" + filteLstTmp.Where(r => r.IsRefund).Count() + ")"; - tabItem.Header = "售后完成单(" + userOrderLst.Where(r => r.IsRefund).Count() + "|" + filteLstTmp.Count() + ")"; + var filteLstTmp = userOrderLst.Where(o => !GetOrderIsFilter(o, "售后完成单")).ToList(); + Dispatcher.Invoke(new Action(() => { tabItem.Header = "售后完成单(" + userOrderLst.Where(r => r.IsRefund).Count() + "|" + filteLstTmp.Count() + ")"; })); } - tabItem = tabItems.FirstOrDefault(t => t.Header.ParseToString().StartsWith("需处理售后单")); + Dispatcher.Invoke(new Action(() => { tabItem = tabItems.FirstOrDefault(t => t.Header.ParseToString().StartsWith("需处理售后单")); })); if (tabItem != null) { - var filteLstTmp = new ObservableCollection(userOrderLst.Where(o => !GetOrderIsFilter(o, "需处理售后单"))); - //tabItem.Header = "需处理售后单(" + userOrderLst.Where(r => r.IsEmergency).Count() + "|" + filteLstTmp.Where(r => r.IsEmergency).Count() + ")"; - tabItem.Header = "需处理售后单(" + userOrderLst.Where(r => r.IsEmergency).Count() + "|" + filteLstTmp.Count() + ")"; + var filteLstTmp = userOrderLst.Where(o => !GetOrderIsFilter(o, "需处理售后单")).ToList(); + Dispatcher.Invoke(new Action(() => { tabItem.Header = "需处理售后单(" + userOrderLst.Where(r => r.IsEmergency).Count() + "|" + filteLstTmp.Count() + ")"; })); } - tabItem = tabItems.FirstOrDefault(t => t.Header.ParseToString().StartsWith("异常单")); + Dispatcher.Invoke(new Action(() => { tabItem = tabItems.FirstOrDefault(t => t.Header.ParseToString().StartsWith("异常单")); })); if (tabItem != null) { - var filteLstTmp = new ObservableCollection(userOrderLst.Where(o => !GetOrderIsFilter(o, "异常单"))); - //tabItem.Header = "异常单(" + userOrderLst.Where(r => r.isAbnormal).Count() + "|" + filteLstTmp.Where(r => r.isAbnormal).Count() + ")"; - tabItem.Header = "异常单(" + userOrderLst.Where(r => r.isAbnormal).Count() + "|" + filteLstTmp.Count() + ")"; + var filteLstTmp = userOrderLst.Where(o => !GetOrderIsFilter(o, "异常单")).ToList(); + Dispatcher.Invoke(new Action(() => { tabItem.Header = "异常单(" + userOrderLst.Where(r => r.isAbnormal).Count() + "|" + filteLstTmp.Count() + ")"; })); } - tabItem = tabItems.FirstOrDefault(t => t.Header.ParseToString().StartsWith("全部订单")); + Dispatcher.Invoke(new Action(() => { tabItem = tabItems.FirstOrDefault(t => t.Header.ParseToString().StartsWith("全部订单")); })); if (tabItem != null) { - var filteLstTmp = new ObservableCollection(userOrderLst.Where(o => !GetOrderIsFilter(o, "全部订单"))); - tabItem.Header = "全部订单(" + userOrderLst.Count() + "|" + filteLstTmp.Count() + ")"; + var filteLstTmp = userOrderLst.Where(o => !GetOrderIsFilter(o, "全部订单")).ToList(); + Dispatcher.Invoke(new Action(() => { tabItem.Header = "全部订单(" + userOrderLst.Count() + "|" + filteLstTmp.Count() + ")"; })); } //txtMsg.Text = "当前条件共计 " + GlobalConfig.lstFilterOrder.Count() + " 条订单记录"; } @@ -1205,15 +1221,15 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls } // 过滤id - if (lstFilterOrderIds.Count > 0) + if (orderFilterConfig.lstFilterOrderIds.Count > 0) { - if (!lstFilterOrderIds.Contains(order.order_id)) + if (!orderFilterConfig.lstFilterOrderIds.Contains(order.order_id)) return true; } // 其他一级过滤选项 else { - if (chkHideGreenFlag.IsChecked == true && order.colour_flag == 4) + if (orderFilterConfig.chkHideGreenFlagIsChecked == true && order.colour_flag == 4) return true; if (!GlobalConfig.ShopLoginList.Any(s => s.ErpShopId.ParseToLong() == order.shop_id)) @@ -1245,77 +1261,114 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls } // 过滤店铺名称 - if (!string.IsNullOrEmpty(txtShopName.Text.Trim()) && !(";" + txtShopName.Text.Trim() + ";").Contains(";" + order.shop_name + ";")) + if (!string.IsNullOrEmpty(orderFilterConfig.txtFilterShopNameText) && !(";" + orderFilterConfig.txtFilterShopNameText + ";").Contains(";" + order.shop_name + ";")) { return true; } // 过滤商品名称 - if (!string.IsNullOrEmpty(txtFilterGoodsName.Text.Trim())) + if (orderFilterConfig.lstFilterGoodsName != null && orderFilterConfig.lstFilterGoodsName.Count > 0) { - if (orderFilterConfig.FilterGoodsNameType == "标题包含" && !orderFilterConfig.FilterGoodsName.Any(name => order.orderItems.Any(it => it.title.Contains(name)))) + if (orderFilterConfig.FilterGoodsNameType == "标题包含" && !orderFilterConfig.lstFilterGoodsName.Any(name => order.orderItems.Any(it => it.title.Contains(name)))) return true; - else if (orderFilterConfig.FilterGoodsNameType == "标题不含" && orderFilterConfig.FilterGoodsName.Any(name => order.orderItems.Any(it => it.title.Contains(name)))) + else if (orderFilterConfig.FilterGoodsNameType == "标题不含" && orderFilterConfig.lstFilterGoodsName.Any(name => order.orderItems.Any(it => it.title.Contains(name)))) return true; } // 过滤多子单订单 - if (chkNoMultiOrder.IsChecked.ParseToBool() && order.orderItems.Count() > 1) + if (orderFilterConfig.chkNoMultiOrderIsChecked && order.orderItems.Count() > 1) { return true; } // 过滤非中转仓订单 - if (chkOnlyWarehouseOrder.IsChecked.ParseToBool() && !order.IsWaitBuy && + if (orderFilterConfig.chkOnlyWarehouseOrderIsChecked && !order.IsWaitBuy && order.orderItems.All(oi => oi.ItemTransitOrderWithVoid == null) && order.orderItems.All(oi => oi.OrderItemExt?.buy_type != "直发")) { return true; } // 过滤备注 - if (chkFilterRemark.IsChecked == true && !string.IsNullOrEmpty(txtFilterRemark.Text)) + if (orderFilterConfig.chkFilterRemarkIsChecked && orderFilterConfig.lstFilterRemarkText != null && orderFilterConfig.lstFilterRemarkText.Count > 0) { if (cmbFilterRemark.SelectedItem is ComboBoxItem comboBoxItem) { if (comboBoxItem.Content is TextBlock tb) { - if (tb.Text == "店铺备注包含" && !lstFilterRemarkText.Contains(order.shop_remark)) + if (tb.Text == "店铺备注包含" && !orderFilterConfig.lstFilterRemarkText.Contains(order.shop_remark)) return true; - else if (tb.Text == "软件备注包含" && !lstFilterRemarkText.Contains(order.soft_remark)) + else if (tb.Text == "软件备注包含" && !orderFilterConfig.lstFilterRemarkText.Contains(order.soft_remark)) return true; - else if (tb.Text == "店铺备注不含" && lstFilterRemarkText.Contains(order.shop_remark)) + else if (tb.Text == "店铺备注不含" && orderFilterConfig.lstFilterRemarkText.Contains(order.shop_remark)) return true; - else if (tb.Text == "软件备注不含" && lstFilterRemarkText.Contains(order.soft_remark)) + else if (tb.Text == "软件备注不含" && orderFilterConfig.lstFilterRemarkText.Contains(order.soft_remark)) return true; } } } - if (!chkDirectOrder.IsChecked == true && order.OrderBuyType == "直发") + if (!orderFilterConfig.chkDirectOrderIsChecked == true && order.OrderBuyType == "直发") return true; - if (!chkTransitOrder.IsChecked == true && order.OrderBuyType == "云仓") + if (!orderFilterConfig.chkTransitOrderIsChecked == true && order.OrderBuyType == "云仓") return true; - if (!chkTransitChangeDirectOrder.IsChecked == true && order.OrderBuyType == "云改直") + if (!orderFilterConfig.chkTransitChangeDirectOrderIsChecked == true && order.OrderBuyType == "云改直") return true; - // 过滤时间范围 - if (cmbTimeType.SelectedItem is ComboBoxItem cbi) + var filterTimeRst = false; + Dispatcher.Invoke(new Action(() => { - if (cbi.Content is TextBlock tb) + // 过滤时间范围 + if (cmbTimeType.SelectedItem is ComboBoxItem cbi) { - if (tb.Text == "更新时间") + if (cbi.Content is TextBlock tb) { - if (order.UpdateDateTime < dateStart.SelectedDate.Value) - return true; - if (chkEndDate.IsChecked == true && order.UpdateDateTime > dateEnd.SelectedDate.Value.AddDays(1)) - return true; - } - if (tb.Text == "成交时间") - { - if (order.CreateDateTime < dateStart.SelectedDate.Value) - return true; - if (chkEndDate.IsChecked == true && order.CreateDateTime > dateEnd.SelectedDate.Value.AddDays(1)) - return true; + if (tb.Text == "更新时间") + { + if (order.UpdateDateTime < dateStart.SelectedDate.Value) + { + filterTimeRst = true; + return; + } + if (chkEndDate.IsChecked == true && order.UpdateDateTime > dateEnd.SelectedDate.Value.AddDays(1)) + { + filterTimeRst = true; + return; + } + } + if (tb.Text == "成交时间") + { + if (order.CreateDateTime < dateStart.SelectedDate.Value) + { + filterTimeRst = true; + return; + } + if (chkEndDate.IsChecked == true && order.CreateDateTime > dateEnd.SelectedDate.Value.AddDays(1)) + { + filterTimeRst = true; + return; + } + } } } - } + })); + if (filterTimeRst) + return filterTimeRst; + + var filterHeadStrRst = false; + Dispatcher.Invoke(new Action(() => + { + filterHeadStrRst = FilterTabPage(order, filterHeadStr); + })); + if (filterHeadStrRst) + return filterHeadStrRst; } + return false; + } + + /// + /// 过滤标签页 + /// + /// + /// + /// + private bool FilterTabPage(oms_wei_order_info order, string filterHeadStr) + { // 过滤标签页 if (filterHeadStr.IsNullOrEmpty()) filterHeadStr = GlobalConfig.OrderTabHeaderStr; @@ -1328,8 +1381,6 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls { if (!order.IsWaitBuy) return true; - //if (order.IsRefund) - // return true; if (chkMapProdOnly.IsChecked == true && order.orderItems.All(oi => oi.BuyMap == null)) return true; if (chkNoMapProdOnly.IsChecked == true && order.orderItems.All(oi => oi.BuyMap != null)) @@ -1417,10 +1468,9 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls if (chkAftersaleWarehouseIsNotPickup.IsChecked == true && order.orderItems.All(oi => oi.WarehouseWaybillStatusStr != "中转待取号" && !oi.WarehouseWaybillStatusStr.Contains("取号异常"))) return true; if (chkAftersaleWarehouseIsPickup.IsChecked == true && order.orderItems.All(oi => oi.WarehouseWaybillStatusStr != "中转提前取号" && oi.WarehouseWaybillStatusStr != "中转已取号" && - oi.WarehouseWaybillStatusStr != "中转已入库" && oi.WarehouseWaybillStatusStr != "中转已出库")) + oi.WarehouseWaybillStatusStr != "中转已入库" && oi.WarehouseWaybillStatusStr != "中转已出库")) return true; } - return false; } @@ -1440,7 +1490,6 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls this.txtShopName.Text = string.Join(";", list.Where(s => s.IsSelect == true).Select(s => s.ShopAccount)); FilterOrders(); - } MainWindow.Instance.shopListCtrl.IsVisibleChanged -= ShopListCtrl_IsVisibleChanged; } @@ -1453,19 +1502,20 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls { Thread.Sleep(5000); Dispatcher.Invoke(new Action(() => { this.btnSearch.IsEnabled = true; })); - }); - Task.Run(() => - { - GetOrder(); - nextGetOrderTime = DateTime.Now.AddMinutes(25); - }); + }); + //Task.Run(() => + //{ + // GetOrder(); + // nextGetOrderTime = DateTime.Now.AddMinutes(25); + //}); + nextGetOrderTime = DateTime.Now; } private async void btnFilter_Click(object sender, RoutedEventArgs e) { - if (lstFilterOrderIds.Count == 1 && !GlobalConfig.lstOrder.Any(o => o.order_id == lstFilterOrderIds.FirstOrDefault())) + if (orderFilterConfig.lstFilterOrderIds.Count == 1 && !GlobalConfig.lstOrder.Any(o => o.order_id == orderFilterConfig.lstFilterOrderIds.FirstOrDefault())) { - await Task.Run(() => { this.GetOrder(lstFilterOrderIds.FirstOrDefault()); }); + await Task.Run(() => { this.GetOrder(orderFilterConfig.lstFilterOrderIds.FirstOrDefault()); }); } FilterOrders(); } @@ -2190,12 +2240,12 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls private void txtFilterRemark_TextChanged(object sender, TextChangedEventArgs e) { - lstFilterRemarkText = [.. txtFilterRemark.Text.Trim().Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries).Distinct().ToList(),]; + orderFilterConfig.lstFilterRemarkText = [.. txtFilterRemark.Text.Trim().Split(new string[] { ";" }, StringSplitOptions.RemoveEmptyEntries).Distinct().ToList(),]; } private void txtOrderId_TextChanged(object arg1, TextChangedEventArgs arg2) { - lstFilterOrderIds = [.. txtFilterOrderId.Text.Trim().Split(new string[] { ";", ";", ",", "," }, StringSplitOptions.RemoveEmptyEntries).Distinct().ToList(),]; + orderFilterConfig.lstFilterOrderIds = [.. txtFilterOrderId.Text.Trim().Split(new string[] { ";", ";", ",", "," }, StringSplitOptions.RemoveEmptyEntries).Distinct().ToList(),]; } private void chkEmergencyReturnOrRefund_Click(object sender, RoutedEventArgs e) @@ -2287,14 +2337,27 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls { if (IsLoaded) { - if (string.Join(";", orderFilterConfig.FilterGoodsName) != txtFilterGoodsName.Text) + if (string.Join(";", orderFilterConfig.lstFilterGoodsName) != txtFilterGoodsName.Text) { - orderFilterConfig.FilterGoodsName = txtFilterGoodsName.Text.Split(new string[] { ";", ";", "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries).ToList(); + orderFilterConfig.lstFilterGoodsName = txtFilterGoodsName.Text.Split(new string[] { ";", ";", "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries).ToList(); NaiBa.Util.Helper.ConfigHelper.SaveConfig("wx_order_filter_config", orderFilterConfig); } } } + private void txtShopName_TextChanged(object arg1, TextChangedEventArgs arg2) + { + if (IsLoaded) + { + //if (string.Join(";", orderFilterConfig.FilterGoodsName) != txtFilterGoodsName.Text) + //{ + // orderFilterConfig.FilterGoodsName = txtFilterGoodsName.Text.Split(new string[] { ";", ";", "\r", "\n" }, StringSplitOptions.RemoveEmptyEntries).ToList(); + // NaiBa.Util.Helper.ConfigHelper.SaveConfig("wx_order_filter_config", orderFilterConfig); + //} + orderFilterConfig.txtFilterShopNameText = txtShopName.Text.Trim(); + } + } + private void cmbFilterGoodsNameType_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (IsLoaded) @@ -2327,9 +2390,80 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls } - public class OrderFilterConfig + public class OrderFilterConfig : PropertyNotifyObject { public string FilterGoodsNameType { get; set; } = "标题包含"; - public List FilterGoodsName { get; set; } = new List(); + public List lstFilterGoodsName { get; set; } = new List(); + /// + /// 隐藏标记 + /// + public bool chkHideGreenFlagIsChecked + { + get { return this.GetValue(x => x.chkHideGreenFlagIsChecked); } + set { this.SetValue(x => x.chkHideGreenFlagIsChecked, value); } + } + /// + /// 过滤非本系统订单 + /// + public bool chkOnlyWarehouseOrderIsChecked + { + get { return this.GetValue(x => x.chkOnlyWarehouseOrderIsChecked); } + set { this.SetValue(x => x.chkOnlyWarehouseOrderIsChecked, value); } + } + /// + /// 过滤多子单订单 + /// + public bool chkNoMultiOrderIsChecked + { + get { return this.GetValue(x => x.chkNoMultiOrderIsChecked); } + set { this.SetValue(x => x.chkNoMultiOrderIsChecked, value); } + } + /// + /// 云仓 + /// + public bool chkTransitOrderIsChecked + { + get { return this.GetValue(x => x.chkTransitOrderIsChecked); } + set { this.SetValue(x => x.chkTransitOrderIsChecked, value); } + } + /// + /// 直发 + /// + public bool chkDirectOrderIsChecked + { + get { return this.GetValue(x => x.chkDirectOrderIsChecked); } + set { this.SetValue(x => x.chkDirectOrderIsChecked, value); } + } + /// + /// 云改直 + /// + public bool chkTransitChangeDirectOrderIsChecked + { + get { return this.GetValue(x => x.chkTransitChangeDirectOrderIsChecked); } + set { this.SetValue(x => x.chkTransitChangeDirectOrderIsChecked, value); } + } + /// + /// 过滤备注 + /// + public bool chkFilterRemarkIsChecked + { + get { return this.GetValue(x => x.chkFilterRemarkIsChecked); } + set { this.SetValue(x => x.chkFilterRemarkIsChecked, value); } + } + public ConcurrentList lstFilterOrderIds + { + get { return this.GetValue(x => x.lstFilterOrderIds); } + set { this.SetValue(x => x.lstFilterOrderIds, value); } + } + public ConcurrentList lstFilterRemarkText + { + get { return this.GetValue(x => x.lstFilterRemarkText); } + set { this.SetValue(x => x.lstFilterRemarkText, value); } + } + public string txtFilterShopNameText + { + get { return this.GetValue(x => x.txtFilterShopNameText); } + set { this.SetValue(x => x.txtFilterShopNameText, value); } + } } } diff --git a/AllBase/BaseClass.cs b/AllBase/BaseClass.cs index eb9c7cf..a7b05bc 100644 --- a/AllBase/BaseClass.cs +++ b/AllBase/BaseClass.cs @@ -36,7 +36,7 @@ namespace AllBase /// 版本ID /// - public static int VersionCount = 256; + public static int VersionCount = 257; public static string ServerUrl { get; set; } = "http://1.13.195.131:9000"; public static string DebugUrl { get; set; } = "http://localhost:9000"; diff --git a/AllBase/Helper/GlobalConfig.cs b/AllBase/Helper/GlobalConfig.cs index d45754d..70dabc3 100644 --- a/AllBase/Helper/GlobalConfig.cs +++ b/AllBase/Helper/GlobalConfig.cs @@ -129,6 +129,8 @@ namespace AllBase.Helper public static SolidColorBrush RedTextBrush = new SolidColorBrush(Color.FromArgb(255, 250, 71, 51)); public static SolidColorBrush RedTextBrush205 = new SolidColorBrush(Color.FromArgb(205, 250, 71, 51)); public static SolidColorBrush RedTextBrush50 = new SolidColorBrush(Color.FromArgb(50, 250, 71, 51)); - #endregion - } + public static SolidColorBrush LightRedTextBrush = new SolidColorBrush(Color.FromArgb(255, 245, 108, 108)); + public static SolidColorBrush LightOrangeTextBrush = new SolidColorBrush(Color.FromArgb(255, 230, 162, 60)); + #endregion + } } diff --git a/AllBase/Model/DBModel/oms_wei_order_item_info.cs b/AllBase/Model/DBModel/oms_wei_order_item_info.cs index 2c09e98..b431e1f 100644 --- a/AllBase/Model/DBModel/oms_wei_order_item_info.cs +++ b/AllBase/Model/DBModel/oms_wei_order_item_info.cs @@ -567,62 +567,58 @@ namespace AllBase.Model.DBModel // WarehouseWaybillStatusStr = "中转已作废"; else if (ItemTransitOrderWithVoid?.pre_allocated_order_no == 0) WarehouseWaybillStatusStr = "中转待取号"; - } - public SolidColorBrush WarehouseWaybillStatusStrColor - { - get - { - var warehouseWaybillStatusStr = WarehouseWaybillStatusStr.ParseToString(); - //if (warehouseWaybillStatusStr.StartsWith("中转已作废")) - // return PurpleBrush; - if (warehouseWaybillStatusStr.StartsWith("中转已出库") || warehouseWaybillStatusStr.StartsWith("中转拦截到仓")) - return GlobalConfig.GreenBrush; - if (warehouseWaybillStatusStr.StartsWith("中转已入库") || warehouseWaybillStatusStr.StartsWith("中转已取号") || warehouseWaybillStatusStr.StartsWith("中转提前取号")) - return GlobalConfig.YellowBrush; - if (warehouseWaybillStatusStr.StartsWith("中转待取号")) - return GlobalConfig.RedBrush; - return GlobalConfig.RedBrush; - } - set { } - } - public void SetWarehouseWaybillStatusStrColor() - { - } + + var warehouseWaybillStatusStr = WarehouseWaybillStatusStr.ParseToString(); + // 状态文字颜色 + //if (warehouseWaybillStatusStr.StartsWith("中转已作废")) + // WarehouseWaybillStatusStrColor = PurpleBrush; + if (warehouseWaybillStatusStr.StartsWith("中转已出库") || warehouseWaybillStatusStr.StartsWith("中转拦截到仓")) + WarehouseWaybillStatusStrColor = GlobalConfig.GreenBrush; + else if (warehouseWaybillStatusStr.StartsWith("中转已入库") || warehouseWaybillStatusStr.StartsWith("中转已取号") || warehouseWaybillStatusStr.StartsWith("中转提前取号")) + WarehouseWaybillStatusStrColor = GlobalConfig.YellowBrush; + else if (warehouseWaybillStatusStr.StartsWith("中转待取号")) + WarehouseWaybillStatusStrColor = GlobalConfig.RedBrush; + else + WarehouseWaybillStatusStrColor = GlobalConfig.RedBrush; + // 状态边框颜色 + //if (warehouseWaybillStatusStr.StartsWith("中转已作废")) + // WarehouseWaybillStatusBorderColor = PurpleBrush75; + if (warehouseWaybillStatusStr.StartsWith("中转已出库")) + WarehouseWaybillStatusBorderColor = GlobalConfig.GreenBrush75; + else if (warehouseWaybillStatusStr.StartsWith("中转已入库") || warehouseWaybillStatusStr.StartsWith("中转已取号") || warehouseWaybillStatusStr.StartsWith("中转提前取号")) + WarehouseWaybillStatusBorderColor = GlobalConfig.YellowBrush75; + else if (warehouseWaybillStatusStr.StartsWith("中转待取号")) + WarehouseWaybillStatusBorderColor = GlobalConfig.RedBrush75; + else + WarehouseWaybillStatusBorderColor = GlobalConfig.RedBrush75; + // 状态背景颜色 + //if (warehouseWaybillStatusStr.StartsWith("中转已作废")) + // WarehouseWaybillStatusBackColor = PurpleBrush35 + if (warehouseWaybillStatusStr.ParseToString().StartsWith("中转已出库")) + WarehouseWaybillStatusBackColor = GlobalConfig.GreenBrush35; + else if(warehouseWaybillStatusStr.ParseToString().StartsWith("中转已入库") || warehouseWaybillStatusStr.StartsWith("中转已取号") || warehouseWaybillStatusStr.StartsWith("中转提前取号")) + WarehouseWaybillStatusBackColor = GlobalConfig.YellowBrush35; + else if(warehouseWaybillStatusStr.ParseToString().StartsWith("中转待取号")) + WarehouseWaybillStatusBackColor = GlobalConfig.RedBrush35; + else + WarehouseWaybillStatusBackColor = GlobalConfig.RedBrush35; + } + public SolidColorBrush WarehouseWaybillStatusStrColor + { + get { return this.GetValue(x => x.WarehouseWaybillStatusStrColor); } + set { this.SetValue(x => x.WarehouseWaybillStatusStrColor, value); } + } public SolidColorBrush WarehouseWaybillStatusBorderColor - { - get - { - string warehouseWaybillStatusStr = this.WarehouseWaybillStatusStr.ParseToString(); - //if (warehouseWaybillStatusStr.StartsWith("中转已作废")) - // return PurpleBrush75; - if (warehouseWaybillStatusStr.StartsWith("中转已出库")) - return GlobalConfig.GreenBrush75; - if (warehouseWaybillStatusStr.StartsWith("中转已入库") || warehouseWaybillStatusStr.StartsWith("中转已取号") || warehouseWaybillStatusStr.StartsWith("中转提前取号")) - return GlobalConfig.YellowBrush75; - if (warehouseWaybillStatusStr.StartsWith("中转待取号")) - return GlobalConfig.RedBrush75; - return GlobalConfig.RedBrush75; - } - set { } - } + { + get { return this.GetValue(x => x.WarehouseWaybillStatusBorderColor); } + set { this.SetValue(x => x.WarehouseWaybillStatusBorderColor, value); } + } public SolidColorBrush WarehouseWaybillStatusBackColor - { - get - { - string warehouseWaybillStatusStr = this.WarehouseWaybillStatusStr.ParseToString(); - //if (warehouseWaybillStatusStr.StartsWith("中转已作废")) - // return PurpleBrush35 - if (warehouseWaybillStatusStr.ParseToString().StartsWith("中转已出库")) - return GlobalConfig.GreenBrush35; - if (warehouseWaybillStatusStr.ParseToString().StartsWith("中转已入库") || warehouseWaybillStatusStr.StartsWith("中转已取号") || warehouseWaybillStatusStr.StartsWith("中转提前取号")) - return GlobalConfig.YellowBrush35; - if (warehouseWaybillStatusStr.ParseToString().StartsWith("中转待取号")) - return GlobalConfig.RedBrush35; - return GlobalConfig.RedBrush35; - } - set { } - } + { + get { return this.GetValue(x => x.WarehouseWaybillStatusBackColor); } + set { this.SetValue(x => x.WarehouseWaybillStatusBackColor, value); } + } #endregion /// diff --git a/AllBase/Model/DBModel/oms_wei_refund_info.cs b/AllBase/Model/DBModel/oms_wei_refund_info.cs index 4d1077e..504716c 100644 --- a/AllBase/Model/DBModel/oms_wei_refund_info.cs +++ b/AllBase/Model/DBModel/oms_wei_refund_info.cs @@ -1,4 +1,5 @@ -using AllBase.Model.MvvmBaseClasses; +using AllBase.Helper; +using AllBase.Model.MvvmBaseClasses; using System; using System.Collections.Generic; using System.Linq; @@ -24,20 +25,10 @@ namespace AllBase.Model.DBModel /// 退款状态颜色 /// public SolidColorBrush RefundStatusColor - { - get - { - if (status == "MERCHANT_PROCESSING" || status == "PLATFORM_REFUNDING" || status == "USER_WAIT_RETURN" || status == "MERCHANT_WAIT_RECEIPT" || - status == "USER_WAIT_CONFIRM" || status == "USER_WAIT_CONFIRM_UPDATE" || status == "USER_WAIT_HANDLE_MERCHANT_AFTER_SALE" || - status == "WAIT_PACKAGE_INTERCEPT") - return new SolidColorBrush(Color.FromRgb(230, 162, 60)); - if (status == "MERCHANT_REFUND_SUCCESS" || status == "MERCHANT_RETURN_SUCCESS" || - status == "USER_CANCELD" /*|| status == "MERCHANT_REJECT_REFUND" || status == "MERCHANT_REJECT_RETURN" || status == "RETURN_CLOSED" || status == "PLATFORM_REFUND_FAIL" || status == "MERCHANT_FAIL"*/) - return new SolidColorBrush(Color.FromRgb(103, 194, 58)); - return new SolidColorBrush(Color.FromRgb(245, 108, 108)); - } - set { } - } + { + get { return this.GetValue(x => x.RefundStatusColor); } + set { this.SetValue(x => x.RefundStatusColor, value); } + } /// /// 售后原因文字 /// @@ -116,6 +107,17 @@ namespace AllBase.Model.DBModel this.IsRefund = true; if (RefundStatusStr == "售后状态读取失败") this.IsRefund = true; + + // 设置售后状态颜色 + if (status == "MERCHANT_PROCESSING" || status == "PLATFORM_REFUNDING" || status == "USER_WAIT_RETURN" || status == "MERCHANT_WAIT_RECEIPT" || + status == "USER_WAIT_CONFIRM" || status == "USER_WAIT_CONFIRM_UPDATE" || status == "USER_WAIT_HANDLE_MERCHANT_AFTER_SALE" || + status == "WAIT_PACKAGE_INTERCEPT") + RefundStatusColor = GlobalConfig.LightOrangeTextBrush; + else if (status == "MERCHANT_REFUND_SUCCESS" || status == "MERCHANT_RETURN_SUCCESS" || + status == "USER_CANCELD" /*|| status == "MERCHANT_REJECT_REFUND" || status == "MERCHANT_REJECT_RETURN" || status == "RETURN_CLOSED" || status == "PLATFORM_REFUND_FAIL" || status == "MERCHANT_FAIL"*/) + RefundStatusColor = GlobalConfig.GreenTextBrush; + else + RefundStatusColor = GlobalConfig.LightRedTextBrush; } } /// diff --git a/Work/_29Tools/Forms/PddMobileBuyOrderForm.cs b/Work/_29Tools/Forms/PddMobileBuyOrderForm.cs index b4f1f59..254333a 100644 --- a/Work/_29Tools/Forms/PddMobileBuyOrderForm.cs +++ b/Work/_29Tools/Forms/PddMobileBuyOrderForm.cs @@ -126,18 +126,22 @@ namespace TemuKJD.ToolForms { for (int i = 3; i > 0; i--) { - Invoke(new Action(() => - { - this.pnlMask.Visible = true; - this.pnlMask.Text = "自动拍单倒计时\r\n" + i; - })); + if (this.Created) + Invoke(new Action(() => + { + this.pnlMask.Visible = true; + this.pnlMask.Text = "自动拍单倒计时\r\n" + i; + })); + else + break; Thread.Sleep(1000); } - Invoke(new Action(() => - { - this.pnlMask.Visible = false; - })); + if (this.Created) + Invoke(new Action(() => + { + this.pnlMask.Visible = false; + })); }); } @@ -470,6 +474,9 @@ namespace TemuKJD.ToolForms var oneGoodsPrice = BaseRegex.GetIntJson(ref data, "goodsPrice"); var buyCnt = BaseRegex.GetIntJson(ref data, "goods_number"); var buyPrice = BaseRegex.GetIntJson(ref data, "pay_price"); + + if (!this.Created) + return; Invoke(new Action(() => { if (!goodsId.IsNullOrZero()) this.txtBuyGoodsId.Text = goodsId.ParseToString(); @@ -480,7 +487,9 @@ namespace TemuKJD.ToolForms if (!buyPrice.IsNullOrZero()) this.txtBuyPrice.Text = (buyPrice * 0.01m).ParseToString(); })); - Invoke(new Action(() => + if (!this.Created) + return; + Invoke(new Action(() => { if (BuyType == "direct" && txtBuyTransitWarehouse.Text.Contains("******")) { @@ -653,6 +662,8 @@ namespace TemuKJD.ToolForms //} })();"; var ts1 = client.Runtime.EvaluateAsync(jsStr1, null, true, null, null, true, null, true); + if (!this.Created) + return "窗口已关闭"; ts1.Wait(5000); for (int i = 0; i < 20; i++) { @@ -680,7 +691,10 @@ namespace TemuKJD.ToolForms ts1 = client.Runtime.EvaluateAsync(jsStr1, null, true, null, null, true, null, true); for (int i = 0; i < 20; i++) { - if (ts1.Result.Result.Value is string rstStr) + if (!this.Created) + return "窗口已关闭"; + + if (ts1.Result.Result.Value is string rstStr) { if (rstStr == "success") break; @@ -739,8 +753,10 @@ namespace TemuKJD.ToolForms } ts1 = client.Runtime.EvaluateAsync(jsStr1, null, true, null, null, true, null, true); for (int i = 0; i < 20; i++) - { - if (ts1.Result.Result.Value is string rstStr) + { + if (!this.Created) + return "窗口已关闭"; + if (ts1.Result.Result.Value is string rstStr) { if (rstStr == "success") break;