|
@@ -345,8 +345,7 @@ namespace Hotline.FlowEngine.Workflows
|
|
|
//结束当前会签流程
|
|
|
if (currentStep.IsCountersignEndStep)
|
|
|
{
|
|
|
- var countersignStartStep =
|
|
|
- workflow.Steps.FirstOrDefault(d => d.Id == currentStep.CountersignStartStepId);
|
|
|
+ var countersignStartStep = workflow.Steps.FirstOrDefault(d => d.Id == currentStep.CountersignStartStepId);
|
|
|
if (countersignStartStep is null)
|
|
|
throw new UserFriendlyException(
|
|
|
$"未查询到会签开始step, workflowId: {workflow.Id}, currentStepId: {currentStep.Id}",
|
|
@@ -406,8 +405,7 @@ namespace Hotline.FlowEngine.Workflows
|
|
|
if (!string.IsNullOrEmpty(currentStep.CountersignId))
|
|
|
{
|
|
|
//会签中正常办理节点,更新会签members办理状态
|
|
|
- var countersign =
|
|
|
- workflow.Countersigns.FirstOrDefault(d =>
|
|
|
+ var countersign = workflow.Countersigns.FirstOrDefault(d =>
|
|
|
!d.IsCompleted() && d.Id == currentStep.CountersignId);
|
|
|
if (countersign is not null)
|
|
|
{
|
|
@@ -2506,12 +2504,11 @@ namespace Hotline.FlowEngine.Workflows
|
|
|
newStep.IsOrigin = step.IsOrigin;
|
|
|
//newStep.ParentId = step.ParentId;
|
|
|
newStep.Handlers = step.Handlers;
|
|
|
- //newStep.StepHandlers = _mapper.Map<List<WorkflowStepHandler>>(step.StepHandlers);
|
|
|
newStep.StartCountersignId = step.StartCountersignId;
|
|
|
newStep.CountersignId = step.CountersignId;
|
|
|
newStep.IsStartedCountersignEnd = step.IsStartedCountersignEnd;
|
|
|
|
|
|
- //退回场景:指派给原办理人,其余场景:按照原节点原始指派方式复制
|
|
|
+ //退回场景:指派给原办理人,其余场景:按照原节点原始指派方式复制 //todo 重构为参数传入办理对象
|
|
|
if (traceType is EWorkflowTraceType.Previous)
|
|
|
{
|
|
|
//newStep.FlowAssignType = EFlowAssignType.User;
|
|
@@ -3115,9 +3112,7 @@ namespace Hotline.FlowEngine.Workflows
|
|
|
|
|
|
//cp会签发起节点变为待办节点
|
|
|
//1. create terminal trace 2. 撤回至startStep
|
|
|
- var newStep = await DuplicateStepWithTraceAsync(workflow, startCountersignStep,
|
|
|
- EWorkflowTraceType.Normal,
|
|
|
- cancellationToken);
|
|
|
+ var newStep = await DuplicateStepWithTraceAsync(workflow, startCountersignStep, EWorkflowTraceType.Normal, cancellationToken);
|
|
|
|
|
|
//当topcsStep结束cs时,实际办理节点应该更新为newStep
|
|
|
if (startCountersignStep.Id == workflow.TopCountersignStepId)
|
|
@@ -3128,7 +3123,9 @@ namespace Hotline.FlowEngine.Workflows
|
|
|
UserId = startCountersignStep.HandlerId,
|
|
|
Username = startCountersignStep.HandlerName,
|
|
|
OrgId = startCountersignStep.HandlerOrgId,
|
|
|
- OrgName = startCountersignStep.HandlerOrgName
|
|
|
+ OrgName = startCountersignStep.HandlerOrgName,
|
|
|
+ RoleId = startCountersignStep.RoleId,
|
|
|
+ RoleName = startCountersignStep.RoleName
|
|
|
});
|
|
|
|
|
|
workflow.UpdateCurrentStepWhenAssign(newStep,
|
|
@@ -3137,25 +3134,27 @@ namespace Hotline.FlowEngine.Workflows
|
|
|
UserId = startCountersignStep.HandlerId,
|
|
|
Username = startCountersignStep.HandlerName,
|
|
|
OrgId = startCountersignStep.HandlerOrgId,
|
|
|
- OrgName = startCountersignStep.HandlerOrgName
|
|
|
+ OrgName = startCountersignStep.HandlerOrgName,
|
|
|
+ RoleId = startCountersignStep.RoleId,
|
|
|
+ RoleName = startCountersignStep.RoleName
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- //csEndStep又开启了cs,在结束会签时,如果该节点是topcs的end节点, workflow.topcsStep应该更新为前一cs开启stepId
|
|
|
- if (startCountersignStep.IsTopCountersignEndStep(workflow.TopCountersignStepId))
|
|
|
- workflow.TopCountersignStepId = startCountersignStep.CountersignStartStepId;
|
|
|
+ // //csEndStep又开启了cs,在结束会签时,如果该节点是topcs的end节点, workflow.topcsStep应该更新为前一cs开启stepId
|
|
|
+ // if (startCountersignStep.IsTopCountersignEndStep(workflow.TopCountersignStepId))
|
|
|
+ // workflow.TopCountersignStepId = startCountersignStep.CountersignStartStepId;
|
|
|
|
|
|
if (workflow.CheckIfCountersignOver())
|
|
|
workflow.EndCountersign();
|
|
|
|
|
|
- var removeHandlers = updateSteps.SelectMany(d => d.Handlers).Select(d => d.Key).ToList();
|
|
|
-
|
|
|
- var handlerObjs = newStep.Handlers.Select(d => new HandlerGroupItem
|
|
|
- {
|
|
|
- GroupId = Guid.NewGuid().ToString(),
|
|
|
- Key = d.Key,
|
|
|
- Value = d.Value
|
|
|
- }).ToList();
|
|
|
+ // var removeHandlers = updateSteps.SelectMany(d => d.Handlers).Select(d => d.Key).ToList();
|
|
|
+ //
|
|
|
+ // var handlerObjs = newStep.Handlers.Select(d => new HandlerGroupItem
|
|
|
+ // {
|
|
|
+ // GroupId = Guid.NewGuid().ToString(),
|
|
|
+ // Key = d.Key,
|
|
|
+ // Value = d.Value
|
|
|
+ // }).ToList();
|
|
|
//workflow.UpdateHandlers(removeHandlers, newStep.FlowAssignType.Value, handlerObjs);
|
|
|
|
|
|
await _workflowRepository.UpdateAsync(workflow, cancellationToken);
|