Browse Source

修复合并拣料接口的bug

master
lilili 2 years ago
parent
commit
139a68c2a6
  1. 40
      WMS-BS/NFine.Application/WMS/PickMaterialApp.cs

40
WMS-BS/NFine.Application/WMS/PickMaterialApp.cs

@ -1595,7 +1595,7 @@ b.InvUnit,
ICSMOApply a ICSMOApply a
inner join ICSMOPickMerge x on a.ID=x.SourceID and a.WorkPoint=x.WorkPoint 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 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"; GROUP BY a.ApplyCode,a.InvCode,b.InvName,b.InvStd,b.InvUnit,a.WhCode,x.MergeID,a.ExtensionID";
#endregion #endregion
} }
@ -1782,13 +1782,12 @@ a.ExtensionID
x.MergeID, x.MergeID,
a.OutCode as Code, a.OutCode as Code,
a.InvCode, a.InvCode,
b.InvName, b.InvName,
b.InvStd, b.InvStd,
b.InvUnit,
b.InvUnit,
SUM(ISNULL(a.Quantity, 0)) AS iQuantity, SUM(ISNULL(a.Quantity, 0)) AS iQuantity,
a.WHCode as WhCode, a.WHCode as WhCode,
a.ExtensionID
a.ExtensionID
FROM FROM
ICSOtherOut a ICSOtherOut a
INNER JOIN ICSTransfer tra ON a.TransferDetailID=tra.TransferDetailID AND a.WorkPoint=tra.WorkPoint 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; string sql = string.Empty;
keyValue = keyValue.TrimEnd(','); keyValue = keyValue.TrimEnd(',');
List<string> 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; DateTime time = DateTime.Now;
string Tday = time.ToString("yyyyMMdd"); 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); DataSet ds = SqlHelper.GetDataSetBySql(sqls);
string MergeID = ""; string MergeID = "";
Int64 Merge_ID = 0; 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) ( ID ,MergeID ,SourceID ,Type,MUSER, MUSERName,MTIME,WorkPoint)
select NEWID(),'{0}',a.ID ,'{1}','{2}','{3}',GETDATE(),'{4}' select NEWID(),'{0}',a.ID ,'{1}','{2}','{3}',GETDATE(),'{4}'
from ICSOIssue a from ICSOIssue a
where a.IssueCode in ('{5}')";
where a.IssueCode in ({5})";
} }
if (Type == "7")//销售发货 if (Type == "7")//销售发货
{ {
sql += @"INSERT INTO dbo.ICSMOPickMerge sql += @"INSERT INTO dbo.ICSMOPickMerge
( ID ,MergeID ,SourceID ,Type,MUSER, MUSERName,MTIME,WorkPoint) ( ID ,MergeID ,SourceID ,Type,MUSER, MUSERName,MTIME,WorkPoint)
select NEWID(),'{0}',a.ID ,'{1}','{2}','{3}',GETDATE(),'{4}' 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")//其它出库 if (Type == "8")//其它出库
{ {
sql += @"INSERT INTO dbo.ICSMOPickMerge sql += @"INSERT INTO dbo.ICSMOPickMerge
( ID ,MergeID ,SourceID ,Type,MUSER, MUSERName,MTIME,WorkPoint) ( ID ,MergeID ,SourceID ,Type,MUSER, MUSERName,MTIME,WorkPoint)
select NEWID(),'{0}',a.ID ,'{1}','{2}','{3}',GETDATE(),'{4}' 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")//借用单 if (Type == "9")//借用单
{ {
sql += @"INSERT INTO dbo.ICSMOPickMerge sql += @"INSERT INTO dbo.ICSMOPickMerge
( ID ,MergeID ,SourceID ,Type,MUSER, MUSERName,MTIME,WorkPoint) ( ID ,MergeID ,SourceID ,Type,MUSER, MUSERName,MTIME,WorkPoint)
select NEWID(),'{0}',a.ID ,'{1}','{2}','{3}',GETDATE(),'{4}' 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")//物料调拨 if (Type == "10")//物料调拨
{ {
@ -1945,7 +1959,7 @@ WHERE a.OutCode in ({0}) AND a.WorkPoint = '{1}'
where a.OutCode in ({5}) 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 try
{ {

Loading…
Cancel
Save