f_cmp_ifemp_oa.srf 791 B

123456789101112131415161718192021222324252627282930313233343536
  1. $PBExportHeader$f_cmp_ifemp_oa.srf
  2. global type f_cmp_ifemp_oa from function_object
  3. end type
  4. forward prototypes
  5. global function integer f_cmp_ifemp_oa (long arg_docid, long arg_empid)
  6. end prototypes
  7. global function integer f_cmp_ifemp_oa (long arg_docid, long arg_empid);//判断传入的arg_empid是否arg_docid公文当前审批的人员,如果不是,定义为下级用户的公文
  8. Int if_user //下级用户的公文
  9. Long cnt
  10. Select count(*)
  11. Into :cnt
  12. From oa_doc Inner JOIN
  13. oa_doc_flow ON oa_doc.docID = oa_doc_flow.Docid And
  14. oa_doc.rowid = oa_doc_flow.rowid
  15. Where oa_doc.docID = :arg_docid
  16. And oa_doc_flow.Empid = :arg_empid;
  17. If sqlca.SQLCode <> 0 Then
  18. if_user = 0
  19. Goto ext
  20. End If
  21. If cnt > 0 Then
  22. if_user = 0
  23. Else
  24. if_user = 1
  25. End If
  26. ext:
  27. Return if_user
  28. end function