123456789101112131415161718192021222324252627282930313233343536373839404142434445464748 |
- $PBExportHeader$f_billevent_trigger.srf
- global type f_billevent_trigger from function_object
- end type
- forward prototypes
- global function integer f_billevent_trigger (long arg_billtype, long arg_eventtype, string arg_taskcode, ref string arg_msg)
- end prototypes
- global function integer f_billevent_trigger (long arg_billtype, long arg_eventtype, string arg_taskcode, ref string arg_msg);Int rslt = 1
- String ls_cmds[], ls_cmd, ls_rslt, ls_msg
- Long ll_cnt = 0, ll_i
- DECLARE cur1 CURSOR FOR
- SELECT escript
- FROM sys_event
- WHERE billtype = :arg_billtype AND
- eventtype = :arg_eventtype AND
- isuse = 1 AND
- rtrim(escript) <> ''
- Order By printid;
- OPEN cur1;
- FETCH cur1 Into :ls_cmd;
- DO WHILE sqlca.SQLCode = 0
- ll_cnt++
- ls_cmds[ll_cnt] = trim(ls_cmd)
- FETCH cur1 Into :ls_cmd;
- LOOP
- CLOSE cur1;
- for ll_i = 1 to ll_cnt
- ls_cmd = ls_cmds[ll_i]
- if ls_cmd <> '' then
- ls_rslt = f_billevent_excute(ls_cmds[ll_i], arg_billtype, arg_eventtype, arg_taskcode)
- if ls_rslt<> '' then
- ls_msg += ls_cmds[ll_i] + '执行失败~r~n'
- ls_msg += '~t' + ls_rslt + '~r~n'
- end if
- end if
- next
- if ls_msg <> '' then
- rslt = 0
- arg_msg = ls_msg
- end if
- RETURN rslt
- end function
|