diff --git a/SlnMesnac.WPF/Page/ManualDeliveryWindow.xaml b/SlnMesnac.WPF/Page/ManualDeliveryWindow.xaml index 6e278ee..8759796 100644 --- a/SlnMesnac.WPF/Page/ManualDeliveryWindow.xaml +++ b/SlnMesnac.WPF/Page/ManualDeliveryWindow.xaml @@ -5,7 +5,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:SlnMesnac.WPF.Page" xmlns:local1="clr-namespace:SlnMesnac.WPF.Converter.ProdMgmt" - mc:Ignorable="d" + mc:Ignorable="d" Topmost="True" Title="投料管理" Height="750" Width="1000" Background="White" Name="window" WindowStartupLocation="CenterOwner"> diff --git a/SlnMesnac.WPF/ViewModel/ManualDeliveryViewModel.cs b/SlnMesnac.WPF/ViewModel/ManualDeliveryViewModel.cs index 023f755..480ab94 100644 --- a/SlnMesnac.WPF/ViewModel/ManualDeliveryViewModel.cs +++ b/SlnMesnac.WPF/ViewModel/ManualDeliveryViewModel.cs @@ -174,20 +174,35 @@ namespace SlnMesnac.WPF.ViewModel }); - return; } - if (!string.IsNullOrEmpty(shallowLocation.ContainerCode)) + //if (!string.IsNullOrEmpty(shallowLocation.ContainerCode)) + //{ + // // 判断浅库位是否已经加到出库队列 + // WmsRawPreferredOut? shallowPreferredOut = wmsRawPreferredOutService.Query(x => x.LocationCode == shallowLocation.LocationCode).FirstOrDefault(); + // if(shallowPreferredOut == null) + // { + // Msg.MsgShow($"当前库位对应的浅库位{shallowLocation.LocationCode}有库存,请优先出对应的浅库位", 2, 3); + // return; + // } + //} + + } + else + { // 浅库位,需要判断深库位是否已经加到出库队列 + int? row = targetLocation.LocRow % 2 == 0 ? targetLocation.LocRow - 1 : targetLocation.LocRow + 1; + WmsBaseLocation? deepLocation = sqlSugarClient.AsTenant().GetConnection("mes").Queryable().Where(it => it.WarehouseId==311 && it.LocRow==row && it.LocColumn==targetLocation.LocColumn).First(); + + if (deepLocation != null) { - // 判断浅库位是否已经加到出库队列 - WmsRawPreferredOut? shallowPreferredOut = wmsRawPreferredOutService.Query(x => x.LocationCode == shallowLocation.LocationCode).FirstOrDefault(); - if(shallowPreferredOut == null) + WmsRawPreferredOut? isDeepHas = wmsRawPreferredOutService.Query(x => x.WarehouseId==311 && x.LocationCode == deepLocation.LocationCode).FirstOrDefault(); + if (isDeepHas != null) { - Msg.MsgShow($"当前库位对应的浅库位{shallowLocation.LocationCode}有库存,请优先出对应的浅库位", 2, 3); + Msg.MsgShow($"当前库位{targetLocation.LocationCode}对应的深库位{deepLocation.LocationCode}已经存在出库队列,禁止出浅库位,请等待出完或手动删除", 2, 3); return; - } + } + } - } WmsRawPreferredOut? isHas = wmsRawPreferredOutService.Query(x => x.LocationCode == targetLocation.LocationCode).FirstOrDefault(); if (isHas != null)