mirror of
https://gitee.com/dotnetchina/OpenAuth.Net.git
synced 2025-11-08 18:34:44 +08:00
refactor: 删除FlowinstanceTransitionHistory
This commit is contained in:
@@ -375,7 +375,6 @@ namespace OpenAuth.App.Flow
|
||||
flowInstance.ActivityName = Nodes[rejectNode].name;
|
||||
flowInstance.MakerList =
|
||||
GetNodeMarkers(Nodes[rejectNode], flowInstance.CreateUserId);
|
||||
SaveTransitionHis();
|
||||
}
|
||||
|
||||
flowInstance.SchemeContent = JsonHelper.Instance.Serialize(ToSchemeObj());
|
||||
@@ -405,8 +404,6 @@ namespace OpenAuth.App.Flow
|
||||
flowInstance.ActivityName = Nodes[startNodeId].name;
|
||||
flowInstance.MakerList = GetNodeMarkers(Nodes[startNodeId], flowInstance.CreateUserId);
|
||||
|
||||
SaveTransitionHis();
|
||||
|
||||
var sugarClient = AutofacContainerModule.GetService<ISqlSugarClient>();
|
||||
sugarClient.Updateable(flowInstance).ExecuteCommand();
|
||||
|
||||
@@ -478,32 +475,6 @@ namespace OpenAuth.App.Flow
|
||||
SaveOperationHis(user.Id, user.Name, opHis);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 保存本次扭转记录
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public void SaveTransitionHis()
|
||||
{
|
||||
var user = AutofacContainerModule.GetService<IAuth>().GetCurrentUser().User;
|
||||
var SugarClient = AutofacContainerModule.GetService<ISqlSugarClient>();
|
||||
var transitionHistory = new FlowInstanceTransitionHistory
|
||||
{
|
||||
InstanceId = flowInstanceId,
|
||||
CreateUserId = user.Id,
|
||||
CreateUserName = user.Name,
|
||||
FromNodeId = currentNodeId,
|
||||
FromNodeName = currentNode.name,
|
||||
FromNodeType = GetCurrentNodeType(),
|
||||
ToNodeId = nextNodeId,
|
||||
ToNodeName = nextNode?.name,
|
||||
ToNodeType = GetNextNodeType(),
|
||||
IsFinish = IsFinish() ? FlowInstanceStatus.Finished : FlowInstanceStatus.Running,
|
||||
TransitionSate = 0
|
||||
};
|
||||
|
||||
SugarClient.Insertable(transitionHistory).ExecuteCommand();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 通知三方系统,节点执行情况
|
||||
/// </summary>
|
||||
@@ -580,12 +551,10 @@ namespace OpenAuth.App.Flow
|
||||
currentNode.setInfo.Description = "";
|
||||
currentNode.setInfo.TagedTime = "";
|
||||
|
||||
//删除当前节点的扭转记录
|
||||
//删除当前节点的审批记录(只删除最新的一条)
|
||||
var user = AutofacContainerModule.GetService<IAuth>().GetCurrentUser().User;
|
||||
var SugarClient = AutofacContainerModule.GetService<ISqlSugarClient>();
|
||||
SugarClient.Deleteable<FlowInstanceTransitionHistory>().Where(u => u.InstanceId == flowInstanceId && u.CreateUserId == user.Id && u.FromNodeId == currentNodeId).ExecuteCommand();
|
||||
|
||||
//删除当前节点的审批记录(只删除最新的一条)
|
||||
|
||||
var latestRecord = SugarClient.Queryable<FlowInstanceOperationHistory>()
|
||||
.Where(u => u.InstanceId == flowInstanceId && u.CreateUserId == user.Id)
|
||||
.OrderByDescending(u => u.CreateDate)
|
||||
|
||||
Reference in New Issue
Block a user