mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-07-16 07:59:54 +08:00
fix issue #I62Y58 更新流程实例时,同时更新拖拽表单关联的数据库表(或自定义表单定义的表)
This commit is contained in:
parent
f55ceba171
commit
bb7bb2675f
@ -51,7 +51,7 @@ namespace OpenAuth.App
|
|||||||
public FlowInstanceApp(IUnitWork<OpenAuthDBContext> unitWork,
|
public FlowInstanceApp(IUnitWork<OpenAuthDBContext> unitWork,
|
||||||
IRepository<FlowInstance, OpenAuthDBContext> repository
|
IRepository<FlowInstance, OpenAuthDBContext> repository
|
||||||
, RevelanceManagerApp app, FlowSchemeApp flowSchemeApp, FormApp formApp,
|
, RevelanceManagerApp app, FlowSchemeApp flowSchemeApp, FormApp formApp,
|
||||||
IHttpClientFactory httpClientFactory, IAuth auth, IServiceProvider serviceProvider,
|
IHttpClientFactory httpClientFactory, IAuth auth, IServiceProvider serviceProvider,
|
||||||
SysMessageApp messageApp, DbExtension dbExtension)
|
SysMessageApp messageApp, DbExtension dbExtension)
|
||||||
: base(unitWork, repository, auth)
|
: base(unitWork, repository, auth)
|
||||||
{
|
{
|
||||||
@ -116,7 +116,8 @@ namespace OpenAuth.App
|
|||||||
flowInstance.PreviousId = wfruntime.currentNodeId;
|
flowInstance.PreviousId = wfruntime.currentNodeId;
|
||||||
flowInstance.CreateUserId = user.User.Id;
|
flowInstance.CreateUserId = user.User.Id;
|
||||||
flowInstance.CreateUserName = user.User.Account;
|
flowInstance.CreateUserName = user.User.Account;
|
||||||
flowInstance.MakerList = (wfruntime.GetNextNodeType() != 4 ? GetNextMakers(wfruntime, addFlowInstanceReq) : "");
|
flowInstance.MakerList =
|
||||||
|
(wfruntime.GetNextNodeType() != 4 ? GetNextMakers(wfruntime, addFlowInstanceReq) : "");
|
||||||
flowInstance.IsFinish = (wfruntime.GetNextNodeType() == 4
|
flowInstance.IsFinish = (wfruntime.GetNextNodeType() == 4
|
||||||
? FlowInstanceStatus.Finished
|
? FlowInstanceStatus.Finished
|
||||||
: FlowInstanceStatus.Running);
|
: FlowInstanceStatus.Running);
|
||||||
@ -136,26 +137,26 @@ namespace OpenAuth.App
|
|||||||
{
|
{
|
||||||
var dbcolumns = _dbExtension.GetDbTableStructure(form.DbName);
|
var dbcolumns = _dbExtension.GetDbTableStructure(form.DbName);
|
||||||
var json = JsonHelper.Instance.Deserialize<JObject>(addFlowInstanceReq.FrmData);
|
var json = JsonHelper.Instance.Deserialize<JObject>(addFlowInstanceReq.FrmData);
|
||||||
var columnstr = string.Empty; //字段
|
var columnstr = string.Empty; //字段
|
||||||
var valstr = string.Empty; //值字符串
|
var valstr = string.Empty; //值字符串
|
||||||
|
|
||||||
|
|
||||||
foreach (var column in dbcolumns)
|
foreach (var column in dbcolumns)
|
||||||
{
|
{
|
||||||
if (column.ColumnName == "Id" || column.ColumnName=="id")
|
if (column.ColumnName == "Id" || column.ColumnName == "id")
|
||||||
{
|
{
|
||||||
var options = new IdGeneratorOptions()
|
var options = new IdGeneratorOptions()
|
||||||
{
|
{
|
||||||
Method = 1,
|
Method = 1,
|
||||||
WorkerId = 1
|
WorkerId = 1
|
||||||
};
|
};
|
||||||
|
|
||||||
YitIdHelper.SetIdGenerator(options);
|
YitIdHelper.SetIdGenerator(options);
|
||||||
columnstr += "Id,";
|
columnstr += "Id,";
|
||||||
valstr += "'" + YitIdHelper.NextId().ToString() + "',";
|
valstr += "'" + YitIdHelper.NextId().ToString() + "',";
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
//讲流程实例ID赋值到表单数据表中,实现表单记录与流程实例关联
|
//讲流程实例ID赋值到表单数据表中,实现表单记录与流程实例关联
|
||||||
if (column.ColumnName == Define.DEFAULT_FORM_INSTANCE_ID_NAME)
|
if (column.ColumnName == Define.DEFAULT_FORM_INSTANCE_ID_NAME)
|
||||||
{
|
{
|
||||||
@ -163,7 +164,7 @@ namespace OpenAuth.App
|
|||||||
valstr += "'" + flowInstance.Id + "',";
|
valstr += "'" + flowInstance.Id + "',";
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
var val = json[column.ColumnName];
|
var val = json[column.ColumnName];
|
||||||
if (val == null)
|
if (val == null)
|
||||||
{
|
{
|
||||||
@ -180,8 +181,8 @@ namespace OpenAuth.App
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(val == null) continue;
|
if (val == null) continue;
|
||||||
columnstr += column.ColumnName + ",";
|
columnstr += column.ColumnName + ",";
|
||||||
valstr += "'" + val + "',";
|
valstr += "'" + val + "',";
|
||||||
}
|
}
|
||||||
@ -216,7 +217,7 @@ namespace OpenAuth.App
|
|||||||
UnitWork.Save();
|
UnitWork.Save();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 更新流程
|
/// 更新流程
|
||||||
/// <para>更新时可以修改表单内容,可以修改流程基本信息,但不能更换表单模版</para>
|
/// <para>更新时可以修改表单内容,可以修改流程基本信息,但不能更换表单模版</para>
|
||||||
@ -232,12 +233,70 @@ namespace OpenAuth.App
|
|||||||
throw new Exception("只能修改【草稿】和【驳回】状态的流程");
|
throw new Exception("只能修改【草稿】和【驳回】状态的流程");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var form = _formApp.Get(flowinstance.FrmId);
|
||||||
|
|
||||||
|
if (form != null)
|
||||||
|
{
|
||||||
|
if (form.FrmType == 1) //如果是开发者自定义的表单,更新对应数据库表数据
|
||||||
|
{
|
||||||
|
var t = Type.GetType("OpenAuth.App." + req.DbName + "App");
|
||||||
|
ICustomerForm icf = (ICustomerForm) _serviceProvider.GetService(t);
|
||||||
|
icf.Update(req.Id, req.FrmData);
|
||||||
|
}
|
||||||
|
else if (form.FrmType == 2 && !string.IsNullOrEmpty(form.DbName)) //拖拽表单定义了关联数据库
|
||||||
|
{
|
||||||
|
var dbcolumns = _dbExtension.GetDbTableStructure(form.DbName);
|
||||||
|
var json = JsonHelper.Instance.Deserialize<JObject>(req.FrmData);
|
||||||
|
var updatestr = string.Empty; //字段
|
||||||
|
|
||||||
|
foreach (var column in dbcolumns)
|
||||||
|
{
|
||||||
|
if (column.ColumnName == "Id" || column.ColumnName == "id")
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
//讲流程实例ID赋值到表单数据表中,实现表单记录与流程实例关联
|
||||||
|
if (column.ColumnName == Define.DEFAULT_FORM_INSTANCE_ID_NAME)
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
var val = json[column.ColumnName];
|
||||||
|
if (val == null)
|
||||||
|
{
|
||||||
|
switch (column.EntityType)
|
||||||
|
{
|
||||||
|
case "int":
|
||||||
|
val = 0;
|
||||||
|
break;
|
||||||
|
case "string":
|
||||||
|
val = "";
|
||||||
|
break;
|
||||||
|
case "DateTime":
|
||||||
|
val = DateTime.Now.ToString("yyyy-MM-dd");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (val == null) continue;
|
||||||
|
updatestr += $"{column.ColumnName} = '{val}',";
|
||||||
|
}
|
||||||
|
|
||||||
|
updatestr = updatestr.TrimEnd(',');
|
||||||
|
var sql =
|
||||||
|
$"update {form.DbName} set {updatestr} where {Define.DEFAULT_FORM_INSTANCE_ID_NAME}='{req.Id}'";
|
||||||
|
UnitWork.ExecuteSql(sql);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
flowinstance.Description = req.Description;
|
flowinstance.Description = req.Description;
|
||||||
flowinstance.Code = req.Code;
|
flowinstance.Code = req.Code;
|
||||||
flowinstance.FrmData = req.FrmData;
|
flowinstance.FrmData = req.FrmData;
|
||||||
flowinstance.DbName = req.DbName;
|
flowinstance.DbName = req.DbName;
|
||||||
flowinstance.CustomName = req.CustomName;
|
flowinstance.CustomName = req.CustomName;
|
||||||
Repository.Update(flowinstance);
|
UnitWork.Update(flowinstance);
|
||||||
|
UnitWork.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@ -249,7 +308,7 @@ namespace OpenAuth.App
|
|||||||
{
|
{
|
||||||
var user = _auth.GetCurrentUser().User;
|
var user = _auth.GetCurrentUser().User;
|
||||||
var instanceId = request.FlowInstanceId;
|
var instanceId = request.FlowInstanceId;
|
||||||
|
|
||||||
var tag = new Tag
|
var tag = new Tag
|
||||||
{
|
{
|
||||||
UserName = user.Name,
|
UserName = user.Name,
|
||||||
@ -257,14 +316,14 @@ namespace OpenAuth.App
|
|||||||
Description = request.VerificationOpinion,
|
Description = request.VerificationOpinion,
|
||||||
Taged = Int32.Parse(request.VerificationFinally)
|
Taged = Int32.Parse(request.VerificationFinally)
|
||||||
};
|
};
|
||||||
|
|
||||||
FlowInstance flowInstance = Get(instanceId);
|
FlowInstance flowInstance = Get(instanceId);
|
||||||
|
|
||||||
if (flowInstance.MakerList != "1" && !flowInstance.MakerList.Contains(user.Id))
|
if (flowInstance.MakerList != "1" && !flowInstance.MakerList.Contains(user.Id))
|
||||||
{
|
{
|
||||||
throw new Exception("当前用户没有审批该节点权限");
|
throw new Exception("当前用户没有审批该节点权限");
|
||||||
}
|
}
|
||||||
|
|
||||||
FlowInstanceOperationHistory flowInstanceOperationHistory = new FlowInstanceOperationHistory
|
FlowInstanceOperationHistory flowInstanceOperationHistory = new FlowInstanceOperationHistory
|
||||||
{
|
{
|
||||||
InstanceId = instanceId,
|
InstanceId = instanceId,
|
||||||
@ -353,7 +412,7 @@ namespace OpenAuth.App
|
|||||||
wfruntime.nextNodeId = "-1";
|
wfruntime.nextNodeId = "-1";
|
||||||
wfruntime.nextNodeType = 4;
|
wfruntime.nextNodeType = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
AddTransHistory(wfruntime);
|
AddTransHistory(wfruntime);
|
||||||
|
|
||||||
flowInstanceOperationHistory.Content = "【" + wfruntime.currentNode.name
|
flowInstanceOperationHistory.Content = "【" + wfruntime.currentNode.name
|
||||||
@ -369,12 +428,12 @@ namespace OpenAuth.App
|
|||||||
if (!string.IsNullOrEmpty(request.FrmData))
|
if (!string.IsNullOrEmpty(request.FrmData))
|
||||||
{
|
{
|
||||||
flowInstance.FrmData = request.FrmData;
|
flowInstance.FrmData = request.FrmData;
|
||||||
|
|
||||||
if (flowInstance.FrmType == 1) //如果是开发者自定义的表单,更新对应数据库表数据
|
if (flowInstance.FrmType == 1) //如果是开发者自定义的表单,更新对应数据库表数据
|
||||||
{
|
{
|
||||||
var t = Type.GetType("OpenAuth.App." + flowInstance.DbName + "App");
|
var t = Type.GetType("OpenAuth.App." + flowInstance.DbName + "App");
|
||||||
ICustomerForm icf = (ICustomerForm) _serviceProvider.GetService(t);
|
ICustomerForm icf = (ICustomerForm) _serviceProvider.GetService(t);
|
||||||
icf.Update(flowInstance.Id,flowInstance.FrmData);
|
icf.Update(flowInstance.Id, flowInstance.FrmData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -382,8 +441,8 @@ namespace OpenAuth.App
|
|||||||
UnitWork.Add(flowInstanceOperationHistory);
|
UnitWork.Add(flowInstanceOperationHistory);
|
||||||
|
|
||||||
//给流程创建人发送通知信息
|
//给流程创建人发送通知信息
|
||||||
_messageApp.SendMsgTo(flowInstance.CreateUserId,
|
_messageApp.SendMsgTo(flowInstance.CreateUserId,
|
||||||
$"你的流程[{flowInstance.CustomName}]已被{user.Name}处理。处理情况如下:{flowInstanceOperationHistory.Content}");
|
$"你的流程[{flowInstance.CustomName}]已被{user.Name}处理。处理情况如下:{flowInstanceOperationHistory.Content}");
|
||||||
|
|
||||||
UnitWork.Save();
|
UnitWork.Save();
|
||||||
|
|
||||||
@ -468,9 +527,9 @@ namespace OpenAuth.App
|
|||||||
+ "】【" + DateTime.Now.ToString("yyyy-MM-dd HH:mm") + "】驳回,备注:"
|
+ "】【" + DateTime.Now.ToString("yyyy-MM-dd HH:mm") + "】驳回,备注:"
|
||||||
+ reqest.VerificationOpinion
|
+ reqest.VerificationOpinion
|
||||||
});
|
});
|
||||||
|
|
||||||
//给流程创建人发送通知信息
|
//给流程创建人发送通知信息
|
||||||
_messageApp.SendMsgTo(flowInstance.CreateUserId,
|
_messageApp.SendMsgTo(flowInstance.CreateUserId,
|
||||||
$"你的流程[{flowInstance.CustomName}]已被{user.Name}驳回。备注信息:{reqest.VerificationOpinion}");
|
$"你的流程[{flowInstance.CustomName}]已被{user.Name}驳回。备注信息:{reqest.VerificationOpinion}");
|
||||||
|
|
||||||
UnitWork.Save();
|
UnitWork.Save();
|
||||||
@ -489,7 +548,7 @@ namespace OpenAuth.App
|
|||||||
/// 一般用于本节点审核完成后,修改流程实例的当前执行人,可以做到通知等功能
|
/// 一般用于本节点审核完成后,修改流程实例的当前执行人,可以做到通知等功能
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
private string GetNextMakers(FlowRuntime wfruntime, NodeDesignateReq request=null)
|
private string GetNextMakers(FlowRuntime wfruntime, NodeDesignateReq request = null)
|
||||||
{
|
{
|
||||||
string makerList = "";
|
string makerList = "";
|
||||||
if (wfruntime.nextNodeId == "-1")
|
if (wfruntime.nextNodeId == "-1")
|
||||||
@ -502,20 +561,24 @@ namespace OpenAuth.App
|
|||||||
makerList = GetForkNodeMakers(wfruntime, wfruntime.nextNodeId);
|
makerList = GetForkNodeMakers(wfruntime, wfruntime.nextNodeId);
|
||||||
}
|
}
|
||||||
else if (wfruntime.nextNode.setInfo.NodeDesignate == Setinfo.RUNTIME_SPECIAL_ROLE)
|
else if (wfruntime.nextNode.setInfo.NodeDesignate == Setinfo.RUNTIME_SPECIAL_ROLE)
|
||||||
{ //如果是运行时指定角色
|
{
|
||||||
|
//如果是运行时指定角色
|
||||||
if (wfruntime.nextNode.setInfo.NodeDesignate != request.NodeDesignateType)
|
if (wfruntime.nextNode.setInfo.NodeDesignate != request.NodeDesignateType)
|
||||||
{
|
{
|
||||||
throw new Exception("前端提交的节点权限类型异常,请检查流程");
|
throw new Exception("前端提交的节点权限类型异常,请检查流程");
|
||||||
}
|
}
|
||||||
|
|
||||||
var users = _revelanceApp.Get(Define.USERROLE, false, request.NodeDesignates);
|
var users = _revelanceApp.Get(Define.USERROLE, false, request.NodeDesignates);
|
||||||
makerList = GenericHelpers.ArrayToString(users, makerList);
|
makerList = GenericHelpers.ArrayToString(users, makerList);
|
||||||
}
|
}
|
||||||
else if (wfruntime.nextNode.setInfo.NodeDesignate == Setinfo.RUNTIME_SPECIAL_USER)
|
else if (wfruntime.nextNode.setInfo.NodeDesignate == Setinfo.RUNTIME_SPECIAL_USER)
|
||||||
{ //如果是运行时指定用户
|
{
|
||||||
|
//如果是运行时指定用户
|
||||||
if (wfruntime.nextNode.setInfo.NodeDesignate != request.NodeDesignateType)
|
if (wfruntime.nextNode.setInfo.NodeDesignate != request.NodeDesignateType)
|
||||||
{
|
{
|
||||||
throw new Exception("前端提交的节点权限类型异常,请检查流程");
|
throw new Exception("前端提交的节点权限类型异常,请检查流程");
|
||||||
}
|
}
|
||||||
|
|
||||||
makerList = GenericHelpers.ArrayToString(request.NodeDesignates, makerList);
|
makerList = GenericHelpers.ArrayToString(request.NodeDesignates, makerList);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -647,6 +710,7 @@ namespace OpenAuth.App
|
|||||||
{
|
{
|
||||||
CheckNodeDesignate(request);
|
CheckNodeDesignate(request);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool isReject = TagState.Reject.Equals((TagState) Int32.Parse(request.VerificationFinally));
|
bool isReject = TagState.Reject.Equals((TagState) Int32.Parse(request.VerificationFinally));
|
||||||
if (isReject) //驳回
|
if (isReject) //驳回
|
||||||
{
|
{
|
||||||
@ -680,18 +744,19 @@ namespace OpenAuth.App
|
|||||||
public FlowVerificationResp GetForVerification(string id)
|
public FlowVerificationResp GetForVerification(string id)
|
||||||
{
|
{
|
||||||
var flowinstance = Get(id);
|
var flowinstance = Get(id);
|
||||||
var resp =flowinstance.MapTo<FlowVerificationResp>();
|
var resp = flowinstance.MapTo<FlowVerificationResp>();
|
||||||
var runtime = new FlowRuntime(flowinstance);
|
var runtime = new FlowRuntime(flowinstance);
|
||||||
if (runtime.currentNode != null && runtime.currentNode.setInfo !=null)
|
if (runtime.currentNode != null && runtime.currentNode.setInfo != null)
|
||||||
{
|
{
|
||||||
resp.CanWriteFormItemIds = runtime.currentNode.setInfo.CanWriteFormItemIds;
|
resp.CanWriteFormItemIds = runtime.currentNode.setInfo.CanWriteFormItemIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (runtime.nextNode != null && runtime.nextNode.setInfo !=null && runtime.nextNodeType != 4)
|
if (runtime.nextNode != null && runtime.nextNode.setInfo != null && runtime.nextNodeType != 4)
|
||||||
{
|
{
|
||||||
resp.NextNodeDesignateType = runtime.nextNode.setInfo.NodeDesignate;
|
resp.NextNodeDesignateType = runtime.nextNode.setInfo.NodeDesignate;
|
||||||
resp.CanWriteFormItemIds = runtime.currentNode.setInfo.CanWriteFormItemIds;
|
resp.CanWriteFormItemIds = runtime.currentNode.setInfo.CanWriteFormItemIds;
|
||||||
}
|
}
|
||||||
|
|
||||||
return resp;
|
return resp;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -715,7 +780,8 @@ namespace OpenAuth.App
|
|||||||
|
|
||||||
result.count = await UnitWork.Find(waitExp).CountAsync();
|
result.count = await UnitWork.Find(waitExp).CountAsync();
|
||||||
|
|
||||||
result.data =await UnitWork.Find(request.page, request.limit, "CreateDate descending", waitExp).ToListAsync();
|
result.data = await UnitWork.Find(request.page, request.limit, "CreateDate descending", waitExp)
|
||||||
|
.ToListAsync();
|
||||||
}
|
}
|
||||||
else if (request.type == "disposed") //已办事项(即我参与过的流程)
|
else if (request.type == "disposed") //已办事项(即我参与过的流程)
|
||||||
{
|
{
|
||||||
@ -734,7 +800,7 @@ namespace OpenAuth.App
|
|||||||
result.data = await query.OrderByDescending(u => u.CreateDate)
|
result.data = await query.OrderByDescending(u => u.CreateDate)
|
||||||
.Skip((request.page - 1) * request.limit)
|
.Skip((request.page - 1) * request.limit)
|
||||||
.Take(request.limit).ToListAsync();
|
.Take(request.limit).ToListAsync();
|
||||||
result.count =await instances.CountAsync();
|
result.count = await instances.CountAsync();
|
||||||
}
|
}
|
||||||
else //我的流程
|
else //我的流程
|
||||||
{
|
{
|
||||||
@ -746,7 +812,7 @@ namespace OpenAuth.App
|
|||||||
myFlowExp = myFlowExp.And(t => t.CustomName.Contains(request.key));
|
myFlowExp = myFlowExp.And(t => t.CustomName.Contains(request.key));
|
||||||
}
|
}
|
||||||
|
|
||||||
result.count =await UnitWork.Find(myFlowExp).CountAsync();
|
result.count = await UnitWork.Find(myFlowExp).CountAsync();
|
||||||
result.data = await UnitWork.Find(request.page, request.limit,
|
result.data = await UnitWork.Find(request.page, request.limit,
|
||||||
"CreateDate descending", myFlowExp).ToListAsync();
|
"CreateDate descending", myFlowExp).ToListAsync();
|
||||||
}
|
}
|
||||||
@ -789,7 +855,7 @@ namespace OpenAuth.App
|
|||||||
{
|
{
|
||||||
var user = _auth.GetCurrentUser().User;
|
var user = _auth.GetCurrentUser().User;
|
||||||
FlowInstance flowInstance = Get(request.FlowInstanceId);
|
FlowInstance flowInstance = Get(request.FlowInstanceId);
|
||||||
if (flowInstance.IsFinish == FlowInstanceStatus.Draft
|
if (flowInstance.IsFinish == FlowInstanceStatus.Draft
|
||||||
|| flowInstance.IsFinish == FlowInstanceStatus.Finished)
|
|| flowInstance.IsFinish == FlowInstanceStatus.Finished)
|
||||||
{
|
{
|
||||||
throw new Exception("当前流程状态不能召回");
|
throw new Exception("当前流程状态不能召回");
|
||||||
@ -818,7 +884,7 @@ namespace OpenAuth.App
|
|||||||
CreateUserId = user.Id,
|
CreateUserId = user.Id,
|
||||||
CreateUserName = user.Name,
|
CreateUserName = user.Name,
|
||||||
CreateDate = DateTime.Now,
|
CreateDate = DateTime.Now,
|
||||||
Content = $"【撤销】由{user.Name}撤销,备注:{request.Description}"
|
Content = $"【撤销】由{user.Name}撤销,备注:{request.Description}"
|
||||||
});
|
});
|
||||||
|
|
||||||
UnitWork.Save();
|
UnitWork.Save();
|
||||||
@ -833,6 +899,7 @@ namespace OpenAuth.App
|
|||||||
{
|
{
|
||||||
throw new Exception("当前流程不是草稿状态,不能启动");
|
throw new Exception("当前流程不是草稿状态,不能启动");
|
||||||
}
|
}
|
||||||
|
|
||||||
var wfruntime = new FlowRuntime(flowInstance);
|
var wfruntime = new FlowRuntime(flowInstance);
|
||||||
var user = _auth.GetCurrentUser();
|
var user = _auth.GetCurrentUser();
|
||||||
|
|
||||||
@ -843,6 +910,7 @@ namespace OpenAuth.App
|
|||||||
}
|
}
|
||||||
|
|
||||||
#region 根据运行实例改变当前节点状态
|
#region 根据运行实例改变当前节点状态
|
||||||
|
|
||||||
flowInstance.ActivityId = wfruntime.nextNodeId;
|
flowInstance.ActivityId = wfruntime.nextNodeId;
|
||||||
flowInstance.ActivityType = wfruntime.GetNextNodeType();
|
flowInstance.ActivityType = wfruntime.GetNextNodeType();
|
||||||
flowInstance.ActivityName = wfruntime.nextNode.name;
|
flowInstance.ActivityName = wfruntime.nextNode.name;
|
||||||
@ -855,6 +923,7 @@ namespace OpenAuth.App
|
|||||||
: FlowInstanceStatus.Running);
|
: FlowInstanceStatus.Running);
|
||||||
|
|
||||||
UnitWork.Update(flowInstance);
|
UnitWork.Update(flowInstance);
|
||||||
|
|
||||||
#endregion 根据运行实例改变当前节点状态
|
#endregion 根据运行实例改变当前节点状态
|
||||||
|
|
||||||
#region 流程操作记录
|
#region 流程操作记录
|
||||||
|
Loading…
Reference in New Issue
Block a user