xf 2 년 전
부모
커밋
cfceb85235
2개의 변경된 파일16개의 추가작업 그리고 11개의 파일을 삭제
  1. 1 1
      src/Hotline.Api/Controllers/OrderController.cs
  2. 15 10
      src/Hotline.Application/Mappers/MapperConfigs.cs

+ 1 - 1
src/Hotline.Api/Controllers/OrderController.cs

@@ -130,7 +130,7 @@ public class OrderController : BaseController
             return null;
         if (!string.IsNullOrEmpty(order?.WorkflowId))
         {
-            order.Workflow = await _workflowDomainService.GetWorkflowAsync(order.WorkflowId, withSteps: true, withSupplements: true, withAssigns: true, cancellationToken: HttpContext.RequestAborted);
+            order.Workflow = await _workflowDomainService.GetWorkflowAsync(order.WorkflowId, withSupplements: true, withAssigns: true, cancellationToken: HttpContext.RequestAborted);
 
             _mediator.Publish(new GetOrderDetailNotify(order.Workflow, _sessionContext.RequiredUserId,
                  _sessionContext.UserName, _sessionContext.RequiredOrgCode, _sessionContext.OrgName));

+ 15 - 10
src/Hotline.Application/Mappers/MapperConfigs.cs

@@ -67,21 +67,21 @@ namespace Hotline.Application.Mappers
                 .Map(d => d.CreationTime, x => x.CreationTime)
                 .Map(d => d.Additions, x => x.Additions)
                 .Map(d => d.Opinion, x => x.Opinion)
-                .Map(d=>d.Creator.Name,x=>x.Creator.Name)
+                .Map(d => d.Creator.Name, x => x.Creator.Name)
                 .IgnoreNonMapped(true)
                 ;
 
             config.ForType<Workflow, WorkflowDto>()
                 .IgnoreIf((s, d) => s.Assigns == null || !s.Assigns.Any(), d => d.AssignOrgs)
                 .IgnoreIf((s, d) => s.Supplements == null || !s.Supplements.Any(), d => d.Supplements)
-                .IgnoreIf((s, d) => s.StepBoxes == null || !s.StepBoxes.Any(), d => d.StepBoxes)
                 .IgnoreIf((s, d) => s.Traces == null || !s.Traces.Any(), d => d.Traces)
-                .IgnoreIf((s, d) => s.Definition == null, d => d.Definition)
+                //.IgnoreIf((s, d) => s.StepBoxes == null || !s.StepBoxes.Any(), d => d.StepBoxes)
+                //.IgnoreIf((s, d) => s.Definition == null, d => d.Definition)
                 .Map(d => d.AssignOrgs, s => string.Join(',', s.Assigns.Select(d => d.OrgName)))
                 .Ignore(d => d.Definition)
-                //.Ignore(d=>d.Supplements)
                 .Ignore(d => d.StepBoxes)
-                .Ignore(d => d.Traces)
+                //.Ignore(d=>d.Supplements)
+                //.Ignore(d => d.Traces)
                 ;
 
             config.ForType<BasicWorkflowDto, WorkflowStep>()
@@ -141,12 +141,17 @@ namespace Hotline.Application.Mappers
             config.ForType<Order, OrderDto>()
                 .IgnoreIf((s, d) => s.OrderComplain == null, d => d.OrderComplain)
                 .IgnoreIf((s, d) => s.OrderReport == null, d => d.OrderReport)
-                .IgnoreIf((s, d) => s.Workflow == null, d => d.Workflow)
                 .IgnoreIf((s, d) => s.Employee == null, d => d.EmployeeName, d => d.EmployeeStaffNo)
-                .Ignore(d => d.Workflow.Definition)
-                .Ignore(d => d.Workflow.StepBoxes)
-                .Ignore(d => d.Workflow.Traces)
-                .IgnoreNullValues(true)
+                //.IgnoreIf((s, d) => s.Workflow == null, d => d.Workflow)
+                //.Ignore(d => d.Workflow.Definition)
+                //.Ignore(d => d.Workflow.StepBoxes)
+                //.Ignore(d => d.Workflow.Traces)
+                .Ignore(d => d.Workflow)
+                .AfterMapping((s, d) =>
+                {
+                    d.Workflow ??= new();
+                    d.Workflow.Supplements = s.Workflow.Supplements.Adapt<List<WorkflowSupplementDto>>();
+                })
                 ;
 
             config.ForType<AddOrderDto, Order>()