change-修改手动投料选择库位逻辑,队列有深库位,禁止出对应的浅库位

dev
liuwf 4 weeks ago
parent 36b7362451
commit 2ef0ac0e1c

@ -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">
<Control.Resources>
<local1:PlanStatusConverter x:Key="PlanStatusConverter" />

@ -174,21 +174,36 @@ 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<WmsBaseLocation>().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)
{

Loading…
Cancel
Save