客户端货架存量增加总数量的显示
This commit is contained in:
@ -68,6 +68,12 @@ namespace WCS.BLL.Services.Service
|
|||||||
|
|
||||||
//分页
|
//分页
|
||||||
var totalCount = await recordsQueryable.CountAsync();
|
var totalCount = await recordsQueryable.CountAsync();
|
||||||
|
|
||||||
|
var totalQty = (decimal)0;
|
||||||
|
if(request.IsClient)
|
||||||
|
{
|
||||||
|
totalQty = recordsQueryable.ToList().Sum(mci => mci.MatQty);
|
||||||
|
}
|
||||||
var records = await recordsQueryable
|
var records = await recordsQueryable
|
||||||
.OrderByDescending(mci => mci.Id)
|
.OrderByDescending(mci => mci.Id)
|
||||||
.Skip((request.PageNumber - 1) * request.PageSize).Take(request.PageSize)
|
.Skip((request.PageNumber - 1) * request.PageSize).Take(request.PageSize)
|
||||||
@ -83,6 +89,7 @@ namespace WCS.BLL.Services.Service
|
|||||||
Message = $"success",
|
Message = $"success",
|
||||||
Data = new PageQueryResponseData<MatDetailCurrentInfoModel>()
|
Data = new PageQueryResponseData<MatDetailCurrentInfoModel>()
|
||||||
{
|
{
|
||||||
|
TotalQty = totalQty,
|
||||||
TotalCount = totalCount,
|
TotalCount = totalCount,
|
||||||
MaxPage = request.PageSize == 0 ? 0 : (int)Math.Ceiling((decimal)totalCount / request.PageSize),
|
MaxPage = request.PageSize == 0 ? 0 : (int)Math.Ceiling((decimal)totalCount / request.PageSize),
|
||||||
Count = records.Count,
|
Count = records.Count,
|
||||||
|
@ -15,5 +15,9 @@ namespace WCS.Model.ApiModel.MatDetailCurrentInfo
|
|||||||
public string MatCode { get; set; }
|
public string MatCode { get; set; }
|
||||||
|
|
||||||
public string MatName { 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 Count { get; set; }
|
||||||
public int MaxPage { get; set; }
|
public int MaxPage { get; set; }
|
||||||
public int TotalCount { get; set; }
|
public int TotalCount { get; set; }
|
||||||
|
public decimal TotalQty { get; set; }
|
||||||
public List<T> Lists { get; set; }
|
public List<T> Lists { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -243,6 +243,9 @@ namespace 智慧物流软件系统.ViewModel
|
|||||||
MatCode = MatCode,
|
MatCode = MatCode,
|
||||||
MatName = MatName,
|
MatName = MatName,
|
||||||
|
|
||||||
|
//是客户端进行的请求
|
||||||
|
IsClient = true,
|
||||||
|
|
||||||
UserName = LocalStatic.CurrentUser,
|
UserName = LocalStatic.CurrentUser,
|
||||||
DeviceType = LocalFile.Config.DeviceType,
|
DeviceType = LocalFile.Config.DeviceType,
|
||||||
PageNumber = CurrentPage,
|
PageNumber = CurrentPage,
|
||||||
@ -254,6 +257,7 @@ namespace 智慧物流软件系统.ViewModel
|
|||||||
DataGridItemSource = Result.Data.Lists;
|
DataGridItemSource = Result.Data.Lists;
|
||||||
MaxPage = Result.Data.MaxPage;
|
MaxPage = Result.Data.MaxPage;
|
||||||
TotalCount = Result.Data.TotalCount;
|
TotalCount = Result.Data.TotalCount;
|
||||||
|
TotalQty = Result.Data.TotalQty;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
@ -393,7 +397,7 @@ namespace 智慧物流软件系统.ViewModel
|
|||||||
set { SetProperty(ref maxPage, value); }
|
set { SetProperty(ref maxPage, value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
//总数量
|
//搜素记录总数量
|
||||||
private int totalCount;
|
private int totalCount;
|
||||||
public int TotalCount
|
public int TotalCount
|
||||||
{
|
{
|
||||||
@ -401,6 +405,14 @@ namespace 智慧物流软件系统.ViewModel
|
|||||||
set { SetProperty(ref totalCount, value); }
|
set { SetProperty(ref totalCount, value); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//搜索后物料的总数量
|
||||||
|
private decimal totalQty;
|
||||||
|
public decimal TotalQty
|
||||||
|
{
|
||||||
|
get { return totalQty; }
|
||||||
|
set { SetProperty(ref totalQty, value); }
|
||||||
|
}
|
||||||
|
|
||||||
private int pageSize = 10;
|
private int pageSize = 10;
|
||||||
public int PageSize
|
public int PageSize
|
||||||
{
|
{
|
||||||
|
@ -247,7 +247,19 @@
|
|||||||
Command="{Binding BtnLastPageCommand}"/>
|
Command="{Binding BtnLastPageCommand}"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</StackPanel>
|
</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>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
Reference in New Issue
Block a user