workflow结束的流程重启

workflow结束的流程重启

insert into WF_GenerWorkerlist(WorkID,FK_Emp,FK_EmpText,FK_Node,FID,FK_NodeText,FK_Flow,FK_Dept,SDT,DTOfWarning,WarningDays,RDT,CDT,IsEnable,IsRead,IsPass,WhoExeIt,Sender,PRI,PressTimes,Tag,Paras,DTOfHungUp,DTOfUnHungUp,HungUpTimes,GuestNO,GuestName,AtPara)
SELECT OID AS WorkID,'T0001' FK_Emp,'T0001' FK_EmpText,'9028' as FK_Node,0 as FID,'预计停产结束' FK_NodeText,
'090' AS FK_Flow,'112' as FK_Dept,RDT AS SDT,RDT DTOfWarning,1 WarningDays,RDT,CDT,1 IsEnable,1 IsRead,0 IsPass,
0 WhoExeIt,'T0001' as Sender,PRI,0 AS PressTimes,'' as Tag,'' Paras,'' as DTOfHungUp,'' as DTOfUnHungUp,0 as HungUpTimes,
'' AS GuestNO,'' as GuestName,'' as AtPara
FROM ND90Rpt r where
 exists(SELECT 1 FROM ND90Rpt a,(select WorkID,NDFrom,ActionType,RDT from ND90Track t where NDFrom=NDTo GROUP BY t.WorkID,NDFrom,ActionType,RDT) b where a.WFState=3 and a.FlowEndNode=b.NDFrom and b.ActionType=8
 AND a.OID=b.WorkID and r.OID=a.OID and r.OID=b.WorkID)

 

insert into WF_GenerWorkFlow(WorkID,FK_Flow,WFState,Title,Starter,NodeName,FK_Dept,PRI,RDT,SDTOfNode,SDTOfFlow,BillNo,FlowNote,GuestNO,TodoEmps,MyNum,FID,FK_FlowSort,FlowName,StarterName,FK_Node,DeptName,PFlowNo,PWorkID,CFlowNo,CWorkID,TodoEmpsNum,TaskSta,AtPara)
SELECT OID AS WorkID,'090' AS FK_Flow,'2' AS WFState,Title,Emps AS Starter,'预计停产结束' as NodeName,
'112' as FK_Dept,PRI,RDT,RDT AS SDTOfNode,RDT as SDTOfFlow,BillNo,'' as FlowNote,'' as GuestNO,'T0001,T0001;' as TodoEmps,
'' AS MyNum,0 as FID,'101' as FK_FlowSort,'机型预定停产统计' as FlowName,(select D1003 FROM ND9001 b where b.OID=r.OID ) as StarterName,
'9028' as FK_Node,'生管课' as DeptName,'' PFlowNo,PWorkID,CFlowNo,CWorkID,'1' TodoEmpsNum,0 TaskSta,'' AtPara
FROM ND90Rpt r where 
exists(SELECT 1 FROM ND90Rpt a,(select WorkID,NDFrom,ActionType,RDT from ND90Track t where NDFrom=NDTo GROUP BY t.WorkID,NDFrom,ActionType,RDT) b where a.WFState=3 and a.FlowEndNode=b.NDFrom and b.ActionType=8
 AND a.OID=b.WorkID and r.OID=a.OID and r.OID=b.WorkID)

展开阅读全文

没有更多推荐了,返回首页