fix-修复5楼辅料人工叫料后再出空箱报错

master
liuwf 1 year ago
parent bc725f4fd4
commit 2ea4d57536

@ -3992,21 +3992,27 @@ namespace Khd.Core.Wpf.Form
var messageBoxResult = HandyControl.Controls.MessageBox.Show($"已创建{addList.Count}个料箱的任务,是否需要创建出空箱的任务?", "提示", MessageBoxButton.YesNo, MessageBoxImage.Question);
if (messageBoxResult == MessageBoxResult.Yes)
{
EmptyCountForm emptyCountForm = new(1, 6 - addList.Count);
emptyCountForm.ShowDialog();
if (EmptyCountForm.IsSelect)
{
List<WmsBaseLocation> emptyLocations = dbContext.ExecuteSqlQuery<WmsBaseLocation>(@$"
select t1.location_id locationId,
t1.container_code containerCode,
t1.location_code locationCode
from wms_base_location t1
left join wms_raw_stock t2
on t1.location_code=t2.location_code
where t2.location_code is null and t1.location_status=1
and t1.container_status=1 and t1.warehouse_id=512
order by t1.loc_column,t1.loc_row
");
List<WmsBaseLocation> emptyLocations = (from t1 in dbContext.WmsBaseLocation
where !dbContext.WmsRawStock.Any(t2 => t2.locationCode == t1.locationCode)
&& t1.locationStatus == "1"
&& t1.ContainerStatus == "1"
&& t1.warehouseId == 512
orderby t1.locColumn, t1.locRow
select new WmsBaseLocation
{
locationId = t1.locationId,
containerCode = t1.containerCode,
locationCode = t1.locationCode
}).ToList();
if (emptyLocations.Count < EmptyCountForm.EmptyTaskCount)
{
messageBoxResult = HandyControl.Controls.MessageBox.Show("没有足够的空箱库位库位,剩余空库位数量为" + emptyLocations.Count + "!\n是否将现有的空箱全部出库", "提示", MessageBoxButton.YesNo, MessageBoxImage.Information);

Loading…
Cancel
Save