$PBExportHeader$uo_phone_push.sru forward global type uo_phone_push from nonvisualobject end type end forward global type uo_phone_push from nonvisualobject end type global uo_phone_push uo_phone_push forward prototypes public function integer uf_add (long arg_empid[], string arg_title, string arg_content, string arg_reltype, string arg_relid, ref long arg_rt_pushid, ref string arg_msg, boolean arg_if_commit) public function integer uf_add (long arg_empid[], string arg_title, string arg_content, ref long arg_rt_pushid, ref string arg_msg, boolean arg_if_commit) end prototypes public function integer uf_add (long arg_empid[], string arg_title, string arg_content, string arg_reltype, string arg_relid, ref long arg_rt_pushid, ref string arg_msg, boolean arg_if_commit);Int rslt = 1 arg_rt_pushid = 0 IF lena(arg_title) > 255 THEN arg_title = mida(arg_title, 1, 252) + '...' END IF IF lena(arg_content) > 255 THEN arg_content = mida(arg_content, 1, 252) + '...' END IF String ls_empids = '' Long i Long ifphone FOR i = 1 To UpperBound(arg_empid) SELECT ifphone Into :ifphone From u_user Where empid = :arg_empid[i]; IF sqlca.SQLCode <> 0 THEN ifphone = 0 // rslt = 0 // arg_msg = '查询用户是否使用手机APP失败,' + sqlca.SQLErrText // GOTO ext END IF IF ifphone = 1 THEN IF ls_empids = '' THEN ls_empids = String(arg_empid[i]) ELSE ls_empids += ',' + String(arg_empid[i]) END IF END IF NEXT Long ll_newid IF ls_empids <> '' THEN ll_newid = f_sys_scidentity(0,"u_phone_push","pushid",arg_msg,True,id_sqlca) IF ll_newid <= 0 THEN rslt = 0 arg_msg = '获取pushid失败,' + arg_msg GOTO ext END IF INSERT Into u_phone_push(pushid, empids, Title, tcontent, reltype, relid) Values(:ll_newid, :ls_empids, :arg_title, :arg_content, :arg_reltype, :arg_relid); IF sqlca.SQLCode <> 0 THEN rslt = 0 arg_msg = '插入推送消息表失败,' + sqlca.SQLErrText GOTO ext END IF arg_rt_pushid = ll_newid END IF ext: IF arg_if_commit THEN IF rslt = 1 THEN COMMIT; ELSE ROLLBACK; END IF END IF RETURN rslt end function public function integer uf_add (long arg_empid[], string arg_title, string arg_content, ref long arg_rt_pushid, ref string arg_msg, boolean arg_if_commit);return uf_add(arg_empid, arg_title, arg_content, '', '', arg_rt_pushid, arg_msg, arg_if_commit) end function on uo_phone_push.create call super::create TriggerEvent( this, "constructor" ) end on on uo_phone_push.destroy TriggerEvent( this, "destructor" ) call super::destroy end on