From 139a68c2a6dba13caeecfaa28950f3c9d782dda8 Mon Sep 17 00:00:00 2001 From: lilili Date: Thu, 20 Apr 2023 16:56:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=90=88=E5=B9=B6=E6=8B=A3?= =?UTF-8?q?=E6=96=99=E6=8E=A5=E5=8F=A3=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../NFine.Application/WMS/PickMaterialApp.cs | 42 ++++++++++++------- 1 file changed, 28 insertions(+), 14 deletions(-) diff --git a/WMS-BS/NFine.Application/WMS/PickMaterialApp.cs b/WMS-BS/NFine.Application/WMS/PickMaterialApp.cs index c82ba4d..bce30d4 100644 --- a/WMS-BS/NFine.Application/WMS/PickMaterialApp.cs +++ b/WMS-BS/NFine.Application/WMS/PickMaterialApp.cs @@ -1595,7 +1595,7 @@ b.InvUnit, ICSMOApply a inner join ICSMOPickMerge x on a.ID=x.SourceID and a.WorkPoint=x.WorkPoint LEFT JOIN ICSINVENTORY b ON a.InvCode = b.InvCode AND a.WorkPoint=b.WorkPoint - WHERE x.SourceID in ({0}) AND a.WorkPoint = '{1}' + WHERE a.ApplyCode in ({0}) AND a.WorkPoint = '{1}' GROUP BY a.ApplyCode,a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.WhCode,x.MergeID,a.ExtensionID"; #endregion } @@ -1781,14 +1781,13 @@ a.ExtensionID sqls = @"select x.MergeID, a.OutCode as Code, - a.InvCode, - + a.InvCode, b.InvName, b.InvStd, -b.InvUnit, + b.InvUnit, SUM(ISNULL(a.Quantity, 0)) AS iQuantity, a.WHCode as WhCode, -a.ExtensionID + a.ExtensionID FROM ICSOtherOut a INNER JOIN ICSTransfer tra ON a.TransferDetailID=tra.TransferDetailID AND a.WorkPoint=tra.WorkPoint @@ -1835,9 +1834,24 @@ WHERE a.OutCode in ({0}) AND a.WorkPoint = '{1}' string sql = string.Empty; keyValue = keyValue.TrimEnd(','); + List arry = keyValue.Split(',').ToList(); + string dataList=string.Empty; + if (arry.Count > 0) + { + foreach (var i in arry) + { + dataList += $@"'{i}',"; + } + if (dataList.Any()) + { + dataList = dataList.TrimEnd(','); + } + } + + DateTime time = DateTime.Now; string Tday = time.ToString("yyyyMMdd"); - string sqls = string.Format(@"SELECT MAX(A.SourceID) AS SourceID FROM ICSMOPickMerge A WHERE A.SourceID LIKE '{0}%' AND LEN(a.SourceID) = 13", Tday); + string sqls = string.Format(@"SELECT MAX(A.MergeID) AS SourceID FROM ICSMOPickMerge A WHERE A.MergeID LIKE '{0}%' AND LEN(a.MergeID) = 13", Tday); DataSet ds = SqlHelper.GetDataSetBySql(sqls); string MergeID = ""; Int64 Merge_ID = 0; @@ -1900,31 +1914,31 @@ WHERE a.OutCode in ({0}) AND a.WorkPoint = '{1}' ( ID ,MergeID ,SourceID ,Type,MUSER, MUSERName,MTIME,WorkPoint) select NEWID(),'{0}',a.ID ,'{1}','{2}','{3}',GETDATE(),'{4}' from ICSOIssue a - where a.IssueCode in ('{5}')"; + where a.IssueCode in ({5})"; } if (Type == "7")//销售发货 { sql += @"INSERT INTO dbo.ICSMOPickMerge ( ID ,MergeID ,SourceID ,Type,MUSER, MUSERName,MTIME,WorkPoint) select NEWID(),'{0}',a.ID ,'{1}','{2}','{3}',GETDATE(),'{4}' - from ICSOIssue a - where a.IssueCode in ({5})"; + from ICSSDN a + where a.SDNCode in ({5}) AND a.Type='1' "; } if (Type == "8")//其它出库 { sql += @"INSERT INTO dbo.ICSMOPickMerge ( ID ,MergeID ,SourceID ,Type,MUSER, MUSERName,MTIME,WorkPoint) select NEWID(),'{0}',a.ID ,'{1}','{2}','{3}',GETDATE(),'{4}' - from ICSSDN a - where a.SDNCode in ({5})"; + from ICSOtherOut a + where a.OutCode in ({5})"; } if (Type == "9")//借用单 { sql += @"INSERT INTO dbo.ICSMOPickMerge ( ID ,MergeID ,SourceID ,Type,MUSER, MUSERName,MTIME,WorkPoint) select NEWID(),'{0}',a.ID ,'{1}','{2}','{3}',GETDATE(),'{4}' - from ICSOtherOut a - where a.OutCode in ({5})"; + from ICSBrrow a + where a.BrrowCode in ({5})"; } if (Type == "10")//物料调拨 { @@ -1945,7 +1959,7 @@ WHERE a.OutCode in ({0}) AND a.WorkPoint = '{1}' where a.OutCode in ({5}) "; } - sql = string.Format(sql, MergeID, Type, MUSER, MUSERNAME, WorkPoint, keyValue); + sql = string.Format(sql, MergeID, Type, MUSER, MUSERNAME, WorkPoint, dataList); try {