From 2ef0ac0e1c1776e6ae93457aa457b57f07cb0c38 Mon Sep 17 00:00:00 2001 From: liuwf Date: Thu, 17 Oct 2024 15:07:16 +0800 Subject: [PATCH] =?UTF-8?q?change-=E4=BF=AE=E6=94=B9=E6=89=8B=E5=8A=A8?= =?UTF-8?q?=E6=8A=95=E6=96=99=E9=80=89=E6=8B=A9=E5=BA=93=E4=BD=8D=E9=80=BB?= =?UTF-8?q?=E8=BE=91=EF=BC=8C=E9=98=9F=E5=88=97=E6=9C=89=E6=B7=B1=E5=BA=93?= =?UTF-8?q?=E4=BD=8D=EF=BC=8C=E7=A6=81=E6=AD=A2=E5=87=BA=E5=AF=B9=E5=BA=94?= =?UTF-8?q?=E7=9A=84=E6=B5=85=E5=BA=93=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SlnMesnac.WPF/Page/ManualDeliveryWindow.xaml | 2 +- .../ViewModel/ManualDeliveryViewModel.cs | 31 ++++++++++++++----- 2 files changed, 24 insertions(+), 9 deletions(-) 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)