mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-19 01:58:01 +08:00
routine update
This commit is contained in:
18
OpenAuth.App/Flow/FlowLine.cs
Normal file
18
OpenAuth.App/Flow/FlowLine.cs
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace OpenAuth.App.Flow
|
||||||
|
{
|
||||||
|
public class FlowLine
|
||||||
|
{
|
||||||
|
public string id { get; set; }
|
||||||
|
public string type { get; set; }
|
||||||
|
public string from { get; set; }
|
||||||
|
public string to { get; set; }
|
||||||
|
public string name { get; set; }
|
||||||
|
public bool dash { get; set; }
|
||||||
|
}
|
||||||
|
}
|
23
OpenAuth.App/Flow/FlowNode.cs
Normal file
23
OpenAuth.App/Flow/FlowNode.cs
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace OpenAuth.App.Flow
|
||||||
|
{
|
||||||
|
public class FlowNode
|
||||||
|
{
|
||||||
|
public const string START = "start round mix";
|
||||||
|
public const string END = "end round";
|
||||||
|
public const string NODE = "node";
|
||||||
|
|
||||||
|
public string id { get; set; }
|
||||||
|
|
||||||
|
public string name { get; set; }
|
||||||
|
|
||||||
|
public string type { get; set; }
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@@ -1,41 +1,32 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
|
||||||
using Infrastructure;
|
using Infrastructure;
|
||||||
|
|
||||||
namespace OpenAuth.App.Extention
|
namespace OpenAuth.App.Flow
|
||||||
{
|
{
|
||||||
public class WF_Runtime
|
public class FlowRuntime
|
||||||
{
|
{
|
||||||
private WF_RuntimeModel _runtimeModel = null;
|
private FlowRuntimeModel _runtimeModel = null;
|
||||||
|
|
||||||
private GetFrmData _getFrmData = null;
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 构造函数
|
/// 构造函数
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="schemeContent">流程模板</param>
|
/// <param name="schemeContent">流程模板</param>
|
||||||
/// <param name="currentNodeId">当前节点</param>
|
/// <param name="currentNodeId">当前节点</param>
|
||||||
/// <param name="frmData">表单数据</param>
|
/// <param name="frmData">表单数据</param>
|
||||||
public WF_Runtime(WF_RuntimeInitModel wfRuntimeInitModel,GetFrmData getFrmData = null)
|
public FlowRuntime(FlowRuntimeInitModel flowRuntimeInitModel)
|
||||||
{
|
{
|
||||||
_runtimeModel = new WF_RuntimeModel();
|
_runtimeModel = new FlowRuntimeModel();
|
||||||
_getFrmData = getFrmData;
|
dynamic schemeContentJson = flowRuntimeInitModel.schemeContent.ToJson();//获取工作流模板内容的json对象;
|
||||||
dynamic schemeContentJson = wfRuntimeInitModel.schemeContent.ToJson();//获取工作流模板内容的json对象;
|
|
||||||
_runtimeModel.schemeContentJson = schemeContentJson;//模板流程json对象
|
_runtimeModel.schemeContentJson = schemeContentJson;//模板流程json对象
|
||||||
_runtimeModel.nodeDictionary = GetNodeDictionary(schemeContentJson);//节点集合
|
_runtimeModel.nodeDictionary = GetNodeDictionary(schemeContentJson);//节点集合
|
||||||
_runtimeModel.lineDictionary = GetLineDictionary(schemeContentJson);//线条集合
|
_runtimeModel.lineDictionary = GetLineDictionary(schemeContentJson);//线条集合
|
||||||
_runtimeModel.currentNodeId = (wfRuntimeInitModel.currentNodeId == "" ? _runtimeModel.startNodeId : wfRuntimeInitModel.currentNodeId);
|
_runtimeModel.currentNodeId = (flowRuntimeInitModel.currentNodeId == "" ? _runtimeModel.startNodeId : flowRuntimeInitModel.currentNodeId);
|
||||||
_runtimeModel.currentNodeType = GetNodeStatus(_runtimeModel.currentNodeId);
|
_runtimeModel.currentNodeType = GetNodeStatus(_runtimeModel.currentNodeId);
|
||||||
_runtimeModel.frmData = wfRuntimeInitModel.frmData;
|
_runtimeModel.frmData = flowRuntimeInitModel.frmData;
|
||||||
if (getFrmData != null)
|
|
||||||
{
|
// flowRuntimeInitModel.frmData = GetNodeFrmData(getFrmData);
|
||||||
_runtimeModel.frmType = 1;
|
|
||||||
wfRuntimeInitModel.frmData = GetNodeFrmData(getFrmData);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
_runtimeModel.frmType = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_runtimeModel.currentNodeType == 0 || _runtimeModel.currentNodeType == 4)
|
if (_runtimeModel.currentNodeType == 0 || _runtimeModel.currentNodeType == 4)
|
||||||
{
|
{
|
||||||
@@ -44,14 +35,13 @@ namespace OpenAuth.App.Extention
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
_runtimeModel.nextNodeId = GetNextNode(wfRuntimeInitModel.frmData);//下一个节点
|
_runtimeModel.nextNodeId = GetNextNode(flowRuntimeInitModel.frmData);//下一个节点
|
||||||
_runtimeModel.nextNodeType = GetNodeStatus(_runtimeModel.nextNodeId);
|
_runtimeModel.nextNodeType = GetNodeStatus(_runtimeModel.nextNodeId);
|
||||||
}
|
}
|
||||||
|
|
||||||
_runtimeModel.previousId = wfRuntimeInitModel.previousId;
|
_runtimeModel.previousId = flowRuntimeInitModel.previousId;
|
||||||
|
|
||||||
_runtimeModel.processId = wfRuntimeInitModel.processId.ToString();
|
_runtimeModel.flowInstanceId = flowRuntimeInitModel.processId.ToString();
|
||||||
_runtimeModel.sqlFrm = SqlBuider(schemeContentJson, wfRuntimeInitModel.frmData, wfRuntimeInitModel.processId.ToString());
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -199,77 +189,7 @@ namespace OpenAuth.App.Extention
|
|||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 获取SQL语句
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="tablename"></param>
|
|
||||||
/// <param name="frmData"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
private string SqlBuider(dynamic schemeContentJson, string frmData, string keyValue)
|
|
||||||
{
|
|
||||||
return "";
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (schemeContentJson.Frm.isSystemTable.Value == 1)
|
|
||||||
{
|
|
||||||
var strSql = new StringBuilder();
|
|
||||||
var frmDataParam = frmData.ToJObject();
|
|
||||||
string sqlname = schemeContentJson.Frm.FrmTableId.Value, sqlvalues = "'" + keyValue + "'";
|
|
||||||
foreach (var item in frmDataParam)
|
|
||||||
{
|
|
||||||
if (item.Key != "__RequestVerificationToken")
|
|
||||||
{
|
|
||||||
sqlname += "," + item.Key;
|
|
||||||
if (item.Value.Type.ToString() == "String")
|
|
||||||
{
|
|
||||||
sqlvalues += ",'" + item.Value + "'";
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
sqlvalues += "," + item.Value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
strSql.Append(string.Format("insert into " + schemeContentJson.Frm.FrmTable.Value + " ({0})values({1})", sqlname, sqlvalues));
|
|
||||||
return strSql.ToString();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
|
||||||
/// 系统表单获取表单数据
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="getFrmData"></param>
|
|
||||||
/// <param name="nodeId"></param>
|
|
||||||
/// <returns></returns>
|
|
||||||
private string GetNodeFrmData(GetFrmData getFrmData,string nodeId = null)
|
|
||||||
{
|
|
||||||
try
|
|
||||||
{
|
|
||||||
string _nodeId = (nodeId == null ? _runtimeModel.currentNodeId : nodeId);
|
|
||||||
dynamic _node = _runtimeModel.nodeDictionary[_nodeId];
|
|
||||||
if (_node.setInfo != null)
|
|
||||||
{
|
|
||||||
return getFrmData(_node.setInfo.NodeDataBase.Value, _node.setInfo.NodeTable.Value, _node.setInfo.NodePram.Value, _runtimeModel.processId);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
catch
|
|
||||||
{
|
|
||||||
throw;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取下一个节点
|
/// 获取下一个节点
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -348,7 +268,7 @@ namespace OpenAuth.App.Extention
|
|||||||
/// 工作流实例运行信息
|
/// 工作流实例运行信息
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public WF_RuntimeModel runtimeModel
|
public FlowRuntimeModel runtimeModel
|
||||||
{
|
{
|
||||||
get { return _runtimeModel; }
|
get { return _runtimeModel; }
|
||||||
}
|
}
|
||||||
@@ -445,14 +365,9 @@ namespace OpenAuth.App.Extention
|
|||||||
try
|
try
|
||||||
{
|
{
|
||||||
string frmData = "";
|
string frmData = "";
|
||||||
if (_runtimeModel.frmType == 0)
|
|
||||||
{
|
// frmData = GetNodeFrmData(_getFrmData, nodeId);
|
||||||
frmData = _runtimeModel.frmData;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
frmData = GetNodeFrmData(_getFrmData, nodeId);
|
|
||||||
}
|
|
||||||
return GetNextNode(frmData, nodeId);
|
return GetNextNode(frmData, nodeId);
|
||||||
}
|
}
|
||||||
catch
|
catch
|
@@ -1,27 +1,27 @@
|
|||||||
namespace OpenAuth.App.Extention
|
namespace OpenAuth.App.Flow
|
||||||
{
|
{
|
||||||
|
|
||||||
public class WF_RuntimeInitModel
|
public class FlowRuntimeInitModel
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// GUID
|
/// GUID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string processId { get; set; }
|
public string processId { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 工作流模板内容
|
/// 工作流模板内容
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string schemeContent { get; set; }
|
public string schemeContent { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 当前运行节点(默认开始节点)
|
/// 当前运行节点(默认开始节点)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string currentNodeId { get; set; }
|
public string currentNodeId { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 提交的表单数据
|
/// 提交的表单数据
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string frmData { get; set; }
|
public string frmData { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 上一个节点
|
/// 上一个节点
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string previousId { get; set; }
|
public string previousId { get; set; }
|
||||||
}
|
}
|
||||||
}
|
}
|
@@ -1,79 +1,66 @@
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
|
||||||
namespace OpenAuth.App.Extention
|
namespace OpenAuth.App.Flow
|
||||||
{
|
{
|
||||||
public class WF_RuntimeModel
|
public class FlowRuntimeModel
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 运行实例的Id
|
/// 运行实例的Id
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string processId { get; set; }
|
public string flowInstanceId { get; set; }
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 开始节点的ID
|
/// 开始节点的ID
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string startNodeId { get; set; }
|
public string startNodeId { get; set; }
|
||||||
/// <summary>
|
|
||||||
/// 开始节点的对象
|
/// <summary>
|
||||||
/// </summary>
|
/// 当前节点的ID
|
||||||
public dynamic startNode { get { return this.nodeDictionary[this.startNodeId]; } }
|
/// </summary>
|
||||||
/// <summary>
|
public string currentNodeId { get; set; }
|
||||||
/// 当前节点的ID
|
/// <summary>
|
||||||
/// </summary>
|
/// 当前节点类型 0会签开始,1会签结束,2一般节点,开始节点,4流程运行结束
|
||||||
public string currentNodeId { get; set; }
|
/// </summary>
|
||||||
/// <summary>
|
public int currentNodeType { get; set; }
|
||||||
/// 当前节点类型 0会签开始,1会签结束,2一般节点,开始节点,4流程运行结束
|
/// <summary>
|
||||||
/// </summary>
|
/// 当前节点的对象
|
||||||
public int currentNodeType { get; set; }
|
/// </summary>
|
||||||
/// <summary>
|
public dynamic currentNode { get { return this.nodeDictionary[this.currentNodeId]; } }
|
||||||
/// 当前节点的对象
|
/// <summary>
|
||||||
/// </summary>
|
/// 下一个节点
|
||||||
public dynamic currentNode { get { return this.nodeDictionary[this.currentNodeId]; } }
|
/// </summary>
|
||||||
/// <summary>
|
public string nextNodeId { get; set; }
|
||||||
/// 下一个节点
|
/// <summary>
|
||||||
/// </summary>
|
/// 下一个节点类型
|
||||||
public string nextNodeId { get; set; }
|
/// </summary>
|
||||||
/// <summary>
|
public int nextNodeType { get; set; }
|
||||||
/// 下一个节点类型
|
/// <summary>
|
||||||
/// </summary>
|
/// 下一个节点对象
|
||||||
public int nextNodeType { get; set; }
|
/// </summary>
|
||||||
/// <summary>
|
public FlowNode nextNode { get { return nodeDictionary[this.nextNodeId]; } }
|
||||||
/// 下一个节点对象
|
|
||||||
/// </summary>
|
/// <summary>
|
||||||
public dynamic nextNode { get { return this.nodeDictionary[this.nextNodeId]; } }
|
/// 上一个节点
|
||||||
|
/// </summary>
|
||||||
/// <summary>
|
public string previousId { get; set; }
|
||||||
/// 上一个节点
|
|
||||||
/// </summary>
|
/// <summary>
|
||||||
public string previousId { get; set; }
|
/// 实例节点集合
|
||||||
/// <summary>
|
/// </summary>
|
||||||
/// 上一个节点
|
public Dictionary<string, FlowNode> nodeDictionary { get; set; }
|
||||||
/// </summary>
|
/// <summary>
|
||||||
public dynamic previousNode { get { return this.nodeDictionary[this.previousId]; } }
|
/// 流转的线段集合
|
||||||
/// <summary>
|
/// </summary>
|
||||||
/// 实例节点集合
|
public Dictionary<string, List<dynamic>> lineDictionary { get; set; }
|
||||||
/// </summary>
|
|
||||||
public Dictionary<string, dynamic> nodeDictionary { get; set; }
|
/// <summary>
|
||||||
/// <summary>
|
/// 模板json数据
|
||||||
/// 流转的线段集合
|
/// </summary>
|
||||||
/// </summary>
|
public dynamic schemeContentJson { get; set; }
|
||||||
public Dictionary<string, List<dynamic>> lineDictionary { get; set; }
|
/// <summary>
|
||||||
/// <summary>
|
/// 表单数据
|
||||||
/// (建表的表单需要插入的数据表的语句)
|
/// </summary>
|
||||||
/// </summary>
|
public string frmData { get; set; }
|
||||||
public string sqlFrm { get; set; }
|
|
||||||
/// <summary>
|
}
|
||||||
/// 模板json数据
|
|
||||||
/// </summary>
|
}
|
||||||
public dynamic schemeContentJson { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// 表单数据
|
|
||||||
/// </summary>
|
|
||||||
public string frmData { get; set; }
|
|
||||||
/// <summary>
|
|
||||||
/// 表单类型(0自定义表单,1系统表单)
|
|
||||||
/// </summary>
|
|
||||||
public int frmType { get; set; }
|
|
||||||
}
|
|
||||||
|
|
||||||
public delegate string GetFrmData(string DataBaseId, string tableName, string tableFiled, string processId);
|
|
||||||
}
|
|
@@ -2,7 +2,7 @@ using System;
|
|||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using Infrastructure;
|
using Infrastructure;
|
||||||
using OpenAuth.App.Extention;
|
using OpenAuth.App.Flow;
|
||||||
using OpenAuth.App.Request;
|
using OpenAuth.App.Request;
|
||||||
using OpenAuth.App.Response;
|
using OpenAuth.App.Response;
|
||||||
using OpenAuth.App.SSO;
|
using OpenAuth.App.SSO;
|
||||||
@@ -72,18 +72,18 @@ namespace OpenAuth.App
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// <20>洢<EFBFBD><E6B4A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
/// <20>洢<EFBFBD><E6B4A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(<28><><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="wfRuntimeModel"></param>
|
/// <param name="flowRuntimeModel"></param>
|
||||||
/// <param name="flowInstance"></param>
|
/// <param name="flowInstance"></param>
|
||||||
/// <param name="processOperationHistoryEntity"></param>
|
/// <param name="processOperationHistoryEntity"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public int SaveProcess(WF_RuntimeModel wfRuntimeModel, FlowInstance flowInstance, FlowInstanceOperationHistory processOperationHistoryEntity, FlowInstanceTransitionHistory processTransitionHistoryEntity)
|
public int SaveProcess(FlowRuntimeModel flowRuntimeModel, FlowInstance flowInstance, FlowInstanceOperationHistory processOperationHistoryEntity, FlowInstanceTransitionHistory processTransitionHistoryEntity)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
if (string.Empty == (flowInstance.Id))
|
if (string.Empty == (flowInstance.Id))
|
||||||
{
|
{
|
||||||
|
|
||||||
flowInstance.Id = (string)(wfRuntimeModel.processId);
|
flowInstance.Id = (string)(flowRuntimeModel.flowInstanceId);
|
||||||
UnitWork.Add(flowInstance);
|
UnitWork.Add(flowInstance);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -205,14 +205,14 @@ namespace OpenAuth.App
|
|||||||
FlowScheme FlowScheme = UnitWork.FindSingle<FlowScheme>(u => u.Id == schemeInfoId);
|
FlowScheme FlowScheme = UnitWork.FindSingle<FlowScheme>(u => u.Id == schemeInfoId);
|
||||||
|
|
||||||
|
|
||||||
WF_RuntimeInitModel wfRuntimeInitModel = new WF_RuntimeInitModel()
|
FlowRuntimeInitModel flowRuntimeInitModel = new FlowRuntimeInitModel()
|
||||||
{
|
{
|
||||||
schemeContent = FlowScheme.SchemeContent,
|
schemeContent = FlowScheme.SchemeContent,
|
||||||
currentNodeId = "",
|
currentNodeId = "",
|
||||||
frmData = frmData,
|
frmData = frmData,
|
||||||
processId = processId
|
processId = processId
|
||||||
};
|
};
|
||||||
WF_Runtime wfruntime = null;
|
FlowRuntime wfruntime = null;
|
||||||
|
|
||||||
if (frmData == null)
|
if (frmData == null)
|
||||||
{
|
{
|
||||||
@@ -220,7 +220,7 @@ namespace OpenAuth.App
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
wfruntime = new WF_Runtime(wfRuntimeInitModel);
|
wfruntime = new FlowRuntime(flowRuntimeInitModel);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -253,7 +253,7 @@ namespace OpenAuth.App
|
|||||||
processTransitionHistoryEntity.FromNodeName = wfruntime.runtimeModel.currentNode.name.Value;
|
processTransitionHistoryEntity.FromNodeName = wfruntime.runtimeModel.currentNode.name.Value;
|
||||||
processTransitionHistoryEntity.FromNodeType = wfruntime.runtimeModel.currentNodeType;
|
processTransitionHistoryEntity.FromNodeType = wfruntime.runtimeModel.currentNodeType;
|
||||||
processTransitionHistoryEntity.ToNodeId = wfruntime.runtimeModel.nextNodeId;
|
processTransitionHistoryEntity.ToNodeId = wfruntime.runtimeModel.nextNodeId;
|
||||||
processTransitionHistoryEntity.ToNodeName = wfruntime.runtimeModel.nextNode.name.Value;
|
processTransitionHistoryEntity.ToNodeName = wfruntime.runtimeModel.nextNode.name;
|
||||||
processTransitionHistoryEntity.ToNodeType = wfruntime.runtimeModel.nextNodeType;
|
processTransitionHistoryEntity.ToNodeType = wfruntime.runtimeModel.nextNodeType;
|
||||||
processTransitionHistoryEntity.TransitionSate = 0;
|
processTransitionHistoryEntity.TransitionSate = 0;
|
||||||
processTransitionHistoryEntity.IsFinish = (processTransitionHistoryEntity.ToNodeType == 4 ? 1 : 0);
|
processTransitionHistoryEntity.IsFinish = (processTransitionHistoryEntity.ToNodeType == 4 ? 1 : 0);
|
||||||
@@ -290,13 +290,13 @@ namespace OpenAuth.App
|
|||||||
FlowInstanceOperationHistory FlowInstanceOperationHistory = new FlowInstanceOperationHistory();//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼
|
FlowInstanceOperationHistory FlowInstanceOperationHistory = new FlowInstanceOperationHistory();//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>¼
|
||||||
FlowInstanceTransitionHistory processTransitionHistoryEntity = null;//<2F><>ת<EFBFBD><D7AA>¼
|
FlowInstanceTransitionHistory processTransitionHistoryEntity = null;//<2F><>ת<EFBFBD><D7AA>¼
|
||||||
|
|
||||||
WF_RuntimeInitModel wfRuntimeInitModel = new WF_RuntimeInitModel()
|
FlowRuntimeInitModel flowRuntimeInitModel = new FlowRuntimeInitModel()
|
||||||
{
|
{
|
||||||
currentNodeId = FlowInstance.ActivityId,
|
currentNodeId = FlowInstance.ActivityId,
|
||||||
previousId = FlowInstance.PreviousId,
|
previousId = FlowInstance.PreviousId,
|
||||||
processId = processId
|
processId = processId
|
||||||
};
|
};
|
||||||
WF_Runtime wfruntime = new WF_Runtime(wfRuntimeInitModel);
|
FlowRuntime wfruntime = new FlowRuntime(flowRuntimeInitModel);
|
||||||
|
|
||||||
|
|
||||||
#region <EFBFBD><EFBFBD>ǩ
|
#region <EFBFBD><EFBFBD>ǩ
|
||||||
@@ -309,7 +309,7 @@ namespace OpenAuth.App
|
|||||||
string _makerList = "";
|
string _makerList = "";
|
||||||
foreach (string item in _nodelist)
|
foreach (string item in _nodelist)
|
||||||
{
|
{
|
||||||
_makerList = GetMakerList(wfruntime.runtimeModel.nodeDictionary[item], wfruntime.runtimeModel.processId);
|
_makerList = GetMakerList(wfruntime.runtimeModel.nodeDictionary[item], wfruntime.runtimeModel.flowInstanceId);
|
||||||
if (_makerList != "-1")
|
if (_makerList != "-1")
|
||||||
{
|
{
|
||||||
var id = AuthUtil.GetCurrentUser().User.Id.ToString();
|
var id = AuthUtil.GetCurrentUser().User.Id.ToString();
|
||||||
@@ -362,7 +362,7 @@ namespace OpenAuth.App
|
|||||||
processTransitionHistoryEntity.FromNodeName = wfruntime.runtimeModel.currentNode.name.Value;
|
processTransitionHistoryEntity.FromNodeName = wfruntime.runtimeModel.currentNode.name.Value;
|
||||||
processTransitionHistoryEntity.FromNodeType = wfruntime.runtimeModel.currentNodeType;
|
processTransitionHistoryEntity.FromNodeType = wfruntime.runtimeModel.currentNodeType;
|
||||||
processTransitionHistoryEntity.ToNodeId = wfruntime.runtimeModel.nextNodeId;
|
processTransitionHistoryEntity.ToNodeId = wfruntime.runtimeModel.nextNodeId;
|
||||||
processTransitionHistoryEntity.ToNodeName = wfruntime.runtimeModel.nextNode.name.Value;
|
processTransitionHistoryEntity.ToNodeName = wfruntime.runtimeModel.nextNode.name;
|
||||||
processTransitionHistoryEntity.ToNodeType = wfruntime.runtimeModel.nextNodeType;
|
processTransitionHistoryEntity.ToNodeType = wfruntime.runtimeModel.nextNodeType;
|
||||||
processTransitionHistoryEntity.TransitionSate = 0;
|
processTransitionHistoryEntity.TransitionSate = 0;
|
||||||
processTransitionHistoryEntity.IsFinish = (processTransitionHistoryEntity.ToNodeType == 4 ? 1 : 0);
|
processTransitionHistoryEntity.IsFinish = (processTransitionHistoryEntity.ToNodeType == 4 ? 1 : 0);
|
||||||
@@ -405,7 +405,7 @@ namespace OpenAuth.App
|
|||||||
FromNodeName = wfruntime.runtimeModel.currentNode.name.Value,
|
FromNodeName = wfruntime.runtimeModel.currentNode.name.Value,
|
||||||
FromNodeType = wfruntime.runtimeModel.currentNodeType,
|
FromNodeType = wfruntime.runtimeModel.currentNodeType,
|
||||||
ToNodeId = wfruntime.runtimeModel.nextNodeId,
|
ToNodeId = wfruntime.runtimeModel.nextNodeId,
|
||||||
ToNodeName = wfruntime.runtimeModel.nextNode.name.Value,
|
ToNodeName = wfruntime.runtimeModel.nextNode.name,
|
||||||
ToNodeType = wfruntime.runtimeModel.nextNodeType,
|
ToNodeType = wfruntime.runtimeModel.nextNodeType,
|
||||||
TransitionSate = 0
|
TransitionSate = 0
|
||||||
};
|
};
|
||||||
@@ -460,13 +460,13 @@ namespace OpenAuth.App
|
|||||||
FlowInstance FlowInstance = GetEntity(processId);
|
FlowInstance FlowInstance = GetEntity(processId);
|
||||||
FlowInstanceOperationHistory FlowInstanceOperationHistory = new FlowInstanceOperationHistory();
|
FlowInstanceOperationHistory FlowInstanceOperationHistory = new FlowInstanceOperationHistory();
|
||||||
FlowInstanceTransitionHistory processTransitionHistoryEntity = null;
|
FlowInstanceTransitionHistory processTransitionHistoryEntity = null;
|
||||||
WF_RuntimeInitModel wfRuntimeInitModel = new WF_RuntimeInitModel()
|
FlowRuntimeInitModel flowRuntimeInitModel = new FlowRuntimeInitModel()
|
||||||
{
|
{
|
||||||
currentNodeId = FlowInstance.ActivityId,
|
currentNodeId = FlowInstance.ActivityId,
|
||||||
previousId = FlowInstance.PreviousId,
|
previousId = FlowInstance.PreviousId,
|
||||||
processId = processId
|
processId = processId
|
||||||
};
|
};
|
||||||
WF_Runtime wfruntime = new WF_Runtime(wfRuntimeInitModel);
|
FlowRuntime wfruntime = new FlowRuntime(flowRuntimeInitModel);
|
||||||
|
|
||||||
|
|
||||||
string resnode = "";
|
string resnode = "";
|
||||||
@@ -493,7 +493,7 @@ namespace OpenAuth.App
|
|||||||
processTransitionHistoryEntity.FromNodeName = wfruntime.runtimeModel.currentNode.name.Value;
|
processTransitionHistoryEntity.FromNodeName = wfruntime.runtimeModel.currentNode.name.Value;
|
||||||
processTransitionHistoryEntity.FromNodeType = wfruntime.runtimeModel.currentNodeType;
|
processTransitionHistoryEntity.FromNodeType = wfruntime.runtimeModel.currentNodeType;
|
||||||
processTransitionHistoryEntity.ToNodeId = wfruntime.runtimeModel.nextNodeId;
|
processTransitionHistoryEntity.ToNodeId = wfruntime.runtimeModel.nextNodeId;
|
||||||
processTransitionHistoryEntity.ToNodeName = wfruntime.runtimeModel.nextNode.name.Value;
|
processTransitionHistoryEntity.ToNodeName = wfruntime.runtimeModel.nextNode.name;
|
||||||
processTransitionHistoryEntity.ToNodeType = wfruntime.runtimeModel.nextNodeType;
|
processTransitionHistoryEntity.ToNodeType = wfruntime.runtimeModel.nextNodeType;
|
||||||
processTransitionHistoryEntity.TransitionSate = 1;//
|
processTransitionHistoryEntity.TransitionSate = 1;//
|
||||||
processTransitionHistoryEntity.IsFinish = (processTransitionHistoryEntity.ToNodeType == 4 ? 1 : 0);
|
processTransitionHistoryEntity.IsFinish = (processTransitionHistoryEntity.ToNodeType == 4 ? 1 : 0);
|
||||||
@@ -521,7 +521,7 @@ namespace OpenAuth.App
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="wfruntime"></param>
|
/// <param name="wfruntime"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private string GetMakerList(WF_Runtime wfruntime)
|
private string GetMakerList(FlowRuntime wfruntime)
|
||||||
{
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
@@ -536,7 +536,7 @@ namespace OpenAuth.App
|
|||||||
string _makerList = "";
|
string _makerList = "";
|
||||||
foreach (string item in _nodelist)
|
foreach (string item in _nodelist)
|
||||||
{
|
{
|
||||||
_makerList = GetMakerList(wfruntime.runtimeModel.nodeDictionary[item], wfruntime.runtimeModel.processId);
|
_makerList = GetMakerList(wfruntime.runtimeModel.nodeDictionary[item], wfruntime.runtimeModel.flowInstanceId);
|
||||||
if (_makerList == "-1")
|
if (_makerList == "-1")
|
||||||
{
|
{
|
||||||
throw (new Exception("<22><EFBFBD>Ѱ<EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>ǩ<EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>鿴<EFBFBD><E9BFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!"));
|
throw (new Exception("<22><EFBFBD>Ѱ<EFBFBD>ҵ<EFBFBD><D2B5><EFBFBD>ǩ<EFBFBD>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>鿴<EFBFBD><E9BFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!"));
|
||||||
@@ -557,7 +557,7 @@ namespace OpenAuth.App
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
makerList = GetMakerList(wfruntime.runtimeModel.nextNode, wfruntime.runtimeModel.processId);
|
makerList = GetMakerList(wfruntime.runtimeModel.nextNode, wfruntime.runtimeModel.flowInstanceId);
|
||||||
if (makerList == "-1")
|
if (makerList == "-1")
|
||||||
{
|
{
|
||||||
throw (new Exception("<22><EFBFBD>Ѱ<EFBFBD>ҵ<EFBFBD><D2B5>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>鿴<EFBFBD><E9BFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!"));
|
throw (new Exception("<22><EFBFBD>Ѱ<EFBFBD>ҵ<EFBFBD><D2B5>ڵ<EFBFBD><DAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD>鿴<EFBFBD><E9BFB4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!"));
|
||||||
@@ -618,7 +618,7 @@ namespace OpenAuth.App
|
|||||||
//}
|
//}
|
||||||
//else if (node.setInfo.NodeDesignate.Value == "NodeDesignateType4")//ǰһ<C7B0><D2BB><EFBFBD><EFBFBD><EFBFBD>쵼
|
//else if (node.setInfo.NodeDesignate.Value == "NodeDesignateType4")//ǰһ<C7B0><D2BB><EFBFBD><EFBFBD><EFBFBD>쵼
|
||||||
//{
|
//{
|
||||||
// FlowInstanceTransitionHistory transitionHistoryEntity = FlowInstanceTransitionHistoryService.GetEntity(processId, node.id.Value);
|
// FlowInstanceTransitionHistory transitionHistoryEntity = FlowInstanceTransitionHistoryService.GetEntity(flowInstanceId, node.id.Value);
|
||||||
// UserEntity userEntity = userService.GetEntity(transitionHistoryEntity.CreateUserId);
|
// UserEntity userEntity = userService.GetEntity(transitionHistoryEntity.CreateUserId);
|
||||||
// if (string.IsNullOrEmpty(userEntity.ManagerId))
|
// if (string.IsNullOrEmpty(userEntity.ManagerId))
|
||||||
// {
|
// {
|
||||||
|
@@ -107,9 +107,11 @@
|
|||||||
<Compile Include="AuthorizeApp.cs" />
|
<Compile Include="AuthorizeApp.cs" />
|
||||||
<Compile Include="CategoryApp.cs" />
|
<Compile Include="CategoryApp.cs" />
|
||||||
<Compile Include="Define.cs" />
|
<Compile Include="Define.cs" />
|
||||||
<Compile Include="Extention\WF_Runtime.cs" />
|
<Compile Include="Flow\FlowRuntime.cs" />
|
||||||
<Compile Include="Extention\WF_RuntimeInitModel.cs" />
|
<Compile Include="Flow\FlowRuntimeInitModel.cs" />
|
||||||
<Compile Include="Extention\WF_RuntimeModel.cs" />
|
<Compile Include="Flow\FlowRuntimeModel.cs" />
|
||||||
|
<Compile Include="Flow\FlowLine.cs" />
|
||||||
|
<Compile Include="Flow\FlowNode.cs" />
|
||||||
<Compile Include="FormApp.cs" />
|
<Compile Include="FormApp.cs" />
|
||||||
<Compile Include="Request\IdPageReq.cs" />
|
<Compile Include="Request\IdPageReq.cs" />
|
||||||
<Compile Include="Request\PageReq.cs" />
|
<Compile Include="Request\PageReq.cs" />
|
||||||
|
@@ -103,15 +103,20 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
var url = '/flowschemes/load';
|
var url = '/flowschemes/load';
|
||||||
$.getJSON(url, function (json) {
|
$.ajax(url,
|
||||||
zTreeObj = $.fn.zTree.init($("#frmTree"), setting);
|
{
|
||||||
zTreeObj.addNodes(null, json.data);
|
async: false
|
||||||
|
|
||||||
$("#menutree").html("点击预览表单效果");
|
, success: function (data) {
|
||||||
zTreeObj.expandAll(true);
|
var json = JSON.parse(data);
|
||||||
});
|
zTreeObj = $.fn.zTree.init($("#frmTree"), setting);
|
||||||
|
zTreeObj.addNodes(null, json.data);
|
||||||
|
|
||||||
|
$("#menutree").html("点击预览表单效果");
|
||||||
|
zTreeObj.expandAll(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
var setCheck = function (id) { //设置已经选中的表单
|
var setCheck = function (id) { //设置已经选中的表单
|
||||||
if (id == null | id == '') return;
|
if (id == null | id == '') return;
|
||||||
|
@@ -57,13 +57,19 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
var url = '/forms/load';
|
var url = '/forms/load';
|
||||||
$.getJSON(url, function (json) { //todo:这个地方要用同步方式,不然后面的setCheck会出问题
|
$.ajax(url,
|
||||||
zTreeObj = $.fn.zTree.init($("#frmTree"), setting);
|
{
|
||||||
zTreeObj.addNodes(null, json.data);
|
async: false
|
||||||
|
|
||||||
$("#menutree").html("点击预览表单效果");
|
, success: function (data) {
|
||||||
zTreeObj.expandAll(true);
|
var json = JSON.parse(data);
|
||||||
});
|
zTreeObj = $.fn.zTree.init($("#frmTree"), setting);
|
||||||
|
zTreeObj.addNodes(null, json.data);
|
||||||
|
|
||||||
|
$("#menutree").html("点击预览表单效果");
|
||||||
|
zTreeObj.expandAll(true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
var setCheck = function (id) { //设置已经选中的表单
|
var setCheck = function (id) { //设置已经选中的表单
|
||||||
if (id == null | id == '') return;
|
if (id == null | id == '') return;
|
||||||
|
Reference in New Issue
Block a user