@ -1149,7 +1149,8 @@ namespace Khd.Core.Wpf.Form
/// <param name="e"></param>
private void btnGetStocK_Click ( object sender , RoutedEventArgs e )
{
Pagination1 . PageIndex = 1 ;
//Pagination1.PageIndex = 1;
this . PageControl1 . PageInfo . CurrentPage = 1 ;
this . EquipListSelectDy . SelectedIndex = - 1 ;
locationDtos . Clear ( ) ;
GetBaseLocations ( ) ;
@ -1206,12 +1207,12 @@ namespace Khd.Core.Wpf.Form
}
var data = dbContext . ExecuteSqlQuery < LocationDto > ( sql ) ;
int sum = data . Count ;
data = data . Skip ( ( this . Pag ination1. PageIndex - 1 ) * this . pageCount ) . Take ( this . pageCount ) . ToList ( ) ;
data = data . Skip ( ( this . Pag eControl1. PageInfo . CurrentPage - 1 ) * this . pageCount ) . Take ( this . pageCount ) . ToList ( ) ;
data . ForEach ( t = >
{
t . LocationStatus = SystemData . LocationStatusDic . GetValueOrDefault ( t . LocationStatus , "未知" ) ;
} ) ;
Pagination1 . MaxPageCount = ( sum / pageCount ) + ( sum % pageCount = = 0 ? 0 : 1 ) ;
this . PageControl1 . PageInfo . TotalPage = ( sum / pageCount ) + ( sum % pageCount = = 0 ? 0 : 1 ) ;
this . LoadMaterial1 . ItemsSource = null ;
this . LoadMaterial1 . ItemsSource = data ;
this . LoadMaterial1 . Items . Refresh ( ) ;
@ -3258,19 +3259,20 @@ namespace Khd.Core.Wpf.Form
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private async void SelectButton_Click ( object sender , RoutedEventArgs e )
private void SelectButton_Click ( object sender , RoutedEventArgs e )
{
this . PageControl2 . PageInfo . CurrentPage = 1 ;
CallSelectedItem . Clear ( ) ;
await GetPersonCallMaterialData ( ) ;
GetPersonCallMaterialData ( ) ;
}
/// <summary>
/// 获取人员呼叫的物料数据
/// </summary>
private async Task GetPersonCallMaterialData ( )
private void GetPersonCallMaterialData ( )
{
try
{
int pageNumber = this . Pag ination2. PageIndex ;
int pageNumber = this . Pag eControl2. PageInfo . CurrentPage ;
// 计算跳过的记录数
int skip = ( pageNumber - 1 ) * pageCount ;
@ -3301,7 +3303,7 @@ namespace Khd.Core.Wpf.Form
} ) ;
int totalRecords = groupWmsRawStock . Count ( ) ;
Pagination2 . MaxPageCount = ( totalRecords / pageCount ) + ( totalRecords % pageCount = = 0 ? 0 : 1 ) ;
this . PageControl2 . PageInfo . TotalPage = ( totalRecords / pageCount ) + ( totalRecords % pageCount = = 0 ? 0 : 1 ) ;
groupWmsRawStock = groupWmsRawStock . Skip ( skip ) . Take ( pageCount ) ;
//.GroupBy(t => t.palletInfoCode)
//.Select(t => new
@ -3312,14 +3314,14 @@ namespace Khd.Core.Wpf.Form
// materialId = string.Join("\n", t.Select(x => x.materialId)),
//}).ToList();
var palletInfoCodes = groupWmsRawStock . Select ( t = > t . palletInfoCode ) . Distinct ( ) . ToList ( ) ;
var wmsBaseLocations = await dbContext . WmsBaseLocation
var wmsBaseLocations = dbContext . WmsBaseLocation
. Where ( t = > t . ContainerStatus = = "1" )
. Where ( t = > t . warehouseId = = 512 )
. Where ( t = > palletInfoCodes . Contains ( t . containerCode ) ) . ToList Async ( ) ;
. Where ( t = > palletInfoCodes . Contains ( t . containerCode ) ) . ToList ( ) ;
if ( string . IsNullOrEmpty ( MaterialName . Text ) )
{
var tempMaterialIds = groupWmsRawStock . Select ( x = > x . materialId ) . Distinct ( ) . ToList ( ) ;
materialInfos = await dbContext . MesBaseMaterialInfo . Where ( x = > tempMaterialIds . Contains ( x . MaterialId ) ) . ToList Async ( ) ;
materialInfos = dbContext . MesBaseMaterialInfo . Where ( x = > tempMaterialIds . Contains ( x . MaterialId ) ) . ToList ( ) ;
}
var bill = from a in wmsBaseLocations
from b in groupWmsRawStock
@ -3382,7 +3384,7 @@ namespace Khd.Core.Wpf.Form
/// <param name="e"></param>
private async void Pagination2_PageUpdated ( object sender , HandyControl . Data . FunctionEventArgs < int > e )
{
await GetPersonCallMaterialData ( ) ;
GetPersonCallMaterialData ( ) ;
}
/// <summary>
/// 页码改变时
@ -3925,7 +3927,7 @@ namespace Khd.Core.Wpf.Form
dbContext . AddRange ( addList ) ;
dbContext . SaveChanges ( ) ;
transaction . Commit ( ) ;
// HandyControl.Controls.MessageBox.Show("创建出库任务成功!");
// HandyControl.Controls.MessageBox.Show("创建出库任务成功!");
itemsControlItems . Clear ( ) ;
CallSelectedItem . Clear ( ) ;
GetPersonCallMaterialData ( ) ;
@ -4872,6 +4874,7 @@ namespace Khd.Core.Wpf.Form
private void SelectInventoryButton_Click ( object sender , RoutedEventArgs e )
{
this . PageControl3 . PageInfo . CurrentPage = 1 ;
GetInvertoryData ( ) ;
}
@ -4893,9 +4896,12 @@ namespace Khd.Core.Wpf.Form
using var dbContext = scope . ServiceProvider . GetRequiredService < DefaultDbContext > ( ) ;
try
{
int totalCount = dbContext . WmsInventoryCheck
. Where ( t = > t . WarehouseId = = 512 ) . Count ( ) ;
var list = dbContext . WmsInventoryCheck
. Where ( t = > t . WarehouseId = = 512 )
. OrderByDescending ( t = > t . CreateTime ) . Skip ( ( this . Pagination3 . PageIndex - 1 ) * this . pageCount ) . Take ( this . pageCount ) . ToList ( ) ;
. OrderByDescending ( t = > t . CreateTime ) . Skip ( ( this . PageControl3 . PageInfo . CurrentPage - 1 ) * this . pageCount ) . Take ( this . pageCount ) . ToList ( ) ;
this . PageControl3 . PageInfo . TotalPage = totalCount / this . pageCount + totalCount % this . pageCount = = 0 ? 0 : 1 ;
this . InventoryMaterial . ItemsSource = list . Select ( t = >
new
{
@ -5763,6 +5769,65 @@ namespace Khd.Core.Wpf.Form
}
}
private void PageControl1_PreviousPageClicked ( object sender , RoutedEventArgs e )
{
this . PageControl1 . PageInfo . CurrentPage - - ;
if ( this . PageControl1 . PageInfo . CurrentPage < 1 )
{
this . PageControl1 . PageInfo . CurrentPage = 1 ;
}
GetLocations ( ) ;
}
private void PageControl1_NextPageClicked ( object sender , RoutedEventArgs e )
{
this . PageControl1 . PageInfo . CurrentPage + + ;
if ( this . PageControl1 . PageInfo . CurrentPage > this . PageControl1 . PageInfo . TotalPage )
{
this . PageControl1 . PageInfo . CurrentPage = this . PageControl1 . PageInfo . TotalPage ;
}
GetLocations ( ) ;
}
private void PageControl2_PreviousPageClicked ( object sender , RoutedEventArgs e )
{
this . PageControl2 . PageInfo . CurrentPage - - ;
if ( this . PageControl2 . PageInfo . CurrentPage < 1 )
{
this . PageControl2 . PageInfo . CurrentPage = 1 ;
}
GetPersonCallMaterialData ( ) ;
}
private void PageControl2_NextPageClicked ( object sender , RoutedEventArgs e )
{
this . PageControl2 . PageInfo . CurrentPage + + ;
if ( this . PageControl2 . PageInfo . CurrentPage > this . PageControl2 . PageInfo . TotalPage )
{
this . PageControl2 . PageInfo . CurrentPage = this . PageControl2 . PageInfo . TotalPage ;
}
GetPersonCallMaterialData ( ) ;
}
private void PageControl3_PreviousPageClicked ( object sender , RoutedEventArgs e )
{
this . PageControl3 . PageInfo . CurrentPage - - ;
if ( this . PageControl3 . PageInfo . CurrentPage < 1 )
{
this . PageControl3 . PageInfo . CurrentPage = 1 ;
}
GetInvertoryData ( ) ;
}
private void PageControl3_NextPageClicked ( object sender , RoutedEventArgs e )
{
this . PageControl3 . PageInfo . CurrentPage + + ;
if ( this . PageControl3 . PageInfo . CurrentPage > this . PageControl3 . PageInfo . TotalPage )
{
this . PageControl3 . PageInfo . CurrentPage = this . PageControl3 . PageInfo . TotalPage ;
}
GetInvertoryData ( ) ;
}
}
}