Explorar el Código

fix: 会签汇总再次派给下级部门,countersignId为null的情况,下级部门办理异常

xf hace 9 meses
padre
commit
88d4fcc138
Se han modificado 1 ficheros con 17 adiciones y 12 borrados
  1. 17 12
      src/Hotline/FlowEngine/Workflows/WorkflowDomainService.cs

+ 17 - 12
src/Hotline/FlowEngine/Workflows/WorkflowDomainService.cs

@@ -411,18 +411,23 @@ namespace Hotline.FlowEngine.Workflows
             //会签办理节点办理时更新会签members字段
             if (currentStep.CountersignPosition is ECountersignPosition.Multi or ECountersignPosition.Single)
             {
-                //会签中正常办理节点,更新会签members办理状态
-                var countersign =
-                    workflow.Countersigns.FirstOrDefault(d => !d.IsCompleted() && d.Id == currentStep.CountersignId);
-                if (countersign is null)
-                    throw new UserFriendlyException(
-                        $"会签数据异常, workflowId: {currentStep.WorkflowId}, countersignId: {currentStep.CountersignId}",
-                        "会签数据异常");
-                countersign.MemberHandled(current.RequiredUserId, current.RequiredOrgId);
-                //update cs
-                await _workflowCountersignRepository.UpdateNav(countersign)
-                    .Include(d => d.Members)
-                    .ExecuteCommandAsync();
+                if (!string.IsNullOrEmpty(currentStep.CountersignId))
+                {
+                    //会签中正常办理节点,更新会签members办理状态
+                    var countersign =
+                        workflow.Countersigns.FirstOrDefault(d => !d.IsCompleted() && d.Id == currentStep.CountersignId);
+                    if (countersign is not null)
+                    {
+                        //throw new UserFriendlyException(
+                        //    $"会签数据异常, workflowId: {currentStep.WorkflowId}, countersignId: {currentStep.CountersignId}",
+                        //    "会签数据异常");
+                        countersign.MemberHandled(current.RequiredUserId, current.RequiredOrgId);
+                        //update cs
+                        await _workflowCountersignRepository.UpdateNav(countersign)
+                            .Include(d => d.Members)
+                            .ExecuteCommandAsync();
+                    }
+                }
             }
 
             await _workflowStepRepository.UpdateRangeAsync(updateSteps, cancellationToken);