驰骋工作流引擎

注册

 

发新话题 回复该主题

ccbpm的功能升级,关于获取当前工作人员发起的在途流程的接口 [复制链接]

1#
ccbpm的功能升级,关于获取当前工作人员发起的在途流程的接口.
  1. /// <summary>
  2.         /// 获取未完成的流程(也称为在途流程:我参与的但是此流程未完成)
  3.         /// 该接口为在途菜单提供数据,在在途工作中,可以执行撤销发送。
  4.         /// </summary>
  5.         /// <param name="userNo">操作员</param>
  6.         /// <param name="fk_flow">流程编号</param>
  7.         /// <param name="isMyStarter">是否仅仅查询我发起的在途流程</param>
  8.         /// <returns>返回从数据视图WF_GenerWorkflow查询出来的数据.</returns>
  9.         public static DataTable DB_GenerRuning(string userNo, string fk_flow, bool isMyStarter=false)
  10.         {
  11.             // 转化成编号.
  12.             fk_flow = TurnFlowMarkToFlowNo(fk_flow);
  13.             string dbStr = SystemConfig.AppCenterDBVarStr;
  14.             Paras ps = new Paras();
  15.             if (WebUser.IsAuthorize)
  16.             {
  17.                 WF.Port.WFEmp emp = new Port.WFEmp(userNo);
  18.                 if (string.IsNullOrEmpty(fk_flow))
  19.                 {
  20.                     if (isMyStarter ==true )
  21.                     {
  22.                         ps.SQL = "SELECT DISTINCT a.* FROM WF_GenerWorkFlow A, WF_GenerWorkerlist B WHERE A.WorkID=B.WorkID AND A.Starter=" + dbStr + "Starter  AND B.FK_Emp=" + dbStr + "FK_Emp AND B.IsEnable=1 AND  (B.IsPass=1 or B.IsPass < 0) AND A.FK_Flow IN " + emp.AuthorFlows;
  23.                         ps.Add("Starter", userNo);
  24.                         ps.Add("FK_Emp", userNo);
  25.                     }
  26.                     else
  27.                     {
  28.                         ps.SQL = "SELECT DISTINCT a.* FROM WF_GenerWorkFlow A, WF_GenerWorkerlist B WHERE A.WorkID=B.WorkID AND B.FK_Emp=" + dbStr + "FK_Emp AND B.IsEnable=1 AND  (B.IsPass=1 or B.IsPass < 0) AND A.FK_Flow IN " + emp.AuthorFlows;
  29.                         ps.Add("FK_Emp", userNo);
  30.                     }
  31.                 }
  32.                 else
  33.                 {
  34.                     if (isMyStarter == true)
  35.                     {
  36.                         ps.SQL = "SELECT DISTINCT a.WorkID FROM WF_GenerWorkFlow A, WF_GenerWorkerlist B WHERE  A.FK_Flow=" + dbStr + "FK_Flow  AND A.WorkID=B.WorkID AND B.FK_Emp=" + dbStr + "FK_Emp AND B.IsEnable=1 AND  (B.IsPass=1 or B.IsPass < 0) AND  A.Starter=" + dbStr + "Starter AND A.FK_Flow IN " + emp.AuthorFlows;
  37.                         ps.Add("FK_Flow", fk_flow);
  38.                         ps.Add("FK_Emp", userNo);
  39.                         ps.Add("Starter", userNo);
  40.                     }
  41.                     else
  42.                     {
  43.                         ps.SQL = "SELECT DISTINCT a.WorkID FROM WF_GenerWorkFlow A, WF_GenerWorkerlist B WHERE A.FK_Flow=" + dbStr + "FK_Flow  AND A.WorkID=B.WorkID AND B.FK_Emp=" + dbStr + "FK_Emp AND B.IsEnable=1 AND  (B.IsPass=1 or B.IsPass < 0) AND A.FK_Flow IN " + emp.AuthorFlows;
  44.                         ps.Add("FK_Flow", fk_flow);
  45.                         ps.Add("FK_Emp", userNo);
  46.                     }
  47.                 
  48.                 }
  49.             }
  50.             else
  51.             {
  52.                 if (string.IsNullOrEmpty(fk_flow))
  53.                 {
  54.                     if (isMyStarter == true)
  55.                     {
  56.                         ps.SQL = "SELECT DISTINCT a.* FROM WF_GenerWorkFlow A, WF_GenerWorkerlist B WHERE A.WorkID=B.WorkID AND B.FK_Emp=" + dbStr + "FK_Emp AND B.IsEnable=1 AND  (B.IsPass=1 or B.IsPass < 0) AND  A.Starter=" + dbStr + "Starter ";
  57.                         ps.Add("FK_Emp", userNo);
  58.                         ps.Add("Starter", userNo);
  59.                     }
  60.                     else
  61.                     {
  62.                         ps.SQL = "SELECT DISTINCT a.* FROM WF_GenerWorkFlow A, WF_GenerWorkerlist B WHERE A.WorkID=B.WorkID AND B.FK_Emp=" + dbStr + "FK_Emp AND B.IsEnable=1 AND  (B.IsPass=1 or B.IsPass < 0) ";
  63.                         ps.Add("FK_Emp", userNo);
  64.                     }
  65.                 }
  66.                 else
  67.                 {
  68.                     if (isMyStarter == true)
  69.                     {
  70.                         ps.SQL = "SELECT DISTINCT a.* FROM WF_GenerWorkFlow A, WF_GenerWorkerlist B WHERE A.FK_Flow=" + dbStr + "FK_Flow  AND A.WorkID=B.WorkID AND B.FK_Emp=" + dbStr + "FK_Emp AND B.IsEnable=1 AND (B.IsPass=1 or B.IsPass < 0 ) AND  A.Starter=" + dbStr + "Starter  ";
  71.                         ps.Add("FK_Flow", fk_flow);
  72.                         ps.Add("FK_Emp", userNo);
  73.                         ps.Add("Starter", userNo);
  74.                     }
  75.                     else
  76.                     {
  77.                         ps.SQL = "SELECT DISTINCT a.* FROM WF_GenerWorkFlow A, WF_GenerWorkerlist B WHERE A.FK_Flow=" + dbStr + "FK_Flow  AND A.WorkID=B.WorkID AND B.FK_Emp=" + dbStr + "FK_Emp AND B.IsEnable=1 AND (B.IsPass=1 or B.IsPass < 0 ) ";
  78.                         ps.Add("FK_Flow", fk_flow);
  79.                         ps.Add("FK_Emp", userNo);
  80.                     }
  81.                 }
  82.             }
  83.             return BP.DA.DBAccess.RunSQLReturnTable(ps);
  84.         }
复制代码
分享 转发
获取最新动态,请关注企业服务号:chichengsoft

学好ccflow,受益一生,多看文档,少走弯路。
TOP
发新话题 回复该主题