IF EXISTS (SELECT 1 FROM sys.objects WHERE object_id = OBJECT_ID('[dbo].[order_239_3490_wrknew_after]') AND type = 'P')
DROP PROCEDURE [dbo].[order_239_3490_wrknew_after]
GO

-- 生成时间:2018-06-19 16:32:09 by ebs-core  
CREATE  procedure order_239_3490_wrknew_after(
     @cmpid int, 
     @useruid int, 
     @bizid int, 
     @ordid bigint, 
     @wrkid int, 
     @jbid bigint 
  ) 
as  
begin  
set nocount on  
declare @nonedate datetime 
set @nonedate = CONVERT(datetime,'1910-1-1')
declare @ord2group2 nvarchar(50) 
set @ord2group2 = '' 
declare @sys_recid bigint 
set @sys_recid = 0 
 --- 以下是预处理事件中的临时表
 
exec drop_temp_table '#master' 
select * into #master from order_239 where ord_id=@ordid 
 ---- 以下是开发人员写的 after new job 事件 --------------
 if  exists(select 1 from #master  where @useruid !=282) 
begin
insert into ebs_kernel.dbo.pub_message(msg_cmpid,msg_mpid,msg_text,msg_senddate,msg_type,msg_target,msg_cuid)
select 
1,
11,
'测试！
完成时间：【'+convert(nvarchar(100),getdate(),20)+'】
单据编号：【'+ord_no+'】
{title}测试',  
getdate(),
'QYH',substring(cu_qyh , 20,50) , cu_id from  mps_login,#master  where cu_id=@useruid  
end

 ---- 以上是开发人员写的 after new job 事件 --------------
 
 
--- 清除临时表 
exec drop_temp_table '#master' 

set nocount off 
end