mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-09-20 10:37:55 +08:00
更改gooflow的导出数据格式,方便后端读取
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user