This commit is contained in:
yubaolee
2017-01-12 19:24:52 +08:00
parent 21b37f77cf
commit 85b10e8877
47 changed files with 5637 additions and 0 deletions

View File

@@ -0,0 +1,113 @@
//------------------------------------------------------------------------------
// <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;
using System.Collections.Generic;
using System.Text;
namespace OpenAuth.Domain
{
/// <summary>
///
/// </summary>
public partial class WFFrmMain :Entity
{
public WFFrmMain()
{
this.FrmCode= string.Empty;
this.FrmName= string.Empty;
this.FrmType= string.Empty;
this.FrmDbId= string.Empty;
this.FrmTable= string.Empty;
this.FrmTableId= string.Empty;
this.FrmContent= string.Empty;
this.Description= string.Empty;
this.CreateDate= DateTime.Now;
this.CreateUserId= string.Empty;
this.CreateUserName= string.Empty;
this.ModifyDate= DateTime.Now;
this.ModifyUserId= string.Empty;
this.ModifyUserName= string.Empty;
}
/// <summary>
///
/// </summary>
public string FrmCode { get; set; }
/// <summary>
///
/// </summary>
public string FrmName { get; set; }
/// <summary>
///
/// </summary>
public string FrmType { get; set; }
/// <summary>
///
/// </summary>
public string FrmDbId { get; set; }
/// <summary>
///
/// </summary>
public string FrmTable { get; set; }
/// <summary>
///
/// </summary>
public int? IsSystemTable { get; set; }
/// <summary>
///
/// </summary>
public string FrmTableId { get; set; }
/// <summary>
///
/// </summary>
public string FrmContent { get; set; }
/// <summary>
///
/// </summary>
public int? SortCode { get; set; }
/// <summary>
///
/// </summary>
public int? DeleteMark { get; set; }
/// <summary>
///
/// </summary>
public int? EnabledMark { get; set; }
/// <summary>
///
/// </summary>
public string Description { get; set; }
/// <summary>
///
/// </summary>
public System.DateTime? CreateDate { get; set; }
/// <summary>
///
/// </summary>
public string CreateUserId { get; set; }
/// <summary>
///
/// </summary>
public string CreateUserName { get; set; }
/// <summary>
///
/// </summary>
public System.DateTime? ModifyDate { get; set; }
/// <summary>
///
/// </summary>
public string ModifyUserId { get; set; }
/// <summary>
///
/// </summary>
public string ModifyUserName { get; set; }
}
}

View File

@@ -0,0 +1,109 @@
//------------------------------------------------------------------------------
// <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;
using System.Collections.Generic;
using System.Text;
namespace OpenAuth.Domain
{
/// <summary>
///
/// </summary>
public partial class WFProcessInstance :Entity
{
public WFProcessInstance()
{
this.Code= string.Empty;
this.CustomName= string.Empty;
this.ActivityId= string.Empty;
this.ActivityType= 0;
this.ActivityName= string.Empty;
this.PreviousId= string.Empty;
this.ProcessSchemeId= string.Empty;
this.SchemeType= string.Empty;
this.EnabledMark= 0;
this.CreateDate= DateTime.Now;
this.CreateUserId= string.Empty;
this.CreateUserName= string.Empty;
this.Description= string.Empty;
this.MakerList= string.Empty;
}
/// <summary>
///
/// </summary>
public string Code { get; set; }
/// <summary>
///
/// </summary>
public string CustomName { get; set; }
/// <summary>
///
/// </summary>
public string ActivityId { get; set; }
/// <summary>
///
/// </summary>
public int ActivityType { get; set; }
/// <summary>
///
/// </summary>
public string ActivityName { get; set; }
/// <summary>
///
/// </summary>
public string PreviousId { get; set; }
/// <summary>
///
/// </summary>
public string ProcessSchemeId { get; set; }
/// <summary>
///
/// </summary>
public string SchemeType { get; set; }
/// <summary>
///
/// </summary>
public int? FrmType { get; set; }
/// <summary>
///
/// </summary>
public int EnabledMark { get; set; }
/// <summary>
///
/// </summary>
public System.DateTime CreateDate { get; set; }
/// <summary>
///
/// </summary>
public string CreateUserId { get; set; }
/// <summary>
///
/// </summary>
public string CreateUserName { get; set; }
/// <summary>
///
/// </summary>
public int? WfLevel { get; set; }
/// <summary>
///
/// </summary>
public string Description { get; set; }
/// <summary>
///
/// </summary>
public int? IsFinish { get; set; }
/// <summary>
///
/// </summary>
public string MakerList { get; set; }
}
}

