From d5d235c0b0f8058d1df6939bba33e29cce2bf82c Mon Sep 17 00:00:00 2001 From: wule Date: Fri, 7 Aug 2026 20:04:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=93=E5=BA=93=E9=80=80=E8=B4=A7=E8=AE=A2?= =?UTF-8?q?=E5=8D=95=E9=80=BB=E8=BE=91=2030%?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BuyerCtrls/PDDBuyerOrderReadCtrl.xaml.cs | 4 +- .../OrderCtrls/OrderListRowHeaderCtrl.xaml.cs | 35 +-- .../OrderCtrls/OrderListRowItemCtrl.xaml | 8 +- .../OrderCtrls/OrderListRowItemCtrl.xaml.cs | 20 +- .../Ctrls/ShopCtrls/ShopListCtrl.xaml | 3 +- .../PeriodRevenueStatisticsView.xaml.cs | 6 + .../Statistics/ShopRevenueStatisticsView.xaml | 2 +- .../ShopRevenueStatisticsView.xaml.cs | 13 ++ .../PeriodRevenueStatisticsViewModel.cs | 4 + 29WxOrderWpf/MainWindow.xaml.cs | 34 +-- .../TransitReturnOrderWindow.xaml | 195 ++++++++++++++++ .../TransitReturnOrderWindow.xaml.cs | 215 ++++++++++++++++++ AllBase/29WxOrderAllBase.csproj | 1 + AllBase/BaseClass.cs | 2 +- AllBase/Model/DBModel/WaybillHelper.cs | 2 +- AllBase/Model/DBModel/distrib_return_order.cs | 193 ++++++++++++++++ AllBase/Model/Result/PddBuyerOrderLiteInfo.cs | 37 ++- Work/_29Tools/BLL/WxOrderSupplierBLL.cs | 12 +- 18 files changed, 747 insertions(+), 39 deletions(-) create mode 100644 29WxOrderWpf/Windows/OrderWindows/TransitReturnOrderWindow.xaml create mode 100644 29WxOrderWpf/Windows/OrderWindows/TransitReturnOrderWindow.xaml.cs create mode 100644 AllBase/Model/DBModel/distrib_return_order.cs diff --git a/29WxOrderWpf/Ctrls/BuyerCtrls/PDDBuyerOrderReadCtrl.xaml.cs b/29WxOrderWpf/Ctrls/BuyerCtrls/PDDBuyerOrderReadCtrl.xaml.cs index f25ea94..8f42a98 100644 --- a/29WxOrderWpf/Ctrls/BuyerCtrls/PDDBuyerOrderReadCtrl.xaml.cs +++ b/29WxOrderWpf/Ctrls/BuyerCtrls/PDDBuyerOrderReadCtrl.xaml.cs @@ -1910,9 +1910,9 @@ namespace _29WxOrderWpf.Ctrls.BuyerCtrls obj["outAccount"] = order.buyerName; obj["outOrderNo"] = order.order_sn; obj["orderId"] = order.ShopOrderIdStr; - if (!order.outExpressCompanyCode.IsNullOrEmpty() && !order.tracking_number.IsNullOrEmpty()) + if (!order.outPddToWxExpressCompanyCode.IsNullOrEmpty() && !order.tracking_number.IsNullOrEmpty()) { - obj["outExpressCompany"] = order.outExpressCompanyCode; + obj["outExpressCompany"] = order.outPddToWxExpressCompanyCode; obj["outExpressNo"] = order.tracking_number; } var dataStr = JsonHelper.SerializeObject(obj); diff --git a/29WxOrderWpf/Ctrls/OrderCtrls/OrderListRowHeaderCtrl.xaml.cs b/29WxOrderWpf/Ctrls/OrderCtrls/OrderListRowHeaderCtrl.xaml.cs index c5f5d26..e01f1ac 100644 --- a/29WxOrderWpf/Ctrls/OrderCtrls/OrderListRowHeaderCtrl.xaml.cs +++ b/29WxOrderWpf/Ctrls/OrderCtrls/OrderListRowHeaderCtrl.xaml.cs @@ -1,4 +1,5 @@ using _29WxOrderWpf.BaseWindows; +using AllBase; using AllBase.Helper; using AllBase.Model.DBModel; using NaiBa.Util.Extension; @@ -59,19 +60,27 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls shopLoginForm.ShowDialog(); 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; - } + { + shop.Is29Supplier = false; + for (int i = 0; i < 100; i++) + { + 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; + } + foreach (var ord in GlobalConfig.lstFilterOrder.Where(o => o.shop_id.ParseToString() == shop.ErpShopId).ToList()) { // 更新代发管理情况 diff --git a/29WxOrderWpf/Ctrls/OrderCtrls/OrderListRowItemCtrl.xaml b/29WxOrderWpf/Ctrls/OrderCtrls/OrderListRowItemCtrl.xaml index 7ab8b47..9ca2c4c 100644 --- a/29WxOrderWpf/Ctrls/OrderCtrls/OrderListRowItemCtrl.xaml +++ b/29WxOrderWpf/Ctrls/OrderCtrls/OrderListRowItemCtrl.xaml @@ -440,7 +440,13 @@ - + + + diff --git a/29WxOrderWpf/Ctrls/OrderCtrls/OrderListRowItemCtrl.xaml.cs b/29WxOrderWpf/Ctrls/OrderCtrls/OrderListRowItemCtrl.xaml.cs index c6c980d..eeb4a8c 100644 --- a/29WxOrderWpf/Ctrls/OrderCtrls/OrderListRowItemCtrl.xaml.cs +++ b/29WxOrderWpf/Ctrls/OrderCtrls/OrderListRowItemCtrl.xaml.cs @@ -1310,5 +1310,23 @@ namespace _29WxOrderWpf.Ctrls.OrderCtrls } } } - } + + private void btnReturnOrder_Click(object sender, RoutedEventArgs e) + { + if (this.DataContext is oms_wei_order_item_info orderItem) + { + //if (orderItem.ItemTransitOrder?.warehouse_status != 2 && orderItem.AddEditTransitWarehouseAfterSaleStr == "添加") + //{ + // BaseMsgWindow.ShowError("商品未出库,请选择中转仓拒收!"); + // return; + //} + + if (TransitReturnOrderWindow.instance != null) + TransitReturnOrderWindow.instance.Close(); + + TransitReturnOrderWindow.instance = new TransitReturnOrderWindow(orderItem); + TransitReturnOrderWindow.instance.Show(); + } + } + } } diff --git a/29WxOrderWpf/Ctrls/ShopCtrls/ShopListCtrl.xaml b/29WxOrderWpf/Ctrls/ShopCtrls/ShopListCtrl.xaml index 7e28d08..8714b49 100644 --- a/29WxOrderWpf/Ctrls/ShopCtrls/ShopListCtrl.xaml +++ b/29WxOrderWpf/Ctrls/ShopCtrls/ShopListCtrl.xaml @@ -129,7 +129,7 @@ - + @@ -138,6 +138,7 @@ + diff --git a/29WxOrderWpf/Ctrls/Statistics/PeriodRevenueStatisticsView.xaml.cs b/29WxOrderWpf/Ctrls/Statistics/PeriodRevenueStatisticsView.xaml.cs index 29982c5..d73b31a 100644 --- a/29WxOrderWpf/Ctrls/Statistics/PeriodRevenueStatisticsView.xaml.cs +++ b/29WxOrderWpf/Ctrls/Statistics/PeriodRevenueStatisticsView.xaml.cs @@ -16,6 +16,12 @@ namespace _29WxOrderWpf.Ctrls.Statistics InitializeComponent(); // 默认天统计;当 XAML 指定 Week/Month 时通过 PeriodType 回调切换 DataContext = new PeriodRevenueStatisticsViewModel(PeriodStatisticType.Day); + this.Loaded += PeriodRevenueStatisticsView_Loaded; + } + + private void PeriodRevenueStatisticsView_Loaded(object sender, RoutedEventArgs e) + { + //(DataContext as PeriodRevenueStatisticsViewModel).Init(); } public static readonly DependencyProperty PeriodTypeProperty = diff --git a/29WxOrderWpf/Ctrls/Statistics/ShopRevenueStatisticsView.xaml b/29WxOrderWpf/Ctrls/Statistics/ShopRevenueStatisticsView.xaml index 5a20933..008a6df 100644 --- a/29WxOrderWpf/Ctrls/Statistics/ShopRevenueStatisticsView.xaml +++ b/29WxOrderWpf/Ctrls/Statistics/ShopRevenueStatisticsView.xaml @@ -122,7 +122,7 @@ - + 0 && e.AddedItems[0] is TabItem tab && tab.Content is PeriodRevenueStatisticsView view && view.DataContext is PeriodRevenueStatisticsViewModel vm) + { + vm.Init(); + } + } } } \ No newline at end of file diff --git a/29WxOrderWpf/Ctrls/Statistics/ViewModels/PeriodRevenueStatisticsViewModel.cs b/29WxOrderWpf/Ctrls/Statistics/ViewModels/PeriodRevenueStatisticsViewModel.cs index 1bae2ba..b41b843 100644 --- a/29WxOrderWpf/Ctrls/Statistics/ViewModels/PeriodRevenueStatisticsViewModel.cs +++ b/29WxOrderWpf/Ctrls/Statistics/ViewModels/PeriodRevenueStatisticsViewModel.cs @@ -62,6 +62,10 @@ namespace _29WxOrderWpf.Ctrls.Statistics.ViewModels _nextPageCommand = new DelegateCommand(() => GoToPage(PageIndex + 1), () => HasNextPage); _lastPageCommand = new DelegateCommand(() => GoToPage(TotalPages), () => HasNextPage); + } + + public void Init() + { InitializeAsync(); } diff --git a/29WxOrderWpf/MainWindow.xaml.cs b/29WxOrderWpf/MainWindow.xaml.cs index 95a299a..6eeccba 100644 --- a/29WxOrderWpf/MainWindow.xaml.cs +++ b/29WxOrderWpf/MainWindow.xaml.cs @@ -294,19 +294,27 @@ namespace _29WxOrderWpf { 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()) + shop.Is29Supplier = false; + for (int i = 0; i < 100; i++) + { + 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; + } + + foreach (var order in GlobalConfig.lstFilterOrder.Where(o => o.shop_id.ParseToString() == shop.ErpShopId).ToList()) { // 更新代发管理情况 foreach (var orderItem in order.orderItems) diff --git a/29WxOrderWpf/Windows/OrderWindows/TransitReturnOrderWindow.xaml b/29WxOrderWpf/Windows/OrderWindows/TransitReturnOrderWindow.xaml new file mode 100644 index 0000000..ecfee5a --- /dev/null +++ b/29WxOrderWpf/Windows/OrderWindows/TransitReturnOrderWindow.xaml @@ -0,0 +1,195 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +