From a30d6bb924e7f076a69d43bbd07cfe9621e8179b Mon Sep 17 00:00:00 2001 From: shanj <18996038927@163.com> Date: Wed, 21 Jun 2023 22:10:14 +0800 Subject: [PATCH] =?UTF-8?q?=E9=BD=90=E5=BA=93=E6=89=93=E5=8C=85=E4=BB=BB?= =?UTF-8?q?=E5=8A=A1-=E5=BE=85=E8=90=BD=E4=BB=93-=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E4=BA=AC=E4=BB=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{ => QiKu}/PackDetailService.cs | 0 .../{ => QiKu}/PackPurchaseTaskService.cs | 0 .../{ => QiKu}/PackServiceService.cs | 0 .../APIServices/{ => QiKu}/PackTaskService.cs | 0 .../APIServices/{ => QiKu}/SealBoxService.cs | 17 +++- .../GetJDSupplierNameAndStoreNameResponse.cs | 11 +++ BBWY.Client/Models/FallWare/JDWareBoxModel.cs | 36 +++++---- .../ViewModels/PackTask/TaskListViewModel.cs | 12 +-- .../PackTask/WareHouseListViewModel.cs | 6 +- .../Views/FallWare/SetJDWareBoxWindow2.xaml | 67 ++++++++++++++++ .../FallWare/SetJDWareBoxWindow2.xaml.cs | 77 +++++++++++++++++++ 11 files changed, 201 insertions(+), 25 deletions(-) rename BBWY.Client/APIServices/{ => QiKu}/PackDetailService.cs (100%) rename BBWY.Client/APIServices/{ => QiKu}/PackPurchaseTaskService.cs (100%) rename BBWY.Client/APIServices/{ => QiKu}/PackServiceService.cs (100%) rename BBWY.Client/APIServices/{ => QiKu}/PackTaskService.cs (100%) rename BBWY.Client/APIServices/{ => QiKu}/SealBoxService.cs (91%) create mode 100644 BBWY.Client/Models/APIModel/Response/SealBox/GetJDSupplierNameAndStoreNameResponse.cs create mode 100644 BBWY.Client/Views/FallWare/SetJDWareBoxWindow2.xaml create mode 100644 BBWY.Client/Views/FallWare/SetJDWareBoxWindow2.xaml.cs diff --git a/BBWY.Client/APIServices/PackDetailService.cs b/BBWY.Client/APIServices/QiKu/PackDetailService.cs similarity index 100% rename from BBWY.Client/APIServices/PackDetailService.cs rename to BBWY.Client/APIServices/QiKu/PackDetailService.cs diff --git a/BBWY.Client/APIServices/PackPurchaseTaskService.cs b/BBWY.Client/APIServices/QiKu/PackPurchaseTaskService.cs similarity index 100% rename from BBWY.Client/APIServices/PackPurchaseTaskService.cs rename to BBWY.Client/APIServices/QiKu/PackPurchaseTaskService.cs diff --git a/BBWY.Client/APIServices/PackServiceService.cs b/BBWY.Client/APIServices/QiKu/PackServiceService.cs similarity index 100% rename from BBWY.Client/APIServices/PackServiceService.cs rename to BBWY.Client/APIServices/QiKu/PackServiceService.cs diff --git a/BBWY.Client/APIServices/PackTaskService.cs b/BBWY.Client/APIServices/QiKu/PackTaskService.cs similarity index 100% rename from BBWY.Client/APIServices/PackTaskService.cs rename to BBWY.Client/APIServices/QiKu/PackTaskService.cs diff --git a/BBWY.Client/APIServices/SealBoxService.cs b/BBWY.Client/APIServices/QiKu/SealBoxService.cs similarity index 91% rename from BBWY.Client/APIServices/SealBoxService.cs rename to BBWY.Client/APIServices/QiKu/SealBoxService.cs index 7c434475..c60ba381 100644 --- a/BBWY.Client/APIServices/SealBoxService.cs +++ b/BBWY.Client/APIServices/QiKu/SealBoxService.cs @@ -167,7 +167,7 @@ namespace BBWY.Client.APIServices - public ApiResponse SetFallWareConfigure(long SealBoxId, string ProductTitle, string PurchaseOrder, string PrewOrder, string WaybillNo) + public ApiResponse SetFallWareConfigure(long SealBoxId, string ProductTitle, string PurchaseOrder, string PrewOrder, string WaybillNo, string providerName = "", string wareName = "") { return SendRequest(globalContext.QKApiHost, $"api/SealBox/SetFallWareConfigure", new @@ -176,7 +176,9 @@ namespace BBWY.Client.APIServices ProductTitle, PurchaseOrder, PrewOrder, - WaybillNo + WaybillNo, + providerName, + wareName } , null, HttpMethod.Post); } @@ -197,5 +199,16 @@ namespace BBWY.Client.APIServices , null, HttpMethod.Post); } + public ApiResponse GetJDSupplierNameAndStoreName(string poOrderNo) + { + return SendRequest(globalContext.BBYWApiHost, "api/qiku/GetJDSupplierNameAndStoreName", new + { + poOrderNo, + globalContext.User.Shop.AppKey, + globalContext.User.Shop.AppSecret, + globalContext.User.Shop.AppToken, + globalContext.User.Shop.Platform, + }, null, HttpMethod.Post); + } } } diff --git a/BBWY.Client/Models/APIModel/Response/SealBox/GetJDSupplierNameAndStoreNameResponse.cs b/BBWY.Client/Models/APIModel/Response/SealBox/GetJDSupplierNameAndStoreNameResponse.cs new file mode 100644 index 00000000..53ec68e1 --- /dev/null +++ b/BBWY.Client/Models/APIModel/Response/SealBox/GetJDSupplierNameAndStoreNameResponse.cs @@ -0,0 +1,11 @@ +namespace BBWY.Client.Models.APIModel +{ + public class GetJDSupplierNameAndStoreNameResponse + { + public string SupplierName { get; set; } + + public string StoreId { get; set; } + + public string StoreName { get; set; } + } +} diff --git a/BBWY.Client/Models/FallWare/JDWareBoxModel.cs b/BBWY.Client/Models/FallWare/JDWareBoxModel.cs index 90ab78ce..bd9ba546 100644 --- a/BBWY.Client/Models/FallWare/JDWareBoxModel.cs +++ b/BBWY.Client/Models/FallWare/JDWareBoxModel.cs @@ -4,9 +4,11 @@ using System.Text; namespace BBWY.Client.Models.FallWare { - public class JDWareBoxModel + public class JDWareBoxModel:NotifyObject { - + private string purchaseOrder; + private string prewOrder; + private string productTitle; /// /// 箱子id /// @@ -16,16 +18,8 @@ namespace BBWY.Client.Models.FallWare /// 供应商名称 /// public string ShopName { get; set; } - /// - /// 采购单号 - /// - public string PurchaseOrder { get; set; } - /// - /// 预约单号 - /// - public string PrewOrder { get; set; } + - /// /// 运单号 /// public string WaybillNo { get; set; } @@ -35,11 +29,6 @@ namespace BBWY.Client.Models.FallWare /// public string WareName { get; set; } - /// - /// 商品名称 - /// - public string ProductTitle { get; set; } - /// /// 箱子数 /// @@ -49,5 +38,20 @@ namespace BBWY.Client.Models.FallWare /// 商品数量 /// public int ProductCount { get; set; } + + /// + /// 采购单号 + /// + public string PurchaseOrder { get => purchaseOrder; set { Set(ref purchaseOrder, value); } } + + /// + /// 预约单号 + /// + public string PrewOrder { get => prewOrder; set { Set(ref prewOrder, value); } } + + /// + /// 商品名称 + /// + public string ProductTitle { get => productTitle; set { Set(ref productTitle, value); } } } } diff --git a/BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs b/BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs index 2bf03a4b..71f12f0d 100644 --- a/BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs +++ b/BBWY.Client/ViewModels/PackTask/TaskListViewModel.cs @@ -200,8 +200,8 @@ namespace BBWY.Client.ViewModels.PackTask - private readonly SealBoxService sealBoxService; - private readonly PackTaskService packTaskService; + private SealBoxService sealBoxService; + private PackTaskService packTaskService; WorkProcessService workProcessService; public int? taskStatus { get; set; } private ObservableCollection packTaskList; @@ -280,9 +280,11 @@ namespace BBWY.Client.ViewModels.PackTask }; if (fallware.WareType== WareType.京仓) { - - SetJDWareBoxWindow window = new SetJDWareBoxWindow(model,sealBoxService,fallware.WareType.Value,ReflashTask); - window.Show(); + + //SetJDWareBoxWindow window = new SetJDWareBoxWindow(model,sealBoxService,fallware.WareType.Value,ReflashTask); + //window.Show(); + var w = new SetJDWareBoxWindow2(model, sealBoxService, fallware.WareType.Value, ReflashTask); + w.ShowDialog(); } if (fallware.WareType == WareType.云仓) { diff --git a/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs b/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs index 2159ac70..12a3c565 100644 --- a/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs +++ b/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs @@ -335,8 +335,10 @@ namespace BBWY.Client.ViewModels.PackTask }; if (fallware.WareType == WareType.京仓) { - SetJDWareBoxWindow window = new SetJDWareBoxWindow(model, sealBoxService, fallware.WareType, ReflashTask,false); - window.Show(); + //SetJDWareBoxWindow window = new SetJDWareBoxWindow(model, sealBoxService, fallware.WareType, ReflashTask,false); + //window.Show(); + var w = new SetJDWareBoxWindow2(model, sealBoxService, fallware.WareType, ReflashTask, false); + w.ShowDialog(); } if (fallware.WareType == WareType.云仓) { diff --git a/BBWY.Client/Views/FallWare/SetJDWareBoxWindow2.xaml b/BBWY.Client/Views/FallWare/SetJDWareBoxWindow2.xaml new file mode 100644 index 00000000..1fe03ced --- /dev/null +++ b/BBWY.Client/Views/FallWare/SetJDWareBoxWindow2.xaml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/BBWY.Client/Views/FallWare/SetJDWareBoxWindow2.xaml.cs b/BBWY.Client/Views/FallWare/SetJDWareBoxWindow2.xaml.cs new file mode 100644 index 00000000..eef4c4d6 --- /dev/null +++ b/BBWY.Client/Views/FallWare/SetJDWareBoxWindow2.xaml.cs @@ -0,0 +1,77 @@ +using BBWY.Client.APIServices; +using BBWY.Client.Models; +using BBWY.Client.Models.FallWare; +using BBWY.Controls; +using System; +using System.Threading.Tasks; +using System.Windows; + +namespace BBWY.Client.Views.FallWare +{ + /// + /// SetJDWareBoxWindow2.xaml 的交互逻辑 + /// + public partial class SetJDWareBoxWindow2 : BWindow + { + public JDWareBoxModel JDWareBoxModel { get; set; } + + private SealBoxService sealBoxService; + + private Action reflashWindow; + + private WareType wareType; + + public bool IsEnabled { get; set; } + public bool IsLoading { get => isLoading; set { Set(ref isLoading, value); } } + + private bool isLoading; + + public SetJDWareBoxWindow2(JDWareBoxModel model, SealBoxService sealBoxService, WareType wareType, Action reflashWindow, bool isEnabled = true) + { + InitializeComponent(); + + this.sealBoxService = sealBoxService; + this.wareType = wareType; + this.reflashWindow = reflashWindow; + JDWareBoxModel = model; + this.IsEnabled = isEnabled; + this.DataContext = this; + } + + private void btn_save_Click(object sender, System.Windows.RoutedEventArgs e) + { + if (string.IsNullOrEmpty(JDWareBoxModel.ProductTitle) || + string.IsNullOrEmpty(JDWareBoxModel.PrewOrder) || + string.IsNullOrEmpty(JDWareBoxModel.PurchaseOrder)) + { + MessageBox.Show("信息不完整", "提示"); + return; + } + IsLoading = true; + Task.Factory.StartNew(() => + { + var getDetailResponse = sealBoxService.GetJDSupplierNameAndStoreName(JDWareBoxModel.PurchaseOrder); + if (!getDetailResponse.Success) + { + IsLoading = false; + this.Dispatcher.Invoke(() => MessageBox.Show(getDetailResponse.Msg, "提示")); + return; + } + + var res = sealBoxService.SetFallWareConfigure(JDWareBoxModel.SealBoxId, JDWareBoxModel.ProductTitle, JDWareBoxModel.PurchaseOrder, JDWareBoxModel.PrewOrder, JDWareBoxModel.WaybillNo, getDetailResponse.Data.SupplierName, getDetailResponse.Data.StoreName); + if (!res.Success) + { + IsLoading = false; + this.Dispatcher.Invoke(() => MessageBox.Show(res.Msg, "提示")); + return; + } + IsLoading = false; + this.Dispatcher.Invoke(() => + { + reflashWindow?.Invoke(); + this.Close(); + }); + }); + } + } +}