Browse Source

调整单据查询接口

master
lilili 2 years ago
parent
commit
cb0759b816
  1. 4
      WMS-BS/NFine.Application/WMS/PickMaterialApp.cs
  2. 35
      WMS-BS/NFine.Application/WMS/WMSCreateItemLotApp.cs

4
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"]}%' ");
}
}

35
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<DbParameter> parameter = new List<DbParameter>();
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<DbParameter> parameter = new List<DbParameter>();
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")

Loading…
Cancel
Save