using Learun.Application.Base.AuthorizeModule;
using Learun.Application.Organization;
using Learun.Application.WorkFlow;
using Learun.Util;
using System.Collections.Generic;
using System.Web.Mvc;
namespace Learun.Application.Web.Areas.LR_WorkFlowModule.Controllers
{
///
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
/// Copyright (c) 2013-2018 北京泉江科技有限公司
/// 创建人:陈彬彬
/// 日 期:2018.01.16
/// 描 述:流程引擎(流程接口)
///
public class WfEngineController : MvcControllerBase
{
private UserRelationIBLL userRelationIBLL = new UserRelationBLL();
private UserIBLL userIBLL = new UserBLL();
///
/// 工作流引擎
///
private WfEngineIBLL wfEngineIBLL = new WfEngineBLL();
private WfProcessInstanceIBLL wfProcessInstanceIBLL = new WfProcessInstanceBLL();
private WfTaskIBLL wfTaskIBLL = new WfTaskBLL();
private WfSchemeIBLL wfSchemeIBLL = new WfSchemeBLL();
#region 获取数据
///
/// 初始化流程模板->获取开始节点数据
///
/// 是否是新发起的实例
/// 流程实例ID
/// 流程模板编码
///
[HttpGet]
[AjaxOnly]
public ActionResult Bootstraper(bool isNew, string processId, string schemeCode)
{
WfParameter wfParameter = new WfParameter();
UserInfo userInfo = LoginUserInfo.Get();
wfParameter.companyId = userInfo.companyId;
wfParameter.departmentId = userInfo.departmentId;
wfParameter.userId = userInfo.userId;
wfParameter.userName = userInfo.realName;
wfParameter.isNew = isNew;
wfParameter.processId = processId;
wfParameter.schemeCode = schemeCode;
WfResult res = wfEngineIBLL.Bootstraper(wfParameter);
return JsonResult(res);
}
///
/// 流程任务信息
///
/// 流程实例ID
/// 流程模板编码
///
[HttpGet]
[AjaxOnly]
public ActionResult Taskinfo(string processId, string taskId)
{
WfParameter wfParameter = new WfParameter();
UserInfo userInfo = LoginUserInfo.Get();
wfParameter.companyId = userInfo.companyId;
wfParameter.departmentId = userInfo.departmentId;
wfParameter.userId = userInfo.userId;
wfParameter.userName = userInfo.realName;
wfParameter.processId = processId;
wfParameter.taskId = taskId;
WfResult res = wfEngineIBLL.GetTaskInfo(wfParameter);
return JsonResult(res);
}
///
/// 获取流程实例信息
///
/// 流程实例ID
/// 流程模板编码
///
[HttpGet]
[AjaxOnly]
public ActionResult Processinfo(string processId, string taskId)
{
WfParameter wfParameter = new WfParameter();
UserInfo userInfo = LoginUserInfo.Get();
wfParameter.companyId = userInfo.companyId;
wfParameter.departmentId = userInfo.departmentId;
wfParameter.userId = userInfo.userId;
wfParameter.userName = userInfo.realName;
wfParameter.processId = processId;
wfParameter.taskId = taskId;
WfResult res = wfEngineIBLL.GetProcessInfo(wfParameter);
return JsonResult(res);
}
///
/// 获取流程实例信息(流程监控)
///
///
///
///
[HttpGet]
[AjaxOnly]
public ActionResult ProcessinfoByMonitor(string processId, string taskId)
{
WfParameter wfParameter = new WfParameter();
UserInfo userInfo = LoginUserInfo.Get();
wfParameter.companyId = userInfo.companyId;
wfParameter.departmentId = userInfo.departmentId;
wfParameter.userId = userInfo.userId;
wfParameter.userName = userInfo.realName;
wfParameter.processId = processId;
wfParameter.taskId = taskId;
WfResult res = wfEngineIBLL.GetProcessInfoByMonitor(wfParameter);
return JsonResult(res);
}
///
/// 获取下一个节点审核人员
///
///
///
///
[HttpPost]
[AjaxOnly]
[ValidateInput(false)]
public ActionResult Auditer(bool isNew, string processId, string schemeCode, string taskId,string formData)
{
WfParameter wfParameter = new WfParameter();
UserInfo userInfo = LoginUserInfo.Get();
wfParameter.companyId = userInfo.companyId;
wfParameter.departmentId = userInfo.departmentId;
wfParameter.userId = userInfo.userId;
wfParameter.userName = userInfo.realName;
wfParameter.isNew = isNew;
wfParameter.processId = processId;
wfParameter.schemeCode = schemeCode;
wfParameter.taskId = taskId;
wfParameter.formData = formData;
WfResult> res = wfEngineIBLL.GetAuditer(wfParameter);
if (res.status == 1)
{
List