From 4837839cd9f8ff1b0b1a1eb81655db83a08a88aa Mon Sep 17 00:00:00 2001 From: "506583276@qq.com" <506583276@qq.com> Date: Tue, 7 Nov 2023 16:24:36 +0800 Subject: [PATCH] =?UTF-8?q?10203.=E6=89=93=E5=8D=B0=E5=B0=81=E7=AE=B1?= =?UTF-8?q?=E6=98=8E=E7=BB=86=E5=90=8E=E7=A6=81=E6=AD=A2=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E5=B0=81=E7=AE=B1=E7=AD=96=E7=95=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../APIServices/QiKu/SealBoxService.cs | 32 ++++++++++++++----- BBWY.Client/GlobalContext.cs | 2 +- .../PackTask/WareHouseListViewModel.cs | 2 +- .../SealBox/SealBoxPrintDetailsWindow.xaml.cs | 23 +++++++++++-- 4 files changed, 47 insertions(+), 12 deletions(-) diff --git a/BBWY.Client/APIServices/QiKu/SealBoxService.cs b/BBWY.Client/APIServices/QiKu/SealBoxService.cs index 85a8993b..be957835 100644 --- a/BBWY.Client/APIServices/QiKu/SealBoxService.cs +++ b/BBWY.Client/APIServices/QiKu/SealBoxService.cs @@ -26,7 +26,7 @@ namespace BBWY.Client.APIServices return SendRequest(globalContext.QKApiHost, $"api/SealBox/GetSealBoxWaitConfigureList", new { - + ShopId = globalContext.User.Shop.ShopId.ToString(), TaskId, SkuId, @@ -91,7 +91,7 @@ namespace BBWY.Client.APIServices , null, HttpMethod.Post); } - public ApiResponse GetWareSealBoxList(string ShopName, long? TaskId, string SkuId,long? SealBoxId, int? PageIndex, int? PageSize) + public ApiResponse GetWareSealBoxList(string ShopName, long? TaskId, string SkuId, long? SealBoxId, int? PageIndex, int? PageSize) { return SendRequest(globalContext.QKApiHost, $"api/SealBox/GetWareSealBoxList", new @@ -119,6 +119,21 @@ namespace BBWY.Client.APIServices } , null, HttpMethod.Post); } + + + + /// + /// 完成打印封箱明细 + /// + /// + /// + public ApiResponse WareCompetePrintSealBox(long SealBoxId) + { + return SendRequest(globalContext.QKApiHost, $"api/SealBox/WareCompetePrintSealBox?SealBoxId={SealBoxId}", + null, null, HttpMethod.Get); + } + + /// /// 仓库端获取待落仓列表 /// @@ -128,7 +143,7 @@ namespace BBWY.Client.APIServices /// /// /// - public ApiResponse SearchWareFallWareConfigureList(PositionState positionState, string ShopName = null, long? TaskId = null, string SkuId = null,long?sealBoxId=null, int PageIndex = 1 + public ApiResponse SearchWareFallWareConfigureList(PositionState positionState, string ShopName = null, long? TaskId = null, string SkuId = null, long? sealBoxId = null, int PageIndex = 1 , int PageSize = 10) { return SendRequest(globalContext.QKApiHost, $"api/SealBox/SearchWareFallWareConfigureList", @@ -174,7 +189,7 @@ namespace BBWY.Client.APIServices - public ApiResponse SetFallWareConfigure(long SealBoxId, string ProductTitle, string PurchaseOrder, string PrewOrder, string WaybillNo, string providerName = "", string wareName = "",string WareCity="",DateTime? TransportOverTime=null) + public ApiResponse SetFallWareConfigure(long SealBoxId, string ProductTitle, string PurchaseOrder, string PrewOrder, string WaybillNo, string providerName = "", string wareName = "", string WareCity = "", DateTime? TransportOverTime = null) { return SendRequest(globalContext.QKApiHost, $"api/SealBox/SetFallWareConfigure", new @@ -246,7 +261,7 @@ namespace BBWY.Client.APIServices - public ApiResponse GetWareWaitTransportList(WareType WareType, int? PageSize, int? PageIndex,string shopId=null) + public ApiResponse GetWareWaitTransportList(WareType WareType, int? PageSize, int? PageIndex, string shopId = null) { return SendRequest(globalContext.QKApiHost, $"api/SealBox/GetWareWaitTransportList", new @@ -263,7 +278,7 @@ namespace BBWY.Client.APIServices public ApiResponse WareCompeteTransport(long sealBoxId) { return SendRequest(globalContext.QKApiHost, $"api/SealBox/WareCompeteTransport?sealBoxId={sealBoxId}", - null , null, HttpMethod.Post); + null, null, HttpMethod.Post); } @@ -273,10 +288,11 @@ namespace BBWY.Client.APIServices null, null, HttpMethod.Post); } - public ApiResponse GetWareWaitCompletedList(string shopId, string ShopName , long? TaskId , string SkuId , long? sealBoxId , int? PageIndex, int? PageSize) + public ApiResponse GetWareWaitCompletedList(string shopId, string ShopName, long? TaskId, string SkuId, long? sealBoxId, int? PageIndex, int? PageSize) { return SendRequest(globalContext.QKApiHost, $"api/SealBox/GetWareWaitCompletedList", - new { + new + { shopId, PageIndex, PageSize, diff --git a/BBWY.Client/GlobalContext.cs b/BBWY.Client/GlobalContext.cs index 895999f6..aa0d5b61 100644 --- a/BBWY.Client/GlobalContext.cs +++ b/BBWY.Client/GlobalContext.cs @@ -13,7 +13,7 @@ namespace BBWY.Client { ShopServiceGroupList = new List(); ShopServiceGroupLowerList = new List(); - ClientVersion = "10202"; + ClientVersion = "10203"; } diff --git a/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs b/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs index f4d9513c..a43753e5 100644 --- a/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs +++ b/BBWY.Client/ViewModels/PackTask/WareHouseListViewModel.cs @@ -1107,7 +1107,7 @@ namespace BBWY.Client.ViewModels.PackTask { var model = (SealBoxModel)obj; - SealBoxPrintDetailsWindow printDetailsWindow = new SealBoxPrintDetailsWindow(model); + SealBoxPrintDetailsWindow printDetailsWindow = new SealBoxPrintDetailsWindow(model, sealBoxService); printDetailsWindow.ShowDialog(); } diff --git a/BBWY.Client/Views/SealBox/SealBoxPrintDetailsWindow.xaml.cs b/BBWY.Client/Views/SealBox/SealBoxPrintDetailsWindow.xaml.cs index 60536936..64d83d56 100644 --- a/BBWY.Client/Views/SealBox/SealBoxPrintDetailsWindow.xaml.cs +++ b/BBWY.Client/Views/SealBox/SealBoxPrintDetailsWindow.xaml.cs @@ -1,4 +1,5 @@ -using BBWY.Client.Models.APIModel; +using BBWY.Client.APIServices; +using BBWY.Client.Models.APIModel; using BBWY.Client.Models.PackTask; using BBWY.Controls; using NPOI.Util; @@ -8,6 +9,7 @@ using System.Collections.ObjectModel; using System.Drawing.Printing; using System.IO; using System.Reflection; +using System.Security.Cryptography.X509Certificates; using System.Text; using System.Threading.Tasks; using System.Windows; @@ -26,12 +28,13 @@ namespace BBWY.Client.Views.SealBox /// public partial class SealBoxPrintDetailsWindow : BWindow { - public SealBoxPrintDetailsWindow(SealBoxModel sealBox) + public SealBoxPrintDetailsWindow(SealBoxModel sealBox, SealBoxService sealBoxService) { InitializeComponent(); InitPrintList(); SealBoxModel = sealBox.Copy(); this.DataContext = this; + this.sealBoxService = sealBoxService; } /// /// 打印机列表 @@ -44,6 +47,8 @@ namespace BBWY.Client.Views.SealBox //BarcodeImage = MyPrintHelper.GetBarcodeImage(SkuId, 300, 60); + + PrintList = new ObservableCollection(); var printingNames = PrinterSettings.InstalledPrinters;//获取本机的打印机数据 int index = -1; @@ -98,12 +103,26 @@ namespace BBWY.Client.Views.SealBox public string WareName { get; set; } public long SealBoxId { get; set; } + + SealBoxService sealBoxService; private void BButton_Click(object sender, RoutedEventArgs e) { int limitIndex = 15;//单页限制数量 + + + + var res = sealBoxService.WareCompetePrintSealBox(SealBoxModel.SealBoxId); + + if (res ==null|| !res.Success) + { + MessageBox.Show(res?.Msg); + return; + } + + Task.Factory.StartNew(() => { for (int i = 0; i < PrintCount; i++)//打印份数