|
@@ -246,7 +246,7 @@ namespace Hotline.FlowEngine.Workflows
|
|
/// <summary>
|
|
/// <summary>
|
|
/// new
|
|
/// new
|
|
/// </summary>
|
|
/// </summary>
|
|
- public async Task<List<WorkflowStep>> NextAsync(NextWorkflowDto dto,
|
|
|
|
|
|
+ public async Task<List<WorkflowStep>> NextAsync(ISessionContext current, NextWorkflowDto dto,
|
|
DateTime? expiredTime = null, CancellationToken cancellationToken = default)
|
|
DateTime? expiredTime = null, CancellationToken cancellationToken = default)
|
|
{
|
|
{
|
|
var workflow = await GetWorkflowAsync(dto.WorkflowId, withDefine: true, withSteps: true,
|
|
var workflow = await GetWorkflowAsync(dto.WorkflowId, withDefine: true, withSteps: true,
|
|
@@ -266,7 +266,7 @@ namespace Hotline.FlowEngine.Workflows
|
|
|
|
|
|
//下一节点是否为动态节点
|
|
//下一节点是否为动态节点
|
|
var isNextDynamic = currentStepDefine.InstanceMode is EInstanceMode.Dynamic &&
|
|
var isNextDynamic = currentStepDefine.InstanceMode is EInstanceMode.Dynamic &&
|
|
- !DynamicShouldTerminal(currentStepDefine, _sessionContext.OrgLevel);
|
|
|
|
|
|
+ !DynamicShouldTerminal(currentStepDefine, current.OrgLevel);
|
|
|
|
|
|
StepDefine nextStepDefine;
|
|
StepDefine nextStepDefine;
|
|
if (isNextDynamic
|
|
if (isNextDynamic
|
|
@@ -349,9 +349,9 @@ namespace Hotline.FlowEngine.Workflows
|
|
|
|
|
|
//结束会签
|
|
//结束会签
|
|
currentCountersign.End(currentStep.Id, currentStep.Code, currentStep.BusinessType,
|
|
currentCountersign.End(currentStep.Id, currentStep.Code, currentStep.BusinessType,
|
|
- _sessionContext.RequiredUserId, _sessionContext.UserName,
|
|
|
|
- _sessionContext.RequiredOrgId, _sessionContext.OrgName,
|
|
|
|
- _sessionContext.OrgAreaCode, _sessionContext.OrgAreaName);
|
|
|
|
|
|
+ current.UserId, current.UserName,
|
|
|
|
+ current.OrgId, current.OrgName,
|
|
|
|
+ current.OrgAreaCode, current.OrgAreaName);
|
|
await _workflowCountersignRepository.UpdateAsync(currentCountersign, cancellationToken);
|
|
await _workflowCountersignRepository.UpdateAsync(currentCountersign, cancellationToken);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -362,10 +362,10 @@ namespace Hotline.FlowEngine.Workflows
|
|
if (isStartCountersign)
|
|
if (isStartCountersign)
|
|
{
|
|
{
|
|
var exists = workflow.Countersigns.Any(d =>
|
|
var exists = workflow.Countersigns.Any(d =>
|
|
- !d.IsCompleted() && d.StarterId == _sessionContext.RequiredUserId);
|
|
|
|
|
|
+ !d.IsCompleted() && d.StarterId == current.UserId);
|
|
if (exists)
|
|
if (exists)
|
|
throw new UserFriendlyException("该用户在当前流程存在未结束会签");
|
|
throw new UserFriendlyException("该用户在当前流程存在未结束会签");
|
|
- await StartCountersignAsync(_sessionContext, workflow, currentStep, dto, flowAssignInfo.FlowAssignType,
|
|
|
|
|
|
+ await StartCountersignAsync(current, workflow, currentStep, dto, flowAssignInfo.FlowAssignType,
|
|
counterSignType, expiredTime, cancellationToken);
|
|
counterSignType, expiredTime, cancellationToken);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -387,7 +387,7 @@ namespace Hotline.FlowEngine.Workflows
|
|
//throw new UserFriendlyException(
|
|
//throw new UserFriendlyException(
|
|
// $"会签数据异常, workflowId: {currentStep.WorkflowId}, countersignId: {currentStep.CountersignId}",
|
|
// $"会签数据异常, workflowId: {currentStep.WorkflowId}, countersignId: {currentStep.CountersignId}",
|
|
// "会签数据异常");
|
|
// "会签数据异常");
|
|
- countersign.MemberHandled(_sessionContext.RequiredUserId, _sessionContext.RequiredOrgId);
|
|
|
|
|
|
+ countersign.MemberHandled(current.UserId, current.OrgId);
|
|
//update cs
|
|
//update cs
|
|
await _workflowCountersignRepository.UpdateNav(countersign)
|
|
await _workflowCountersignRepository.UpdateNav(countersign)
|
|
.Include(d => d.Members)
|
|
.Include(d => d.Members)
|
|
@@ -427,12 +427,12 @@ namespace Hotline.FlowEngine.Workflows
|
|
if (workflow.ActualHandleStepId == currentStep.Id)
|
|
if (workflow.ActualHandleStepId == currentStep.Id)
|
|
{
|
|
{
|
|
//更新实际办理节点信息
|
|
//更新实际办理节点信息
|
|
- workflow.UpdateActualStepWhenHandle(currentStep, _sessionContext.OrgAreaCode, _sessionContext.OrgAreaName, _sessionContext.OrgLevel);
|
|
|
|
|
|
+ workflow.UpdateActualStepWhenHandle(currentStep, current.OrgAreaCode, current.OrgAreaName, current.OrgLevel);
|
|
}
|
|
}
|
|
|
|
|
|
if (workflow.CurrentStepId == currentStep.Id)
|
|
if (workflow.CurrentStepId == currentStep.Id)
|
|
{
|
|
{
|
|
- workflow.UpdateCurrentStepWhenHandle(currentStep, _sessionContext.OrgAreaCode, _sessionContext.OrgAreaName, _sessionContext.OrgLevel);
|
|
|
|
|
|
+ workflow.UpdateCurrentStepWhenHandle(currentStep, current.OrgAreaCode, current.OrgAreaName, current.OrgLevel);
|
|
}
|
|
}
|
|
|
|
|
|
//检查是否流转到流程终点
|
|
//检查是否流转到流程终点
|
|
@@ -478,7 +478,7 @@ namespace Hotline.FlowEngine.Workflows
|
|
|
|
|
|
//更新会签实际办理对象信息
|
|
//更新会签实际办理对象信息
|
|
if (currentStep.IsActualHandled)
|
|
if (currentStep.IsActualHandled)
|
|
- workflow.AddCsActualHandler(_sessionContext.RequiredUserId, _sessionContext.RequiredOrgId);
|
|
|
|
|
|
+ workflow.AddCsActualHandler(current.UserId, current.OrgId);
|
|
|
|
|
|
await _workflowRepository.UpdateAsync(workflow, cancellationToken);
|
|
await _workflowRepository.UpdateAsync(workflow, cancellationToken);
|
|
|
|
|
|
@@ -493,7 +493,7 @@ namespace Hotline.FlowEngine.Workflows
|
|
var currentTrace = workflow.Traces.First(d => d.Id == currentStep.Id);
|
|
var currentTrace = workflow.Traces.First(d => d.Id == currentStep.Id);
|
|
await _publisher.PublishAsync(
|
|
await _publisher.PublishAsync(
|
|
new NextStepNotify(workflow, dto, flowAssignInfo, currentTrace, nextStepDefine,
|
|
new NextStepNotify(workflow, dto, flowAssignInfo, currentTrace, nextStepDefine,
|
|
- _sessionContext.RequiredOrgId, expiredTime.HasValue), PublishStrategy.ParallelWhenAll,
|
|
|
|
|
|
+ current.UserId, expiredTime.HasValue), PublishStrategy.ParallelWhenAll,
|
|
cancellationToken);
|
|
cancellationToken);
|
|
|
|
|
|
return nextSteps;
|
|
return nextSteps;
|
|
@@ -2394,9 +2394,9 @@ namespace Hotline.FlowEngine.Workflows
|
|
StartStepCode = startStep.Code,
|
|
StartStepCode = startStep.Code,
|
|
StartStepBusiType = startStep.BusinessType,
|
|
StartStepBusiType = startStep.BusinessType,
|
|
|
|
|
|
- StarterId = current.RequiredUserId,
|
|
|
|
|
|
+ StarterId = current.UserId,
|
|
StarterName = current.UserName ?? string.Empty,
|
|
StarterName = current.UserName ?? string.Empty,
|
|
- StarterOrgId = current.RequiredOrgId,
|
|
|
|
|
|
+ StarterOrgId = current.OrgId,
|
|
StarterOrgName = current.OrgName,
|
|
StarterOrgName = current.OrgName,
|
|
StarterOrgAreaCode = current.OrgAreaCode ?? string.Empty,
|
|
StarterOrgAreaCode = current.OrgAreaCode ?? string.Empty,
|
|
StarterOrgAreaName = current.OrgAreaName ?? string.Empty,
|
|
StarterOrgAreaName = current.OrgAreaName ?? string.Empty,
|