From cb0759b81630b0fa608f395d19774985d49eda6c Mon Sep 17 00:00:00 2001 From: lilili Date: Wed, 10 May 2023 11:24:06 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E5=8D=95=E6=8D=AE=E6=9F=A5?= =?UTF-8?q?=E8=AF=A2=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 | 4 +-- .../WMS/WMSCreateItemLotApp.cs | 35 +++++++++++-------- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/WMS-BS/NFine.Application/WMS/PickMaterialApp.cs b/WMS-BS/NFine.Application/WMS/PickMaterialApp.cs index 15ed500..14fe7f2 100644 --- a/WMS-BS/NFine.Application/WMS/PickMaterialApp.cs +++ b/WMS-BS/NFine.Application/WMS/PickMaterialApp.cs @@ -117,7 +117,7 @@ where b.MOCode='{0}' and a.WorkPoint='{1}'"; sqlString.Append($@" SELECT * from (select row_number() over(partition by a.ApplyCode ORDER BY a.ApplyCode) as row, - a.ApplyCode as Code,a.CreateDateTime as MTIME,a.createperson as MUSER,a.WHCode,b.EATTRIBUTE1 AS Area, + a.ApplyCode as Code,a.CreateDateTime as MTIME,a.createperson as MUSER,a.WHCode,detail.LocationCode AS Area, a.EATTRIBUTE,a.Sets,a.OrderInvCode,a.OrderInvDescribe,a.BillType,a.Remarks,a.Desks,a.DispatchNumber,a.DispatcherName, a.ReceiverNumber,a.ReceiverName,a.Urgency,a.NeedDate,a.NeedTime,a.RemarksTerm,a.TextNumber,a.InvDescribe,a.Unit,a.StockIndicator, case when max(e.SourceID) is null then '未合并' else '已合并' end as IsNew,f.Colspan , @@ -144,7 +144,7 @@ where b.MOCode='{0}' and a.WorkPoint='{1}'"; } if (!string.IsNullOrWhiteSpace(queryParam["Area"].ToString())) { - sqlString.Append($@" and b.EATTRIBUTE1 like '%{queryParam["Area"]}%' "); + sqlString.Append($@" and detail.LocationCode like '%{queryParam["Area"]}%' "); } } diff --git a/WMS-BS/NFine.Application/WMS/WMSCreateItemLotApp.cs b/WMS-BS/NFine.Application/WMS/WMSCreateItemLotApp.cs index da83759..fba2690 100644 --- a/WMS-BS/NFine.Application/WMS/WMSCreateItemLotApp.cs +++ b/WMS-BS/NFine.Application/WMS/WMSCreateItemLotApp.cs @@ -570,13 +570,14 @@ CAST( (a.Quantity-ISNULL(c.LOTQTY,0)) as DECIMAL(18,{0})) as thisCreateQty,isnu object Figure = GetDecimalDigits(); #region [SQL] - string sql = @" select a.ID,a.SDNCode,a.Sequence,a.SOCode,a.SOSequence,a.CusCode,a.CusName,a.Type,a.ArriveDate,a.InvCode,a.WHCode,b.EATTRIBUTE1 AS Area,b.InvName,b.InvDesc,b.InvStd,b.InvUnit,CAST(a.Quantity AS DECIMAL(18,{0})) as Quantity + string sql = @" select a.ID,a.SDNCode,a.Sequence,a.SOCode,a.SOSequence,a.CusCode,a.CusName,a.Type,a.ArriveDate,a.InvCode,a.WHCode,detail.LocationCode AS Area,b.InvName,b.InvDesc,b.InvStd,b.InvUnit,CAST(a.Quantity AS DECIMAL(18,{0})) as Quantity ,cast(a.Amount as decimal(18,{0})) as Amount, CAST(a.SDNQuantity AS DECIMAL(18,{0})) as SDNQuantity ,a.Status,a.ExtensionID,a.CreatePerson,a.CreateDateTime ,CAST(c.LOTQTY AS DECIMAL(18,{0})) as LOTQTY ,a.WorkPoint,a.Points,a.DeliveryType,a.DeliveryDescribe,a.InvDescribe,a.OtherDescribe,a.SalesUnit,a.StockIndicator,a.IsSerialNumber ,f.Colspan ,f.ProjectCode ,f.BatchCode ,f.Version ,f.Brand ,f.cFree1 ,f.cFree2 ,f.cFree3 ,f.cFree4 ,f.cFree5 ,f.cFree6 ,f.cFree7 ,f.cFree8 ,f.cFree9 ,f.cFree10 from ICSSDN a left join ICSInventory b on a.InvCode=b.InvCode and a.WorkPoint=b.WorkPoint +LEFT JOIN ICSInventoryDetail detail WHERE b.InvCode=detail.INVCode AND a.WHCode=detail.WHCode AND a.WorkPoint=detail.WorkPoint left join ( select mm.TransCode,mm.TransSequence,sum(isnull(ee.Quantity,0)) LOTQTY,ee.WorkPoint from ICSInventoryLot ee left join ICSInventoryLotDetail mm on ee.LotNo=mm.LotNo and ee.type='4' @@ -613,7 +614,7 @@ where a.Type='2'"; } if (!string.IsNullOrWhiteSpace(queryParam["Area"].ToString())) { - sql += " and b.EATTRIBUTE1 like '%" + queryParam["Area"].ToString() + "%' "; + sql += " and detail.LocationCode like '%" + queryParam["Area"].ToString() + "%' "; } @@ -736,12 +737,13 @@ insert into ICSInventoryLot #region [SQL] string sql = @" select a.ID,a.InCode,a.Sequence,a.WHCode,a.InvCode,a.WorkPoint,a.OrderType, a.TypeDescribe,a.CostCenter,a.Remarks,a.PersonNumber,a.InvDescribe, -a.Unit,a.StockIndicator,b.EATTRIBUTE1 AS Area, b.InvName,b.InvStd,b.InvDesc,b.InvUnit, +a.Unit,a.StockIndicator,detail.LocationCode AS Area, b.InvName,b.InvStd,b.InvDesc,b.InvUnit, CAST(a.Quantity AS DECIMAL(18,{0})) as Quantity,CAST(a.Amount AS DECIMAL(18,{0})) as Amount, CAST(a.InQuantity AS DECIMAL(18,{0})) as InQuantity,a.CreatePerson,a.CreateDateTime,CAST(c.LOTQTY AS DECIMAL(18,{0})) as LOTQTY ,f.Colspan ,f.ProjectCode ,f.BatchCode ,f.Version ,f.Brand ,f.cFree1 ,f.cFree2 ,f.cFree3 ,f.cFree4 ,f.cFree5 ,f.cFree6 ,f.cFree7 ,f.cFree8 ,f.cFree9 ,f.cFree10 from ICSOtherIn a left join ICSInventory b on a.InvCode=b.InvCode and a.WorkPoint=b.WorkPoint +LEFT JOIN ICSInventoryDetail detail WHERE b.InvCode=detail.INVCode AND a.WHCode=detail.WHCode AND a.WorkPoint=detail.WorkPoint left join ( select mm.TransCode,mm.TransSequence,sum(isnull(ee.Quantity,0)) LOTQTY,ee.WorkPoint from ICSInventoryLot ee left join ICSInventoryLotDetail mm on ee.LotNo=mm.LotNo and ee.type='5' @@ -778,7 +780,7 @@ where a.Status='1'"; } if (!string.IsNullOrWhiteSpace(queryParam["Area"].ToString())) { - sql += " and b.EATTRIBUTE1 like '%" + queryParam["Area"].ToString() + "%' "; + sql += " and detail.LocationCode like '%" + queryParam["Area"].ToString() + "%' "; } } @@ -898,10 +900,11 @@ insert into ICSInventoryLot List parameter = new List(); object Figure = GetDecimalDigits(); #region [SQL] - string sql = @"select a.ID,a.ReturnCode,a.Sequence,a.WHCode,a.InvCode,b.EATTRIBUTE1 AS Area, b.InvName,b.InvStd,b.InvDesc,b.InvUnit,CAST(a.Quantity AS DECIMAL(18,{0})) as Quantity ,CAST(a.Amount AS DECIMAL(18,{0})) as Amount, CAST(a.ReturnQuantity AS DECIMAL(18,{0})) as ReturnQuantity,a.CreatePerson,a.CreateDateTime,CAST(c.LOTQTY AS DECIMAL(18,{0})) as LOTQTY + string sql = @"select a.ID,a.ReturnCode,a.Sequence,a.WHCode,a.InvCode, detail.LocationCode AS Area, b.InvName,b.InvStd,b.InvDesc,b.InvUnit,CAST(a.Quantity AS DECIMAL(18,{0})) as Quantity ,CAST(a.Amount AS DECIMAL(18,{0})) as Amount, CAST(a.ReturnQuantity AS DECIMAL(18,{0})) as ReturnQuantity,a.CreatePerson,a.CreateDateTime,CAST(c.LOTQTY AS DECIMAL(18,{0})) as LOTQTY ,f.Colspan ,f.ProjectCode ,f.BatchCode ,f.Version ,f.Brand ,f.cFree1 ,f.cFree2 ,f.cFree3 ,f.cFree4 ,f.cFree5 ,f.cFree6 ,f.cFree7 ,f.cFree8 ,f.cFree9 ,f.cFree10 from ICSReturn a left join ICSInventory b on a.InvCode=b.InvCode and a.WorkPoint=b.WorkPoint +LEFT JOIN ICSInventoryDetail detail WHERE b.InvCode=detail.INVCode AND a.WHCode=detail.WHCode AND a.WorkPoint=detail.WorkPoint left join ( select mm.TransCode,mm.TransSequence,sum(isnull(ee.Quantity,0)) LOTQTY,ee.WorkPoint from ICSInventoryLot ee left join ICSInventoryLotDetail mm on ee.LotNo=mm.LotNo and ee.type='6' @@ -929,7 +932,7 @@ where a.Status='2'"; } if (!string.IsNullOrWhiteSpace(queryParam["Area"].ToString())) { - sql += " and b.EATTRIBUTE1 like '%" + queryParam["Area"].ToString() + "%' "; + sql += " and detail.LocationCode like '%" + queryParam["Area"].ToString() + "%' "; } if (!string.IsNullOrWhiteSpace(queryParam["BatchCode"].ToString())) { @@ -957,12 +960,13 @@ where a.Status='2'"; #region [SQL] string sql = @"select a.ID, '' as 'POCode',-- d.POCode,d.Sequence as POSequence, '' as POSequence, -a.DNCode,a.Sequence,a.VenCode,e.VenName,a.WHCode,a.InvCode,a.DNID,a.DNDetailID,a.WorkPoint,a.InspectionType,a.InvoDescribe,a.Unity,a.StockIndicator, b.InvName,b.InvStd,b.InvDesc,b.InvUnit,b.EATTRIBUTE1 AS Area, +a.DNCode,a.Sequence,a.VenCode,e.VenName,a.WHCode,a.InvCode,a.DNID,a.DNDetailID,a.WorkPoint,a.InspectionType,a.InvoDescribe,a.Unity,a.StockIndicator, b.InvName,b.InvStd,b.InvDesc,b.InvUnit, detail.LocationCode AS Area, CAST(a.Quantity AS DECIMAL(18,{0})) as Quantity ,CAST(a.Amount AS DECIMAL(18,{0})) as Amount,CAST(a.RCVQuantity AS DECIMAL(18,{0})) as RCVQuantity,CAST(a.UnitPrice AS DECIMAL(18,{0})) as UnitPrice,a.Currency,a.CreatePerson,a.CreateDateTime,CAST(c.LOTQTY AS DECIMAL(18,{0})) as LOTQTY ,f.Colspan ,f.ProjectCode ,f.BatchCode ,f.Version ,f.Brand ,f.cFree1 ,f.cFree2 ,f.cFree3 ,f.cFree4 ,f.cFree5 ,f.cFree6 ,f.cFree7 ,f.cFree8 ,f.cFree9 ,f.cFree10 from ICSDeliveryNotice a left join ICSInventory b on a.InvCode=b.InvCode and a.WorkPoint=b.WorkPoint +LEFT JOIN ICSInventoryDetail detail WHERE b.InvCode=detail.INVCode AND a.WHCode=detail.WHCode AND a.WorkPoint=detail.WorkPoint left join ( select mm.TransCode,mm.TransSequence,sum(isnull(ee.Quantity,0)) LOTQTY,ee.WorkPoint from ICSInventoryLot ee left join ICSInventoryLotDetail mm on ee.LotNo=mm.LotNo and ee.type='7' @@ -994,7 +998,7 @@ where a.DNType='1' and a.Status='2' and a.ASNCode is null } if (!string.IsNullOrWhiteSpace(queryParam["Area"].ToString())) { - sql += " and b.EATTRIBUTE1 like '%" + queryParam["Area"].ToString() + "%' "; + sql += " and detail.LocationCode like '%" + queryParam["Area"].ToString() + "%' "; } if (!string.IsNullOrWhiteSpace(queryParam["Location"].ToString())) { @@ -1033,12 +1037,13 @@ where a.DNType='1' and a.Status='2' and a.ASNCode is null List parameter = new List(); object Figure = GetDecimalDigits(); #region [SQL] - string sql = @"select a.ID, d.OOCode,d.Sequence as OOSequence,a.ODNCode,a.Sequence,a.VenCode,e.VenName,a.InvCode, b.InvName,b.InvStd,b.InvDesc,b.InvUnit,b.EATTRIBUTE1 AS Area,CAST(a.Quantity AS DECIMAL(18,{0})) as Quantity ,CAST(a.Amount AS DECIMAL(18,{0})) as Amount,CAST(a.RCVQuantity AS DECIMAL(18,{0})) as RCVQuantity,CAST(a.UnitPrice AS DECIMAL(18,{0})) as UnitPrice,a.Currency,a.CreatePerson,a.CreateDateTime, + string sql = @"select a.ID, d.OOCode,d.Sequence as OOSequence,a.ODNCode,a.Sequence,a.VenCode,e.VenName,a.InvCode, b.InvName,b.InvStd,b.InvDesc,b.InvUnit,detail.LocationCode AS Area,CAST(a.Quantity AS DECIMAL(18,{0})) as Quantity ,CAST(a.Amount AS DECIMAL(18,{0})) as Amount,CAST(a.RCVQuantity AS DECIMAL(18,{0})) as RCVQuantity,CAST(a.UnitPrice AS DECIMAL(18,{0})) as UnitPrice,a.Currency,a.CreatePerson,a.CreateDateTime, CAST(c.LOTQTY AS DECIMAL(18,{0})) as LOTQTY ,f.Colspan ,f.ProjectCode ,f.BatchCode ,f.Version ,f.Brand ,f.cFree1 ,f.cFree2 ,f.cFree3 ,f.cFree4 ,f.cFree5 ,f.cFree6 ,f.cFree7 ,f.cFree8 ,f.cFree9 ,f.cFree10 from ICSODeliveryNotice a left join ICSInventory b on a.InvCode=b.InvCode and a.WorkPoint=b.WorkPoint +LEFT JOIN ICSInventoryDetail detail WHERE b.InvCode=detail.INVCode AND a.WHCode=detail.WHCode AND a.WorkPoint=detail.WorkPoint left join ( select mm.TransCode,mm.TransSequence,sum(isnull(ee.Quantity,0)) LOTQTY,ee.WorkPoint from ICSInventoryLot ee left join ICSInventoryLotDetail mm on ee.LotNo=mm.LotNo and ee.type='8' @@ -1072,7 +1077,7 @@ where a.ODNType='1' and a.Status='2' and a.OASNCode is null"; } if (!string.IsNullOrWhiteSpace(queryParam["Area"].ToString())) { - sql += " and b.EATTRIBUTE1 like '%" + queryParam["Area"].ToString() + "%' "; + sql += " and detail.LocationCode like '%" + queryParam["Area"].ToString() + "%' "; } if (!string.IsNullOrWhiteSpace(queryParam["InvName"].ToString())) { @@ -1107,12 +1112,13 @@ where a.ODNType='1' and a.Status='2' and a.OASNCode is null"; string sql = @" select a.ID,a.RCVCode,a.Sequence,a.WHCode,a.InvCode,a.EATTRIBUTE,a.WorkPoint,a.InvDescribe,a.OrderNumber, a.OrderInvCode,a.OrderInvDescribe,a.BillType,a.Remarks,a.Unit, -a.StockIndicator,a.RemarksTerm,b.EATTRIBUTE1 AS Area, b.InvName,b.InvStd,b.InvDesc,b.InvUnit,CAST(a.Quantity AS DECIMAL(18,{0})) as Quantity , +a.StockIndicator,a.RemarksTerm,detail.LocationCode AS Area, b.InvName,b.InvStd,b.InvDesc,b.InvUnit,CAST(a.Quantity AS DECIMAL(18,{0})) as Quantity , CAST(a.Amount AS DECIMAL(18,{0})) as Amount,CAST(a.RCVQuantity AS DECIMAL(18,{0})) as RCVQuantity ,a.CreatePerson,a.CreateDateTime,CAST(c.LOTQTY AS DECIMAL(18,{0})) as LOTQTY ,f.Colspan ,f.ProjectCode ,f.BatchCode ,f.Version ,f.Brand ,f.cFree1 ,f.cFree2 ,f.cFree3 ,f.cFree4 ,f.cFree5 ,f.cFree6 ,f.cFree7 ,f.cFree8 ,f.cFree9 ,f.cFree10 from ICSManufactureReceive a left join ICSInventory b on a.InvCode=b.InvCode and a.WorkPoint=b.WorkPoint +LEFT JOIN ICSInventoryDetail detail WHERE b.InvCode=detail.INVCode AND a.WHCode=detail.WHCode AND a.WorkPoint=detail.WorkPoint left join ( select mm.TransCode,mm.TransSequence,sum(isnull(ee.Quantity,0)) LOTQTY,ee.WorkPoint from ICSInventoryLot ee left join ICSInventoryLotDetail mm on ee.LotNo=mm.LotNo and ee.type='9' @@ -1140,7 +1146,7 @@ where a.Status='1' and a.Type='1'"; } if (!string.IsNullOrWhiteSpace(queryParam["Area"].ToString())) { - sql += " and b.EATTRIBUTE1 like '%" + queryParam["Area"].ToString() + "%' "; + sql += " and detail.LocationCode like '%" + queryParam["Area"].ToString() + "%' "; } if (!string.IsNullOrWhiteSpace(queryParam["InvName"].ToString())) { @@ -1761,11 +1767,12 @@ where a.DNType='3' and a.Status='2' and a.EATTRIBUTE1 is NOT null string sql = @"select a.ID,a.ApplyNegCode,a.Sequence,a.SourceDetailID,a.InvCode,b.InvName,b.InvDesc,b.InvStd,b.InvUnit, CAST(a.Quantity AS DECIMAL(18,{0})) as Quantity ,CAST(a.Amount AS DECIMAL(18,{0})) as Amount,CAST(a.IssueNegQuantity AS DECIMAL(18,{0})) as IssueNegQuantity ,a.ExtensionID,a.MUSERName,a.MTIME ,CAST(c.LOTQTY AS DECIMAL(18,{0})) as LOTQTY - ,a.WHCode,b.EATTRIBUTE1 AS Area,f.Colspan ,f.ProjectCode ,f.BatchCode ,f.Version ,f.Brand ,f.cFree1 ,f.cFree2 ,f.cFree3 ,f.cFree4 + ,a.WHCode,detail.LocationCode AS Area,f.Colspan ,f.ProjectCode ,f.BatchCode ,f.Version ,f.Brand ,f.cFree1 ,f.cFree2 ,f.cFree3 ,f.cFree4 ,f.cFree5 ,f.cFree6 ,f.cFree7 ,f.cFree8 ,f.cFree9 ,f.cFree10 from ICSMOApplyNegDetail a left join ICSMOApplyNeg d on a.ApplyNegCode=d.ApplyNegCode and a.WorkPoint=d.WorkPoint left join ICSInventory b on a.InvCode=b.InvCode and a.WorkPoint=b.WorkPoint + LEFT JOIN ICSInventoryDetail detail WHERE b.InvCode=detail.INVCode AND a.WHCode=detail.WHCode AND a.WorkPoint=detail.WorkPoint left join ( select mm.TransCode,mm.TransSequence,sum(isnull(ee.Quantity,0)) LOTQTY,ee.WorkPoint from ICSInventoryLot ee left join ICSInventoryLotDetail mm on ee.LotNo=mm.LotNo and ee.type='12' @@ -1802,7 +1809,7 @@ where a.DNType='3' and a.Status='2' and a.EATTRIBUTE1 is NOT null } if (!string.IsNullOrWhiteSpace(queryParam["Area"].ToString())) { - sql += " and b.EATTRIBUTE1 like '%" + queryParam["Area"].ToString() + "%' "; + sql += " and detail.LocationCode like '%" + queryParam["Area"].ToString() + "%' "; } } if (NFine.Code.OperatorProvider.Provider.GetCurrent().RoleEnCode != "admin")