|
|
@ -1342,12 +1342,16 @@ Convert(decimal(18,1),isnull(QQ.COMQTY,0)) 完成数量, |
|
|
|
string SqlText = ""; |
|
|
|
|
|
|
|
SqlText = @"
|
|
|
|
select SDNCode as '发货单号' ,ArriveDate |
|
|
|
,case when getdate()-ArriveDate>3 then 'red' when getdate()-ArriveDate>2 and getdate()-ArriveDate<3 then 'yellow' when getdate()-ArriveDate>1 and getdate()-ArriveDate<2 then 'green' when getdate()-ArriveDate<=0 then 'white' end Status |
|
|
|
,cast(getdate()-ArriveDate as int) as '滞留天数' |
|
|
|
,case when EATTRIBUTE3='0' then '未拣配' when EATTRIBUTE3='1' then '拣配中' when EATTRIBUTE3='2' then '拣配完成' end as '状态' |
|
|
|
,CreatePerson as '管理员' |
|
|
|
from dbo.ICSSDN where Type='1' and Status<>'3' and Quantity-SDNQuantity>0 group by SDNCode,ArriveDate,EATTRIBUTE3,CreatePerson |
|
|
|
select |
|
|
|
a.SDNCode as '发货单号' ,ArriveDate |
|
|
|
,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 |
|
|
|
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 |
|
|
|
";
|
|
|
|
|
|
|
|
|
|
|
@ -1531,12 +1535,15 @@ cast(sum(case when a.WarehouseCode='002' then a.Quantity/isnull(b.EATTRIBUTE1,1) |
|
|
|
select count(*) as CPFH |
|
|
|
into #Temp1 |
|
|
|
from (select |
|
|
|
SDNCode as '发货单号' ,ArriveDate |
|
|
|
,case when getdate()-ArriveDate>3 then 'red' when getdate()-ArriveDate>2 and getdate()-ArriveDate<3 then 'yellow' when getdate()-ArriveDate>1 and getdate()-ArriveDate<2 then 'green' when getdate()-ArriveDate<=0 then 'white' end Status |
|
|
|
,cast(getdate()-ArriveDate as int) as '滞留天数' |
|
|
|
,case when EATTRIBUTE3='0' then '未拣配' when EATTRIBUTE3='1' then '拣配中' when EATTRIBUTE3='2' then '拣配完成' end as '状态' |
|
|
|
,CreatePerson as '管理员' |
|
|
|
from dbo.ICSSDN where Type='1' and Status<>'3' and Quantity-SDNQuantity>0 group by SDNCode,ArriveDate,EATTRIBUTE3,CreatePerson |
|
|
|
a.SDNCode as '发货单号' ,ArriveDate |
|
|
|
,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 |
|
|
|
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 |
|
|
|
)a |
|
|
|
|
|
|
|
select count(*) as CGWDH |
|
|
|