WorkItemManager.cs
上传用户:li2971742
上传日期:2021-11-18
资源大小:39096k
文件大小:6k
源码类别:

OA系统

开发平台:

C#

  1. using System;
  2. using System.Web;
  3. using System.Collections;
  4. using System.Web.Services;
  5. using System.Web.Services.Protocols;
  6. /// <summary>
  7. /// Summary description for WorkItemManager
  8. /// </summary>
  9. [WebService(Namespace = "http://tempuri.org/")]
  10. [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
  11. public class WorkItemManager : System.Web.Services.WebService
  12. {
  13.     public WorkItemManager()
  14.     {
  15.         //Uncomment the following line if using designed components 
  16.         //InitializeComponent(); 
  17.     }
  18.     [WebMethod]
  19.     public string AddWorkItem(OThinker.H3.WorkItem.WorkItem WorkItem)
  20.     {
  21.         return OThinker.H3.Server.Engine.WorkItemManager.AddWorkItem(WorkItem);
  22.     }
  23.     [WebMethod]
  24.     public OThinker.H3.WorkItem.WorkItem GetWorkItem(string WorkItemID)
  25.     {
  26.         return OThinker.H3.Server.Engine.WorkItemManager.GetWorkItem(WorkItemID);
  27.     }
  28.     /// <summary>
  29.     /// 查询用户任务
  30.     /// </summary>
  31.     /// <param name="InstanceId">实例的ID,如果为UnspecifiedID,则忽略</param>
  32.     /// <param name="Receiver">接收者,如果为null,则忽略</param>
  33.     /// <param name="From">最小接收时间,如果为System.DateTime.MinValue,则忽略</param>
  34.     /// <param name="To">最大接收时间,如果为System.DateTime.MaxValue,则忽略</param>
  35.     /// <param name="State">状态,如果为Unfinished,则查询出等待或者处理中的,如果为Unspecified,则忽略</param>
  36.     /// <returns></returns>
  37.     [WebMethod]
  38.     public string[] Query(
  39.         string ActivityName,
  40.         string[] Instances,
  41.         string[] Participants,
  42.         System.DateTime From,
  43.         System.DateTime To,
  44.         OThinker.H3.WorkItem.WorkItemState State)
  45.     {
  46.         return OThinker.H3.Server.Engine.WorkItemManager.Query(
  47.             ActivityName,
  48.             Instances,
  49.             Participants,
  50.             From,
  51.             To,
  52.             State);
  53.     }
  54.     [WebMethod]
  55.     public long CancelWorkItem(string WorkItemID, bool Force)
  56.     {
  57.         return OThinker.H3.Server.Engine.WorkItemManager.CancelWorkItem(WorkItemID, Force);
  58.     }
  59.     [WebMethod]
  60.     public long ForwardWorkItem(string WorkItemID, string UserID)
  61.     {
  62.         return OThinker.H3.Server.Engine.WorkItemManager.ForwardWorkItem(WorkItemID, UserID);
  63.     }
  64.     [WebMethod]
  65.     public void DoWorkItem(string WorkItemID)
  66.     {
  67.         OThinker.H3.Server.Engine.WorkItemManager.DoWorkItem(WorkItemID);
  68.     }
  69.     [WebMethod]
  70.     public void FinishWorkItem(string WorkItemID, string Finisher, string ParticipateGroup, OThinker.Data.BoolMatchValue Approval, string Comment)
  71.     {
  72.         OThinker.H3.Server.Engine.WorkItemManager.FinishWorkItem(WorkItemID, Finisher, ParticipateGroup, Approval, Comment);
  73.     }
  74.     [WebMethod]
  75.     public void Urge(string InstanceId, string Urgency)
  76.     {
  77.         OThinker.H3.Server.Engine.WorkItemManager.Urge(InstanceId, Urgency);
  78.     }
  79.     /// <summary>
  80.     /// 征询意见
  81.     /// </summary>
  82.     /// <param name="JobID"></param>
  83.     /// <param name="Receivers"></param>
  84.     /// <returns></returns>
  85.     [WebMethod]
  86.     public long Consult(string WorkItemID, string[] Receivers)
  87.     {
  88.         return OThinker.H3.Server.Engine.WorkItemManager.Consult(
  89.             WorkItemID,
  90.             Receivers);
  91.     }
  92.     [WebMethod]
  93.     public string[] GetAllConsultants(string ConsultedWorkItemID)
  94.     {
  95.         return OThinker.H3.Server.Engine.WorkItemManager.GetAllConsultants(ConsultedWorkItemID);
  96.     }
  97.     /// <summary>
  98.     /// 获得某个用户工作效率
  99.     /// </summary>
  100.     /// <param name="WorkflowPackage">流程的类型</param>
  101.     /// <param name="WorkflowName">流程的名称</param>
  102.     /// <param name="WorkflowVersion">流程的版本</param>
  103.     /// <param name="ActivityName">任务的名称</param>
  104.     /// <param name="From">最小接收时间</param>
  105.     /// <param name="To">最大接收时间</param>
  106.     /// <returns>用户效率</returns>
  107.     [WebMethod]
  108.     public OThinker.H3.WorkItem.UserPerformance GetUserPerformance(
  109.         string WorkflowPackage,
  110.         string WorkflowName,
  111.         int WorkflowVersion,
  112.         string ActivityName,
  113.         string Receiver,
  114.         System.DateTime From,
  115.         System.DateTime To)
  116.     {
  117.         return OThinker.H3.Server.Engine.WorkItemManager.GetUserPerformance(
  118.             WorkflowPackage,
  119.             WorkflowName,
  120.             WorkflowVersion,
  121.             ActivityName,
  122.             Receiver,
  123.             From,
  124.             To);
  125.     }
  126.     /// <summary>
  127.     /// 获得某个流程的参与者,即参加过这个流程的某个实例的某个任务的人员
  128.     /// </summary>
  129.     /// <param name="WorkflowPackage"></param>
  130.     /// <param name="WorkflowName"></param>
  131.     /// <param name="WorkflowVersion"></param>
  132.     /// <param name="From"></param>
  133.     /// <param name="To"></param>
  134.     /// <returns></returns>
  135.     [WebMethod]
  136.     public string[] GetWorkflowParticipants(
  137.         string WorkflowPackage,
  138.         string WorkflowName,
  139.         int WorkflowVersion,
  140.         string ActivityName,
  141.         System.DateTime From,
  142.         System.DateTime To)
  143.     {
  144.         return OThinker.H3.Server.Engine.WorkItemManager.GetWorkflowParticipants(
  145.             WorkflowPackage,
  146.             WorkflowName,
  147.             WorkflowVersion,
  148.             ActivityName,
  149.             From,
  150.             To);
  151.     }
  152.     [WebMethod]
  153.     public string[] QueryHandledInstances(string[] Instances, string Participant, OThinker.H3.WorkItem.WorkItemState State)
  154.     {
  155.         return OThinker.H3.Server.Engine.WorkItemManager.QueryHandledInstances(
  156.             Instances, 
  157.             Participant,
  158.             State);
  159.     }
  160.     [WebMethod]
  161.     public string[] GetLastWorkItems(string InstanceId, long TokenID, int TopNum, OThinker.H3.WorkItem.WorkItemType ItemType, OThinker.H3.WorkItem.WorkItemState State)
  162.     {
  163.         return OThinker.H3.Server.Engine.WorkItemManager.GetLastWorkItems(InstanceId, TokenID, TopNum, ItemType, State);
  164.     }
  165. }