From aadf0c1ea7793c3b315c3db2b01fb96a98052ca4 Mon Sep 17 00:00:00 2001 From: lilili Date: Thu, 6 Apr 2023 09:09:24 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E6=8B=A3=E6=96=99=E6=8E=A8?= =?UTF-8?q?=E8=8D=90=E6=9D=A1=E7=A0=81=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NFine.Application/WMS/PickMaterialApp.cs | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/WMS-BS/NFine.Application/WMS/PickMaterialApp.cs b/WMS-BS/NFine.Application/WMS/PickMaterialApp.cs index 54e749d..58e9141 100644 --- a/WMS-BS/NFine.Application/WMS/PickMaterialApp.cs +++ b/WMS-BS/NFine.Application/WMS/PickMaterialApp.cs @@ -812,12 +812,12 @@ where a.IssueCode='{0}' and a.WorkPoint='{1}'"; c.InvCode, c.InvName, c.InvStd, -c.InvUnit, + c.InvUnit, FLOOR(c.iQuantity) AS iQuantity, d.WarehouseCode, d.LocationCode, - d.LotNO, - FLOOR(ISNULL(d.Quantity, 0)) AS QTY, + m.LotNO, + (case when m.LotNo is null then 0 else FLOOR(ISNULL(d.Quantity, 0)) end) AS QTY, CONVERT(varchar(100),d.MTIME, 23) MTIME, FLOOR(f.QTYTotal) QTYTotal INTO #temp FROM @@ -830,6 +830,7 @@ c.InvUnit, DECLARE @ItemCode VARCHAR(50), @QTY DECIMAL(18,3), @ItemCodeCurrent VARCHAR(50), + @Lotno VARCHAR(50), @QTYCurrent DECIMAL(18,3), @iQuantityCurrent DECIMAL(18,3), @CanDelete BIT, @@ -839,10 +840,11 @@ SET @Row = @@rowcount SET @rowCurrent=1 SET @CanDelete=0 SET @ItemCode='' +SET @Lotno = '' WHILE @rowCurrent<=@Row BEGIN - SELECT @ItemCodeCurrent=InvCode,@QTYCurrent=QTY,@iQuantityCurrent=iQuantity FROM #temp WHERE rowNo=@rowCurrent + SELECT @ItemCodeCurrent=InvCode,@QTYCurrent=QTY,@iQuantityCurrent=iQuantity,@Lotno = Lotno FROM #temp WHERE rowNo=@rowCurrent PRINT(@rowCurrent) IF @ItemCode<>@ItemCodeCurrent @@ -859,8 +861,8 @@ PRINT(@rowCurrent) CONTINUE END - SET @QTY += @QTYCurrent - IF @QTY>=@iQuantityCurrent + SET @QTY += @QTYCurrent + IF @LotNo is null or @QTY>=@iQuantityCurrent BEGIN SET @CanDelete=1 END @@ -882,7 +884,7 @@ DROP TABLE #temp b.InvStd, SUM(ISNULL(a.Quantity, 0)) AS iQuantity, a.WhCode, -b.InvUnit, + b.InvUnit, a.ExtensionID FROM ICSMOPick a @@ -919,7 +921,7 @@ b.InvUnit, a.InvCode, b.InvName, b.InvStd, -b.InvUnit, + b.InvUnit, SUM(ISNULL(a.Quantity, 0)) AS iQuantity, a.WhCode, a.ExtensionID @@ -933,7 +935,7 @@ b.InvUnit, if (Type=="4") { #region 委外备料SQL - sqls = @" select + sqls = @" select c.OOCode as Code, a.InvCode, b.InvName, @@ -1015,10 +1017,10 @@ a.ExtensionID a.InvCode, b.InvName, b.InvStd, -b.InvUnit, + b.InvUnit, SUM(ISNULL(a.Quantity, 0)) AS iQuantity, a.WhCode, -a.ExtensionID + a.ExtensionID FROM ICSOtherOut a LEFT JOIN ICSINVENTORY b ON a.InvCode = b.InvCode AND a.WorkPoint=b.WorkPoint