|
@@ -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>()
|