mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-20 18:47:55 +08:00
调整流程详情显示效果
添加DataGrid数据格式
This commit is contained in:
@@ -6,6 +6,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Web.Mvc;
|
||||
using System.Xml.Linq;
|
||||
using OpenAuth.Mvc.Models;
|
||||
using OptimaJet.Workflow;
|
||||
using OptimaJet.Workflow.Core.Builder;
|
||||
using OptimaJet.Workflow.Core.Bus;
|
||||
@@ -21,7 +22,7 @@ namespace OpenAuth.Mvc.Controllers
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
|
||||
public ActionResult API()
|
||||
{
|
||||
Stream filestream = null;
|
||||
@@ -30,8 +31,8 @@ namespace OpenAuth.Mvc.Controllers
|
||||
|
||||
var pars = new NameValueCollection();
|
||||
pars.Add(Request.Params);
|
||||
|
||||
if(Request.HttpMethod.Equals("POST", StringComparison.InvariantCultureIgnoreCase))
|
||||
|
||||
if (Request.HttpMethod.Equals("POST", StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
var parsKeys = pars.AllKeys;
|
||||
foreach (var key in Request.Form.AllKeys)
|
||||
@@ -49,8 +50,7 @@ namespace OpenAuth.Mvc.Controllers
|
||||
return Content(res);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@@ -5,6 +5,7 @@ using Infrastructure;
|
||||
using OpenAuth.App;
|
||||
using OpenAuth.App.SSO;
|
||||
using OpenAuth.Domain;
|
||||
using OpenAuth.Mvc.Models;
|
||||
using OptimaJet.Workflow.Core.Runtime;
|
||||
using ProcessStatus = OptimaJet.Workflow.Core.Persistence.ProcessStatus;
|
||||
|
||||
@@ -12,11 +13,11 @@ namespace OpenAuth.Mvc.Controllers
|
||||
{
|
||||
public class GoodsAppliesController : BaseController
|
||||
{
|
||||
private GoodsApplyApp _app;
|
||||
private GoodsApplyApp _app;
|
||||
|
||||
public GoodsAppliesController()
|
||||
{
|
||||
_app = AutofacExt.GetFromFac<GoodsApplyApp>();
|
||||
public GoodsAppliesController()
|
||||
{
|
||||
_app = AutofacExt.GetFromFac<GoodsApplyApp>();
|
||||
}
|
||||
|
||||
public ActionResult Index()
|
||||
@@ -45,15 +46,20 @@ namespace OpenAuth.Mvc.Controllers
|
||||
return JsonHelper.Instance.Serialize(BjuiResponse);
|
||||
}
|
||||
|
||||
public dynamic Get(Guid id)
|
||||
public ActionResult Detail(Guid id)
|
||||
{
|
||||
try
|
||||
{
|
||||
var apply = _app.Get(id);
|
||||
CreateWorkflowIfNotExists(id);
|
||||
|
||||
return new
|
||||
return View(apply);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
Apply=apply
|
||||
};
|
||||
Console.WriteLine(e);
|
||||
}
|
||||
|
||||
return View();
|
||||
}
|
||||
|
||||
|
||||
|
@@ -1,34 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using OpenAuth.App;
|
||||
using OptimaJet.Workflow.Core.Model;
|
||||
using OptimaJet.Workflow.Core.Runtime;
|
||||
|
||||
namespace OpenAuth.Mvc.Controllers
|
||||
{
|
||||
public class WorkflowActionProvider :IWorkflowActionProvider
|
||||
{
|
||||
private ModuleManagerApp _app;
|
||||
|
||||
public WorkflowActionProvider()
|
||||
{
|
||||
_app = AutofacExt.GetFromFac<ModuleManagerApp>();
|
||||
}
|
||||
public void ExecuteAction(string name, ProcessInstance processInstance, WorkflowRuntime runtime, string actionParameter)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public bool ExecuteCondition(string name, ProcessInstance processInstance, WorkflowRuntime runtime, string actionParameter)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public List<string> GetActions()
|
||||
{
|
||||
return new List<string>{"ok"};
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,50 +0,0 @@
|
||||
using System;
|
||||
using System.Configuration;
|
||||
using System.Xml.Linq;
|
||||
using OptimaJet.Workflow.Core.Builder;
|
||||
using OptimaJet.Workflow.Core.Bus;
|
||||
using OptimaJet.Workflow.Core.Runtime;
|
||||
using OptimaJet.Workflow.DbPersistence;
|
||||
|
||||
namespace OpenAuth.Mvc.Controllers
|
||||
{
|
||||
public class WorkflowInit
|
||||
{
|
||||
private static volatile WorkflowRuntime _runtime;
|
||||
private static readonly object _sync = new object();
|
||||
|
||||
public static WorkflowRuntime Runtime
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_runtime == null)
|
||||
{
|
||||
lock (_sync)
|
||||
{
|
||||
if (_runtime == null)
|
||||
{
|
||||
var connectionString = ConfigurationManager.ConnectionStrings["WorkFlow"].ConnectionString;
|
||||
var builder = new WorkflowBuilder<XElement>(
|
||||
new MSSQLProvider(connectionString),
|
||||
new OptimaJet.Workflow.Core.Parser.XmlWorkflowParser(),
|
||||
new MSSQLProvider(connectionString)
|
||||
).WithDefaultCache();
|
||||
|
||||
_runtime = new WorkflowRuntime(new Guid("{8D38DB8F-F3D5-4F26-A989-4FDD40F32D9D}"))
|
||||
.WithBuilder(builder)
|
||||
// .WithRuleProvider(new WorkflowRuleProvider())
|
||||
// .WithActionProvider(new WorkflowActionProvider())
|
||||
.WithPersistenceProvider(new MSSQLProvider(connectionString))
|
||||
.WithTimerManager(new TimerManager())
|
||||
.WithBus(new NullBus())
|
||||
.SwitchAutoUpdateSchemeBeforeGetAvailableCommandsOn()
|
||||
.Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return _runtime;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@@ -1,40 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using OpenAuth.App;
|
||||
using OptimaJet.Workflow.Core.Model;
|
||||
using OptimaJet.Workflow.Core.Runtime;
|
||||
|
||||
namespace OpenAuth.Mvc.Controllers
|
||||
{
|
||||
public class WorkflowRuleProvider : IWorkflowRuleProvider
|
||||
{
|
||||
private RoleManagerApp _app;
|
||||
|
||||
public WorkflowRuleProvider()
|
||||
{
|
||||
_app = AutofacExt.GetFromFac<RoleManagerApp>();
|
||||
}
|
||||
|
||||
public List<string> GetRules()
|
||||
{
|
||||
var roles = _app.Load(Guid.Empty, 1, 100).list;
|
||||
var rolestrs = new List<string>();
|
||||
foreach (var role in roles)
|
||||
{
|
||||
rolestrs.Add(role.Name);
|
||||
}
|
||||
return rolestrs;
|
||||
}
|
||||
|
||||
public bool Check(ProcessInstance processInstance, WorkflowRuntime runtime, string identityId, string ruleName,
|
||||
string parameter)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
|
||||
public IEnumerable<string> GetIdentities(ProcessInstance processInstance, WorkflowRuntime runtime, string ruleName, string parameter)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user