mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-11-09 10:54:46 +08:00
更改gooflow的导出数据格式,方便后端读取
This commit is contained in:
@@ -1,64 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace OpenAuth.App.Extention
|
||||
{
|
||||
public interface IWF_Runtime
|
||||
{
|
||||
#region 工作流实例流转API
|
||||
/// <summary>
|
||||
/// 工作流实例运行信息
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
WF_RuntimeModel runtimeModel{get;}
|
||||
/// <summary>
|
||||
/// 获取实例接下来运行的状态
|
||||
/// </summary>
|
||||
/// <returns>-1无法运行,0会签开始,1会签结束,2一般节点,4流程运行结束</returns>
|
||||
int GetStatus();
|
||||
/// <summary>
|
||||
/// 获取节点类型 0会签开始,1会签结束,2一般节点,开始节点,4流程运行结束
|
||||
/// </summary>
|
||||
/// <param name="nodeId"></param>
|
||||
/// <returns></returns>
|
||||
int GetNodeStatus(string nodeId);
|
||||
/// <summary>
|
||||
/// 获取会签下面需要审核的ID列表
|
||||
/// </summary>
|
||||
/// <param name="shuntnodeId"></param>
|
||||
/// <returns></returns>
|
||||
List<string> GetCountersigningNodeIdList(string shuntnodeId);
|
||||
/// <summary>
|
||||
/// 通过节点Id获取下一个节点Id
|
||||
/// </summary>
|
||||
/// <param name="nodeId"></param>
|
||||
/// <returns></returns>
|
||||
string GetNextNodeByNodeId(string nodeId);
|
||||
/// <summary>
|
||||
/// 节点会签审核
|
||||
/// </summary>
|
||||
/// <param name="nodeId"></param>
|
||||
/// <param name="flag"></param>
|
||||
/// <returns>-1不通过,1等待,其它通过</returns>
|
||||
string NodeConfluence(string nodeId, bool flag,string userId, string description = "");
|
||||
/// <summary>
|
||||
/// 驳回节点0"前一步"1"第一步"2"某一步" 3"不处理"
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
string RejectNode();
|
||||
/// <summary>
|
||||
/// 驳回节点0"前一步"1"第一步"2"某一步" 3"不处理"
|
||||
/// </summary>
|
||||
/// <param name="nodeId"></param>
|
||||
/// <returns></returns>
|
||||
string RejectNode(string nodeId);
|
||||
/// <summary>
|
||||
/// 标记节点1通过,-1不通过,0驳回
|
||||
/// </summary>
|
||||
/// <param name="nodeId"></param>
|
||||
/// <param name="flag"></param>
|
||||
/// <param name="userId"></param>
|
||||
/// <param name="description"></param>
|
||||
void MakeTagNode(string nodeId, int flag,string userId, string description = "");
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -5,7 +5,7 @@ using Infrastructure;
|
||||
|
||||
namespace OpenAuth.App.Extention
|
||||
{
|
||||
public class WF_Runtime : IWF_Runtime
|
||||
public class WF_Runtime
|
||||
{
|
||||
private WF_RuntimeModel _runtimeModel = null;
|
||||
|
||||
|
||||
@@ -182,100 +182,6 @@ namespace OpenAuth.App
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>(ɾ<><C9BE><EFBFBD>ݸ<EFBFBD>ʹ<EFBFBD><CAB9>)
|
||||
/// </summary>
|
||||
/// <param name="keyValue"><3E><><EFBFBD><EFBFBD></param>
|
||||
/// <returns></returns>
|
||||
public int DeleteProcess(string keyValue)
|
||||
{
|
||||
try
|
||||
{
|
||||
FlowInstance entity = UnitWork.FindSingle<FlowInstance>(u =>u.Id ==keyValue);
|
||||
|
||||
UnitWork.Delete<FlowInstance>(u =>u.Id == keyValue);
|
||||
UnitWork.Save();
|
||||
return 1;
|
||||
}
|
||||
catch {
|
||||
throw;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʵ<EFBFBD><CAB5>
|
||||
/// </summary>
|
||||
/// <param name="keyValue"></param>
|
||||
/// <param name="state">0<><30>ͣ,1<><31><EFBFBD><EFBFBD>,2ȡ<32><C8A1><EFBFBD><EFBFBD><EFBFBD>ٻأ<D9BB></param>
|
||||
/// <returns></returns>
|
||||
public int OperateVirtualProcess(string keyValue,int state)
|
||||
{
|
||||
try
|
||||
{
|
||||
FlowInstance entity = UnitWork.FindSingle<FlowInstance>(u =>u.Id ==keyValue);
|
||||
if (entity.IsFinish == 1)
|
||||
{
|
||||
throw new Exception("ʵ<><CAB5><EFBFBD>Ѿ<EFBFBD><D1BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,<2C><><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>");
|
||||
}
|
||||
else if (entity.IsFinish == 2)
|
||||
{
|
||||
throw new Exception("ʵ<><CAB5><EFBFBD>Ѿ<EFBFBD>ȡ<EFBFBD><C8A1>,<2C><><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>");
|
||||
}
|
||||
/// <20><><EFBFBD><EFBFBD><EFBFBD>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>(0<><30><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,1<><31><EFBFBD>н<EFBFBD><D0BD><EFBFBD>,2<><32><EFBFBD>ٻ<EFBFBD>,3<><33>ͬ<EFBFBD><CDAC>,4<><34>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
||||
string content = "";
|
||||
switch (state)
|
||||
{
|
||||
case 0:
|
||||
if (entity.Disabled == 0)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
entity.Disabled = 0;
|
||||
content = "<22><><EFBFBD><EFBFBD>ͣ<EFBFBD><CDA3><EFBFBD><EFBFBD>ͣ<EFBFBD><CDA3>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD>̽<EFBFBD><CCBD>̡<EFBFBD>" + entity.Code + "/" + entity.CustomName + "<22><>";
|
||||
break;
|
||||
case 1:
|
||||
if (entity.Disabled == 1)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
entity.Disabled = 1;
|
||||
content = "<22><><EFBFBD><EFBFBD><EFBFBD>á<EFBFBD><C3A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD>̽<EFBFBD><CCBD>̡<EFBFBD>" + entity.Code + "/" + entity.CustomName + "<22><>";
|
||||
break;
|
||||
case 2:
|
||||
entity.IsFinish = 2;
|
||||
content = "<22><><EFBFBD>ٻء<D9BB><D8A1>ٻ<EFBFBD><D9BB><EFBFBD>һ<EFBFBD><D2BB><EFBFBD><EFBFBD><EFBFBD>̽<EFBFBD><CCBD>̡<EFBFBD>" + entity.Code + "/" + entity.CustomName + "<22><>";
|
||||
break;
|
||||
}
|
||||
UnitWork.Update(entity);
|
||||
FlowInstanceOperationHistory processOperationHistoryEntity = new FlowInstanceOperationHistory();
|
||||
processOperationHistoryEntity.InstanceId = entity.Id;
|
||||
processOperationHistoryEntity.Content = content;
|
||||
UnitWork.Add(processOperationHistoryEntity);
|
||||
UnitWork.Save();
|
||||
return 1;
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <20><><EFBFBD><EFBFBD>ָ<EFBFBD><D6B8>
|
||||
/// </summary>
|
||||
/// <param name="processId"></param>
|
||||
/// <param name="makeLists"></param>
|
||||
public void DesignateProcess(string processId, string makeLists)
|
||||
{
|
||||
try
|
||||
{
|
||||
FlowInstance entity = new FlowInstance();
|
||||
entity.Id = processId;
|
||||
entity.MakerList = makeLists;
|
||||
UnitWork.Update(entity);
|
||||
}
|
||||
catch {
|
||||
throw;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
|
||||
@@ -306,7 +212,7 @@ namespace OpenAuth.App
|
||||
frmData = frmData,
|
||||
processId = processId
|
||||
};
|
||||
IWF_Runtime wfruntime = null;
|
||||
WF_Runtime wfruntime = null;
|
||||
|
||||
if (frmData == null)
|
||||
{
|
||||
@@ -390,7 +296,7 @@ namespace OpenAuth.App
|
||||
previousId = FlowInstance.PreviousId,
|
||||
processId = processId
|
||||
};
|
||||
IWF_Runtime wfruntime = new WF_Runtime(wfRuntimeInitModel);
|
||||
WF_Runtime wfruntime = new WF_Runtime(wfRuntimeInitModel);
|
||||
|
||||
|
||||
#region <EFBFBD><EFBFBD>ǩ
|
||||
@@ -560,7 +466,7 @@ namespace OpenAuth.App
|
||||
previousId = FlowInstance.PreviousId,
|
||||
processId = processId
|
||||
};
|
||||
IWF_Runtime wfruntime = new WF_Runtime(wfRuntimeInitModel);
|
||||
WF_Runtime wfruntime = new WF_Runtime(wfRuntimeInitModel);
|
||||
|
||||
|
||||
string resnode = "";
|
||||
@@ -608,138 +514,6 @@ namespace OpenAuth.App
|
||||
throw;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <20>ٻ<EFBFBD><D9BB><EFBFBD><EFBFBD>̽<EFBFBD><CCBD><EFBFBD>
|
||||
/// </summary>
|
||||
/// <param name="processId"></param>
|
||||
public void CallingBackProcess(string processId)
|
||||
{
|
||||
try
|
||||
{
|
||||
OperateVirtualProcess(processId, 2);
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <20><>ֹһ<D6B9><D2BB>ʵ<EFBFBD><CAB5>(<28><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE>)
|
||||
/// </summary>
|
||||
/// <param name="processId"></param>
|
||||
/// <returns></returns>
|
||||
public void KillProcess(string processId)
|
||||
{
|
||||
try
|
||||
{
|
||||
UnitWork.Delete<FlowInstance>(u => u.Id == processId);
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <20><>ȡij<C8A1><C4B3><EFBFBD>ڵ㣨<DAB5><E3A3A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܿ<EFBFBD><DCBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <returns></returns>
|
||||
public string GetProcessSchemeContentByNodeId(string data, string nodeId)
|
||||
{
|
||||
try
|
||||
{
|
||||
List<dynamic> list = new List<dynamic>();
|
||||
dynamic schemeContentJson = data.ToJson();//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD>ݵ<EFBFBD>json<6F><6E><EFBFBD><EFBFBD>;
|
||||
string schemeContent1 = schemeContentJson.SchemeContent.Value;
|
||||
dynamic schemeContentJson1 = schemeContent1.ToJson();
|
||||
string FrmContent = schemeContentJson1.Frm.FrmContent.Value;
|
||||
dynamic FrmContentJson = FrmContent.ToJson();
|
||||
|
||||
foreach (var item in schemeContentJson1.Flow.nodes)
|
||||
{
|
||||
if (item.id.Value == nodeId && item.setInfo != null)
|
||||
{
|
||||
foreach (var item1 in item.setInfo.frmPermissionInfo)
|
||||
{
|
||||
foreach (var item2 in FrmContentJson)
|
||||
{
|
||||
if (item2.control_field.Value == item1.fieldid.Value)
|
||||
{
|
||||
if (item1.look.Value == true)
|
||||
{
|
||||
if (item1.down != null)
|
||||
{
|
||||
item2.down = item1.down.Value;
|
||||
}
|
||||
list.Add(item2);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
schemeContentJson1.Frm.FrmContent = list.ToJson().ToString();
|
||||
schemeContentJson.SchemeContent = schemeContentJson1.ToString();
|
||||
return schemeContentJson.ToString();
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// <20><>ȡij<C8A1><C4B3><EFBFBD>ڵ㣨<DAB5><E3A3A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܿ<EFBFBD><DCBF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ύ<EFBFBD><E1BDBB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ȩ<EFBFBD>ޣ<EFBFBD>
|
||||
/// </summary>
|
||||
/// <param name="data"></param>
|
||||
/// <param name="userId"></param>
|
||||
/// <returns></returns>
|
||||
public string GetProcessSchemeContentByUserId(string data, string userId)
|
||||
{
|
||||
try
|
||||
{
|
||||
List<dynamic> list = new List<dynamic>();
|
||||
dynamic schemeContentJson = data.ToJson();//<2F><>ȡ<EFBFBD><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD><EFBFBD>ݵ<EFBFBD>json<6F><6E><EFBFBD><EFBFBD>;
|
||||
string schemeContent1 = schemeContentJson.SchemeContent.Value;
|
||||
dynamic schemeContentJson1 = schemeContent1.ToJson();
|
||||
string FrmContent = schemeContentJson1.Frm.FrmContent.Value;
|
||||
dynamic FrmContentJson = FrmContent.ToJson();
|
||||
|
||||
foreach (var item in schemeContentJson1.Flow.nodes)
|
||||
{
|
||||
if (item.setInfo != null && item.setInfo.UserId != null && item.setInfo.UserId.Value == userId)
|
||||
{
|
||||
foreach (var item1 in item.setInfo.frmPermissionInfo)
|
||||
{
|
||||
foreach (var item2 in FrmContentJson)
|
||||
{
|
||||
if (item2.control_field.Value == item1.fieldid.Value)
|
||||
{
|
||||
if (item1.look.Value == true)
|
||||
{
|
||||
if (item1.down != null)
|
||||
{
|
||||
item2.down = item1.down.Value;
|
||||
}
|
||||
list.Add(item2);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
schemeContentJson1.Frm.FrmContent = list.ToJson().ToString();
|
||||
schemeContentJson.SchemeContent = schemeContentJson1.ToString();
|
||||
return schemeContentJson.ToString();
|
||||
}
|
||||
catch
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
@@ -747,7 +521,7 @@ namespace OpenAuth.App
|
||||
/// </summary>
|
||||
/// <param name="wfruntime"></param>
|
||||
/// <returns></returns>
|
||||
private string GetMakerList(IWF_Runtime wfruntime)
|
||||
private string GetMakerList(WF_Runtime wfruntime)
|
||||
{
|
||||
try
|
||||
{
|
||||
@@ -912,11 +686,6 @@ namespace OpenAuth.App
|
||||
}
|
||||
|
||||
|
||||
public FlowInstance GetProcessInstanceEntity(string keyValue)
|
||||
{
|
||||
return UnitWork.FindSingle<FlowInstance>(u => u.Id == keyValue);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
/// <para><3E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>2017-01-20 15:44:45</para>
|
||||
@@ -955,9 +724,9 @@ namespace OpenAuth.App
|
||||
}
|
||||
|
||||
|
||||
public void Add(FlowInstance flowScheme)
|
||||
public void Add(FlowInstance instance)
|
||||
{
|
||||
Repository.Add(flowScheme);
|
||||
Repository.Add(instance);
|
||||
}
|
||||
|
||||
public void Update(FlowInstance flowScheme)
|
||||
|
||||
@@ -13,22 +13,15 @@ namespace OpenAuth.App
|
||||
* view
|
||||
*/
|
||||
private static string temp_view = "<div style=\"{0}\"/>{1}</div>";
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* 功能: html
|
||||
*/
|
||||
public static string GetHtml(Form form, string action){
|
||||
|
||||
//action=action!=null && !""==(action)?action:"view";
|
||||
|
||||
var tableData =new Dictionary<string, Object>();//表单数据
|
||||
|
||||
string html = form.ContentParse;
|
||||
foreach (var json in form.ContentData.ToList<JObject>())
|
||||
{
|
||||
|
||||
|
||||
public static string GetHtml(string contentData, string contentParse, string action)
|
||||
{
|
||||
var tableData = new Dictionary<string, Object>();//表单数据
|
||||
|
||||
string html = contentParse;
|
||||
foreach (var json in contentData.ToList<JObject>())
|
||||
{
|
||||
string name = "";
|
||||
string leipiplugins = json.GetValue("leipiplugins").ToString();
|
||||
if ("checkboxs" == (leipiplugins))
|
||||
@@ -54,11 +47,11 @@ namespace OpenAuth.App
|
||||
case "checkboxs":
|
||||
temp_html = GetCheckboxs(json, tableData, action);
|
||||
break;
|
||||
|
||||
|
||||
case "qrcode"://二维码
|
||||
temp_html = GetQrcode(json, tableData, action);
|
||||
break;
|
||||
|
||||
|
||||
case "progressbar"://进度条 (未做处理)
|
||||
/*temp_html = GetProgressbar(json, tableData, action);*/
|
||||
break;
|
||||
@@ -69,11 +62,22 @@ namespace OpenAuth.App
|
||||
|
||||
html = html.Replace("{" + name + "}", temp_html);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
return html;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* 功能: html
|
||||
*/
|
||||
public static string GetHtml(Form form, string action){
|
||||
|
||||
//action=action!=null && !""==(action)?action:"view";
|
||||
return GetHtml(form.ContentData, form.ContentParse, action);
|
||||
|
||||
}
|
||||
|
||||
//text
|
||||
private static string GetTextBox(JObject item, Dictionary<string,Object> formData,string action)
|
||||
{
|
||||
|
||||
@@ -107,7 +107,6 @@
|
||||
<Compile Include="AuthorizeApp.cs" />
|
||||
<Compile Include="CategoryApp.cs" />
|
||||
<Compile Include="Define.cs" />
|
||||
<Compile Include="Extention\IWF_Runtime.cs" />
|
||||
<Compile Include="Extention\WF_Runtime.cs" />
|
||||
<Compile Include="Extention\WF_RuntimeInitModel.cs" />
|
||||
<Compile Include="Extention\WF_RuntimeModel.cs" />
|
||||
|
||||
Reference in New Issue
Block a user