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

-- 生成时间:2018-11-30 11:09:35 by ebs-core  
CREATE  procedure order_260_3570_wrklink_before(
     @cmpid int, 
     @useruid int,
     @bizid int, 
     @ordid bigint, 
     @wrkid int, 
     @jbid bigint, 
     @wsid int, 
     @wsstatus nvarchar(50), 
     @operation varchar(50) output, 
     @errorinfo nvarchar(4000) output
  ) 
as  
begin  
set nocount on  
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED
declare @nonedate datetime 
set @nonedate = CONVERT(datetime,'1910-1-1')
declare @ord2group2 nvarchar(50) 
set @ord2group2 = '' 
declare @sys_recid bigint 
set @sys_recid = 0 
 set @operation = 'continue'
 set @errorinfo = '' 
 --- 以下是预处理事件中的临时表
 
exec drop_temp_table '#master' 
select * into #master from order_260 with(nolock) where ord_id=@ordid 
 ---- 以下是开发人员写的 before link job 事件 --------------
 --对物流状态进行验证
declare @dqzt varchar(100)
select @dqzt=ord_dqzt from #master
if(@dqzt!='维修后门店收货')
begin
    set @operation='abort'
    set @errorinfo='门店还没有收货，不能进行下一步操作'
end
else
    set @operation='continue'
 ---- 以上是开发人员写的 before libk job 事件 --------------
 
 if (@operation='continue') 
 begin
 set @nonedate= @nonedate  -- here useless 
 
end 
--- 清除临时表 
exec drop_temp_table '#master' 

set nocount off 
end