|
|
@ -1390,7 +1390,7 @@ where DNType='1' and a.Quantity-a.RCVQuantity>0"; |
|
|
|
string SqlText = ""; |
|
|
|
|
|
|
|
SqlText = @"
|
|
|
|
select f.DepName as '产线',e.InvName as '存货编码',sum(c.Quantity) 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) + '分钟' |
|
|
@ -1427,7 +1427,18 @@ order by f.DepName desc "; |
|
|
|
string SqlText = ""; |
|
|
|
|
|
|
|
SqlText = @"
|
|
|
|
select OOCode as '委外订单号','' as '状态','' as '出库单号',PlanArriveDate as '发单时间' from ICSOutsourcingOrder";
|
|
|
|
SELECT |
|
|
|
A.OOCode AS '委外订单号','' as '状态','' as '出库单号',MOS.dStartDate as '发单时间' |
|
|
|
FROM ICSOutsourcingOrder a |
|
|
|
--主表 |
|
|
|
left join [UFDATA_001_2021].dbo.OM_MOMain MO on MO.cCode = a.OOCode |
|
|
|
--子表 |
|
|
|
left join [UFDATA_001_2021].dbo.OM_MODetails MOS on MOS.MOID = MO.MOID AND a.Sequence=MOS.iVouchRowNo |
|
|
|
--子件表 |
|
|
|
left join [UFDATA_001_2021].dbo.OM_MOMaterials MOM on MOM.MoDetailsID = MOS.MoDetailsID |
|
|
|
where MOM.iQuantity>iSendQTY and MO.cState='1' |
|
|
|
GROUP BY A.OOCode,MOS.dStartDate |
|
|
|
order by MOS.dStartDate desc";
|
|
|
|
|
|
|
|
|
|
|
|
DataTable dt = SqlHelper.GetDataTableBySql(SqlText) ; |
|
|
@ -1487,7 +1498,7 @@ else a.仓库F end as '产线' |
|
|
|
from dbo.ICSWareHouseLotInfoLog a |
|
|
|
inner join dbo.ICSInventory b on a.InvCode=b.InvCode and a.WorkPoint=b.WorkPoint |
|
|
|
inner join dbo.ICSWarehouse c on a.ToWarehouseCode=c.WarehouseCode and a.WorkPoint=c.WorkPoint |
|
|
|
where BusinessCode in ('70','47') and a.TransType in ('6','14') |
|
|
|
where BusinessCode in ('70','47') and a.TransType in ('6','14') and format(a.MTIME , 'yyyy-MM-dd') =format(getdate() , 'yyyy-MM-dd') |
|
|
|
and (a.FromWarehouseCode in('021','022','023','024','025','026','027')or a.ToWarehouseCode in('021','022','023','024','025','026','027')) |
|
|
|
)a |
|
|
|
group by a.调拨时间 ,a.存货编码,a.存货名称,a.仓库F,a.仓库T |
|
|
@ -1556,7 +1567,8 @@ where DNType='1' and a.Quantity-a.RCVQuantity>0 |
|
|
|
)b |
|
|
|
|
|
|
|
|
|
|
|
select count(*) as CPWRK into #Temp3 from (select f.DepName as '产线',e.InvName as '存货编码',sum(c.Quantity) as '数量', |
|
|
|
select count(*) as CPWRK into #Temp3 from ( |
|
|
|
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) + '分钟' |
|
|
@ -1574,11 +1586,23 @@ inner join dbo.ICSInventory e on a.InvCode=e.InvCode and a.WorkPoint=e.WorkPoint |
|
|
|
left join dbo.ICSWareHouseLotInfo d on c.LotNo=d.LotNo and a.WorkPoint=b.WorkPoint |
|
|
|
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)c |
|
|
|
group by c.ProductDate,e.InvName,f.DepName |
|
|
|
)c |
|
|
|
|
|
|
|
|
|
|
|
select count(*) as WWJG into #Temp4 from ( |
|
|
|
select OOCode as '委外订单号','' as '状态','' as '出库单号',PlanArriveDate as '发单时间' ,'green' as Status from ICSOutsourcingOrder |
|
|
|
SELECT |
|
|
|
A.OOCode AS '委外订单号','' as '状态','' as '出库单号',MOS.dStartDate as '发单时间' |
|
|
|
FROM ICSOutsourcingOrder a |
|
|
|
--主表 |
|
|
|
left join [UFDATA_001_2021].dbo.OM_MOMain MO on MO.cCode = a.OOCode |
|
|
|
--子表 |
|
|
|
left join [UFDATA_001_2021].dbo.OM_MODetails MOS on MOS.MOID = MO.MOID AND a.Sequence=MOS.iVouchRowNo |
|
|
|
--子件表 |
|
|
|
left join [UFDATA_001_2021].dbo.OM_MOMaterials MOM on MOM.MoDetailsID = MOS.MoDetailsID |
|
|
|
where MOM.iQuantity>iSendQTY and MO.cState='1' |
|
|
|
GROUP BY A.OOCode,MOS.dStartDate |
|
|
|
|
|
|
|
)d |
|
|
|
|
|
|
|
|
|
|
@ -1605,7 +1629,7 @@ else a.仓库F end as '产线' |
|
|
|
from dbo.ICSWareHouseLotInfoLog a |
|
|
|
inner join dbo.ICSInventory b on a.InvCode=b.InvCode and a.WorkPoint=b.WorkPoint |
|
|
|
inner join dbo.ICSWarehouse c on a.ToWarehouseCode=c.WarehouseCode and a.WorkPoint=c.WorkPoint |
|
|
|
where BusinessCode in ('70','47') and a.TransType in ('6','14') |
|
|
|
where BusinessCode in ('70','47') and a.TransType in ('6','14') and format(a.MTIME , 'yyyy-MM-dd') =format(getdate() , 'yyyy-MM-dd') |
|
|
|
and (a.FromWarehouseCode in('021','022','023','024','025','026','027')or a.ToWarehouseCode in('021','022','023','024','025','026','027')) |
|
|
|
)a |
|
|
|
group by a.调拨时间 ,a.存货编码,a.存货名称,a.仓库F,a.仓库T |
|
|
|