删除workflowengine.net

This commit is contained in:
yubaolee
2017-01-20 17:49:45 +08:00
parent b46729b31d
commit b9a849e3ea
33 changed files with 204 additions and 1427 deletions

View File

@@ -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);
}
}
}

View File

@@ -80,7 +80,6 @@
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ApplyTransitionHistoryApp.cs" />
<Compile Include="CategoryManagerApp.cs" />
<Compile Include="AuthorizeApp.cs" />
<Compile Include="Extention\IWF_Runtime.cs" />
@@ -89,7 +88,7 @@
<Compile Include="Extention\WF_RuntimeModel.cs" />
<Compile Include="WFProcessInstanceService.cs" />
<Compile Include="WFRuntimeService.cs" />
<Compile Include="WorkflowInboxApp.cs" />
<Compile Include="WFSchemeService.cs" />
<Compile Include="ModuleElementManagerApp.cs" />
<Compile Include="ModuleManagerApp.cs" />
<Compile Include="ResourceManagerApp.cs" />
@@ -109,14 +108,12 @@
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="OrgManagerApp.cs" />
<Compile Include="ViewModel\CommandModel.cs" />
<Compile Include="ViewModel\CommonApplyVM.cs" />
<Compile Include="ViewModel\GridData.cs" />
<Compile Include="ViewModel\UserWithAccessedCtrls.cs" />
<Compile Include="ViewModel\ModuleElementVM.cs" />
<Compile Include="ViewModel\ModuleView.cs" />
<Compile Include="ViewModel\RoleVM.cs" />
<Compile Include="ViewModel\UserView.cs" />
<Compile Include="WorkflowSchemasManagerApp.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Infrastructure\Infrastructure.csproj">

View File

@@ -0,0 +1,120 @@
using System;
using System.Collections.Generic;
using System.Linq;
using OpenAuth.App.ViewModel;
using OpenAuth.Domain.Interface;
namespace OpenAuth.Domain.Service
{
/// <summary>
/// 流程设计服务
/// <para>李玉宝新增于2017-01-16 16:18:35</para>
/// </summary>
public class WFSchemeService
{
protected IUnitWork _unitWork;
public WFSchemeService(IUnitWork unitWork)
{
_unitWork = unitWork;
}
/// <summary>
/// 保存流程
/// </summary>
/// <param name="entity">表单模板实体类</param>
/// <param name="keyValue">主键</param>
/// <returns></returns>
public int SaveForm(string keyValue, WFSchemeInfo entity, WFSchemeContent modelentity)
{
try
{
if (string.IsNullOrEmpty(keyValue))
{
entity.SchemeVersion = DateTime.Now.ToString("yyyyMMddHHmmssffff");
_unitWork.Add(entity);
modelentity.SchemeInfoId = entity.Id;
modelentity.SchemeVersion = entity.SchemeVersion;
_unitWork.Add(modelentity);
}
else
{
Guid schemeid = Guid.Parse(keyValue);
WFSchemeContent modelentityold =
_unitWork.FindSingle<WFSchemeContent>(u => u.SchemeVersion == entity.SchemeVersion
&& u.SchemeInfoId == schemeid);
if (modelentityold.SchemeContent != modelentity.SchemeContent)
{
if (modelentity.SchemeVersion == "cg")
{
modelentityold.SchemeContent = modelentity.SchemeContent;
modelentityold.SchemeVersion = DateTime.Now.ToString("yyyyMMddHHmmssffff");
modelentity.SchemeVersion = modelentityold.SchemeVersion;
_unitWork.Update(modelentityold);
}
else
{
modelentity.SchemeInfoId = schemeid;
modelentity.SchemeVersion = DateTime.Now.ToString("yyyyMMddHHmmssffff");
_unitWork.Add(modelentity);
}
}
else
{
modelentity.SchemeVersion = modelentityold.SchemeVersion;
}
entity.Id = Guid.Parse(keyValue);
entity.SchemeVersion = modelentity.SchemeVersion;
_unitWork.Update(entity);
}
_unitWork.Save();
return 1;
}
catch (Exception)
{
throw;
}
}
public void RemoveForm(string keyValue)
{
throw new NotImplementedException();
}
public WFSchemeInfo GetEntity(string keyValue)
{
throw new NotImplementedException();
}
public WFSchemeContent GetSchemeEntity(Guid schemeinfoId, string schemeinfoSchemeVersion)
{
throw new NotImplementedException();
}
public void UpdateState(string keyValue, int state)
{
throw new NotImplementedException();
}
public List<WFSchemeInfo> GetList()
{
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;
}
}
}

View File

@@ -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);
}
}
}

View File

@@ -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));
}
}
}