Browse Source

调整代码

master
lilili 9 months ago
parent
commit
a5c97e1e42
  1. 55
      ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs

55
ICSSoft.WMS.WebAPI/ICSSoft.DataProject/ICSSubmitService.cs

@ -1421,17 +1421,17 @@ namespace ICSSoft.DataProject
select @bb=id from ICSLocation where LocationCode='{2}'
IF @bb IS not NULL
BEGIN
set @wheresql='and a.locationcode=s.locationcode and a.LocationCode=''{2}'' '
set @groupsql = 'group by inv.LotEnable,a.ID,con.ContainerCode,con.ContainerName,a.LotNo,a.InvCode,inv.InvName,inv.InvStd,inv.InvUnit,inv.LotEnable,a.warehouseCode,a.LocationCode, inv.INVCODE,inv.INVNAME,inv.INVSTD,a.Quantity,inv.AmountUnit,
ext.ID,ext.ProjectCode,ext.Version,ext.Brand,ext.cFree1,ext.cFree2,ext.cFree3,ext.cFree4,ext.cFree5,ext.cFree6,ext.cFree7,ext.cFree8,ext.cFree9,ext.cFree10,a.MUSER ,a.MTIME'
set @wheresql='and a.LocationCode=''{2}'' '
set @groupsql = 'group by a.InvCode,a.LocationCode,b.InvName,a.WorkPoint ,b.InvStd,b.InvUnit,b.LotEnable,
a.WarehouseCode'
END
select @cc=id from ICSInventory where invcode='{2}'
IF @cc IS not NULL
BEGIN
set @wheresql='and inv.invcode=''{2}'' and a.invcode=s.invcode '
set @groupsql='group by inv.LotEnable,a.ID,con.ContainerCode,con.ContainerName,a.LotNo,a.InvCode,inv.InvName,inv.InvStd,inv.InvUnit,inv.LotEnable,a.WarehouseCode,a.LocationCode, inv.INVCODE,inv.INVNAME,inv.INVSTD,a.Quantity,inv.AmountUnit,
ext.ID,ext.ProjectCode,ext.Version,ext.Brand,ext.cFree1,ext.cFree2,ext.cFree3,ext.cFree4,ext.cFree5,ext.cFree6,ext.cFree7,ext.cFree8,ext.cFree9,ext.cFree10,a.MUSER ,a.MTIME'
set @wheresql='and b.invcode=''{2}'' '
set @groupsql=' group by a.InvCode,a.LocationCode,b.InvName,a.WorkPoint, b.InvStd,b.InvUnit,b.LotEnable,
a.WarehouseCode '
END
select @dd=id from ICSInventory where InvStd LIKE '%{2}%'
@ -1450,41 +1450,18 @@ namespace ICSSoft.DataProject
BEGIN
set @b =
'SELECT a.ID,con.ContainerCode,con.ContainerName,a.LotNo,a.InvCode,
inv.InvName,
inv.InvStd,
inv.InvUnit,
inv.LotEnable,
a.WarehouseCode,a.LocationCode,a.Quantity as Qty,SUM(s.sumQty) sumQty,
inv.AmountUnit,
ext.ID AS ExtensionID,
ext.ProjectCode,
ext.Version,
ext.Brand,
ext.cFree1,
ext.cFree2,
ext.cFree3,
ext.cFree4,
ext.cFree5,
ext.cFree6,
ext.cFree7,
ext.cFree8,
ext.cFree9,
ext.cFree10,
a.MUSER AS [User],
a.MTIME AS [MTime]
FROM ICSWareHouseLotInfo a
LEFT JOIN ICSLocation b ON a.LocationCode = b.LocationCode and a.WorkPoint=b.WorkPoint
INNER JOIN ICSInventoryLot lot ON a.LotNo=lot.LotNo AND a.WorkPoint=lot.WorkPoint
INNER JOIN ICSExtension ext ON lot.ExtensionID=ext.ID AND lot.WorkPoint=ext.WorkPoint
LEFT JOIN (select SUM(Quantity) AS sumQty,WarehouseCode,INVCode,LocationCode,workpoint from ICSWareHouseLotInfo where quantity>0 group by WarehouseCode,INVCode,LocationCode,workpoint)s ON a.workpoint=s.workpoint
LEFT JOIN ICSContainerLot conlot ON a.LotNo=conlot.LotNo AND a.WorkPoint=conlot.WorkPoint
LEFT JOIN ICSContainer con ON conlot.ContainerID=con.ID AND conlot.WorkPoint=con.WorkPoint
INNER JOIN ICSInventory inv ON a.InvCode=inv.InvCode AND a.WorkPoint=inv.WorkPoint
WHERE a.Quantity>0 and a.WorkPoint=''{3}'' ' + @wheresql + @groupsql
'SELECT a.InvCode,
b.InvName,
b.InvStd,
b.InvUnit,
b.LotEnable,
a.WarehouseCode,a.LocationCode,SUM(a.Quantity) as Qty
from ICSWareHouseLotInfo a
INNER JOIN ICSInventory b ON a.InvCode=b.InvCode
WHERE a.Quantity>0 and a.WorkPoint=''{3}'' ' + @wheresql + @groupsql
END
exec(@b)
exec(@b)

Loading…
Cancel
Save