|
@@ -253,18 +253,33 @@ namespace Hotline.FlowEngine.Workflows
|
|
var currentStep = GetUnHandleStep(workflow.Steps, _sessionContext.RequiredOrgId, _sessionContext.RequiredUserId);
|
|
var currentStep = GetUnHandleStep(workflow.Steps, _sessionContext.RequiredOrgId, _sessionContext.RequiredUserId);
|
|
if (currentStep.Status is not EWorkflowStepStatus.WaitForAccept) return;
|
|
if (currentStep.Status is not EWorkflowStepStatus.WaitForAccept) return;
|
|
|
|
|
|
- if (currentStep.HandlerType is EHandlerType.AssignedUser or EHandlerType.Role
|
|
|
|
- && !currentStep.IsInCountersign()
|
|
|
|
- && currentStep.InstanceMode is EInstanceMode.Config)
|
|
|
|
|
|
+ if(currentStep.HandlerType is EHandlerType.AssignedOrg or EHandlerType.OrgLevel or EHandlerType.OrgType
|
|
|
|
+ || (currentStep.InstanceMode is EInstanceMode.Dynamic && !currentStep.DynamicShouldTerminal())//动态并且非结束节点
|
|
|
|
+ || (currentStep.IsInCountersign() && !currentStep.IsCountersignEndStep)//会签并且非会签节点
|
|
|
|
+ )
|
|
{
|
|
{
|
|
- //userId
|
|
|
|
- if (currentStep.Handlers.All(d => d.Key != userId)) return;
|
|
|
|
|
|
+ //orgId
|
|
|
|
+ if (currentStep.Handlers.All(d => d.Key != orgId)) return;
|
|
}
|
|
}
|
|
else
|
|
else
|
|
{
|
|
{
|
|
- //orgId
|
|
|
|
- if (currentStep.Handlers.All(d => d.Key != orgId)) return;
|
|
|
|
|
|
+ //userId
|
|
|
|
+ if (currentStep.Handlers.All(d => d.Key != userId)) return;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ //if (currentStep.HandlerType is EHandlerType.AssignedUser or EHandlerType.Role
|
|
|
|
+ //&& !currentStep.IsInCountersign()
|
|
|
|
+ //&& currentStep.InstanceMode is EInstanceMode.Config
|
|
|
|
+ //)
|
|
|
|
+ //{
|
|
|
|
+ // //userId
|
|
|
|
+ // if (currentStep.Handlers.All(d => d.Key != userId)) return;
|
|
|
|
+ //}
|
|
|
|
+ //else
|
|
|
|
+ //{
|
|
|
|
+ // //orgId
|
|
|
|
+ // if (currentStep.Handlers.All(d => d.Key != orgId)) return;
|
|
|
|
+ //}
|
|
if (currentStep.StepType is EStepType.End)
|
|
if (currentStep.StepType is EStepType.End)
|
|
throw new UserFriendlyException("当前流程已流转到最终步骤");
|
|
throw new UserFriendlyException("当前流程已流转到最终步骤");
|
|
|
|
|
|
@@ -505,6 +520,7 @@ namespace Hotline.FlowEngine.Workflows
|
|
{
|
|
{
|
|
var csEndStep = _mapper.Map<WorkflowStep>(countersignStartStep);
|
|
var csEndStep = _mapper.Map<WorkflowStep>(countersignStartStep);
|
|
_mapper.Map(dto, csEndStep);
|
|
_mapper.Map(dto, csEndStep);
|
|
|
|
+ csEndStep.Status = EWorkflowStepStatus.WaitForAccept;
|
|
csEndStep.NextSteps = new();
|
|
csEndStep.NextSteps = new();
|
|
csEndStep.PrevStepId = null;
|
|
csEndStep.PrevStepId = null;
|
|
csEndStep.PrevStepCode = null;
|
|
csEndStep.PrevStepCode = null;
|