View File

@@ -0,0 +1,52 @@
//------------------------------------------------------------------------------
// <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;
using System.Collections.Generic;
using System.Text;
namespace OpenAuth.Domain
{
/// <summary>
///
/// </summary>
public partial class WFProcessOperationHistory :Entity
{
public WFProcessOperationHistory()
{
this.ProcessId= string.Empty;
this.Content= string.Empty;
this.CreateDate= DateTime.Now;
this.CreateUserId= string.Empty;
this.CreateUserName= string.Empty;
}
/// <summary>
///
/// </summary>
public string ProcessId { get; set; }
/// <summary>
///
/// </summary>
public string Content { get; set; }
/// <summary>
///
/// </summary>
public System.DateTime CreateDate { get; set; }
/// <summary>
///
/// </summary>
public string CreateUserId { get; set; }
/// <summary>
///
/// </summary>
public string CreateUserName { get; set; }
}
}

View File

@@ -0,0 +1,47 @@
//------------------------------------------------------------------------------
// <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;
using System.Collections.Generic;
using System.Text;
namespace OpenAuth.Domain
{
/// <summary>
///
/// </summary>
public partial class WFProcessScheme :Entity
{
public WFProcessScheme()
{
this.SchemeContent= string.Empty;
this.WFSchemeInfoId= string.Empty;
this.SchemeVersion= string.Empty;
this.ProcessType= 0;
}
/// <summary>
///
/// </summary>
public string SchemeContent { get; set; }
/// <summary>
///
/// </summary>
public string WFSchemeInfoId { get; set; }
/// <summary>
///
/// </summary>
public string SchemeVersion { get; set; }
/// <summary>
///
/// </summary>
public int ProcessType { get; set; }
}
}

View File

@@ -0,0 +1,85 @@
//------------------------------------------------------------------------------
// <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;
using System.Collections.Generic;
using System.Text;
namespace OpenAuth.Domain
{
/// <summary>
///
/// </summary>
public partial class WFProcessTransitionHistory :Entity
{
public WFProcessTransitionHistory()
{
this.ProcessId= string.Empty;
this.FromNodeId= string.Empty;
this.FromNodeName= string.Empty;
this.ToNodeId= string.Empty;
this.ToNodeName= string.Empty;
this.TransitionSate= 0;
this.IsFinish= 0;
this.CreateDate= DateTime.Now;
this.CreateUserId= string.Empty;
this.CreateUserName= string.Empty;
}
/// <summary>
///
/// </summary>
public string ProcessId { get; set; }
/// <summary>
///
/// </summary>
public string FromNodeId { get; set; }
/// <summary>
///
/// </summary>
public int? FromNodeType { get; set; }
/// <summary>
///
/// </summary>
public string FromNodeName { get; set; }
/// <summary>
///
/// </summary>
public string ToNodeId { get; set; }
/// <summary>
///
/// </summary>
public int? ToNodeType { get; set; }
/// <summary>
///
/// </summary>
public string ToNodeName { get; set; }
/// <summary>
///
/// </summary>
public int TransitionSate { get; set; }
/// <summary>
///
/// </summary>
public int IsFinish { get; set; }
/// <summary>
///
/// </summary>
public System.DateTime CreateDate { get; set; }
/// <summary>
///
/// </summary>
public string CreateUserId { get; set; }
/// <summary>
///
/// </summary>
public string CreateUserName { get; set; }
}
}

View File

