mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-07-15 23:13:40 +08:00
删除workflowengine.net
This commit is contained in:
parent
b46729b31d
commit
b9a849e3ea
@ -1,38 +0,0 @@
|
|||||||
using System;
|
|
||||||
using OpenAuth.Domain;
|
|
||||||
using OpenAuth.Domain.Interface;
|
|
||||||
|
|
||||||
namespace OpenAuth.App
|
|
||||||
{
|
|
||||||
public class ApplyTransitionHistoryApp
|
|
||||||
{
|
|
||||||
private IRepository<ApplyTransitionHistory> _repository;
|
|
||||||
|
|
||||||
public ApplyTransitionHistoryApp(IRepository<ApplyTransitionHistory> repository)
|
|
||||||
{
|
|
||||||
_repository = repository;
|
|
||||||
}
|
|
||||||
|
|
||||||
public ApplyTransitionHistory Get(Guid processId, string currentstate, string nextState)
|
|
||||||
{
|
|
||||||
return _repository.FindSingle(h => h.ApplyId == processId && !h.TransitionTime.HasValue &&
|
|
||||||
h.InitialState == currentstate && h.DestinationState == nextState);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Add(ApplyTransitionHistory historyItem)
|
|
||||||
{
|
|
||||||
_repository.Add(historyItem);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Update(ApplyTransitionHistory historyItem)
|
|
||||||
{
|
|
||||||
_repository.Update(u =>u.Id, historyItem);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void DeleteByProcess(Guid processId)
|
|
||||||
{
|
|
||||||
_repository.Delete(dth =>
|
|
||||||
dth.ApplyId == processId && !dth.TransitionTime.HasValue);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -80,7 +80,6 @@
|
|||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="ApplyTransitionHistoryApp.cs" />
|
|
||||||
<Compile Include="CategoryManagerApp.cs" />
|
<Compile Include="CategoryManagerApp.cs" />
|
||||||
<Compile Include="AuthorizeApp.cs" />
|
<Compile Include="AuthorizeApp.cs" />
|
||||||
<Compile Include="Extention\IWF_Runtime.cs" />
|
<Compile Include="Extention\IWF_Runtime.cs" />
|
||||||
@ -89,7 +88,7 @@
|
|||||||
<Compile Include="Extention\WF_RuntimeModel.cs" />
|
<Compile Include="Extention\WF_RuntimeModel.cs" />
|
||||||
<Compile Include="WFProcessInstanceService.cs" />
|
<Compile Include="WFProcessInstanceService.cs" />
|
||||||
<Compile Include="WFRuntimeService.cs" />
|
<Compile Include="WFRuntimeService.cs" />
|
||||||
<Compile Include="WorkflowInboxApp.cs" />
|
<Compile Include="WFSchemeService.cs" />
|
||||||
<Compile Include="ModuleElementManagerApp.cs" />
|
<Compile Include="ModuleElementManagerApp.cs" />
|
||||||
<Compile Include="ModuleManagerApp.cs" />
|
<Compile Include="ModuleManagerApp.cs" />
|
||||||
<Compile Include="ResourceManagerApp.cs" />
|
<Compile Include="ResourceManagerApp.cs" />
|
||||||
@ -109,14 +108,12 @@
|
|||||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
<Compile Include="OrgManagerApp.cs" />
|
<Compile Include="OrgManagerApp.cs" />
|
||||||
<Compile Include="ViewModel\CommandModel.cs" />
|
<Compile Include="ViewModel\CommandModel.cs" />
|
||||||
<Compile Include="ViewModel\CommonApplyVM.cs" />
|
|
||||||
<Compile Include="ViewModel\GridData.cs" />
|
<Compile Include="ViewModel\GridData.cs" />
|
||||||
<Compile Include="ViewModel\UserWithAccessedCtrls.cs" />
|
<Compile Include="ViewModel\UserWithAccessedCtrls.cs" />
|
||||||
<Compile Include="ViewModel\ModuleElementVM.cs" />
|
<Compile Include="ViewModel\ModuleElementVM.cs" />
|
||||||
<Compile Include="ViewModel\ModuleView.cs" />
|
<Compile Include="ViewModel\ModuleView.cs" />
|
||||||
<Compile Include="ViewModel\RoleVM.cs" />
|
<Compile Include="ViewModel\RoleVM.cs" />
|
||||||
<Compile Include="ViewModel\UserView.cs" />
|
<Compile Include="ViewModel\UserView.cs" />
|
||||||
<Compile Include="WorkflowSchemasManagerApp.cs" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Infrastructure\Infrastructure.csproj">
|
<ProjectReference Include="..\Infrastructure\Infrastructure.csproj">
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
using OpenAuth.App.ViewModel;
|
||||||
using OpenAuth.Domain.Interface;
|
using OpenAuth.Domain.Interface;
|
||||||
|
|
||||||
namespace OpenAuth.Domain.Service
|
namespace OpenAuth.Domain.Service
|
||||||
@ -102,5 +103,18 @@ namespace OpenAuth.Domain.Service
|
|||||||
{
|
{
|
||||||
return _unitWork.Find<WFSchemeInfo>(null).ToList();
|
return _unitWork.Find<WFSchemeInfo>(null).ToList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public GridData Load(int pageCurrent, int pageSize)
|
||||||
|
{
|
||||||
|
var result = new GridData
|
||||||
|
{
|
||||||
|
page = pageCurrent
|
||||||
|
};
|
||||||
|
|
||||||
|
result.total = _unitWork.Find<WFSchemeInfo>(null).Count();
|
||||||
|
result.rows = _unitWork.Find<WFSchemeInfo>(pageCurrent, pageSize, "ModifyDate descending", null).ToList();
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,28 +0,0 @@
|
|||||||
using System;
|
|
||||||
using OpenAuth.App.ViewModel;
|
|
||||||
using OpenAuth.Domain;
|
|
||||||
using OpenAuth.Domain.Interface;
|
|
||||||
|
|
||||||
namespace OpenAuth.App
|
|
||||||
{
|
|
||||||
public class WorkflowInboxApp
|
|
||||||
{
|
|
||||||
private IRepository<Relevance> _repository;
|
|
||||||
|
|
||||||
public WorkflowInboxApp(IRepository<Relevance> repository)
|
|
||||||
{
|
|
||||||
_repository = repository;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void DeleteAllByProcess(Guid processId)
|
|
||||||
{
|
|
||||||
_repository.Delete(u =>u.FirstId == processId && u.Key=="ProcessUser");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Add(Relevance newInboxItem)
|
|
||||||
{
|
|
||||||
_repository.Add(newInboxItem);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,38 +0,0 @@
|
|||||||
using System.Linq;
|
|
||||||
using System.Web.Mvc;
|
|
||||||
using Infrastructure;
|
|
||||||
using OpenAuth.App.ViewModel;
|
|
||||||
using OpenAuth.Domain;
|
|
||||||
using OpenAuth.Domain.Interface;
|
|
||||||
|
|
||||||
namespace OpenAuth.App
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 工作流模板
|
|
||||||
/// </summary>
|
|
||||||
public class WorkflowSchemasManagerApp
|
|
||||||
{
|
|
||||||
private IWorkflowSchemeRepository _repository;
|
|
||||||
|
|
||||||
public WorkflowSchemasManagerApp(IWorkflowSchemeRepository repository)
|
|
||||||
{
|
|
||||||
_repository = repository;
|
|
||||||
}
|
|
||||||
public GridData Load(int pageCurrent, int pageSize)
|
|
||||||
{
|
|
||||||
var result = new GridData
|
|
||||||
{
|
|
||||||
page = pageCurrent,
|
|
||||||
total = _repository.GetCount(),
|
|
||||||
rows = _repository.Find(pageCurrent, pageSize, "Code", null).ToList()
|
|
||||||
};
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
[HttpPost]
|
|
||||||
public void Del(string[] codes)
|
|
||||||
{
|
|
||||||
_repository.Delete(u =>codes.Contains(u.Code));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,62 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <autogenerated>
|
|
||||||
// This code was generated by a CodeSmith Template.
|
|
||||||
//
|
|
||||||
// DO NOT MODIFY contents of this file. Changes to this
|
|
||||||
// file will be lost if the code is regenerated.
|
|
||||||
// Author:Yubao Li
|
|
||||||
// </autogenerated>
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace OpenAuth.Domain
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public partial class ApplyTransitionHistory :Entity
|
|
||||||
{
|
|
||||||
public ApplyTransitionHistory()
|
|
||||||
{
|
|
||||||
this.AllowedToUserNames= string.Empty;
|
|
||||||
this.InitialState= string.Empty;
|
|
||||||
this.DestinationState= string.Empty;
|
|
||||||
this.Command= string.Empty;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public System.Guid ApplyId { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public System.Guid? UserId { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public string AllowedToUserNames { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public System.DateTime? TransitionTime { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public long Order { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public string InitialState { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public string DestinationState { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public string Command { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,36 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <autogenerated>
|
|
||||||
// This code was generated by a CodeSmith Template.
|
|
||||||
//
|
|
||||||
// DO NOT MODIFY contents of this file. Changes to this
|
|
||||||
// file will be lost if the code is regenerated.
|
|
||||||
// Author:Yubao Li
|
|
||||||
// </autogenerated>
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
using System;
|
|
||||||
|
|
||||||
namespace OpenAuth.Domain
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public partial class WorkflowScheme
|
|
||||||
{
|
|
||||||
public WorkflowScheme()
|
|
||||||
{
|
|
||||||
this.Code= string.Empty;
|
|
||||||
this.Scheme= string.Empty;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public string Code { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
///
|
|
||||||
/// </summary>
|
|
||||||
public string Scheme { get; set; }
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,12 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
|
|
||||||
namespace OpenAuth.Domain.Interface
|
|
||||||
{
|
|
||||||
public interface IWorkflowSchemeRepository : IRepository<WorkflowScheme>
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -42,14 +42,11 @@
|
|||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Core\ApplyTransitionHistory.cs" />
|
|
||||||
<Compile Include="Core\Category.cs" />
|
<Compile Include="Core\Category.cs" />
|
||||||
<Compile Include="Core\UserExt.cs" />
|
<Compile Include="Core\UserExt.cs" />
|
||||||
<Compile Include="Core\DicDetail.cs" />
|
<Compile Include="Core\DicDetail.cs" />
|
||||||
<Compile Include="Core\DicIndex.cs" />
|
<Compile Include="Core\DicIndex.cs" />
|
||||||
<Compile Include="Core\Entity.cs" />
|
<Compile Include="Core\Entity.cs" />
|
||||||
<Compile Include="Core\CommonApply.cs" />
|
|
||||||
<Compile Include="Interface\IWorkflowSchemeRepository.cs" />
|
|
||||||
<Compile Include="Interface\ICategoryRepository.cs" />
|
<Compile Include="Interface\ICategoryRepository.cs" />
|
||||||
<Compile Include="Interface\IModuleRepository.cs" />
|
<Compile Include="Interface\IModuleRepository.cs" />
|
||||||
<Compile Include="Interface\IOrgRepository.cs" />
|
<Compile Include="Interface\IOrgRepository.cs" />
|
||||||
@ -75,7 +72,6 @@
|
|||||||
<Compile Include="Service\ResManagerService.cs" />
|
<Compile Include="Service\ResManagerService.cs" />
|
||||||
<Compile Include="Service\StockManagerService.cs" />
|
<Compile Include="Service\StockManagerService.cs" />
|
||||||
<Compile Include="Service\WFFormService.cs" />
|
<Compile Include="Service\WFFormService.cs" />
|
||||||
<Compile Include="Service\WFSchemeService.cs" />
|
|
||||||
<Compile Include="Core\Stock.cs" />
|
<Compile Include="Core\Stock.cs" />
|
||||||
<Compile Include="Core\User.cs" />
|
<Compile Include="Core\User.cs" />
|
||||||
<Compile Include="Core\WFFrmMain.cs" />
|
<Compile Include="Core\WFFrmMain.cs" />
|
||||||
@ -85,7 +81,6 @@
|
|||||||
<Compile Include="Core\WFProcessTransitionHistory.cs" />
|
<Compile Include="Core\WFProcessTransitionHistory.cs" />
|
||||||
<Compile Include="Core\WFSchemeContent.cs" />
|
<Compile Include="Core\WFSchemeContent.cs" />
|
||||||
<Compile Include="Core\WFSchemeInfo.cs" />
|
<Compile Include="Core\WFSchemeInfo.cs" />
|
||||||
<Compile Include="Core\WorkflowScheme.cs" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
|
@ -6,6 +6,7 @@ using System.Web.UI.WebControls;
|
|||||||
using Infrastructure;
|
using Infrastructure;
|
||||||
using LeaRun.Util.WebControl;
|
using LeaRun.Util.WebControl;
|
||||||
using OpenAuth.App;
|
using OpenAuth.App;
|
||||||
|
using OpenAuth.App.SSO;
|
||||||
using OpenAuth.Domain;
|
using OpenAuth.Domain;
|
||||||
using OpenAuth.Domain.Service;
|
using OpenAuth.Domain.Service;
|
||||||
|
|
||||||
@ -149,6 +150,11 @@ namespace OpenAuth.Mvc.Areas.FlowManage.Controllers
|
|||||||
wfFlowInfoBLL.UpdateState(keyValue, State);
|
wfFlowInfoBLL.UpdateState(keyValue, State);
|
||||||
return Content("操作成功。");
|
return Content("操作成功。");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public string Load(int pageCurrent = 1, int pageSize = 30)
|
||||||
|
{
|
||||||
|
return JsonHelper.Instance.Serialize(wfFlowInfoBLL.Load(pageCurrent, pageSize));
|
||||||
|
}
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region 获取权限数据
|
#region 获取权限数据
|
||||||
|
@ -1,4 +1,61 @@
|
|||||||
@{
|
@{
|
||||||
|
Layout = "~/Views/Shared/_Layout.cshtml";
|
||||||
|
}
|
||||||
|
|
||||||
|
<!-- #section:basics/content.breadcrumbs -->
|
||||||
|
<div class="breadcrumbs" id="breadcrumbs">
|
||||||
|
<ul class="breadcrumb">
|
||||||
|
<li>
|
||||||
|
<i class="ace-icon fa fa-home home-icon"></i>
|
||||||
|
<a href="#">申请管理</a>
|
||||||
|
</li>
|
||||||
|
<li class="active">列表</li>
|
||||||
|
</ul><!-- /.breadcrumb -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- /section:basics/content.breadcrumbs -->
|
||||||
|
<div class="page-content">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12">
|
||||||
|
<div class="col-md-3">
|
||||||
|
<div class="widget-box widget-color-blue">
|
||||||
|
<div class="widget-header">
|
||||||
|
</div>
|
||||||
|
<div class="widget-body">
|
||||||
|
<div class="widget-main">
|
||||||
|
<ul id="orgtree" class="ztree" style="width: 100%"></ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-9">
|
||||||
|
<div class="widget-box widget-color-blue">
|
||||||
|
<div class="widget-header">
|
||||||
|
@Html.Action("MenuHeader", "Home", new {area=""})
|
||||||
|
</div>
|
||||||
|
<div class="widget-body gridwidth">
|
||||||
|
<div class="widget-main">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-md-12 ">
|
||||||
|
<table id="maingrid"></table>
|
||||||
|
<div id="grid-pager"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div><!-- /.page-content -->
|
||||||
|
|
||||||
|
<script src="~/BllScripts/grid.js"></script>
|
||||||
|
<script src="~/BllScripts/flowDesign.js"></script>
|
||||||
|
<script src="~/BllScripts/jqEvent.js"></script>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@{
|
||||||
ViewBag.Title = "流程设计管理";
|
ViewBag.Title = "流程设计管理";
|
||||||
Layout = "~/Views/Shared/_LayoutIndex.cshtml";
|
Layout = "~/Views/Shared/_LayoutIndex.cshtml";
|
||||||
}
|
}
|
||||||
|
122
OpenAuth.Mvc/BllScripts/flowDesign.js
Normal file
122
OpenAuth.Mvc/BllScripts/flowDesign.js
Normal file
@ -0,0 +1,122 @@
|
|||||||
|
//grid列表模块
|
||||||
|
function MainGrid() {
|
||||||
|
var url = '/workflowschemas/Load';
|
||||||
|
this.maingrid = $('#maingrid')
|
||||||
|
.jqGrid({
|
||||||
|
colModel: [
|
||||||
|
{ label: '主键', name: 'id', hidden: true },
|
||||||
|
{ label: '流程编号', name: 'schemecode', index: 'schemecode', width: 100, align: 'left' },
|
||||||
|
{ label: '流程名称', name: 'schemename', index: 'schemename', width: 150, align: 'left' },
|
||||||
|
{
|
||||||
|
label: "表单类型", name: "frmtype", index: "frmtype", width: 80, align: "left",
|
||||||
|
formatter: function (cellvalue, options, rowObject) {
|
||||||
|
return (cellvalue == 1 ? '系统表单' : '自定义表单')
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ label: '模板版本', name: 'schemeversion', index: 'schemeversion', width: 180, align: 'left' },
|
||||||
|
{ label: '状态Id', name: 'enabledmark', index: 'enabledmark', hidden: true },
|
||||||
|
{
|
||||||
|
label: "状态", name: "enabledmarklabel", index: "enabledmarklabel", width: 50, align: "center",
|
||||||
|
formatter: function (cellvalue, options, rowObject) {
|
||||||
|
if (rowObject.enabledmark == 1) {
|
||||||
|
return '<span class=\"label label-success\">启用</span>';
|
||||||
|
} else if (rowObject.enabledmark == 0) {
|
||||||
|
return '<span class=\"label label-danger\">停用</span>';
|
||||||
|
} else {
|
||||||
|
return '<span class=\"label label-info\">草稿</span>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
{ label: "最近编辑用户", name: "modifyusername", index: "modifyusername", width: 90, align: "left" },
|
||||||
|
{
|
||||||
|
label: "最近编辑时间", name: "modifydate", index: "modifydate", width: 150, align: "left",
|
||||||
|
formatter: function (cellvalue, options, rowObject) {
|
||||||
|
return formatDate(cellvalue, 'yyyy-MM-dd hh:mm:ss');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{ label: "创建用户", name: "createusername", index: "createusername", width: 80, align: "left" },
|
||||||
|
{
|
||||||
|
label: "创建时间", name: "createdate", index: "createdate", width: 150, align: "left",
|
||||||
|
formatter: function (cellvalue, options, rowObject) {
|
||||||
|
return formatDate(cellvalue, 'yyyy-MM-dd hh:mm:ss');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
{ label: "备注", name: "description", index: "description", width: 200, align: "left" }
|
||||||
|
|
||||||
|
],
|
||||||
|
url: url,
|
||||||
|
datatype: "json",
|
||||||
|
|
||||||
|
viewrecords: true,
|
||||||
|
rowNum: 18,
|
||||||
|
pager: "#grid-pager",
|
||||||
|
altRows: true,
|
||||||
|
height: 'auto',
|
||||||
|
multiselect: true,
|
||||||
|
multiboxonly: true,
|
||||||
|
|
||||||
|
loadComplete: function () {
|
||||||
|
var table = this;
|
||||||
|
setTimeout(function () {
|
||||||
|
updatePagerIcons(table);
|
||||||
|
},
|
||||||
|
0);
|
||||||
|
}
|
||||||
|
}).jqGrid('navGrid', "#grid-pager", {
|
||||||
|
edit: false, add: false, del: false, refresh: false, search: false
|
||||||
|
});
|
||||||
|
|
||||||
|
this.reload = function (id) {
|
||||||
|
this.maingrid.jqGrid("setGridParam", { url: url })
|
||||||
|
.trigger("reloadGrid", [{ page: 1 }]); //重载JQGrid
|
||||||
|
|
||||||
|
};
|
||||||
|
};
|
||||||
|
MainGrid.prototype = new Grid();
|
||||||
|
var list = new MainGrid();
|
||||||
|
var vm = new Vue({
|
||||||
|
el: '#editDlg'
|
||||||
|
});
|
||||||
|
|
||||||
|
//删除
|
||||||
|
function del() {
|
||||||
|
list.del("Code", "/WorkflowSchemas/Del", function () {
|
||||||
|
list.reload();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
//自定义的编辑按钮
|
||||||
|
function edit() {
|
||||||
|
var selected = list.getSelectedObj();
|
||||||
|
if (selected == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
title:selected.Code,
|
||||||
|
skin: 'layui-layer-rim', //加上边框
|
||||||
|
area: ['800px', '600px'], //宽高
|
||||||
|
maxmin: true, //开启最大化最小化按钮
|
||||||
|
content: '/designer/index?schemeName=' + selected.Code
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
function add() {
|
||||||
|
layer.open({
|
||||||
|
type: 2,
|
||||||
|
skin: 'layui-layer-rim', //加上边框
|
||||||
|
area: ['800px', '600px'], //宽高
|
||||||
|
maxmin: true, //开启最大化最小化按钮
|
||||||
|
content: '/designer/index?schemeName=',
|
||||||
|
end: function() {
|
||||||
|
list.reload();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,92 +0,0 @@
|
|||||||
//grid列表模块
|
|
||||||
function MainGrid() {
|
|
||||||
var url = '/workflowschemas/Load';
|
|
||||||
this.maingrid = $('#maingrid')
|
|
||||||
.jqGrid({
|
|
||||||
colModel: [
|
|
||||||
{
|
|
||||||
name: 'Id',
|
|
||||||
index: 'Id',
|
|
||||||
hidden: true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
index: 'Code',
|
|
||||||
name: 'Code',
|
|
||||||
label: '模板名称'
|
|
||||||
}
|
|
||||||
|
|
||||||
],
|
|
||||||
url: url,
|
|
||||||
datatype: "json",
|
|
||||||
|
|
||||||
viewrecords: true,
|
|
||||||
rowNum: 18,
|
|
||||||
pager: "#grid-pager",
|
|
||||||
altRows: true,
|
|
||||||
height: 'auto',
|
|
||||||
multiselect: true,
|
|
||||||
multiboxonly: true,
|
|
||||||
|
|
||||||
loadComplete: function () {
|
|
||||||
var table = this;
|
|
||||||
setTimeout(function () {
|
|
||||||
updatePagerIcons(table);
|
|
||||||
},
|
|
||||||
0);
|
|
||||||
}
|
|
||||||
}).jqGrid('navGrid', "#grid-pager", {
|
|
||||||
edit: false, add: false, del: false, refresh: false, search: false
|
|
||||||
});
|
|
||||||
|
|
||||||
this.reload = function (id) {
|
|
||||||
this.maingrid.jqGrid("setGridParam", { url: url })
|
|
||||||
.trigger("reloadGrid", [{ page: 1 }]); //重载JQGrid
|
|
||||||
|
|
||||||
};
|
|
||||||
};
|
|
||||||
MainGrid.prototype = new Grid();
|
|
||||||
var list = new MainGrid();
|
|
||||||
var vm = new Vue({
|
|
||||||
el: '#editDlg'
|
|
||||||
});
|
|
||||||
|
|
||||||
//删除
|
|
||||||
function del() {
|
|
||||||
list.del("Code", "/WorkflowSchemas/Del", function () {
|
|
||||||
list.reload();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
//自定义的编辑按钮
|
|
||||||
function edit() {
|
|
||||||
var selected = list.getSelectedObj();
|
|
||||||
if (selected == null) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
layer.open({
|
|
||||||
type: 2,
|
|
||||||
title:selected.Code,
|
|
||||||
skin: 'layui-layer-rim', //加上边框
|
|
||||||
area: ['800px', '600px'], //宽高
|
|
||||||
maxmin: true, //开启最大化最小化按钮
|
|
||||||
content: '/designer/index?schemeName=' + selected.Code
|
|
||||||
});
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
function add() {
|
|
||||||
layer.open({
|
|
||||||
type: 2,
|
|
||||||
skin: 'layui-layer-rim', //加上边框
|
|
||||||
area: ['800px', '600px'], //宽高
|
|
||||||
maxmin: true, //开启最大化最小化按钮
|
|
||||||
content: '/designer/index?schemeName=',
|
|
||||||
end: function() {
|
|
||||||
list.reload();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1,56 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Specialized;
|
|
||||||
using System.Configuration;
|
|
||||||
using System.IO;
|
|
||||||
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;
|
|
||||||
using OptimaJet.Workflow.Core.Runtime;
|
|
||||||
using OptimaJet.Workflow.DbPersistence;
|
|
||||||
using WorkflowRuntime = OptimaJet.Workflow.Core.Runtime.WorkflowRuntime;
|
|
||||||
|
|
||||||
namespace OpenAuth.Mvc.Controllers
|
|
||||||
{
|
|
||||||
public class DesignerController : BaseController
|
|
||||||
{
|
|
||||||
public ActionResult Index(string schemeName)
|
|
||||||
{
|
|
||||||
return View();
|
|
||||||
}
|
|
||||||
|
|
||||||
public ActionResult API()
|
|
||||||
{
|
|
||||||
Stream filestream = null;
|
|
||||||
if (Request.Files.Count > 0)
|
|
||||||
filestream = Request.Files[0].InputStream;
|
|
||||||
|
|
||||||
var pars = new NameValueCollection();
|
|
||||||
pars.Add(Request.Params);
|
|
||||||
|
|
||||||
if (Request.HttpMethod.Equals("POST", StringComparison.InvariantCultureIgnoreCase))
|
|
||||||
{
|
|
||||||
var parsKeys = pars.AllKeys;
|
|
||||||
foreach (var key in Request.Form.AllKeys)
|
|
||||||
{
|
|
||||||
if (!parsKeys.Contains(key))
|
|
||||||
{
|
|
||||||
pars.Add(Request.Form);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var res = WorkflowInit.Runtime.DesignerAPI(pars, filestream, true);
|
|
||||||
if (pars["operation"].ToLower() == "downloadscheme")
|
|
||||||
return File(Encoding.UTF8.GetBytes(res), "text/xml", "scheme.xml");
|
|
||||||
return Content(res);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,45 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Web.Mvc;
|
|
||||||
using Infrastructure;
|
|
||||||
using OpenAuth.App;
|
|
||||||
|
|
||||||
namespace OpenAuth.Mvc.Controllers
|
|
||||||
{
|
|
||||||
public class WorkflowSchemasController : BaseController
|
|
||||||
{
|
|
||||||
private WorkflowSchemasManagerApp _app;
|
|
||||||
|
|
||||||
public WorkflowSchemasController()
|
|
||||||
{
|
|
||||||
_app = AutofacExt.GetFromFac<WorkflowSchemasManagerApp>();
|
|
||||||
}
|
|
||||||
public ActionResult Index()
|
|
||||||
{
|
|
||||||
return View();
|
|
||||||
}
|
|
||||||
|
|
||||||
public string Load(int pageCurrent = 1, int pageSize = 30)
|
|
||||||
{
|
|
||||||
return JsonHelper.Instance.Serialize(_app.Load(pageCurrent, pageSize));
|
|
||||||
}
|
|
||||||
|
|
||||||
[HttpPost]
|
|
||||||
public string Del(string[] ids)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
_app.Del(ids);
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
Result.Status = false;
|
|
||||||
Result.Message = e.Message;
|
|
||||||
}
|
|
||||||
|
|
||||||
return JsonHelper.Instance.Serialize(Result);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@ -1,45 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using OptimaJet.Workflow.Core.Cache;
|
|
||||||
using OptimaJet.Workflow.Core.Model;
|
|
||||||
|
|
||||||
namespace OpenAuth.Mvc.Models
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 流程定义的缓存
|
|
||||||
/// <para>李玉宝新增于2016-09-28 17:15:45</para>
|
|
||||||
/// </summary>
|
|
||||||
public sealed class DefaultParcedProcessCache : IParsedProcessCache
|
|
||||||
{
|
|
||||||
private Dictionary<Guid, ProcessDefinition> _cache;
|
|
||||||
|
|
||||||
public void Clear()
|
|
||||||
{
|
|
||||||
_cache.Clear();
|
|
||||||
}
|
|
||||||
|
|
||||||
public ProcessDefinition GetProcessDefinitionBySchemeId(Guid schemeId)
|
|
||||||
{
|
|
||||||
if (_cache == null)
|
|
||||||
return null;
|
|
||||||
if (_cache.ContainsKey(schemeId))
|
|
||||||
return _cache[schemeId];
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void AddProcessDefinition(Guid schemeId, ProcessDefinition processDefinition)
|
|
||||||
{
|
|
||||||
if (_cache == null)
|
|
||||||
{
|
|
||||||
_cache = new Dictionary<Guid, ProcessDefinition> {{schemeId, processDefinition}};
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (_cache.ContainsKey(schemeId))
|
|
||||||
_cache[schemeId] = processDefinition;
|
|
||||||
else
|
|
||||||
_cache.Add(schemeId, processDefinition);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,146 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Data.Entity.Validation;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Text;
|
|
||||||
using OpenAuth.App;
|
|
||||||
using OpenAuth.Domain;
|
|
||||||
using OptimaJet.Workflow.Core.Model;
|
|
||||||
using OptimaJet.Workflow.Core.Runtime;
|
|
||||||
|
|
||||||
namespace OpenAuth.Mvc.Models
|
|
||||||
{
|
|
||||||
public class WorkflowActionProvider :IWorkflowActionProvider
|
|
||||||
{
|
|
||||||
private ModuleManagerApp _app;
|
|
||||||
|
|
||||||
public WorkflowActionProvider()
|
|
||||||
{
|
|
||||||
_app = AutofacExt.GetFromFac<ModuleManagerApp>();
|
|
||||||
}
|
|
||||||
public void ExecuteAction(string name, ProcessInstance processInstance, WorkflowRuntime runtime, string actionParameter)
|
|
||||||
{
|
|
||||||
if (_actions.ContainsKey(name))
|
|
||||||
{
|
|
||||||
_actions[name].Invoke(processInstance, actionParameter);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool ExecuteCondition(string name, ProcessInstance processInstance, WorkflowRuntime runtime, string actionParameter)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<string> GetActions()
|
|
||||||
{
|
|
||||||
return _actions.Keys.ToList();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static Dictionary<string, Action<ProcessInstance, string>> _actions = new Dictionary
|
|
||||||
<string, Action<ProcessInstance, string>>
|
|
||||||
{
|
|
||||||
{"创建流程记录", WriteTransitionHistory}, //仅用于PreExecution,创建流程初始转换列表
|
|
||||||
{"更新流程记录", UpdateTransitionHistory}
|
|
||||||
};
|
|
||||||
|
|
||||||
private static ApplyTransitionHistoryApp _applyTransitionHistoryApp = AutofacExt.GetFromFac<ApplyTransitionHistoryApp>();
|
|
||||||
|
|
||||||
public static void WriteTransitionHistory(ProcessInstance processInstance, string parameter)
|
|
||||||
{
|
|
||||||
if (processInstance.IdentityIds == null)
|
|
||||||
return;
|
|
||||||
|
|
||||||
var currentstate = WorkflowInit.Runtime.GetLocalizedStateName(processInstance.ProcessId, processInstance.CurrentState);
|
|
||||||
|
|
||||||
var nextState = WorkflowInit.Runtime.GetLocalizedStateName(processInstance.ProcessId, processInstance.ExecutedActivityState);
|
|
||||||
|
|
||||||
var command = WorkflowInit.Runtime.GetLocalizedCommandName(processInstance.ProcessId, processInstance.CurrentCommand);
|
|
||||||
|
|
||||||
|
|
||||||
var historyItem = new ApplyTransitionHistory
|
|
||||||
{
|
|
||||||
Id = Guid.NewGuid(),
|
|
||||||
AllowedToUserNames = GetEmployeesString(processInstance.IdentityIds),
|
|
||||||
DestinationState = nextState,
|
|
||||||
ApplyId = processInstance.ProcessId,
|
|
||||||
InitialState = currentstate,
|
|
||||||
Command = command
|
|
||||||
};
|
|
||||||
_applyTransitionHistoryApp.Add(historyItem);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
private static string GetEmployeesString(IEnumerable<string> identities)
|
|
||||||
{
|
|
||||||
var identitiesGuid = identities.Select(c => new Guid(c));
|
|
||||||
var app = AutofacExt.GetFromFac<UserManagerApp>();
|
|
||||||
|
|
||||||
var employees = app.GetUsers(identitiesGuid);
|
|
||||||
|
|
||||||
var sb = new StringBuilder();
|
|
||||||
bool isFirst = true;
|
|
||||||
foreach (var employee in employees)
|
|
||||||
{
|
|
||||||
if (!isFirst)
|
|
||||||
sb.Append(",");
|
|
||||||
isFirst = false;
|
|
||||||
|
|
||||||
sb.Append(employee.Name);
|
|
||||||
}
|
|
||||||
|
|
||||||
return sb.ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void UpdateTransitionHistory(ProcessInstance processInstance, string parameter)
|
|
||||||
{
|
|
||||||
var currentstate = WorkflowInit.Runtime.GetLocalizedStateName(processInstance.ProcessId, processInstance.CurrentState);
|
|
||||||
|
|
||||||
var nextState = WorkflowInit.Runtime.GetLocalizedStateName(processInstance.ProcessId, processInstance.ExecutedActivityState);
|
|
||||||
|
|
||||||
var command = WorkflowInit.Runtime.GetLocalizedCommandName(processInstance.ProcessId, processInstance.CurrentCommand);
|
|
||||||
|
|
||||||
var isTimer = !string.IsNullOrEmpty(processInstance.ExecutedTimer);
|
|
||||||
|
|
||||||
var historyItem = _applyTransitionHistoryApp.Get(processInstance.ProcessId, currentstate, nextState);
|
|
||||||
|
|
||||||
if (historyItem == null)
|
|
||||||
{
|
|
||||||
historyItem = new ApplyTransitionHistory()
|
|
||||||
{
|
|
||||||
Id = Guid.NewGuid(),
|
|
||||||
AllowedToUserNames = string.Empty,
|
|
||||||
DestinationState = nextState,
|
|
||||||
ApplyId = processInstance.ProcessId,
|
|
||||||
InitialState = currentstate
|
|
||||||
};
|
|
||||||
|
|
||||||
_applyTransitionHistoryApp.Add(historyItem);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
historyItem.Command = !isTimer ? command : string.Format("Timer: {0}", processInstance.ExecutedTimer);
|
|
||||||
historyItem.TransitionTime = DateTime.Now;
|
|
||||||
|
|
||||||
if (string.IsNullOrWhiteSpace(processInstance.IdentityId))
|
|
||||||
historyItem.UserId = null;
|
|
||||||
else
|
|
||||||
historyItem.UserId = new Guid(processInstance.IdentityId);
|
|
||||||
|
|
||||||
try
|
|
||||||
{
|
|
||||||
_applyTransitionHistoryApp.Update(historyItem);
|
|
||||||
}
|
|
||||||
catch (DbEntityValidationException e)
|
|
||||||
{
|
|
||||||
Console.WriteLine(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
internal static void DeleteEmptyPreHistory(Guid processId)
|
|
||||||
{
|
|
||||||
_applyTransitionHistoryApp.DeleteByProcess(processId);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,110 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Configuration;
|
|
||||||
using System.Xml.Linq;
|
|
||||||
using OpenAuth.App;
|
|
||||||
using OpenAuth.Domain;
|
|
||||||
using OptimaJet.Workflow.Core.Builder;
|
|
||||||
using OptimaJet.Workflow.Core.Bus;
|
|
||||||
using OptimaJet.Workflow.Core.Persistence;
|
|
||||||
using OptimaJet.Workflow.Core.Runtime;
|
|
||||||
using OptimaJet.Workflow.DbPersistence;
|
|
||||||
|
|
||||||
namespace OpenAuth.Mvc.Models
|
|
||||||
{
|
|
||||||
public static 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)
|
|
||||||
);
|
|
||||||
builder.SetCache(new DefaultParcedProcessCache());
|
|
||||||
|
|
||||||
_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();
|
|
||||||
_runtime.ProcessStatusChanged += _runtime_ProcessStatusChanged;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return _runtime;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void _runtime_ProcessStatusChanged(object sender, ProcessStatusChangedEventArgs e)
|
|
||||||
{
|
|
||||||
if (e.NewStatus != ProcessStatus.Idled && e.NewStatus != ProcessStatus.Finalized)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(e.SchemeCode))
|
|
||||||
return;
|
|
||||||
|
|
||||||
//创建流程状态转换记录
|
|
||||||
WorkflowActionProvider.DeleteEmptyPreHistory(e.ProcessId);
|
|
||||||
_runtime.PreExecuteFromCurrentActivity(e.ProcessId);
|
|
||||||
|
|
||||||
//更新通知列表
|
|
||||||
UpdateInbox(e);
|
|
||||||
|
|
||||||
//更改申请的状态
|
|
||||||
UpdateApplyState(e);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 更新申请状态
|
|
||||||
/// </summary>
|
|
||||||
private static void UpdateApplyState(ProcessStatusChangedEventArgs e)
|
|
||||||
{
|
|
||||||
var nextState = WorkflowInit.Runtime.GetLocalizedStateName(e.ProcessId, e.ProcessInstance.CurrentState);
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 更新通知列表
|
|
||||||
/// </summary>
|
|
||||||
private static void UpdateInbox(ProcessStatusChangedEventArgs e)
|
|
||||||
{
|
|
||||||
var inboxApp = AutofacExt.GetFromFac<WorkflowInboxApp>();
|
|
||||||
inboxApp.DeleteAllByProcess(e.ProcessId);
|
|
||||||
|
|
||||||
if (e.NewStatus != ProcessStatus.Finalized)
|
|
||||||
{
|
|
||||||
var newActors = Runtime.GetAllActorsForDirectCommandTransitions(e.ProcessId);
|
|
||||||
foreach (var newActor in newActors)
|
|
||||||
{
|
|
||||||
var newInboxItem = new Relevance()
|
|
||||||
{
|
|
||||||
Id = Guid.NewGuid(),
|
|
||||||
SecondId = new Guid(newActor),
|
|
||||||
FirstId = e.ProcessId,
|
|
||||||
Key = "ProcessUser"
|
|
||||||
};
|
|
||||||
|
|
||||||
inboxApp.Add(newInboxItem);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,65 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using System.Linq;
|
|
||||||
using OpenAuth.App;
|
|
||||||
using OptimaJet.Workflow.Core.Model;
|
|
||||||
using OptimaJet.Workflow.Core.Runtime;
|
|
||||||
|
|
||||||
namespace OpenAuth.Mvc.Models
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// 流程角色处理
|
|
||||||
/// </summary>
|
|
||||||
public class WorkflowRuleProvider : IWorkflowRuleProvider
|
|
||||||
{
|
|
||||||
private RoleManagerApp _app;
|
|
||||||
|
|
||||||
public WorkflowRuleProvider()
|
|
||||||
{
|
|
||||||
_app = AutofacExt.GetFromFac<RoleManagerApp>();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 加载角色列表,供流程设计的时候进行选择
|
|
||||||
/// </summary>
|
|
||||||
public List<string> GetRules()
|
|
||||||
{
|
|
||||||
var roles = _app.Load(Guid.Empty, 1, 100).rows;
|
|
||||||
var rolestrs = new List<string>();
|
|
||||||
foreach (var role in roles)
|
|
||||||
{
|
|
||||||
rolestrs.Add(role.Name);
|
|
||||||
}
|
|
||||||
return rolestrs;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Checks the specified process instance.
|
|
||||||
/// <para>李玉宝于2016-09-05 16:43:07</para>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="processInstance">The process instance.</param>
|
|
||||||
/// <param name="runtime">The runtime.</param>
|
|
||||||
/// <param name="identityId">用户ID</param>
|
|
||||||
/// <param name="ruleName">Name of the rule.</param>
|
|
||||||
/// <param name="parameter">The parameter.</param>
|
|
||||||
/// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
|
|
||||||
public bool Check(ProcessInstance processInstance, WorkflowRuntime runtime, string identityId, string ruleName,
|
|
||||||
string parameter)
|
|
||||||
{
|
|
||||||
var userRole = _app.LoadForUser(Guid.Parse(identityId));
|
|
||||||
foreach (var role in userRole)
|
|
||||||
{
|
|
||||||
if (role.Name == ruleName)
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public IEnumerable<string> GetIdentities(ProcessInstance processInstance, WorkflowRuntime runtime, string ruleName, string parameter)
|
|
||||||
{
|
|
||||||
var userids = _app.GetUsersInRole(ruleName);
|
|
||||||
if (userids == null) return null;
|
|
||||||
return userids.Select(u => u.ToString());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -73,14 +73,6 @@
|
|||||||
<SpecificVersion>False</SpecificVersion>
|
<SpecificVersion>False</SpecificVersion>
|
||||||
<HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
|
<HintPath>..\packages\Newtonsoft.Json.7.0.1\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="OptimaJet.Workflow.Core, Version=1.5.5.0, Culture=neutral, PublicKeyToken=3d29392dccd464d7, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\WorkflowEngine.NET-Core.1.5.5.2\lib\net45\OptimaJet.Workflow.Core.dll</HintPath>
|
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="OptimaJet.Workflow.DbPersistence, Version=1.5.5.0, Culture=neutral, PublicKeyToken=3d29392dccd464d7, processorArchitecture=MSIL">
|
|
||||||
<HintPath>..\packages\WorkflowEngine.NET-ProviderForMSSQL.1.5.5.2\lib\net45\OptimaJet.Workflow.DbPersistence.dll</HintPath>
|
|
||||||
<Private>True</Private>
|
|
||||||
</Reference>
|
|
||||||
<Reference Include="System" />
|
<Reference Include="System" />
|
||||||
<Reference Include="System.Data" />
|
<Reference Include="System.Data" />
|
||||||
<Reference Include="System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
<Reference Include="System.Net.Http.Formatting, Version=5.2.3.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||||
@ -158,8 +150,6 @@
|
|||||||
<Compile Include="AutofacExt.cs" />
|
<Compile Include="AutofacExt.cs" />
|
||||||
<Compile Include="Controllers\BaseController.cs" />
|
<Compile Include="Controllers\BaseController.cs" />
|
||||||
<Compile Include="Controllers\CategoryManagerController.cs" />
|
<Compile Include="Controllers\CategoryManagerController.cs" />
|
||||||
<Compile Include="Controllers\WorkflowSchemasController.cs" />
|
|
||||||
<Compile Include="Controllers\DesignerController.cs" />
|
|
||||||
<Compile Include="Controllers\ErrorController.cs" />
|
<Compile Include="Controllers\ErrorController.cs" />
|
||||||
<Compile Include="Areas\FlowManage\Controllers\CommonAppliesController.cs" />
|
<Compile Include="Areas\FlowManage\Controllers\CommonAppliesController.cs" />
|
||||||
<Compile Include="Controllers\HomeController.cs" />
|
<Compile Include="Controllers\HomeController.cs" />
|
||||||
@ -172,11 +162,7 @@
|
|||||||
<Compile Include="Controllers\RoleManagerController.cs" />
|
<Compile Include="Controllers\RoleManagerController.cs" />
|
||||||
<Compile Include="Controllers\StockManagerController.cs" />
|
<Compile Include="Controllers\StockManagerController.cs" />
|
||||||
<Compile Include="Controllers\UserManagerController.cs" />
|
<Compile Include="Controllers\UserManagerController.cs" />
|
||||||
<Compile Include="Models\DefaultParcedProcessCache.cs" />
|
|
||||||
<Compile Include="Models\JobjectModelBinder.cs" />
|
<Compile Include="Models\JobjectModelBinder.cs" />
|
||||||
<Compile Include="Models\WorkflowActionProvider.cs" />
|
|
||||||
<Compile Include="Models\WorkflowInit.cs" />
|
|
||||||
<Compile Include="Models\WorkflowRuleProvider.cs" />
|
|
||||||
<Compile Include="Global.asax.cs">
|
<Compile Include="Global.asax.cs">
|
||||||
<DependentUpon>Global.asax</DependentUpon>
|
<DependentUpon>Global.asax</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@ -207,7 +193,7 @@
|
|||||||
<Content Include="BllScripts\resourceManager.js" />
|
<Content Include="BllScripts\resourceManager.js" />
|
||||||
<Content Include="BllScripts\roleManager.js" />
|
<Content Include="BllScripts\roleManager.js" />
|
||||||
<Content Include="BllScripts\commonApply.js" />
|
<Content Include="BllScripts\commonApply.js" />
|
||||||
<Content Include="BllScripts\workflowSchemaManager.js" />
|
<Content Include="BllScripts\flowDesign.js" />
|
||||||
<Content Include="BllScripts\stockManager.js" />
|
<Content Include="BllScripts\stockManager.js" />
|
||||||
<Content Include="BllScripts\usermanager.js" />
|
<Content Include="BllScripts\usermanager.js" />
|
||||||
<Content Include="BllScripts\assignRes.js" />
|
<Content Include="BllScripts\assignRes.js" />
|
||||||
@ -1273,7 +1259,6 @@
|
|||||||
<Content Include="Images\login\bg.jpg" />
|
<Content Include="Images\login\bg.jpg" />
|
||||||
<Content Include="Images\x.png" />
|
<Content Include="Images\x.png" />
|
||||||
<Content Include="Scripts\ace.js" />
|
<Content Include="Scripts\ace.js" />
|
||||||
<Content Include="Scripts\designerconstants.js" />
|
|
||||||
<Content Include="Scripts\ext-searchbox.js" />
|
<Content Include="Scripts\ext-searchbox.js" />
|
||||||
<Content Include="Scripts\jquery-ui.js" />
|
<Content Include="Scripts\jquery-ui.js" />
|
||||||
<Content Include="Scripts\jquery.js" />
|
<Content Include="Scripts\jquery.js" />
|
||||||
@ -1282,7 +1267,6 @@
|
|||||||
<Content Include="Scripts\mode-csharp.js" />
|
<Content Include="Scripts\mode-csharp.js" />
|
||||||
<Content Include="Scripts\mode-json.js" />
|
<Content Include="Scripts\mode-json.js" />
|
||||||
<Content Include="Scripts\theme-monokai.js" />
|
<Content Include="Scripts\theme-monokai.js" />
|
||||||
<Content Include="Scripts\workflowdesigner.min.js" />
|
|
||||||
<Content Include="Views\CategoryManager\Index.cshtml" />
|
<Content Include="Views\CategoryManager\Index.cshtml" />
|
||||||
<Content Include="fonts\glyphicons-halflings-regular.eot" />
|
<Content Include="fonts\glyphicons-halflings-regular.eot" />
|
||||||
<Content Include="fonts\glyphicons-halflings-regular.ttf" />
|
<Content Include="fonts\glyphicons-halflings-regular.ttf" />
|
||||||
@ -1522,7 +1506,6 @@
|
|||||||
<Content Include="Areas\FlowManage\Views\FlowMyProcess\ProcessLookForm.cshtml" />
|
<Content Include="Areas\FlowManage\Views\FlowMyProcess\ProcessLookForm.cshtml" />
|
||||||
<Content Include="Areas\FlowManage\Views\CommonApplies\ProcessLookForm.cshtml" />
|
<Content Include="Areas\FlowManage\Views\CommonApplies\ProcessLookForm.cshtml" />
|
||||||
<None Include="Properties\PublishProfiles\default.pubxml" />
|
<None Include="Properties\PublishProfiles\default.pubxml" />
|
||||||
<Content Include="Views\Designer\Index.cshtml" />
|
|
||||||
<None Include="Views\Error\NoAccess.cshtml" />
|
<None Include="Views\Error\NoAccess.cshtml" />
|
||||||
<Content Include="Views\Home\git.cshtml" />
|
<Content Include="Views\Home\git.cshtml" />
|
||||||
<Content Include="Web.config">
|
<Content Include="Web.config">
|
||||||
@ -1543,7 +1526,6 @@
|
|||||||
<Content Include="Views\StockManager\Index.cshtml" />
|
<Content Include="Views\StockManager\Index.cshtml" />
|
||||||
<Content Include="Views\Shared\_Layout.cshtml" />
|
<Content Include="Views\Shared\_Layout.cshtml" />
|
||||||
<Content Include="Areas\FlowManage\Views\CommonApplies\Index.cshtml" />
|
<Content Include="Areas\FlowManage\Views\CommonApplies\Index.cshtml" />
|
||||||
<Content Include="Views\WorkflowSchemas\Index.cshtml" />
|
|
||||||
<Content Include="Views\Home\Navbar.cshtml" />
|
<Content Include="Views\Home\Navbar.cshtml" />
|
||||||
<Content Include="Views\Shared\Blank.cshtml" />
|
<Content Include="Views\Shared\Blank.cshtml" />
|
||||||
<Content Include="Views\Shared\_LayoutNoHeader.cshtml" />
|
<Content Include="Views\Shared\_LayoutNoHeader.cshtml" />
|
||||||
|
@ -1,186 +0,0 @@
|
|||||||
var WorkflowDesignerConstants = {
|
|
||||||
SelectColor: 'purple',
|
|
||||||
ActivityColor: '#F2F2F2',
|
|
||||||
ActivityInitialColor: '#00ff00',
|
|
||||||
ActivityFinalColor: '#ff0000',
|
|
||||||
ActivityCurrentColor: '#00CCCC',
|
|
||||||
|
|
||||||
DeleteConfirm: '确定要删除所选项?',
|
|
||||||
FieldIsRequired: 'Field is required!',
|
|
||||||
FieldMustBeUnique: 'Field must be unique!',
|
|
||||||
ButtonTextDelete: '删除',
|
|
||||||
ButtonTextCreate: '创建',
|
|
||||||
|
|
||||||
InfoBlockLabel: {
|
|
||||||
Activity: '节点: ',
|
|
||||||
Transition: '状态转换: ',
|
|
||||||
Command: '命令: ',
|
|
||||||
},
|
|
||||||
|
|
||||||
ActivityNamePrefix: 'Activity_',
|
|
||||||
ActivityFormLabel: {
|
|
||||||
Title: '节点',
|
|
||||||
Name: '名称',
|
|
||||||
State: '状态',
|
|
||||||
IsInitial: '是否为初始节点',
|
|
||||||
IsFinal: '是否为完成节点',
|
|
||||||
IsForSetState: '是否修改状态',
|
|
||||||
IsAutoSchemeUpdate: '是否自动更新',
|
|
||||||
Implementation: '执行操作',
|
|
||||||
PreExecutionImplementation: '提前执行操作',
|
|
||||||
ImpOrder: '序号',
|
|
||||||
ImpAction: '操作',
|
|
||||||
ImpActionParameter: '操作参数',
|
|
||||||
AlwaysConditionShouldBeSingle: 'Always condition should be single',
|
|
||||||
OtherwiseConditionShouldBeSingle: 'Otherwise condition should be single'
|
|
||||||
|
|
||||||
},
|
|
||||||
|
|
||||||
TransitionFormLabel: {
|
|
||||||
Title: '状态转换',
|
|
||||||
Name: '名称',
|
|
||||||
From: '上一步',
|
|
||||||
To: '下一步',
|
|
||||||
Classifier: '类型',
|
|
||||||
Restrictions: '限制条件',
|
|
||||||
RestrictionsType: '类型',
|
|
||||||
RestrictionsActor: '执行人',
|
|
||||||
Condition: '转换条件',
|
|
||||||
ConditionType: '类型',
|
|
||||||
ConditionAction: '操作',
|
|
||||||
ResultOnPreExecution: 'Result on PreExecution',
|
|
||||||
Trigger: '触发',
|
|
||||||
TriggerType: '触发类型',
|
|
||||||
TriggerCommand: '命令',
|
|
||||||
TriggerTimer: '定时',
|
|
||||||
ConditionActionParameter: '操作参数',
|
|
||||||
ConditionInversion: '转换执行结果',
|
|
||||||
ConditionsConcatenationType: 'Conditions concatenation type',
|
|
||||||
AllowConcatenationType: 'Concat allow as',
|
|
||||||
RestrictConcatenationType: 'Concat restrict as',
|
|
||||||
ConditionsListShouldNotBeEmpty: 'Conditions list should not be empty',
|
|
||||||
IsFork: 'Is fork',
|
|
||||||
MergeViaSetState: 'Merge subprocess via set state',
|
|
||||||
DisableParentStateControl: 'Disable parent process control'
|
|
||||||
|
|
||||||
},
|
|
||||||
LocalizationFormLabel: {
|
|
||||||
Title: 'Localization',
|
|
||||||
ObjectName: 'ObjectName',
|
|
||||||
Type: 'Type',
|
|
||||||
IsDefault: 'IsDefault',
|
|
||||||
Culture: 'Culture',
|
|
||||||
Value: 'Value',
|
|
||||||
Types: ['Command', 'State', 'Parameter'],
|
|
||||||
},
|
|
||||||
|
|
||||||
TimerFormLabel: {
|
|
||||||
Title: 'Timers',
|
|
||||||
Name: 'Name',
|
|
||||||
Type: 'Type',
|
|
||||||
Value: 'Value',
|
|
||||||
Types: ['Command', 'State', 'Parameter'],
|
|
||||||
NotOverrideIfExists: "Do not override timer if exists"
|
|
||||||
},
|
|
||||||
|
|
||||||
ParameterFormLabel: {
|
|
||||||
Title: '系统参数',
|
|
||||||
Name: 'Name',
|
|
||||||
Type: 'Type',
|
|
||||||
Purpose: 'Purpose',
|
|
||||||
Value: 'Value',
|
|
||||||
InitialValue: '默认值'
|
|
||||||
},
|
|
||||||
|
|
||||||
ActorFormLabel: {
|
|
||||||
Title: '执行人',
|
|
||||||
Name: '名称',
|
|
||||||
Rule: 'Rule',
|
|
||||||
Value: 'Value'
|
|
||||||
},
|
|
||||||
|
|
||||||
CommandFormLabel: {
|
|
||||||
Title: '命令',
|
|
||||||
Name: "名称",
|
|
||||||
InputParameters: "Input Parameters",
|
|
||||||
InputParametersName: 'Name',
|
|
||||||
InputParametersParameter: 'Parameter'
|
|
||||||
},
|
|
||||||
|
|
||||||
AdditionalParamsFormLabel: {
|
|
||||||
Title: 'Additional Parameters',
|
|
||||||
IsObsolete: "IsObsolete",
|
|
||||||
DefiningParameters: 'Defining parameters',
|
|
||||||
ProcessParameters: 'Process parameters',
|
|
||||||
ProcessParametersName: 'Name',
|
|
||||||
ProcessParametersValue: 'Value'
|
|
||||||
},
|
|
||||||
CodeActionsFormLabel: {
|
|
||||||
Title: '代码片段',
|
|
||||||
Name: 'Name',
|
|
||||||
ActionCode: 'Action code',
|
|
||||||
IsGlobal: 'Is global',
|
|
||||||
Type: 'Type'
|
|
||||||
},
|
|
||||||
|
|
||||||
ToolbarLabel: {
|
|
||||||
CreateActivity: '创建节点',
|
|
||||||
CopySelected: '复制所选',
|
|
||||||
Undo: '撤销',
|
|
||||||
Redo: '重做',
|
|
||||||
Move: '移动',
|
|
||||||
ZoomIn: '放大',
|
|
||||||
ZoomOut: '缩小',
|
|
||||||
ZoomPositionDefault: '默认大小',
|
|
||||||
AutoArrangement: '自动排列',
|
|
||||||
Actors: '执行人',
|
|
||||||
Commands: '命令',
|
|
||||||
Parameters: '参数',
|
|
||||||
Localization: '本地化',
|
|
||||||
Timers: '定时器',
|
|
||||||
AdditionalParameters: '附加参数',
|
|
||||||
CodeActions: '代码片段'
|
|
||||||
},
|
|
||||||
ErrorActivityIsInitialCountText: "One element must be marked flag Initial",
|
|
||||||
ErrorReadOnlySaveText: "The Designer in ReadOnly mode, you can't save it.",
|
|
||||||
FormMaxHeight: 500,
|
|
||||||
EditCodeSettings: {
|
|
||||||
Height: 600,
|
|
||||||
Width: 1000,
|
|
||||||
CodeHeight: 390,
|
|
||||||
MessageBoxHeight: 400,
|
|
||||||
MessageBoxWidth: 600,
|
|
||||||
SuccessBoxHeight: 150,
|
|
||||||
SuccessBoxWidth: 300
|
|
||||||
},
|
|
||||||
EditCodeLabel: {
|
|
||||||
Title: "Edit code",
|
|
||||||
EditCodeButton: 'Edit code',
|
|
||||||
Usings: 'Usings',
|
|
||||||
Compile: "Compile",
|
|
||||||
CompileSucceeded: "Compilation succeeded.",
|
|
||||||
Success: "Success",
|
|
||||||
Error: "Error",
|
|
||||||
OK: "OK"
|
|
||||||
},
|
|
||||||
|
|
||||||
EditJSONSettings: {
|
|
||||||
Height: 600,
|
|
||||||
Width: 1000,
|
|
||||||
CodeHeight: 390,
|
|
||||||
MessageBoxHeight: 400,
|
|
||||||
MessageBoxWidth: 600,
|
|
||||||
SuccessBoxHeight: 150,
|
|
||||||
SuccessBoxWidth: 300
|
|
||||||
},
|
|
||||||
EditJSONLabel: {
|
|
||||||
Title: "Edit code",
|
|
||||||
EditCodeButton: 'Edit code',
|
|
||||||
Usings: 'Usings',
|
|
||||||
Compile: "Compile",
|
|
||||||
CompileSucceeded: "Compilation succeeded.",
|
|
||||||
Success: "Success",
|
|
||||||
Error: "Error",
|
|
||||||
OK: "OK"
|
|
||||||
}
|
|
||||||
};
|
|
3
OpenAuth.Mvc/Scripts/workflowdesigner.min.js
vendored
3
OpenAuth.Mvc/Scripts/workflowdesigner.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,95 +0,0 @@
|
|||||||
@{
|
|
||||||
Layout = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
<script src="/Scripts/jquery.js"></script>
|
|
||||||
<script src="/Scripts/jquery-ui.js"></script>
|
|
||||||
<script src="/Scripts/kinetic-v5.1.0.min.js"></script>
|
|
||||||
<script src="/Scripts/workflowdesigner.min.js"></script>
|
|
||||||
<script src="/Scripts/designerconstants.js"></script>
|
|
||||||
<script src="/Scripts/ace.js"></script>
|
|
||||||
<script src="/Scripts/json5.js"></script>
|
|
||||||
<script src="/BllScripts/queryString.js"></script>
|
|
||||||
|
|
||||||
<link href="/Content/style.css" rel="stylesheet" />
|
|
||||||
<link href="/Content/plugins/jQueryUI/base/jquery-ui.min.css" rel="stylesheet" />
|
|
||||||
<link href="/Content/workflowdesigner.css" rel="stylesheet" type="text/css"/>
|
|
||||||
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<td>大小:</td>
|
|
||||||
<td><input id="graphwidth" value="1200" /> x <input id="graphheight" value="600" /></td>
|
|
||||||
<td><button onclick="wfdesignerRedraw()">缩放</button></td>
|
|
||||||
<td>
|
|
||||||
|
|
|
||||||
</td>
|
|
||||||
<td><label class="msg-wrap">*模板名称</label></td>
|
|
||||||
<td><input value="" id="schemeName" /></td>
|
|
||||||
<td><button class="btn btn-primary" onclick="OnSave()">保存</button></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<br />
|
|
||||||
<div id="wfdesigner"></div>
|
|
||||||
|
|
||||||
<script>
|
|
||||||
var schemecode = decodeURI(QueryString["schemeName"]);
|
|
||||||
var inputScheme = $("#schemeName");
|
|
||||||
var add = schemecode == "" ? true : false;
|
|
||||||
if (!add) {
|
|
||||||
inputScheme.val(schemecode);
|
|
||||||
inputScheme.attr("readonly", "readonly");
|
|
||||||
}
|
|
||||||
|
|
||||||
var wfdesigner = undefined;
|
|
||||||
|
|
||||||
function wfdesignerRedraw() {
|
|
||||||
var data;
|
|
||||||
|
|
||||||
if (wfdesigner != undefined) {
|
|
||||||
data = wfdesigner.data;
|
|
||||||
wfdesigner.destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
wfdesigner = new WorkflowDesigner({
|
|
||||||
name: 'simpledesigner',
|
|
||||||
apiurl: '/Designer/API',
|
|
||||||
renderTo: 'wfdesigner',
|
|
||||||
imagefolder: '/images/',
|
|
||||||
graphwidth: $('#graphwidth').val(),
|
|
||||||
graphheight: $('#graphheight').val()
|
|
||||||
});
|
|
||||||
|
|
||||||
if (add) {
|
|
||||||
wfdesigner.create();
|
|
||||||
} else {
|
|
||||||
if (data == undefined) {
|
|
||||||
var isreadonly = false;
|
|
||||||
var p = { schemecode: schemecode, readonly: isreadonly };
|
|
||||||
if (wfdesigner.exists(p)) //如果已经存在
|
|
||||||
wfdesigner.load(p);
|
|
||||||
} else {
|
|
||||||
wfdesigner.data = data;
|
|
||||||
wfdesigner.render();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
wfdesignerRedraw();
|
|
||||||
|
|
||||||
function OnSave() {
|
|
||||||
if (inputScheme.val().length == 0) {
|
|
||||||
alert("请输入模板名称");
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
wfdesigner.schemecode = inputScheme.val();
|
|
||||||
var err = wfdesigner.validate();
|
|
||||||
if (err != undefined && err.length > 0) {
|
|
||||||
alert(err);
|
|
||||||
} else {
|
|
||||||
wfdesigner.save(function () {
|
|
||||||
alert('保存成功');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
@ -1,40 +0,0 @@
|
|||||||
@{
|
|
||||||
Layout = "~/Views/Shared/_Layout.cshtml";
|
|
||||||
}
|
|
||||||
|
|
||||||
<!-- #section:basics/content.breadcrumbs -->
|
|
||||||
<div class="breadcrumbs" id="breadcrumbs">
|
|
||||||
<ul class="breadcrumb">
|
|
||||||
<li>
|
|
||||||
<i class="ace-icon fa fa-home home-icon"></i>
|
|
||||||
<a href="#">流程设计</a>
|
|
||||||
</li>
|
|
||||||
<li class="active">列表</li>
|
|
||||||
</ul><!-- /.breadcrumb -->
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- /section:basics/content.breadcrumbs -->
|
|
||||||
<div class="page-content">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-12">
|
|
||||||
<div class="widget-box widget-color-blue">
|
|
||||||
<div class="widget-header">
|
|
||||||
@Html.Action("MenuHeader", "Home")
|
|
||||||
</div>
|
|
||||||
<div class="widget-body gridwidth">
|
|
||||||
<div class="widget-main">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-md-12 ">
|
|
||||||
<table id="maingrid"></table>
|
|
||||||
<div id="grid-pager"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div><!-- /.page-content -->
|
|
||||||
<script src="~/BllScripts/grid.js"></script>
|
|
||||||
<script src="~/BllScripts/workflowSchemaManager.js"></script>
|
|
||||||
<script src="~/BllScripts/jqEvent.js"></script>
|
|
@ -17,7 +17,6 @@
|
|||||||
<add name="OpenAuthDBContext" connectionString="Data Source=.;Initial Catalog=OpenAuthDB;Persist Security Info=True;User ID=sa;Password=000000;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
|
<add name="OpenAuthDBContext" connectionString="Data Source=.;Initial Catalog=OpenAuthDB;Persist Security Info=True;User ID=sa;Password=000000;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
|
||||||
|
|
||||||
<!--工作流数据库-->
|
<!--工作流数据库-->
|
||||||
<add name="WorkFlow" connectionString="Data Source=.;Initial Catalog=Workflow.Net;Persist Security Info=True;User ID=sa;Password=000000;MultipleActiveResultSets=True" providerName="System.Data.SqlClient" />
|
|
||||||
<!--<add name="OpenAuthDBContext" connectionString="server=127.0.0.1;user id=root;persistsecurityinfo=True;database=openauth;password=123456" providerName="MySql.Data.MySqlClient" />-->
|
<!--<add name="OpenAuthDBContext" connectionString="server=127.0.0.1;user id=root;persistsecurityinfo=True;database=openauth;password=123456" providerName="MySql.Data.MySqlClient" />-->
|
||||||
</connectionStrings>
|
</connectionStrings>
|
||||||
|
|
||||||
@ -53,8 +52,6 @@
|
|||||||
<component type=" OpenAuth.Repository.CategoryRepository" service="OpenAuth.Domain.Interface.ICategoryRepository,OpenAuth.Domain" />
|
<component type=" OpenAuth.Repository.CategoryRepository" service="OpenAuth.Domain.Interface.ICategoryRepository,OpenAuth.Domain" />
|
||||||
<component type=" OpenAuth.Repository.ResourceRepository" service="OpenAuth.Domain.Interface.IResourceRepository,OpenAuth.Domain" />
|
<component type=" OpenAuth.Repository.ResourceRepository" service="OpenAuth.Domain.Interface.IResourceRepository,OpenAuth.Domain" />
|
||||||
<component type=" OpenAuth.Repository.StockRepository" service="OpenAuth.Domain.Interface.IStockRepository,OpenAuth.Domain" />
|
<component type=" OpenAuth.Repository.StockRepository" service="OpenAuth.Domain.Interface.IStockRepository,OpenAuth.Domain" />
|
||||||
<component type=" OpenAuth.Repository.Workflow.WorkflowSchemeRepository"
|
|
||||||
service="OpenAuth.Domain.Interface.IWorkflowSchemeRepository,OpenAuth.Domain" />
|
|
||||||
</components>
|
</components>
|
||||||
</autofac>
|
</autofac>
|
||||||
|
|
||||||
|
@ -25,7 +25,4 @@
|
|||||||
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
|
<package id="Newtonsoft.Json" version="7.0.1" targetFramework="net45" />
|
||||||
<package id="Respond" version="1.2.0" targetFramework="net45" />
|
<package id="Respond" version="1.2.0" targetFramework="net45" />
|
||||||
<package id="WebGrease" version="1.5.2" targetFramework="net45" />
|
<package id="WebGrease" version="1.5.2" targetFramework="net45" />
|
||||||
<package id="WorkflowEngine.NET-Core" version="1.5.5.2" targetFramework="net45" />
|
|
||||||
<package id="WorkflowEngine.NET-Designer" version="1.5.5.2" targetFramework="net45" />
|
|
||||||
<package id="WorkflowEngine.NET-ProviderForMSSQL" version="1.5.5.2" targetFramework="net45" />
|
|
||||||
</packages>
|
</packages>
|
@ -1,62 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <autogenerated>
|
|
||||||
// This code was generated by a CodeSmith Template.
|
|
||||||
//
|
|
||||||
// DO NOT MODIFY contents of this file. Changes to this
|
|
||||||
// file will be lost if the code is regenerated.
|
|
||||||
// </autogenerated>
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
|
||||||
using OpenAuth.Domain;
|
|
||||||
|
|
||||||
namespace OpenAuth.Repository.Models.Mapping
|
|
||||||
{
|
|
||||||
public partial class ApplyTransitionHistoryMap
|
|
||||||
: System.Data.Entity.ModelConfiguration.EntityTypeConfiguration<ApplyTransitionHistory>
|
|
||||||
{
|
|
||||||
public ApplyTransitionHistoryMap()
|
|
||||||
{
|
|
||||||
// table
|
|
||||||
ToTable("ApplyTransitionHistory", "dbo");
|
|
||||||
|
|
||||||
// keys
|
|
||||||
HasKey(t => t.Id);
|
|
||||||
|
|
||||||
// Properties
|
|
||||||
Property(t => t.Id)
|
|
||||||
.HasColumnName("Id")
|
|
||||||
.IsRequired();
|
|
||||||
Property(t => t.ApplyId)
|
|
||||||
.HasColumnName("ApplyId")
|
|
||||||
.IsRequired();
|
|
||||||
Property(t => t.UserId)
|
|
||||||
.HasColumnName("UserId")
|
|
||||||
.IsOptional();
|
|
||||||
Property(t => t.AllowedToUserNames)
|
|
||||||
.HasColumnName("AllowedToUserNames")
|
|
||||||
.IsRequired();
|
|
||||||
Property(t => t.TransitionTime)
|
|
||||||
.HasColumnName("TransitionTime")
|
|
||||||
.IsOptional();
|
|
||||||
Property(t => t.Order)
|
|
||||||
.HasColumnName("Order")
|
|
||||||
.HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity)
|
|
||||||
.IsRequired();
|
|
||||||
Property(t => t.InitialState)
|
|
||||||
.HasColumnName("InitialState")
|
|
||||||
.HasMaxLength(1024)
|
|
||||||
.IsRequired();
|
|
||||||
Property(t => t.DestinationState)
|
|
||||||
.HasColumnName("DestinationState")
|
|
||||||
.HasMaxLength(1024)
|
|
||||||
.IsRequired();
|
|
||||||
Property(t => t.Command)
|
|
||||||
.HasColumnName("Command")
|
|
||||||
.HasMaxLength(1024)
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
// Relationships
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -27,7 +27,6 @@ namespace OpenAuth.Repository.Models
|
|||||||
: base(nameOrConnectionString)
|
: base(nameOrConnectionString)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
public System.Data.Entity.DbSet<ApplyTransitionHistory> ApplyTransitionHistories { get; set; }
|
|
||||||
public System.Data.Entity.DbSet<Category> Categories { get; set; }
|
public System.Data.Entity.DbSet<Category> Categories { get; set; }
|
||||||
public System.Data.Entity.DbSet<DicDetail> DicDetails { get; set; }
|
public System.Data.Entity.DbSet<DicDetail> DicDetails { get; set; }
|
||||||
public System.Data.Entity.DbSet<DicIndex> DicIndices { get; set; }
|
public System.Data.Entity.DbSet<DicIndex> DicIndices { get; set; }
|
||||||
@ -49,7 +48,6 @@ namespace OpenAuth.Repository.Models
|
|||||||
|
|
||||||
protected override void OnModelCreating(DbModelBuilder modelBuilder)
|
protected override void OnModelCreating(DbModelBuilder modelBuilder)
|
||||||
{
|
{
|
||||||
modelBuilder.Configurations.Add(new ApplyTransitionHistoryMap());
|
|
||||||
modelBuilder.Configurations.Add(new CategoryMap());
|
modelBuilder.Configurations.Add(new CategoryMap());
|
||||||
modelBuilder.Configurations.Add(new DicDetailMap());
|
modelBuilder.Configurations.Add(new DicDetailMap());
|
||||||
modelBuilder.Configurations.Add(new DicIndexMap());
|
modelBuilder.Configurations.Add(new DicIndexMap());
|
||||||
|
@ -55,8 +55,6 @@
|
|||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="Models\Mapping\ApplyTransitionHistoryMap.cs" />
|
|
||||||
<Compile Include="Models\Mapping\CommonApplyMap.cs" />
|
|
||||||
<Compile Include="Models\Mapping\WFFrmMainMap.cs" />
|
<Compile Include="Models\Mapping\WFFrmMainMap.cs" />
|
||||||
<Compile Include="Models\Mapping\WFProcessInstanceMap.cs" />
|
<Compile Include="Models\Mapping\WFProcessInstanceMap.cs" />
|
||||||
<Compile Include="Models\Mapping\WFProcessOperationHistoryMap.cs" />
|
<Compile Include="Models\Mapping\WFProcessOperationHistoryMap.cs" />
|
||||||
@ -64,7 +62,6 @@
|
|||||||
<Compile Include="Models\Mapping\WFProcessTransitionHistoryMap.cs" />
|
<Compile Include="Models\Mapping\WFProcessTransitionHistoryMap.cs" />
|
||||||
<Compile Include="Models\Mapping\WFSchemeContentMap.cs" />
|
<Compile Include="Models\Mapping\WFSchemeContentMap.cs" />
|
||||||
<Compile Include="Models\Mapping\WFSchemeInfoMap.cs" />
|
<Compile Include="Models\Mapping\WFSchemeInfoMap.cs" />
|
||||||
<Compile Include="Workflow\Mapping\WorkflowSchemeMap.cs" />
|
|
||||||
<Compile Include="UnitWork.cs" />
|
<Compile Include="UnitWork.cs" />
|
||||||
<Compile Include="BaseRepository.cs" />
|
<Compile Include="BaseRepository.cs" />
|
||||||
<Compile Include="Models\Mapping\CategoryMap.cs" />
|
<Compile Include="Models\Mapping\CategoryMap.cs" />
|
||||||
@ -88,9 +85,6 @@
|
|||||||
<Compile Include="StockRepository.cs" />
|
<Compile Include="StockRepository.cs" />
|
||||||
<Compile Include="UserRepository.cs" />
|
<Compile Include="UserRepository.cs" />
|
||||||
<Compile Include="RelevanceRepository.cs" />
|
<Compile Include="RelevanceRepository.cs" />
|
||||||
<Compile Include="Workflow\WorkflowSchemeRepository.cs" />
|
|
||||||
<Compile Include="Workflow\WorkflowBaseRepository.cs" />
|
|
||||||
<Compile Include="Workflow\WorkflowContext.cs" />
|
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\Infrastructure\Infrastructure.csproj">
|
<ProjectReference Include="..\Infrastructure\Infrastructure.csproj">
|
||||||
|
@ -1,37 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <autogenerated>
|
|
||||||
// This code was generated by a CodeSmith Template.
|
|
||||||
//
|
|
||||||
// DO NOT MODIFY contents of this file. Changes to this
|
|
||||||
// file will be lost if the code is regenerated.
|
|
||||||
// </autogenerated>
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
using OpenAuth.Domain;
|
|
||||||
|
|
||||||
namespace OpenAuth.Repository.Workflow.Mapping
|
|
||||||
{
|
|
||||||
public partial class WorkflowSchemeMap
|
|
||||||
: System.Data.Entity.ModelConfiguration.EntityTypeConfiguration<WorkflowScheme>
|
|
||||||
{
|
|
||||||
public WorkflowSchemeMap()
|
|
||||||
{
|
|
||||||
// table
|
|
||||||
ToTable("WorkflowScheme", "dbo");
|
|
||||||
|
|
||||||
// keys
|
|
||||||
HasKey(t => t.Code);
|
|
||||||
|
|
||||||
// Properties
|
|
||||||
Property(t => t.Code)
|
|
||||||
.HasColumnName("Code")
|
|
||||||
.HasMaxLength(256)
|
|
||||||
.IsRequired();
|
|
||||||
Property(t => t.Scheme)
|
|
||||||
.HasColumnName("Scheme")
|
|
||||||
.IsRequired();
|
|
||||||
|
|
||||||
// Relationships
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,134 +0,0 @@
|
|||||||
using System;
|
|
||||||
using System.Data.Entity;
|
|
||||||
using System.Data.Entity.Migrations;
|
|
||||||
using System.Linq;
|
|
||||||
using System.Linq.Expressions;
|
|
||||||
using EntityFramework.Extensions;
|
|
||||||
using Infrastructure;
|
|
||||||
using OpenAuth.Domain.Interface;
|
|
||||||
|
|
||||||
namespace OpenAuth.Repository.Workflow
|
|
||||||
{
|
|
||||||
public class WorkflowBaseRepository<T> :IRepository<T> where T:class
|
|
||||||
{
|
|
||||||
protected WorkflowContext Context = new WorkflowContext();
|
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 根据过滤条件,获取记录
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="exp">The exp.</param>
|
|
||||||
public IQueryable<T> Find(Expression<Func<T, bool>> exp = null)
|
|
||||||
{
|
|
||||||
return Filter(exp);
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool IsExist(Expression<Func<T, bool>> exp)
|
|
||||||
{
|
|
||||||
return Context.Set<T>().Any(exp);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 查找单个
|
|
||||||
/// </summary>
|
|
||||||
public T FindSingle(Expression<Func<T, bool>> exp)
|
|
||||||
{
|
|
||||||
return Context.Set<T>().AsNoTracking().FirstOrDefault(exp);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 得到分页记录
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="pageindex">The pageindex.</param>
|
|
||||||
/// <param name="pagesize">The pagesize.</param>
|
|
||||||
/// <param name="orderby">排序,格式如:"Id"/"Id descending"</param>
|
|
||||||
public IQueryable<T> Find(int pageindex, int pagesize, string orderby = "", Expression<Func<T, bool>> exp = null)
|
|
||||||
{
|
|
||||||
if (pageindex < 1) pageindex = 1;
|
|
||||||
if (string.IsNullOrEmpty(orderby))
|
|
||||||
orderby = "Id descending";
|
|
||||||
|
|
||||||
return Filter(exp).OrderBy(orderby).Skip(pagesize * (pageindex - 1)).Take(pagesize);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 根据过滤条件获取记录数
|
|
||||||
/// </summary>
|
|
||||||
public int GetCount(Expression<Func<T, bool>> exp = null)
|
|
||||||
{
|
|
||||||
return Filter(exp).Count();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Add(T entity)
|
|
||||||
{
|
|
||||||
Context.Set<T>().Add(entity);
|
|
||||||
Save();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 批量添加
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="entities">The entities.</param>
|
|
||||||
public void BatchAdd(T[] entities)
|
|
||||||
{
|
|
||||||
Context.Set<T>().AddRange(entities);
|
|
||||||
Save();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Update(T entity)
|
|
||||||
{
|
|
||||||
var entry = this.Context.Entry(entity);
|
|
||||||
//todo:如果状态没有任何更改,会报错
|
|
||||||
entry.State = EntityState.Modified;
|
|
||||||
|
|
||||||
Save();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Delete(T entity)
|
|
||||||
{
|
|
||||||
Context.Set<T>().Remove(entity);
|
|
||||||
Save();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 按指定id更新实体,会更新整个实体
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="identityExp">The identity exp.</param>
|
|
||||||
/// <param name="entity">The entity.</param>
|
|
||||||
public void Update(Expression<Func<T, object>> identityExp, T entity)
|
|
||||||
{
|
|
||||||
Context.Set<T>().AddOrUpdate(identityExp, entity);
|
|
||||||
Save();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 实现按需要只更新部分更新
|
|
||||||
/// <para>如:Update(u =>u.Id==1,u =>new User{Name="ok"});</para>
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="where">The where.</param>
|
|
||||||
/// <param name="entity">The entity.</param>
|
|
||||||
public void Update(Expression<Func<T, bool>> where, Expression<Func<T, T>> entity)
|
|
||||||
{
|
|
||||||
Context.Set<T>().Where(where).Update(entity);
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual void Delete(Expression<Func<T, bool>> exp)
|
|
||||||
{
|
|
||||||
Context.Set<T>().Where(exp).Delete();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Save()
|
|
||||||
{
|
|
||||||
Context.SaveChanges();
|
|
||||||
}
|
|
||||||
|
|
||||||
private IQueryable<T> Filter(Expression<Func<T, bool>> exp)
|
|
||||||
{
|
|
||||||
var dbSet = Context.Set<T>().AsQueryable();
|
|
||||||
if (exp != null)
|
|
||||||
dbSet = dbSet.Where(exp);
|
|
||||||
return dbSet;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,41 +0,0 @@
|
|||||||
//------------------------------------------------------------------------------
|
|
||||||
// <autogenerated>
|
|
||||||
// This code was generated by a CodeSmith Template.
|
|
||||||
//
|
|
||||||
// DO NOT MODIFY contents of this file. Changes to this
|
|
||||||
// file will be lost if the code is regenerated.
|
|
||||||
// </autogenerated>
|
|
||||||
//------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
using System.Data.Entity;
|
|
||||||
using OpenAuth.Domain;
|
|
||||||
using OpenAuth.Repository.Models;
|
|
||||||
using OpenAuth.Repository.Models.Mapping;
|
|
||||||
using OpenAuth.Repository.Workflow.Mapping;
|
|
||||||
|
|
||||||
namespace OpenAuth.Repository.Workflow
|
|
||||||
{
|
|
||||||
public partial class WorkflowContext: DbContext
|
|
||||||
{
|
|
||||||
static WorkflowContext()
|
|
||||||
{
|
|
||||||
Database.SetInitializer< OpenAuthDBContext>(null);
|
|
||||||
}
|
|
||||||
public WorkflowContext()
|
|
||||||
:base("Name=WorkFlow")
|
|
||||||
{ }
|
|
||||||
|
|
||||||
public WorkflowContext(string nameOrConnectionString)
|
|
||||||
: base(nameOrConnectionString)
|
|
||||||
{ }
|
|
||||||
|
|
||||||
|
|
||||||
public System.Data.Entity.DbSet<WorkflowScheme> WorkflowSchemes { get; set; }
|
|
||||||
|
|
||||||
protected override void OnModelCreating(DbModelBuilder modelBuilder)
|
|
||||||
{
|
|
||||||
modelBuilder.Configurations.Add(new WorkflowSchemeMap());
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,11 +0,0 @@
|
|||||||
using OpenAuth.Domain;
|
|
||||||
using OpenAuth.Domain.Interface;
|
|
||||||
|
|
||||||
namespace OpenAuth.Repository.Workflow
|
|
||||||
{
|
|
||||||
public class WorkflowSchemeRepository:WorkflowBaseRepository<WorkflowScheme>,IWorkflowSchemeRepository
|
|
||||||
{
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user