@ -630,7 +630,7 @@ namespace Khd.Core.Wpf.Form
} ) . ToList ( ) ;
//本次所有任务出来的托盘号
List < WcsTask > wcsTasks = dbContext . WcsTask . Where ( t = > t . taskType = = 30 & & targetRawOutstocks . Select ( d = > d . materialId ) . Contains ( t . materialId ) ) . ToList ( ) ;
List < WcsTask > wcsTasks = dbContext . WcsTask . Where ( t = > t . taskType = = 30 & & targetRawOutstocks . Select ( d = > d . materialId ) . Contains ( t . materialId ) ) . ToList ( ) ;
List < string > containerNos = wcsTasks . Select ( t = > t . containerNo ) . ToList ( ) ;
//本次所有托盘携带的物料
List < WmsRawStock > wmsRawStocks = dbContext . WmsRawStock . Where ( t = > containerNos . Contains ( t . palletInfoCode ) ) . ToList ( ) ;
@ -1112,7 +1112,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 ( ) ;
@ -1169,12 +1170,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 ( ) ;
@ -1832,8 +1833,8 @@ namespace Khd.Core.Wpf.Form
{
TaskHistoryWindow taskHistoryWindow = new TaskHistoryWindow ( _host ) ;
taskHistoryWindow . ShowDialog ( ) ;
}
catch ( Exception ex )
{
@ -2820,8 +2821,8 @@ namespace Khd.Core.Wpf.Form
}
if ( wmsRawOutstocks . Count > 0 )
{
wmsRawOutstocks = wmsRawOutstocks . OrderBy ( t = > list [ 0 ] = = t . endStationCode ? 0 : 99 ) . ToList ( ) ;
wmsRawOutstocks = wmsRawOutstocks . OrderBy ( t = > list [ 0 ] = = t . endStationCode ? 0 : 99 ) . ToList ( ) ;
decimal? sum = wmsRawOutstocks . Sum ( t = > ( t . outstockAmount - t . realOutstockAmount ) ) ;
if ( outScan > sum )
{
@ -2832,7 +2833,7 @@ namespace Khd.Core.Wpf.Form
{
if ( outScan < = 0 )
{
break ;
break ;
}
decimal outAmount = 0 ;
if ( item . outstockAmount - item . realOutstockAmount > outScan )
@ -3186,7 +3187,7 @@ namespace Khd.Core.Wpf.Form
}
catch ( Exception ex )
{
scanOutMsg . Text = "出库失败" + ex ;
scanOutMsg . Text = "出库失败" + ex ;
}
}
/// <summary>
@ -3194,19 +3195,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 ;
@ -3237,7 +3239,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
@ -3248,14 +3250,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
@ -3318,7 +3320,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>
/// 页码改变时
@ -4808,6 +4810,7 @@ namespace Khd.Core.Wpf.Form
private void SelectInventoryButton_Click ( object sender , RoutedEventArgs e )
{
this . PageControl3 . PageInfo . CurrentPage = 1 ;
GetInvertoryData ( ) ;
}
@ -4831,7 +4834,7 @@ namespace Khd.Core.Wpf.Form
{
var list = dbContext . WmsInventoryCheck
. Where ( t = > t . WarehouseId = = 512 )
. OrderByDescending ( t = > t . CreateTime ) . Skip ( ( this . Pag ination3. PageIndex - 1 ) * this . pageCount ) . Take ( this . pageCount ) . ToList ( ) ;
. OrderByDescending ( t = > t . CreateTime ) . Skip ( ( this . Pag eControl3. PageInfo . CurrentPage - 1 ) * this . pageCount ) . Take ( this . pageCount ) . ToList ( ) ;
this . InventoryMaterial . ItemsSource = list . Select ( t = >
new
{
@ -5699,6 +5702,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 ( ) ;
}
}
}