|
|
@ -1347,11 +1347,10 @@ Convert(decimal(18,1),isnull(QQ.COMQTY,0)) 完成数量, |
|
|
|
,cast(getdate()-a.ArriveDate as int) as '滞留天数' |
|
|
|
,case when ISNULL(a.EATTRIBUTE3,'0')='0' then '未拣配' when ISNULL(a.EATTRIBUTE3,'0')='1' then '拣配中' when ISNULL(a.EATTRIBUTE3,'0')='2' then '拣配完成' end as '状态' |
|
|
|
,a.CreatePerson as '管理员' |
|
|
|
from dbo.ICSSDN a |
|
|
|
FROM ICSSDN a |
|
|
|
left join [UFDATA_001_2021].dbo.DispatchLists dls on dls.DLID = a.SDNID and dls.irowno = a.Sequence |
|
|
|
where a.Type='1' and a.Status<>'3' and a.Quantity-a.SDNQuantity>0 |
|
|
|
and a.SDNQuantity + dls.fOutQuantity <> a.Quantity |
|
|
|
group by a.SDNCode,a.ArriveDate,a.EATTRIBUTE3,a.CreatePerson |
|
|
|
WHERE a.WorkPoint='UFDATA_001_2021' AND a.Type='1' AND a.Status<>'3' and a.Quantity-a.SDNQuantity>0 |
|
|
|
and a.SDNQuantity + dls.fOutQuantity <> a.Quantity and dls.iQuantity>dls.fOutQuantity and a.WHCode not in ('018','019','020') |
|
|
|
";
|
|
|
|
|
|
|
|
|
|
|
@ -1390,7 +1389,7 @@ where DNType='1' and a.Quantity-a.RCVQuantity>0"; |
|
|
|
string SqlText = ""; |
|
|
|
|
|
|
|
SqlText = @"
|
|
|
|
select f.DepName as '产线',e.InvName as '存货编码',sum(case when e.AmountEnable='1' then c.Quantity/isnull(e.EATTRIBUTE1,1) else c.Quantity end ) as '数量' , |
|
|
|
select f.DepName as '产线',e.InvName as '存货名称',sum(case when e.AmountEnable='1' then c.Quantity/isnull(e.EATTRIBUTE1,1) else c.Quantity end ) as '数量' , |
|
|
|
CASE |
|
|
|
WHEN DATEDIFF(MINUTE, c.ProductDate, GETDATE()) < 60 THEN CAST(DATEDIFF(MINUTE, c.ProductDate, GETDATE()) AS VARCHAR) + '分钟' |
|
|
|
WHEN DATEDIFF(HOUR, c.ProductDate, GETDATE()) < 24 THEN CAST(DATEDIFF(HOUR, c.ProductDate, GETDATE()) AS VARCHAR) + '小时 ' + CAST((DATEDIFF(MINUTE, c.ProductDate, GETDATE()) % 60) AS VARCHAR) + '分钟' |
|
|
@ -1409,7 +1408,7 @@ left join dbo.ICSWareHouseLotInfo d on c.LotNo=d.LotNo and a.WorkPoint=b.WorkPoi |
|
|
|
inner join ICSDepartment f on a.DepCode=f.DepCode and a.WorkPoint=f.WorkPoint |
|
|
|
where isnull(d.LotNo,'')='' |
|
|
|
group by c.ProductDate,e.InvName,f.DepName |
|
|
|
order by f.DepName desc ";
|
|
|
|
order by f.DepName desc , c.ProductDate asc ";
|
|
|
|
|
|
|
|
|
|
|
|
DataTable dt = SqlHelper.GetDataTableBySql(SqlText); |
|
|
@ -1476,7 +1475,7 @@ where ODNType='1' and a.Quantity-a.RCVQuantity>0"; |
|
|
|
string SqlText = ""; |
|
|
|
|
|
|
|
SqlText = @"
|
|
|
|
select a.存货编码,a.存货名称,a.数量, |
|
|
|
select a.存货编码,a.存货名称,a.数量,a.目标仓库, |
|
|
|
case when a.产线='021' then 'L1' when a.产线='022' then 'L2' when a.产线='023' then 'L3' when a.产线='024' then 'L4' |
|
|
|
when a.产线='025' then 'L5' when a.产线='026' then 'L6' when a.产线='027' then 'L7' when a.产线='015' then 'C1' end as '产线' |
|
|
|
,a.调拨时间 from ( |
|
|
@ -1487,9 +1486,9 @@ case when a.仓库F not in ('021','022','023','024','025','026','027','015') an |
|
|
|
when a.仓库F = '015' and a.仓库T in ('021','022','023','024','025','026','027') then a.仓库T |
|
|
|
when a.仓库F in ('021','022','023','024','025','026','027') and a.仓库T='015' then a.仓库F |
|
|
|
else a.仓库F end as '产线' |
|
|
|
,a.调拨时间 |
|
|
|
,a.调拨时间 ,a.仓库T as '目标仓库' |
|
|
|
from( |
|
|
|
select a.InvCode as '存货编码',b.InvName as '存货名称', |
|
|
|
select a.InvCode as '存货编码',b.InvName+'|'+b.InvStd as '存货名称', |
|
|
|
case when b.AmountEnable='1' then a.Quantity/b.EATTRIBUTE1 else a.Quantity end '数量', |
|
|
|
a.FromWarehouseCode as '仓库F', |
|
|
|
a.ToWarehouseCode as '仓库T', |
|
|
@ -1550,11 +1549,10 @@ into #Temp1 |
|
|
|
,cast(getdate()-a.ArriveDate as int) as '滞留天数' |
|
|
|
,case when ISNULL(a.EATTRIBUTE3,'0')='0' then '未拣配' when ISNULL(a.EATTRIBUTE3,'0')='1' then '拣配中' when ISNULL(a.EATTRIBUTE3,'0')='2' then '拣配完成' end as '状态' |
|
|
|
,a.CreatePerson as '管理员' |
|
|
|
from dbo.ICSSDN a |
|
|
|
FROM ICSSDN a |
|
|
|
left join [UFDATA_001_2021].dbo.DispatchLists dls on dls.DLID = a.SDNID and dls.irowno = a.Sequence |
|
|
|
where a.Type='1' and a.Status<>'3' and a.Quantity-a.SDNQuantity>0 |
|
|
|
and a.SDNQuantity + dls.fOutQuantity <> a.Quantity |
|
|
|
group by a.SDNCode,a.ArriveDate,a.EATTRIBUTE3,a.CreatePerson |
|
|
|
WHERE a.WorkPoint='UFDATA_001_2021' AND a.Type='1' AND a.Status<>'3' and a.Quantity-a.SDNQuantity>0 |
|
|
|
and a.SDNQuantity + dls.fOutQuantity <> a.Quantity and dls.iQuantity>dls.fOutQuantity and a.WHCode not in ('018','019','020') |
|
|
|
)a |
|
|
|
|
|
|
|
select count(*) as CGWDH |
|
|
@ -1607,7 +1605,7 @@ SELECT |
|
|
|
|
|
|
|
|
|
|
|
select count(*) as DB into #Temp5 from( |
|
|
|
select a.存货编码,a.存货名称,a.数量, |
|
|
|
select a.存货编码,a.存货名称,a.数量,a.目标仓库, |
|
|
|
case when a.产线='021' then 'L1' when a.产线='022' then 'L2' when a.产线='023' then 'L3' when a.产线='024' then 'L4' |
|
|
|
when a.产线='025' then 'L5' when a.产线='026' then 'L6' when a.产线='027' then 'L7' when a.产线='015' then 'C1' end as '产线' |
|
|
|
,a.调拨时间 from ( |
|
|
@ -1618,9 +1616,9 @@ case when a.仓库F not in ('021','022','023','024','025','026','027','015') an |
|
|
|
when a.仓库F = '015' and a.仓库T in ('021','022','023','024','025','026','027') then a.仓库T |
|
|
|
when a.仓库F in ('021','022','023','024','025','026','027') and a.仓库T='015' then a.仓库F |
|
|
|
else a.仓库F end as '产线' |
|
|
|
,a.调拨时间 |
|
|
|
,a.调拨时间 ,a.仓库T as '目标仓库' |
|
|
|
from( |
|
|
|
select a.InvCode as '存货编码',b.InvName as '存货名称', |
|
|
|
select a.InvCode as '存货编码',b.InvName+'|'+b.InvStd as '存货名称', |
|
|
|
case when b.AmountEnable='1' then a.Quantity/b.EATTRIBUTE1 else a.Quantity end '数量', |
|
|
|
a.FromWarehouseCode as '仓库F', |
|
|
|
a.ToWarehouseCode as '仓库T', |
|
|
|