客户端货架存量增加总数量的显示
This commit is contained in:
@ -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<MatDetailCurrentInfoModel>()
|
||||
{
|
||||
TotalQty = totalQty,
|
||||
TotalCount = totalCount,
|
||||
MaxPage = request.PageSize == 0 ? 0 : (int)Math.Ceiling((decimal)totalCount / request.PageSize),
|
||||
Count = records.Count,
|
||||
|
@ -15,5 +15,9 @@ namespace WCS.Model.ApiModel.MatDetailCurrentInfo
|
||||
public string MatCode { get; set; }
|
||||
|
||||
public string MatName { get; set; }
|
||||
/// <summary>
|
||||
/// 是否是客户端请求
|
||||
/// </summary>
|
||||
public bool IsClient { get; set; } = false;
|
||||
}
|
||||
}
|
||||
|
@ -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<T> Lists { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -248,6 +248,18 @@
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Orientation="Horizontal"
|
||||
HorizontalAlignment="Center"
|
||||
Grid.Column="2"
|
||||
Margin="5">
|
||||
<TextBlock FontSize="20"
|
||||
VerticalAlignment="Center"
|
||||
Text="总数量:"></TextBlock>
|
||||
<TextBlock FontSize="20"
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding TotalQty ,FallbackValue=0}"></TextBlock>
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
</Border>
|
||||
</Grid>
|
||||
|
Reference in New Issue
Block a user