IWorkflowServices.cs 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using EMIS.ViewModel.SystemView;
  6. using Bowin.Common.Linq.Entity;
  7. using System.Linq.Expressions;
  8. using EMIS.Entities;
  9. using EMIS.ViewModel.WorkflowManage;
  10. namespace EMIS.CommonLogic.SystemServices
  11. {
  12. public interface IWorkflowServices
  13. {
  14. /// <summary>
  15. /// 查询对应的接入流程表开始流程环节的Pid(对应的流程环节Pid)
  16. /// </summary>
  17. /// <param name="tableName"></param>
  18. /// <returns></returns>
  19. int? GetStartStatus(string tableName);
  20. /// <summary>
  21. /// 查询对应的接入流程表已退回流程环节Pid(注:不包含开始环节、结束环节且为[BP]标识)
  22. /// </summary>
  23. /// <param name="tableName"></param>
  24. /// <returns></returns>
  25. int? GetSendBackStatus(string tableName);
  26. /// <summary>
  27. /// 查询对应的接入流程表已通过流程环节Pid(注:不包含开始环节、结束环节且为[PASS]标识)
  28. /// </summary>
  29. /// <param name="tableName"></param>
  30. /// <returns></returns>
  31. int? GetPassNoEndStatus(string tableName);
  32. /// <summary>
  33. /// 查询对应的结束流程环节Pid
  34. /// </summary>
  35. /// <param name="tableName"></param>
  36. /// <returns></returns>
  37. List<int?> GetEndStatus(string tableName);
  38. /// <summary>
  39. /// 查询对应的接入流程表结束流程环节且正常结束的流程环节Pid(注:结束环节且不为[BP]标识的)
  40. /// </summary>
  41. /// <param name="tableName"></param>
  42. /// <returns></returns>
  43. int? GetCorrectEndStatus(string tableName);
  44. /// <summary>
  45. /// 查询对应的接入流程表非正常结束的流程环节Pid(注:通常为结束环节且为[BP]标识的)
  46. /// </summary>
  47. /// <param name="tableName"></param>
  48. /// <returns></returns>
  49. List<int?> GetBackpointStatus(string tableName);
  50. /// <summary>
  51. /// 查询对应的接入流程表中开始环节、审核流程环节Pid(注:不包含结束、非正常[BP]结束环节)
  52. /// </summary>
  53. /// <param name="tableName"></param>
  54. /// <returns></returns>
  55. List<int?> GetStartApproveStatusList(string tableName);
  56. /// <summary>
  57. /// 查询对应的接入流程表中全部流程环节信息(WorkflowStatusView)
  58. /// </summary>
  59. /// <param name="tableName">主表表名</param>
  60. /// <returns></returns>
  61. List<WorkflowStatusView> GetStatusViewList(string tableName);
  62. /// <summary>
  63. /// 查询对应的接入流程表中审核流程环节信息(WorkflowStatusView,不包含开始、结束、非正常[BP]结束环节)
  64. /// </summary>
  65. /// <param name="tableName">主表表名</param>
  66. /// <returns></returns>
  67. List<WorkflowStatusView> GetApproveStatusViewList(string tableName);
  68. /// <summary>
  69. /// 查询重录待审,重新录入环节Pid(用于期末设定学生名单背景颜色)
  70. /// </summary>
  71. /// <param name="tableName"></param>
  72. /// <returns></returns>
  73. List<int?> GetRebutStatus(string tableName);
  74. /// <summary>
  75. /// 查询对应的接入流程表中全部非开始流程环节信息(WorkflowStatusView,不包含开始环节)
  76. /// </summary>
  77. /// <param name="tableName">主表表名</param>
  78. /// <returns></returns>
  79. List<WorkflowStatusView> GetNoStartStatusViewList(string tableName);
  80. /// <summary>
  81. /// 查询对应的接入流程表中全部结束流程环节信息
  82. /// </summary>
  83. /// <param name="tableName"></param>
  84. /// <returns></returns>
  85. List<WorkflowStatusView> GetEndStatusViewList(string tableName);
  86. /// <summary>
  87. /// 查询工作流程中是否有对应的操作权限——动作(根据对应的信息-处理人、处理人标识)
  88. /// </summary>
  89. /// <param name="tableName">主表表名</param>
  90. /// <param name="userID">用户ID</param>
  91. /// <param name="actionID">审核动作ID(路由ID)</param>
  92. /// <param name="formIDs">表单ID列表</param>
  93. /// <param name="dataRangeUserFunc">获取数据范围用户的方法</param>
  94. /// <returns></returns>
  95. bool IsCanApprove(string tableName, Guid userID, Guid actionID, List<Guid> formIDs, Func<List<Guid>, Guid, bool> dataRangeUserFunc = null);
  96. /// <summary>
  97. /// 查询工作流程中是否有对应的操作权限——动作(根据对应的信息-处理人、处理人标识)
  98. /// </summary>
  99. /// <param name="tableName">主表表名</param>
  100. /// <param name="userID">用户ID</param>
  101. /// <param name="actionID">审核动作ID(路由ID)</param>
  102. /// <param name="formIDs">表单ID列表</param>
  103. /// <param name="dataRangeUserFunc">获取数据范围用户的方法</param>
  104. /// <returns></returns>
  105. List<WorkflowPermissionView> IsCanApprove(string tableName, Guid userID, List<Guid> formIDs);
  106. /// <summary>
  107. /// 重载方法,启动对应的流程并执行指定的动作至下一环节(提交),适用于开始节点有两个以上动作时
  108. /// </summary>
  109. /// <param name="tableName">主表表名</param>
  110. /// <param name="formID">需要提交的记录主键ID</param>
  111. /// <param name="userID">提交人ID</param>
  112. /// <param name="userID">动作ID</param>
  113. /// <param name="comment">提交意见</param>
  114. /// <param name="dataRangeUserFunc">获取数据范围用户的方法</param>
  115. void StartUp(string tableName, Guid formID, Guid userID, Guid actionID, string comment = "", Func<List<Guid>, Guid, bool> dataRangeUserFunc = null);
  116. /// <summary>
  117. /// 启动对应的流程并执行指定的动作至下一环节(提交)
  118. /// </summary>
  119. /// <param name="tableName">主表表名</param>
  120. /// <param name="formID">需要提交的记录主键ID</param>
  121. /// <param name="userID">提交人ID</param>
  122. /// <param name="comment">提交意见</param>
  123. /// <param name="dataRangeUserFunc">获取数据范围用户的方法</param>
  124. void StartUp(string tableName, Guid formID, Guid userID, string comment = "", Func<List<Guid>, Guid, bool> dataRangeUserFunc = null);
  125. /// <summary>
  126. ///
  127. /// </summary>
  128. /// <param name="tableName"></param>
  129. /// <param name="formIDList"></param>
  130. /// <param name="userID"></param>
  131. /// <param name="comment"></param>
  132. /// <param name="dataRangeUserFunc"></param>
  133. void BatchStartUp(string tableName, List<Guid> formIDList, Guid userID, string comment, Func<List<Guid>, Guid, bool> dataRangeUserFunc = null);
  134. /// <summary>
  135. /// 审核流程(不包括提交——不包含流程启动)
  136. /// </summary>
  137. /// <param name="tableName">主表表名</param>
  138. /// <param name="formID">需要审核的记录主键ID</param>
  139. /// <param name="userID">审核人ID</param>
  140. /// <param name="actionID">审核动作ID</param>
  141. /// <param name="comment">提交意见</param>
  142. /// <param name="dataRangeUserFunc">获取数据范围用户的方法</param>
  143. void Approve(string tableName, Guid formID, Guid userID, Guid actionID, string comment = "", Func<List<Guid>, Guid, bool> dataRangeUserFunc = null);
  144. /// <summary>
  145. ///
  146. /// </summary>
  147. /// <param name="tableName"></param>
  148. /// <param name="formIDList"></param>
  149. /// <param name="userID"></param>
  150. /// <param name="actionID"></param>
  151. /// <param name="comment"></param>
  152. /// <param name="dataRangeUserFunc"></param>
  153. void BatchApprove(string tableName, List<Guid> formIDList, Guid userID, Guid actionID, string comment = "", Func<List<Guid>, Guid, bool> dataRangeUserFunc = null);
  154. /// <summary>
  155. /// 工作流流程状态修改(通常用于取消申请、撤销等环节)
  156. /// </summary>
  157. /// <param name="tableName">主表表名</param>
  158. /// <param name="formID">表单ID</param>
  159. /// <param name="status">状态:A为活动,D为结束、其他的自己定义</param>
  160. /// <param name="description">描述改变内容</param>
  161. void ModifyProcessState(string tableName, Guid formID, string status, string description);
  162. /// <summary>
  163. /// 根据当前流程环节ID获取下一步审批动作
  164. /// </summary>
  165. /// <param name="tableName">主表表名</param>
  166. /// <param name="formID">表单ID</param>
  167. /// <param name="userID">当前用户ID</param>
  168. /// <returns></returns>
  169. List<ActionView> GetActionView(string tableName, Guid formID, Guid userID);
  170. /// <summary>
  171. /// 重载方法,根据当前流程环节ID获取全部审批动作
  172. /// </summary>
  173. /// <param name="tableName">主表表名</param>
  174. /// <returns></returns>
  175. List<ActionView> GetActionView(string tableName);
  176. /// <summary>
  177. /// 查询开始流程环节的动作列表List
  178. /// </summary>
  179. /// <param name="tableName">主表表名</param>
  180. /// <returns></returns>
  181. List<ActionView> GetStartActionView(string tableName);
  182. /// <summary>
  183. /// 查询对应的审核历史信息列表List(WorkflowApproveHistoryView)
  184. /// </summary>
  185. /// <param name="tableName">主表表名</param>
  186. /// <param name="formID">需要获取的记录主键ID</param>
  187. /// <returns></returns>
  188. IList<ViewModel.SystemView.WorkflowApproveHistoryView> GetApproveHistoryViewList(string tableName, Guid formID);
  189. /// <summary>
  190. /// 获取待办列表
  191. /// </summary>
  192. /// <typeparam name="T"></typeparam>
  193. /// <param name="tableName">主表表名</param>
  194. /// <param name="query">查询视图,指定一个IQueryable决定如何获取表单记录</param>
  195. /// <param name="userID">待办用户ID</param>
  196. /// <param name="pkSelector">指定主键列</param>
  197. /// <param name="pageIndex">页码</param>
  198. /// <param name="pageSize">每页行数</param>
  199. /// <returns></returns>
  200. IGridResultSet<T> QueryByPendingJob<T, TOrder>(string tableName, IQueryable<T> query, Guid userID,
  201. Expression<Func<T, Guid>> pkSelector, Expression<Func<T, TOrder>> orderby, bool isDescending = false,
  202. int? pageIndex = null, int? pageSize = null);
  203. }
  204. }