Browse Source

看板优化

master
徐莉 2 years ago
parent
commit
aebd24f64a
  1. 19
      NFine.Application/SRM/WatchPanelApp.cs

19
NFine.Application/SRM/WatchPanelApp.cs

@ -1147,7 +1147,7 @@ select * from (
SELECT C.molotcode as 销售车号,C.ITEMCODE 物料编码,dd.INVNAME 物料名称 ,C.MOCODE 工单号, SELECT C.molotcode as 销售车号,C.ITEMCODE 物料编码,dd.INVNAME 物料名称 ,C.MOCODE 工单号,
a.OPCODE 工序代码,ppp.opname 工序名称,us.UserName 报工人,B.UserCodeBegin, a.OPCODE 工序代码,ppp.opname 工序名称,us.UserName 报工人,B.UserCodeBegin,
CASE WHEN A.ACTIONRESULT='COLLECT_BEGIN' then '----生产中----' WHEN A.ACTIONRESULT='COLLECT_END' then '----已结束----' end as 工序结束状态, CASE WHEN A.ACTIONRESULT='COLLECT_BEGIN' then '----生产中----' WHEN A.ACTIONRESULT='COLLECT_END' then '----已结束----' end as 工序结束状态,
DATEDIFF(MINUTE, B.BeginDateTime, B.EndDateTime) as '报工时长',
ISNULL(DATEDIFF(MINUTE, B.BeginDateTime, B.EndDateTime) ,0) as '报工时长',
isnull(CONVERT(VARCHAR,B.BeginDateTime,120),'') 开工时间, isnull(CONVERT(VARCHAR,B.BeginDateTime,120),'') 开工时间,
isnull(CONVERT(VARCHAR,B.EndDateTime,120),'') 完工时间 ,A.ID,B.ID DetailID,B.BeginDateTime,B.EndDateTime isnull(CONVERT(VARCHAR,B.EndDateTime,120),'') 完工时间 ,A.ID,B.ID DetailID,B.BeginDateTime,B.EndDateTime
@ -1192,13 +1192,13 @@ FROM #TempXXXXX HH
GROUP BY DetailID GROUP BY DetailID
SELECT 销售车号, 物料编码, 物料名称 , 工单号, 工序代码, 工序名称, 报工人, 工序结束状态, SELECT 销售车号, 物料编码, 物料名称 , 工单号, 工序代码, 工序名称, 报工人, 工序结束状态,
DATEDIFF(MINUTE, DD.BeginDateTime, DD.EndDateTime) as '报工时长',
DATEDIFF(MINUTE, dd.BeginDateTime, dd.EndDateTime) -ISNULL(xx.[暂停时长],0) AS 有效时间,
xx.[暂停时长] 暂停时长,
ISNULL(DATEDIFF(MINUTE, DD.BeginDateTime, DD.EndDateTime) ,0) as '报工时长',
ISNULL( DATEDIFF(MINUTE, dd.BeginDateTime, dd.EndDateTime) -ISNULL(xx.[暂停时长],0) ,0) AS 有效时间,
ISNULL(xx.[暂停时长],0) 暂停时长,
DD.开工时间, DD.开工时间,
DD.完工时间, DD.完工时间,
xx.暂停开始时间 暂停开始时间,
xx.暂停结束时间 暂停结束时间,
ISNULL(xx.暂停开始时间 ,'') 暂停开始时间,
ISNULL(xx.暂停结束时间,'') 暂停结束时间,
isnull(xx.[暂停原因],'') 暂停原因 , isnull(xx.[暂停原因],'') 暂停原因 ,
case when 暂停开始时间 is not null and 暂停结束时间 is null then '暂停中' else '' end 暂停状态 case when 暂停开始时间 is not null and 暂停结束时间 is null then '暂停中' else '' end 暂停状态
FROM #TempCCDD_Tt DD FROM #TempCCDD_Tt DD
@ -1266,7 +1266,7 @@ ORDER BY 销售车号, 物料编码 ,报工人 asc
drop table #TempMOCCOM drop table #TempMOCCOM
select distinct tso.socode 销售车辆号,convert(varchar(10),tso.plandate,120) as 客户交货期, select distinct tso.socode 销售车辆号,convert(varchar(10),tso.plandate,120) as 客户交货期,
isnull(convert(char(4),cus.fname),'') 用户单位, inv.invname as 产品名称
isnull(convert(char(4),cus.fname),'') 用户单位, ISNULL(inv.invname,'') as 产品名称
into #TempSSCC into #TempSSCC
from from
icsso tso with(nolock) icsso tso with(nolock)
@ -1307,8 +1307,9 @@ ORDER BY 销售车号, 物料编码 ,报工人 asc
select tso.销售车辆号, 客户交货期, 用户单位, select tso.销售车辆号, 客户交货期, 用户单位,
产品名称, 产品名称,
concat(cast(cast(tnum.wipnum * 1.0 / tnum.monum as decimal(18,3))* 100 as decimal(18,0)),'%') 进度,
(case when tnum.wipnum/tnum.monum =1 then '已完工' when tnum.wipbnum >0 then '开工中' else '未开工' end ) 生产状态
CASE WHEN ISNULL(tnum.monum,0) =0 THEN '0%' ELSE
concat(cast(cast(tnum.wipnum * 1.0 / tnum.monum as decimal(18,3))* 100 as decimal(18,0)),'%') END 进度,
CASE WHEN ISNULL(tnum.monum,0) =0 THEN '未开工' ELSE (case when tnum.wipnum/tnum.monum =1 then '已完工' when tnum.wipbnum >0 then '开工中' else '未开工' end ) END 生产状态
from #TempSSCC tso from #TempSSCC tso
left join #tempNum tnum on tnum.销售车辆号 = tso.销售车辆号 left join #tempNum tnum on tnum.销售车辆号 = tso.销售车辆号

Loading…
Cancel
Save