@@ -0,0 +1,57 @@
//------------------------------------------------------------------------------
// <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;
using System.Collections.Generic;
using System.Text;
namespace OpenAuth.Domain
{
/// <summary>
///
/// </summary>
public partial class WFSchemeContent :Entity
{
public WFSchemeContent()
{
this.WFSchemeInfoId= string.Empty;
this.SchemeVersion= string.Empty;
this.SchemeContent= string.Empty;
this.CreateDate= DateTime.Now;
this.CreateUserId= string.Empty;
this.CreateUserName= string.Empty;
}
/// <summary>
///
/// </summary>
public string WFSchemeInfoId { get; set; }
/// <summary>
///
/// </summary>
public string SchemeVersion { get; set; }
/// <summary>
///
/// </summary>
public string SchemeContent { get; set; }
/// <summary>
///
/// </summary>
public System.DateTime CreateDate { get; set; }
/// <summary>
///
/// </summary>
public string CreateUserId { get; set; }
/// <summary>
///
/// </summary>
public string CreateUserName { get; set; }
}
}

View File

@@ -0,0 +1,109 @@
//------------------------------------------------------------------------------
// <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;
using System.Collections.Generic;
using System.Text;
namespace OpenAuth.Domain
{
/// <summary>
///
/// </summary>
public partial class WFSchemeInfo :Entity
{
public WFSchemeInfo()
{
this.SchemeCode= string.Empty;
this.SchemeName= string.Empty;
this.SchemeType= string.Empty;
this.SchemeVersion= string.Empty;
this.SchemeCanUser= string.Empty;
this.DeleteMark= 0;
this.EnabledMark= 0;
this.Description= string.Empty;
this.CreateDate= DateTime.Now;
this.CreateUserId= string.Empty;
this.CreateUserName= string.Empty;
this.ModifyDate= DateTime.Now;
this.ModifyUserId= string.Empty;
this.ModifyUserName= string.Empty;
}
/// <summary>
///
/// </summary>
public string SchemeCode { get; set; }
/// <summary>
///
/// </summary>
public string SchemeName { get; set; }
/// <summary>
///
/// </summary>
public string SchemeType { get; set; }
/// <summary>
///
/// </summary>
public string SchemeVersion { get; set; }
/// <summary>
///
/// </summary>
public string SchemeCanUser { get; set; }
/// <summary>
///
/// </summary>
public int? FrmType { get; set; }
/// <summary>
///
/// </summary>
public int? AuthorizeType { get; set; }
/// <summary>
///
/// </summary>
public int? SortCode { get; set; }
/// <summary>
///
/// </summary>
public int DeleteMark { get; set; }
/// <summary>
///
/// </summary>
public int EnabledMark { get; set; }
/// <summary>
///
/// </summary>
public string Description { get; set; }
/// <summary>
///
/// </summary>
public System.DateTime CreateDate { get; set; }
/// <summary>
///
/// </summary>
public string CreateUserId { get; set; }
/// <summary>
///
/// </summary>
public string CreateUserName { get; set; }
/// <summary>
///
/// </summary>
public System.DateTime? ModifyDate { get; set; }
/// <summary>
///
/// </summary>
public string ModifyUserId { get; set; }
/// <summary>
///
/// </summary>
public string ModifyUserName { get; set; }
}
}

View File

@@ -0,0 +1,100 @@
using System;
using System.Collections.Generic;
using OpenAuth.Domain.Interface;
namespace OpenAuth.Domain.Service
{
public class WorkflowService
{
protected IUnitWork _unitWork;
public WorkflowService(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.WFSchemeInfoId = entity.Id.ToString();
modelentity.SchemeVersion = entity.SchemeVersion;
_unitWork.Add(modelentity);
}
else
{
WFSchemeContent modelentityold =
_unitWork.FindSingle<WFSchemeContent>(u => u.SchemeVersion == entity.SchemeVersion
&& u.WFSchemeInfoId == keyValue);
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.WFSchemeInfoId = keyValue;
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()
{
throw new NotImplementedException();
}
}
}