|
@@ -4037,7 +4037,8 @@ public class OrderController : BaseController
|
|
|
nextDto.StepId = startStep.Id;
|
|
|
nextDto.HandlerType = EHandlerType.OrgLevel;
|
|
|
nextDto.FlowDirection = EFlowDirection.CenterToOrg;
|
|
|
- var nextHandleOrgs = orderHandleFlowDto.SecondaryOrgs
|
|
|
+ var secondaryOrgs = orderHandleFlowDto.SecondaryOrgs.DistinctBy(d => d.Id).ToList();
|
|
|
+ var nextHandleOrgs = secondaryOrgs
|
|
|
.Where(d => d.Level == 1 && d.Id.StartsWith(OrgSeedData.CenterId))
|
|
|
.ToList();
|
|
|
if (nextHandleOrgs.Any())
|
|
@@ -4051,9 +4052,14 @@ public class OrderController : BaseController
|
|
|
nextDto.IsStartCountersign = nextDto.NextHandlers.Count > 1;
|
|
|
|
|
|
await HandleNextInMainAndSecondaryAsync(_sessionContext, workflow.WorkflowDefinition,
|
|
|
- orderHandleFlowDto.SecondaryOrgs, nextDto, order.ExpiredTime, isAutoFillSummaryOpinion,
|
|
|
+ secondaryOrgs, nextDto, order.ExpiredTime, isAutoFillSummaryOpinion,
|
|
|
cancellationToken);
|
|
|
|
|
|
+ //抄送
|
|
|
+ orderHandleFlowDto.Copys
|
|
|
+ .Where(d=>!string.IsNullOrEmpty(d.OrgId)||!string.IsNullOrEmpty(d.RoleId)||!string.IsNullOrEmpty(d.UserId))
|
|
|
+ .Select(d=>_mapper.Map<>())
|
|
|
+
|
|
|
break;
|
|
|
default:
|
|
|
throw new ArgumentOutOfRangeException();
|
|
@@ -4063,7 +4069,7 @@ public class OrderController : BaseController
|
|
|
private async Task HandleNextInMainAndSecondaryAsync(ISessionContext current, WorkflowDefinition definition, List<OrgDto> orgs,
|
|
|
NextWorkflowDto? flowDto, DateTime? expiredTime, bool isAutoFillSummaryOpinion, CancellationToken cancellation)
|
|
|
{
|
|
|
- if (flowDto is null) return;
|
|
|
+ if (flowDto is null || !flowDto.NextHandlers.Any()) return;
|
|
|
var nextSteps = await _workflowDomainService.NextAsync(current, flowDto, expiredTime,
|
|
|
isAutoFillSummaryOpinion, cancellation);
|
|
|
|
|
@@ -4430,9 +4436,6 @@ public class OrderController : BaseController
|
|
|
.OrderBy(d => d.CreationTime)
|
|
|
.ToTreeAsync(d => d.Traces, d => d.ParentId, null);
|
|
|
|
|
|
- //todo files
|
|
|
- //await _fileRepository.WorkflowTraceRecursion(workflowDto.Traces, HttpContext.RequestAborted);
|
|
|
-
|
|
|
return _mapper.Map<IReadOnlyList<OrderFlowTraceDto>>(traces);
|
|
|
}
|
|
|
|