From 71347b2cc96122fcf39d5fbcb469515777a89a88 Mon Sep 17 00:00:00 2001 From: hehaibing-1996 Date: Tue, 1 Apr 2025 11:16:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=A2=E6=88=B7=E7=AB=AF=E8=B4=A7=E6=9E=B6?= =?UTF-8?q?=E5=AD=98=E9=87=8F=E5=A2=9E=E5=8A=A0=E6=80=BB=E6=95=B0=E9=87=8F?= =?UTF-8?q?=E7=9A=84=E6=98=BE=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/MatDetailCurrentInfoService.cs | 7 +++++++ .../GetLocationInfosRequest.cs | 4 ++++ WCS.Model/ApiModel/PageQuery/PageQueryResponse.cs | 1 + .../ViewModels/MatDetailCurrentInfoViewModel.cs | 14 +++++++++++++- 货架标准上位机/Views/MatDetailCurrentInfoView.xaml | 14 +++++++++++++- 5 files changed, 38 insertions(+), 2 deletions(-) diff --git a/WCS.BLL/Services/Service/MatDetailCurrentInfoService.cs b/WCS.BLL/Services/Service/MatDetailCurrentInfoService.cs index 212a3aa..2952478 100644 --- a/WCS.BLL/Services/Service/MatDetailCurrentInfoService.cs +++ b/WCS.BLL/Services/Service/MatDetailCurrentInfoService.cs @@ -68,6 +68,12 @@ namespace WCS.BLL.Services.Service //分页 var totalCount = await recordsQueryable.CountAsync(); + + var totalQty = (decimal)0; + if(request.IsClient) + { + totalQty = recordsQueryable.ToList().Sum(mci => mci.MatQty); + } var records = await recordsQueryable .OrderByDescending(mci => mci.Id) .Skip((request.PageNumber - 1) * request.PageSize).Take(request.PageSize) @@ -83,6 +89,7 @@ namespace WCS.BLL.Services.Service Message = $"success", Data = new PageQueryResponseData() { + TotalQty = totalQty, TotalCount = totalCount, MaxPage = request.PageSize == 0 ? 0 : (int)Math.Ceiling((decimal)totalCount / request.PageSize), Count = records.Count, diff --git a/WCS.Model/ApiModel/MatDetailCurrentInfo/GetLocationInfosRequest.cs b/WCS.Model/ApiModel/MatDetailCurrentInfo/GetLocationInfosRequest.cs index 01208cc..8cb8a9a 100644 --- a/WCS.Model/ApiModel/MatDetailCurrentInfo/GetLocationInfosRequest.cs +++ b/WCS.Model/ApiModel/MatDetailCurrentInfo/GetLocationInfosRequest.cs @@ -15,5 +15,9 @@ namespace WCS.Model.ApiModel.MatDetailCurrentInfo public string MatCode { get; set; } public string MatName { get; set; } + /// + /// 是否是客户端请求 + /// + public bool IsClient { get; set; } = false; } } diff --git a/WCS.Model/ApiModel/PageQuery/PageQueryResponse.cs b/WCS.Model/ApiModel/PageQuery/PageQueryResponse.cs index 0fc9d4d..0524e8a 100644 --- a/WCS.Model/ApiModel/PageQuery/PageQueryResponse.cs +++ b/WCS.Model/ApiModel/PageQuery/PageQueryResponse.cs @@ -16,6 +16,7 @@ namespace WCS.Model public int Count { get; set; } public int MaxPage { get; set; } public int TotalCount { get; set; } + public decimal TotalQty { get; set; } public List Lists { get; set; } } } diff --git a/货架标准上位机/ViewModels/MatDetailCurrentInfoViewModel.cs b/货架标准上位机/ViewModels/MatDetailCurrentInfoViewModel.cs index 844ddb5..67e6aac 100644 --- a/货架标准上位机/ViewModels/MatDetailCurrentInfoViewModel.cs +++ b/货架标准上位机/ViewModels/MatDetailCurrentInfoViewModel.cs @@ -243,6 +243,9 @@ namespace 智慧物流软件系统.ViewModel MatCode = MatCode, MatName = MatName, + //是客户端进行的请求 + IsClient = true, + UserName = LocalStatic.CurrentUser, DeviceType = LocalFile.Config.DeviceType, PageNumber = CurrentPage, @@ -254,6 +257,7 @@ namespace 智慧物流软件系统.ViewModel DataGridItemSource = Result.Data.Lists; MaxPage = Result.Data.MaxPage; TotalCount = Result.Data.TotalCount; + TotalQty = Result.Data.TotalQty; } } catch (Exception ex) @@ -393,7 +397,7 @@ namespace 智慧物流软件系统.ViewModel set { SetProperty(ref maxPage, value); } } - //总数量 + //搜素记录总数量 private int totalCount; public int TotalCount { @@ -401,6 +405,14 @@ namespace 智慧物流软件系统.ViewModel set { SetProperty(ref totalCount, value); } } + //搜索后物料的总数量 + private decimal totalQty; + public decimal TotalQty + { + get { return totalQty; } + set { SetProperty(ref totalQty, value); } + } + private int pageSize = 10; public int PageSize { diff --git a/货架标准上位机/Views/MatDetailCurrentInfoView.xaml b/货架标准上位机/Views/MatDetailCurrentInfoView.xaml index 11e9992..eae0d95 100644 --- a/货架标准上位机/Views/MatDetailCurrentInfoView.xaml +++ b/货架标准上位机/Views/MatDetailCurrentInfoView.xaml @@ -247,7 +247,19 @@ Command="{Binding BtnLastPageCommand}"/> - + + + + + +