2023-05-17 16:00:50 +10:00
|
|
|
|
using AutoMapper;
|
2023-12-06 11:53:36 +10:00
|
|
|
|
using PARR.API.Authentication.Models;
|
2023-06-16 15:00:11 +10:00
|
|
|
|
using PARR.API.Contracts.V1.Responses;
|
2023-09-19 16:42:06 +10:00
|
|
|
|
using PARR.API.MappingProfiles.Resolvers;
|
2024-10-08 13:53:57 +10:00
|
|
|
|
using PARR.Common.Domain;
|
2023-10-12 12:06:47 +10:00
|
|
|
|
using PARR.DAL.DomainModels;
|
2023-09-15 16:32:46 +10:00
|
|
|
|
using PARR.DAL.Models;
|
2025-06-25 14:17:34 +10:00
|
|
|
|
using PARR.DAL.Models.Job;
|
2025-12-26 11:21:45 +10:00
|
|
|
|
using PARR.DAL.Models.Schedule;
|
2025-06-06 16:39:41 +10:00
|
|
|
|
using PARR.DAL.Models.Unit;
|
2023-05-17 16:00:50 +10:00
|
|
|
|
|
2023-05-17 16:30:13 +10:00
|
|
|
|
namespace PARR.API.MappingProfiles
|
2023-05-17 16:00:50 +10:00
|
|
|
|
{
|
|
|
|
|
|
public class DomainToResponseProfile : Profile
|
|
|
|
|
|
{
|
|
|
|
|
|
public DomainToResponseProfile()
|
|
|
|
|
|
{
|
2023-12-27 08:50:45 +10:00
|
|
|
|
#region Template
|
|
|
|
|
|
|
2023-09-20 09:13:46 +10:00
|
|
|
|
// --- Template ---
|
2023-09-19 15:47:50 +10:00
|
|
|
|
CreateMap<Template, TemplateResponse>()
|
2025-06-25 14:17:34 +10:00
|
|
|
|
.ForMember(d => d.Job, o => o.MapFrom(s => s.Job))
|
|
|
|
|
|
.ForMember(d => d.Unit, o => o.MapFrom(s => s.Unit))
|
|
|
|
|
|
.ForMember(d => d.Process, o => o.MapFrom(s => s.Job!.Tnk!.Subprocess!.Process))
|
|
|
|
|
|
.ForMember(d => d.Subprocess, o => o.MapFrom(s => s.Job!.Tnk!.Subprocess))
|
|
|
|
|
|
.ForMember(d => d.Tnk, o => o.MapFrom(s => s.Job!.Tnk))
|
|
|
|
|
|
.ForMember(d => d.ShortDescription, o => o.MapFrom(s => s.Job!.Group!.ShortDescription))
|
|
|
|
|
|
.ForMember(d => d.FullDescription, o => o.MapFrom(s => s.Job!.Group!.FullDescription))
|
|
|
|
|
|
.ForMember(d => d.Solution, o => o.MapFrom(s => s.Job!.Group!.Solution))
|
|
|
|
|
|
.ForMember(d => d.TemplateDuration, o => o.MapFrom(s => s.Job!.Group!.TemplateDuration))
|
2023-09-20 09:13:46 +10:00
|
|
|
|
.ForMember(d => d.Initiator, o => o.MapFrom<TemplateInitiatorResolver>())
|
|
|
|
|
|
.ForMember(d => d.ClosingCode, o => o.MapFrom<TemplateClosingCodeResolver>())
|
2023-10-06 15:13:40 +10:00
|
|
|
|
.ForMember(d => d.Category, o => o.MapFrom<TemplateCategoryResolver>())
|
2024-02-26 09:20:13 +10:00
|
|
|
|
.ForMember(d => d.SyncStatus, o => o.MapFrom(s => s.RobotConfigurations.OrderBy(t => t.RobotCode)))
|
2023-10-17 16:59:53 +10:00
|
|
|
|
.ForMember(d => d.Schedule, o => o.MapFrom<TemplateScheduleResolver>())
|
2025-06-25 14:17:34 +10:00
|
|
|
|
.ForMember(d => d.Agent, o => o.MapFrom(s => s.Job!.Group!))
|
2024-07-03 15:19:09 +10:00
|
|
|
|
//.ForMember(d => d.NextRun, o => o.MapFrom(s => s.ApplicationsInWork!.NextRun))
|
|
|
|
|
|
//.ForMember(d => d.LastRun, o => o.MapFrom(s => s.ApplicationsInWork!.LastRun))
|
|
|
|
|
|
.ForMember(d => d.NextRun, o => o.MapFrom(s => s.NextRun))
|
|
|
|
|
|
.ForMember(d => d.LastRun, o => o.MapFrom(s => s.LastRun))
|
2024-07-05 12:42:01 +10:00
|
|
|
|
.ForMember(d => d.OrderCount, o => o.MapFrom(s => s.Orders.Count()))
|
2025-12-02 09:49:08 +10:00
|
|
|
|
.ForMember(d => d.IsAutoDistributionEnabled, o => o.MapFrom(s => s.Job!.Group!.IsAutoDistributionEnabled))
|
2025-12-26 11:21:45 +10:00
|
|
|
|
.ForMember(d => d.StatusType, o => o.MapFrom(s => s.StatusType))
|
|
|
|
|
|
.ForMember(d => d.ScheduleExcludeType, o => o.MapFrom(s => s.Job!.Group!.ScheduleExcludeType))
|
|
|
|
|
|
.ForMember(d => d.ScheduleExcludeTypeCalendar, o => o.MapFrom(s => s.Job!.Group!.ScheduleExcludeTypeCalendar))
|
|
|
|
|
|
;
|
2023-09-20 09:13:46 +10:00
|
|
|
|
// === Template ===
|
2023-09-18 12:08:40 +10:00
|
|
|
|
|
2023-12-27 08:50:45 +10:00
|
|
|
|
|
2023-10-11 15:28:37 +10:00
|
|
|
|
CreateMap<Template, TemplateScheduleEsppIdResponse>();
|
|
|
|
|
|
|
2024-04-03 14:12:59 +10:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
2025-06-27 13:42:13 +10:00
|
|
|
|
CreateMap<JobGroup, TemplateAgentResponse>()
|
2023-10-17 16:59:53 +10:00
|
|
|
|
.ForMember(d => d.IsAgent, o => o.MapFrom(s => s.IsAgent))
|
|
|
|
|
|
.ForMember(d => d.Name, o => o.MapFrom(s => s.AgentName))
|
|
|
|
|
|
.ForMember(d => d.Script, o => o.MapFrom(s => s.AgentScript))
|
|
|
|
|
|
.ForMember(d => d.TimeOutSec, o => o.MapFrom(s => s.AgentTimeOutSec));
|
|
|
|
|
|
|
2023-10-06 14:24:58 +10:00
|
|
|
|
CreateMap<DAL.Models.TaskStatus, TaskStatusResponse>();
|
2023-10-04 12:00:43 +10:00
|
|
|
|
|
2023-09-19 16:55:56 +10:00
|
|
|
|
|
2025-12-02 09:49:08 +10:00
|
|
|
|
#region StatusTypeResponse
|
|
|
|
|
|
|
|
|
|
|
|
CreateMap<TemplateStatusType, TemplateStatusTypeResponse>();
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
2024-04-03 14:12:59 +10:00
|
|
|
|
#region Tnk
|
|
|
|
|
|
|
2023-09-19 16:55:56 +10:00
|
|
|
|
CreateMap<Process, ProcessResponse>();
|
2024-04-03 14:12:59 +10:00
|
|
|
|
|
|
|
|
|
|
CreateMap<Subprocess, SubprocessResponse>()
|
|
|
|
|
|
.Include<Subprocess, SubprocessWithProcessResponse>();
|
|
|
|
|
|
|
|
|
|
|
|
CreateMap<Subprocess, SubprocessWithProcessResponse>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CreateMap<Tnk, TnkResponse>()
|
|
|
|
|
|
.Include<Tnk, TnkWithSubprocessResponse>();
|
|
|
|
|
|
|
|
|
|
|
|
CreateMap<Tnk, TnkWithSubprocessResponse>();
|
|
|
|
|
|
|
|
|
|
|
|
|
2025-12-09 16:00:38 +10:00
|
|
|
|
//CreateMap<Work, WorkResponse>()
|
|
|
|
|
|
// .Include<Work, WorkWithTnkResponse>();
|
2024-04-03 14:12:59 +10:00
|
|
|
|
|
2025-12-09 16:00:38 +10:00
|
|
|
|
//CreateMap<Work, WorkWithTnkResponse>();
|
2024-04-03 14:12:59 +10:00
|
|
|
|
|
|
|
|
|
|
#endregion
|
2023-09-19 16:55:56 +10:00
|
|
|
|
|
|
|
|
|
|
|
2023-11-30 10:17:02 +10:00
|
|
|
|
CreateMap<Application, ApplicationResponse>()
|
|
|
|
|
|
.ForMember(t => t.Type, o => o.MapFrom(s => s.ApplicationType));
|
2023-09-19 16:55:56 +10:00
|
|
|
|
|
2023-11-30 10:17:02 +10:00
|
|
|
|
CreateMap<ApplicationType, ApplicationTypeResponse>();
|
|
|
|
|
|
|
2024-06-04 12:03:15 +10:00
|
|
|
|
#region Host
|
2023-12-27 08:50:45 +10:00
|
|
|
|
|
2023-11-30 10:17:02 +10:00
|
|
|
|
CreateMap<DAL.Models.Host, HostBaseResponse>()
|
|
|
|
|
|
.Include<DAL.Models.Host, HostTemplateResponse>()
|
|
|
|
|
|
.Include<DAL.Models.Host, HostWithApplicationsResponse>()
|
2023-09-28 14:28:10 +10:00
|
|
|
|
.ForMember(d => d.Status, o => o.MapFrom(s => s.EkStatus!.Name))
|
2024-06-19 14:11:58 +10:00
|
|
|
|
.ForMember(d => d.EkStatus, o => o.MapFrom(s => s.EkStatus))
|
2024-06-04 12:03:15 +10:00
|
|
|
|
.ForMember(d => d.ResponseArea, o => o.MapFrom(s => s.ResponseArea!.Name))
|
2024-06-19 11:54:31 +10:00
|
|
|
|
.ForMember(d => d.WorkGroupName, o => o.MapFrom(s => s.WorkGroup!.Name))
|
|
|
|
|
|
.ForMember(d => d.WorkGroup, o => o.MapFrom(s => s.WorkGroup))
|
|
|
|
|
|
.ForMember(d => d.EkResponseArea, o => o.MapFrom(s => s.ResponseArea));
|
2023-09-19 16:55:56 +10:00
|
|
|
|
|
2023-11-30 10:17:02 +10:00
|
|
|
|
CreateMap<DAL.Models.Host, HostTemplateResponse>();
|
|
|
|
|
|
|
|
|
|
|
|
CreateMap<DAL.Models.Host, HostWithApplicationsResponse>()
|
2023-12-05 16:32:34 +10:00
|
|
|
|
.ForMember(d => d.Applications, o => o.MapFrom(s => s.ApplicationsInHosts.Select(t => t.Application).OrderBy(t => t.Name)));
|
2024-06-04 12:03:15 +10:00
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
2025-06-06 16:39:41 +10:00
|
|
|
|
#region Unit
|
|
|
|
|
|
|
2025-09-24 10:08:50 +10:00
|
|
|
|
CreateMap<Unit, UnitBaseResponse>();
|
|
|
|
|
|
|
2025-06-09 13:55:57 +10:00
|
|
|
|
CreateMap<UnitField, FieldResponse>()
|
|
|
|
|
|
.ForMember(d => d.Name, o => o.MapFrom(s => (string.IsNullOrEmpty(s.DisplayName)) ? s.AihitName : s.DisplayName));
|
|
|
|
|
|
|
2025-09-22 11:04:27 +10:00
|
|
|
|
CreateMap<UnitFieldValue, UnitFieldValueResponse>();
|
2025-06-09 13:55:57 +10:00
|
|
|
|
|
2025-09-09 17:19:41 +10:00
|
|
|
|
CreateMap<Unit, UnitResponse>()
|
2025-06-06 16:39:41 +10:00
|
|
|
|
.Include<Unit, UnitWithAttributesResponse>()
|
2025-11-21 10:56:30 +10:00
|
|
|
|
.Include<Unit, UnitRelationshipsAndAttributesResponse>()
|
2025-06-06 16:39:41 +10:00
|
|
|
|
.ForMember(d => d.Name, o => o.MapFrom(s => s.Name));
|
|
|
|
|
|
|
|
|
|
|
|
CreateMap<Unit, UnitWithAttributesResponse>()
|
2025-11-21 10:56:30 +10:00
|
|
|
|
.Include<Unit, UnitRelationshipsAndAttributesResponse>()
|
2025-09-22 15:25:17 +10:00
|
|
|
|
.ForMember(d => d.Attributes, o => o.MapFrom(s => s.UnitValues.GroupBy(g => g.Field)
|
2025-11-21 10:56:30 +10:00
|
|
|
|
.Select(fieldGroup => new AttributeResponse
|
|
|
|
|
|
{
|
|
|
|
|
|
Field = new FieldResponse
|
2025-09-22 15:25:17 +10:00
|
|
|
|
{
|
2025-11-21 10:56:30 +10:00
|
|
|
|
Id = fieldGroup.Key!.Id,
|
|
|
|
|
|
Name = string.IsNullOrEmpty(fieldGroup.Key.DisplayName) ? fieldGroup.Key.AihitName : fieldGroup.Key.DisplayName,
|
2025-11-28 09:12:26 +10:00
|
|
|
|
IsMultipleValue = fieldGroup.Key.IsMultipleValue,
|
|
|
|
|
|
Code = fieldGroup.Key.Code
|
2025-11-21 10:56:30 +10:00
|
|
|
|
},
|
|
|
|
|
|
Values = fieldGroup.Select(s => new UnitFieldValueResponse { Id = s.ValueId, Value = s.Value!.Value }).ToList()
|
|
|
|
|
|
}
|
2025-11-17 12:06:33 +10:00
|
|
|
|
).OrderBy(o => o.Field.Name)
|
2025-09-22 15:25:17 +10:00
|
|
|
|
));
|
2025-11-21 10:56:30 +10:00
|
|
|
|
|
2025-11-28 09:12:26 +10:00
|
|
|
|
|
2025-11-21 10:56:30 +10:00
|
|
|
|
CreateMap<Unit, UnitRelationshipsAndAttributesResponse>()
|
|
|
|
|
|
.ForMember(d => d.Childrens, o => o.MapFrom(s => s.ChildUnits.Select(t => t.ChildUnit).OrderBy(t => t.Name)))
|
|
|
|
|
|
.ForMember(d => d.Parents, o => o.MapFrom(s => s.ParentUnits.Select(t => t.ParentUnit).OrderBy(t => t.Name)));
|
|
|
|
|
|
//.ForMember(d => d.Attributes, o => o.MapFrom(s => s.UnitValues.GroupBy(g => g.Field)
|
|
|
|
|
|
// .Select(fieldGroup => new AttributeResponse
|
|
|
|
|
|
// {
|
|
|
|
|
|
// Field = new FieldResponse
|
|
|
|
|
|
// {
|
|
|
|
|
|
// Id = fieldGroup.Key!.Id,
|
|
|
|
|
|
// Name = string.IsNullOrEmpty(fieldGroup.Key.DisplayName) ? fieldGroup.Key.AihitName : fieldGroup.Key.DisplayName,
|
|
|
|
|
|
// IsMultipleValue = fieldGroup.Key.IsMultipleValue
|
|
|
|
|
|
// },
|
|
|
|
|
|
// Values = fieldGroup.Select(s => new UnitFieldValueResponse { Id = s.ValueId, Value = s.Value!.Value }).ToList()
|
|
|
|
|
|
// }
|
|
|
|
|
|
// ).OrderBy(o => o.Field.Name)
|
|
|
|
|
|
//));
|
2025-06-06 16:39:41 +10:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
2024-06-04 12:03:15 +10:00
|
|
|
|
#region WorkGroup
|
|
|
|
|
|
|
|
|
|
|
|
CreateMap<WorkGroup, WorkGroupResponse>();
|
2023-11-30 10:17:02 +10:00
|
|
|
|
|
2024-01-26 12:27:59 +10:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region Robot
|
2023-12-27 08:50:45 +10:00
|
|
|
|
|
2023-10-03 16:54:01 +10:00
|
|
|
|
CreateMap<RobotStatus, RobotStatusResponse>();
|
|
|
|
|
|
|
2023-10-04 15:22:06 +10:00
|
|
|
|
CreateMap<RobotHistoryLevel, RobotHistoryLevelResponse>();
|
|
|
|
|
|
|
2023-10-06 13:58:10 +10:00
|
|
|
|
CreateMap<RobotHistory, RobotHistoryResponse>()
|
2023-10-04 15:22:06 +10:00
|
|
|
|
.ForMember(d => d.Level, o => o.MapFrom(s => s.RobotHistoryLevel))
|
|
|
|
|
|
.ForMember(d => d.Date, o => o.MapFrom(s => s.DateCreated))
|
2023-10-13 15:28:17 +10:00
|
|
|
|
.ForMember(d => d.TaskId, o => o.MapFrom(s => s.RobotConfigurationId))
|
|
|
|
|
|
.ForMember(d => d.TaskStatus, o => o.MapFrom(s => s.StatusTask))
|
|
|
|
|
|
.ForMember(d => d.TemplateId, o => o.MapFrom(s => s.RobotConfiguration!.TemplateId))
|
2024-01-26 12:27:59 +10:00
|
|
|
|
.ForMember(d => d.TemplateName, o => o.MapFrom(s => s.RobotConfiguration!.Template!.Name))
|
|
|
|
|
|
.ForMember(d => d.Robot, o => o.MapFrom(s => s.RobotConfiguration!.Robot));
|
2023-10-04 15:22:06 +10:00
|
|
|
|
|
2024-01-26 12:27:59 +10:00
|
|
|
|
#endregion
|
2023-10-06 09:49:36 +10:00
|
|
|
|
|
2023-12-27 08:50:45 +10:00
|
|
|
|
#region RobotConfiguration
|
2023-10-06 09:49:36 +10:00
|
|
|
|
// --- RobotConfiguration ---
|
2023-10-10 16:58:05 +10:00
|
|
|
|
CreateMap<RobotConfiguration, RobotTaskBaseResponse>()
|
|
|
|
|
|
.Include<RobotConfiguration, RobotTaskTemplateResponse>()
|
|
|
|
|
|
.Include<RobotConfiguration, RobotTaskScheduleResponse>()
|
|
|
|
|
|
.ForMember(d => d.TaskId, o => o.MapFrom(s => s.Id));
|
|
|
|
|
|
|
2023-10-06 09:49:36 +10:00
|
|
|
|
CreateMap<RobotConfiguration, RobotTaskTemplateResponse>()
|
|
|
|
|
|
.ForMember(d => d.IsActive, o => o.MapFrom(s => s.Template!.IsActiveTemplate))
|
|
|
|
|
|
.ForMember(d => d.ClosingCode, o => o.MapFrom<RobotTaskTemplateClosingCodeResolver>())
|
2025-06-25 14:17:34 +10:00
|
|
|
|
.ForMember(d => d.FullDescription, o => o.MapFrom(s => s.Template!.Job!.Group!.FullDescription))
|
2025-08-01 14:45:36 +10:00
|
|
|
|
.ForMember(d => d.ShortDescription, o => o.MapFrom(s => s.Template!.Job!.Group!.ShortDescription))
|
2025-06-25 14:17:34 +10:00
|
|
|
|
.ForMember(d => d.Solution, o => o.MapFrom(s => s.Template!.Job!.Group!.Solution))
|
2025-07-01 17:20:48 +10:00
|
|
|
|
//.ForMember(d => d.ResponseArea, o => o.MapFrom(s => s.Template!.Host!.ResponseArea!.Name))
|
|
|
|
|
|
//ЗО берем у группы а не у хоста
|
2025-08-06 10:33:55 +10:00
|
|
|
|
.ForMember(d => d.ResponseArea, o => o.MapFrom(s => s.Template!.Unit!.BaseFields!.ResponseArea))
|
2025-06-25 14:17:34 +10:00
|
|
|
|
.ForMember(d => d.TemplateDuration, o => o.MapFrom(s => s.Template!.Job!.Group!.TemplateDuration))
|
2023-10-06 09:49:36 +10:00
|
|
|
|
.ForMember(d => d.Initiator, o => o.MapFrom<RobotTaskTemplateInitiatorResolver>())
|
|
|
|
|
|
.ForMember(d => d.Category, o => o.MapFrom<RobotTaskTemplateCategoryResolver>())
|
2025-08-22 11:25:51 +10:00
|
|
|
|
.ForMember(d => d.WorkGroup, o => o.MapFrom(s => s.Template!.Job!.WorkGroupMask))
|
2025-06-27 13:42:13 +10:00
|
|
|
|
.ForMember(d => d.Ek, o => o.MapFrom(s => s.Template!.Unit!.Name))
|
2023-10-06 09:49:36 +10:00
|
|
|
|
.ForMember(d => d.Name, o => o.MapFrom(s => s.Template!.Name))
|
2025-06-25 14:17:34 +10:00
|
|
|
|
.ForMember(d => d.ProcessName, o => o.MapFrom(s => s.Template!.Job!.Tnk!.Subprocess!.Process!.Name))
|
|
|
|
|
|
.ForMember(d => d.ProcessEsppId, o => o.MapFrom(s => s.Template!.Job!.Tnk!.Subprocess!.Process!.EsppId))
|
|
|
|
|
|
.ForMember(d => d.SubprocessName, o => o.MapFrom(s => s.Template!.Job!.Tnk!.Subprocess!.Name))
|
|
|
|
|
|
.ForMember(d => d.SubprocessEsppId, o => o.MapFrom(s => s.Template!.Job!.Tnk!.Subprocess!.EsppId))
|
2025-08-01 14:45:36 +10:00
|
|
|
|
.ForMember(d => d.TnkName, o => o.MapFrom(s => s.Template!.Job!.Tnk!.Name))
|
2025-12-09 10:25:41 +10:00
|
|
|
|
.ForMember(d => d.TnkEsppId, o => o.MapFrom(s =>
|
|
|
|
|
|
s.Template!.Job!.Tnk!.EsppId.HasValue
|
|
|
|
|
|
? s.Template!.Job!.Tnk!.EsppId.Value.ToString()
|
|
|
|
|
|
: string.Empty
|
|
|
|
|
|
))
|
2025-08-01 14:45:36 +10:00
|
|
|
|
.ForMember(d => d.WorkName, o => o.MapFrom(s => s.Template!.Job!.WorkName))
|
2025-06-25 14:17:34 +10:00
|
|
|
|
//.ForMember(d => d.WorkEsppId, o => o.MapFrom(s => s.Template!.Job!.EsppId))
|
2025-06-11 12:02:24 +10:00
|
|
|
|
.ForMember(d => d.ScheduleEsppId, o => o.MapFrom(s => s.Template!.ScheduleEsppId));
|
2023-10-06 09:49:36 +10:00
|
|
|
|
|
2023-10-06 11:38:33 +10:00
|
|
|
|
CreateMap<RobotConfiguration, RobotTaskScheduleResponse>()
|
2023-10-10 16:58:05 +10:00
|
|
|
|
.ForMember(d => d.EsppId, o => o.MapFrom(s => s.Template!.ScheduleEsppId))
|
|
|
|
|
|
.ForMember(d => d.ScheduleName, o => o.MapFrom(s => s.Template!.Name))
|
|
|
|
|
|
.ForMember(d => d.IsActive, o => o.MapFrom(s => s.Template!.IsActiveSchedule))
|
2025-06-25 14:17:34 +10:00
|
|
|
|
.ForMember(d => d.ResponseArea, o => o.MapFrom(s => s.Template!.Unit!.BaseFields!.ResponseArea))
|
2023-10-10 16:58:05 +10:00
|
|
|
|
.ForMember(d => d.TemplateName, o => o.MapFrom(s => s.Template!.Name))
|
|
|
|
|
|
.ForMember(d => d.TemplateId, o => o.MapFrom(s => s.Template!.Id))
|
2025-08-22 11:25:51 +10:00
|
|
|
|
.ForMember(d => d.WorkGroup, o => o.MapFrom(s => s.Template!.Job!.WorkGroupMask))
|
2025-12-25 17:01:42 +10:00
|
|
|
|
//.ForMember(d => d.Exclude, o => o.MapFrom<RobotTaskScheduleExcludeResolver>())
|
|
|
|
|
|
.ForMember(d => d.Exclude, o => o.MapFrom(s => s.Template!.Job!.Group!.ScheduleExcludeType!.EsppName))
|
|
|
|
|
|
//.ForMember(d => d.ExcludeCalendar, o => o.MapFrom<RobotTaskScheduleExcludeCalendarResolver>())
|
|
|
|
|
|
.ForMember(d => d.ExcludeCalendar, o => o.MapFrom(s => s.Template!.Job!.Group!.ScheduleExcludeTypeCalendar != null ? s.Template!.Job!.Group!.ScheduleExcludeTypeCalendar.EsppName : null))
|
2023-10-11 11:10:35 +10:00
|
|
|
|
.ForMember(d => d.Timezone, o => o.MapFrom<RobotTaskScheduleTimezoneResolver>())
|
|
|
|
|
|
.ForMember(d => d.RepeatRange, o => o.MapFrom<RobotTaskScheduleRepeatRangeResolver>())
|
2024-08-06 10:52:27 +10:00
|
|
|
|
//todo: GenerationTime
|
|
|
|
|
|
//.ForMember(d => d.GenerationTime, o => o.MapFrom(s => EsppScheduleHelpers.GetGenerationTime(s.Template!.NextRun)))
|
|
|
|
|
|
.ForMember(d => d.GenerationTime, o => o.MapFrom<RobotTaskScheduleGenerationTimeResolver>())
|
|
|
|
|
|
//.ForMember(d => d.NextStart, o => o.MapFrom(s => EsppScheduleHelpers.GetNextRun(s.Template!.NextRun)))
|
|
|
|
|
|
.ForMember(d => d.NextStart, o => o.MapFrom<RobotTaskScheduleNextStartResolver>())
|
2023-10-11 11:10:35 +10:00
|
|
|
|
.ForMember(d => d.ScheduleType, o => o.MapFrom(s =>
|
2025-06-25 14:17:34 +10:00
|
|
|
|
s.Template!.Job!.Group!.EsppSchValues!.First()!.EsppSchTypeConfig!.EsppSchTypeSchedule!.Description))
|
2023-10-12 09:10:10 +10:00
|
|
|
|
.ForMember(d => d.ScheduleTypeCode, o => o.MapFrom(s =>
|
2025-06-25 14:17:34 +10:00
|
|
|
|
s.Template!.Job!.Group!.EsppSchValues!.First()!.EsppSchTypeConfig!.EsppSchTypeSchedule!.Id))
|
2023-10-11 11:10:35 +10:00
|
|
|
|
.ForMember(d => d.Schedule, o => o.MapFrom<RobotTaskScheduleSchResolver>());
|
2023-10-06 09:49:36 +10:00
|
|
|
|
|
2023-10-06 11:38:33 +10:00
|
|
|
|
CreateMap<Robot, RobotResponse>();
|
|
|
|
|
|
|
|
|
|
|
|
CreateMap<DAL.Models.TaskStatus, TaskStatusResponse>();
|
|
|
|
|
|
|
|
|
|
|
|
CreateMap<RobotConfiguration, RobotConfigurationResponse>()
|
|
|
|
|
|
.ForMember(d => d.Robot, o => o.MapFrom(s => s.Robot))
|
2023-10-06 15:13:40 +10:00
|
|
|
|
.ForMember(d => d.TaskStatus, o => o.MapFrom(s => s.TaskStatus))
|
2023-10-06 11:38:33 +10:00
|
|
|
|
.ForMember(d => d.RobotStatus, o => o.MapFrom(s => s.RobotStatus));
|
2025-09-10 10:40:12 +10:00
|
|
|
|
// === RobotConfiguration ===
|
|
|
|
|
|
#endregion
|
2023-10-06 11:38:33 +10:00
|
|
|
|
|
2024-04-03 14:12:59 +10:00
|
|
|
|
#region EsppSch
|
2024-04-08 12:16:14 +10:00
|
|
|
|
CreateMap<EsppSchTypeSchedule, EsppScheduleTypeScheduleResponse>()
|
|
|
|
|
|
.Include<EsppSchTypeSchedule, EsppScheduleTypeScheduleWithDataResponse>();
|
|
|
|
|
|
|
|
|
|
|
|
CreateMap<EsppSchTypeSchedule, EsppScheduleTypeScheduleWithDataResponse>()
|
|
|
|
|
|
.ForMember(d => d.Configs, o => o.MapFrom(s => s.EsppSchTypeConfigs.OrderBy(t => t.Order)));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CreateMap<EsppSchTypeConfig, EsppScheduleTypeConfigWithDataResponse>()
|
|
|
|
|
|
.ForMember(d => d.Type, o => o.MapFrom(s => s.EsppSchType));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CreateMap<EsppSchType, EsppScheduleTypeResponse>()
|
|
|
|
|
|
.Include<EsppSchType, EsppScheduleTypeWithDataResponse>();
|
|
|
|
|
|
|
|
|
|
|
|
CreateMap<EsppSchType, EsppScheduleTypeWithDataResponse>()
|
|
|
|
|
|
.ForMember(d => d.Values, o => o.MapFrom(s => s.EsppSchTypeValues.OrderBy(t => t.Order)));
|
2023-10-12 12:06:47 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CreateMap<EsppSchTypeValue, EsppScheduleTypeValueResponse>();
|
|
|
|
|
|
|
|
|
|
|
|
CreateMap<EsppScheduleValDto, EsppScheduleValResponse>()
|
|
|
|
|
|
.ForMember(d => d.Order, o => o.MapFrom(s => s.Order))
|
|
|
|
|
|
.ForMember(d => d.Value, o => o.MapFrom(s => s.Value))
|
|
|
|
|
|
.ForMember(d => d.Type, o => o.MapFrom(s => s.Type));
|
2024-04-03 14:12:59 +10:00
|
|
|
|
#endregion EsppSch
|
2023-10-12 12:06:47 +10:00
|
|
|
|
|
2025-09-10 10:40:12 +10:00
|
|
|
|
#region AgentHistory
|
2023-10-19 11:22:35 +10:00
|
|
|
|
CreateMap<AgentHistoryLevel, AgentHistoryLevelResponse>();
|
|
|
|
|
|
|
|
|
|
|
|
CreateMap<AgentHistory, AgentHistoryResponse>()
|
2024-03-12 15:09:12 +10:00
|
|
|
|
.ForMember(d => d.Date, o => o.MapFrom(s => s.DateCreated))
|
|
|
|
|
|
.ForMember(d => d.Level, o => o.MapFrom(s => s.AgentHistoryLevel))
|
|
|
|
|
|
.ForMember(d => d.TemplateName, o => o.MapFrom(s => s.Template!.Name));
|
2023-12-05 16:32:34 +10:00
|
|
|
|
|
2025-09-10 10:40:12 +10:00
|
|
|
|
#endregion
|
2023-12-21 16:00:08 +10:00
|
|
|
|
|
2023-12-05 16:32:34 +10:00
|
|
|
|
#region User
|
|
|
|
|
|
|
2024-07-22 14:48:44 +10:00
|
|
|
|
CreateMap<User, UserBaseResponse>()
|
|
|
|
|
|
.Include<User, UserResponse>();
|
|
|
|
|
|
|
|
|
|
|
|
CreateMap<User, UserBaseResponse>();
|
|
|
|
|
|
|
2023-12-05 16:32:34 +10:00
|
|
|
|
CreateMap<User, UserResponse>()
|
|
|
|
|
|
.ForMember(t => t.Roles, o => o.MapFrom(s => s.Roles.Select(t => t.Role).OrderBy(t => t!.Description)));
|
|
|
|
|
|
|
|
|
|
|
|
CreateMap<Role, RoleResponse>();
|
|
|
|
|
|
|
2023-12-06 11:53:36 +10:00
|
|
|
|
CreateMap<UserCache, UserProfileResponse>();
|
|
|
|
|
|
|
2023-12-05 16:32:34 +10:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
2023-12-21 16:00:08 +10:00
|
|
|
|
#region Order
|
2023-12-27 08:50:45 +10:00
|
|
|
|
|
2023-12-21 16:00:08 +10:00
|
|
|
|
CreateMap<OrderStatus, OrderStatusResponse>();
|
2023-12-27 08:50:45 +10:00
|
|
|
|
|
2024-01-22 11:46:49 +10:00
|
|
|
|
CreateMap<Order, OrderResponseBase>()
|
|
|
|
|
|
.Include<Order, OrderForAgentHistoryResponse>()
|
|
|
|
|
|
.Include<Order, OrderResponse>();
|
|
|
|
|
|
|
|
|
|
|
|
CreateMap<Order, OrderForAgentHistoryResponse>()
|
|
|
|
|
|
.ForMember(s => s.Status, o => o.MapFrom(s => s.OrderStatus))
|
|
|
|
|
|
.ForMember(s => s.NextStatus, o => o.MapFrom(s => s.NextStatus));
|
|
|
|
|
|
|
2024-02-26 09:20:13 +10:00
|
|
|
|
CreateMap<Order, OrderResponse>()
|
|
|
|
|
|
.ForMember(s => s.Status, o => o.MapFrom(s => s.OrderStatus))
|
|
|
|
|
|
.ForMember(s => s.NextStatus, o => o.MapFrom(s => s.NextStatus));
|
2024-01-22 11:46:49 +10:00
|
|
|
|
|
2023-12-21 16:00:08 +10:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
2024-03-12 15:09:12 +10:00
|
|
|
|
|
2025-12-08 14:23:08 +10:00
|
|
|
|
#region Job
|
2024-03-14 10:14:25 +10:00
|
|
|
|
|
2025-12-08 14:23:08 +10:00
|
|
|
|
CreateMap<Job, JobBaseResponse>()
|
|
|
|
|
|
.Include<Job, JobResponse>();
|
2024-04-03 14:12:59 +10:00
|
|
|
|
|
2025-12-08 14:23:08 +10:00
|
|
|
|
CreateMap<Job, JobResponse>()
|
|
|
|
|
|
.ForMember(d => d.AutoControl, o => o.MapFrom(s => s.AutoControl));
|
2025-09-09 17:19:41 +10:00
|
|
|
|
|
2025-09-10 10:40:12 +10:00
|
|
|
|
CreateMap<JobUnitFilter, UnitFilterResponse>()
|
2025-09-24 10:08:50 +10:00
|
|
|
|
.ForMember(d => d.UnitFilterMask, o => o.MapFrom(s => s.UnitFilter))
|
2025-09-24 10:16:18 +10:00
|
|
|
|
.ForMember(d => d.FieldFilters, o => o.MapFrom(s => s.FieldFilters.OrderBy(o => o.UnitField!.AihitName)))
|
|
|
|
|
|
.ForMember(d => d.RelationshipFilters, o => o.MapFrom(s => s.RelationshipFilters.OrderBy(o => o.UnitField!.AihitName)));
|
2025-09-10 10:40:12 +10:00
|
|
|
|
|
2025-09-22 15:25:17 +10:00
|
|
|
|
CreateMap<JobFieldFilter, FieldResponse>();
|
2025-09-10 10:40:12 +10:00
|
|
|
|
|
2025-09-22 15:56:58 +10:00
|
|
|
|
CreateMap<JobFieldFilter, FieldFilterResponse>()
|
|
|
|
|
|
.ForMember(d => d.Field, o => o.MapFrom(s => s.UnitField));
|
2025-09-10 10:40:12 +10:00
|
|
|
|
|
2025-09-09 17:19:41 +10:00
|
|
|
|
CreateMap<JobRelationshipFilter, RelationshipFilterResponse>()
|
|
|
|
|
|
.ForMember(d => d.Field, o => o.MapFrom(s => s.UnitField));
|
|
|
|
|
|
|
2025-12-08 14:23:08 +10:00
|
|
|
|
CreateMap<JobAutoControl, JobAutoControlResponse>();
|
|
|
|
|
|
|
2025-06-25 14:17:34 +10:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
2025-07-01 17:20:48 +10:00
|
|
|
|
#region JobGroup
|
2025-12-26 11:21:45 +10:00
|
|
|
|
|
2025-07-01 17:20:48 +10:00
|
|
|
|
CreateMap<JobGroup, JobGroupBaseResponse>()
|
2025-11-17 12:06:33 +10:00
|
|
|
|
.Include<JobGroup, JobGroupResponse>()
|
2025-12-19 10:48:41 +10:00
|
|
|
|
.ForMember(d => d.GroupType, o => o.MapFrom(s => s.GroupType))
|
|
|
|
|
|
.ForMember(d => d.GroupingUnitField, o => o.MapFrom(s => s.GroupingUnitField));
|
2025-09-04 14:51:51 +10:00
|
|
|
|
|
|
|
|
|
|
CreateMap<JobGroup, JobGroupBaseResponse>()
|
|
|
|
|
|
.ForMember(d => d.Name, o => o.MapFrom(s => s.GroupName));
|
2025-07-01 17:20:48 +10:00
|
|
|
|
|
2025-12-26 11:21:45 +10:00
|
|
|
|
CreateMap<JobGroup, JobGroupResponse>()
|
|
|
|
|
|
.ForMember(d => d.ScheduleExcludeType, o => o.MapFrom(s => s.ScheduleExcludeType))
|
|
|
|
|
|
.ForMember(d => d.ScheduleExcludeTypeCalendar, o => o.MapFrom(s => s.ScheduleExcludeTypeCalendar));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region ScheduleExcludeTypeCalendarResponse
|
|
|
|
|
|
|
|
|
|
|
|
CreateMap<ScheduleExcludeTypeCalendar, ScheduleExcludeTypeCalendarResponse>();
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region ScheduleExcludeTypeResponse
|
2025-09-10 10:40:12 +10:00
|
|
|
|
|
2025-12-26 11:21:45 +10:00
|
|
|
|
CreateMap<ScheduleExcludeType, ScheduleExcludeTypeResponse>();
|
2025-09-04 14:51:51 +10:00
|
|
|
|
|
2025-11-17 12:06:33 +10:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
#region JobGroupType
|
|
|
|
|
|
|
|
|
|
|
|
CreateMap<JobGroupType, JobGroupTypeResponse>();
|
|
|
|
|
|
|
2025-07-01 17:20:48 +10:00
|
|
|
|
#endregion
|
|
|
|
|
|
|
2025-12-05 14:07:48 +10:00
|
|
|
|
//#region JobAutoControl
|
2024-09-09 15:48:49 +10:00
|
|
|
|
|
2025-12-05 14:07:48 +10:00
|
|
|
|
//CreateMap<JobAutoControl, JobAutoControlBaseResponse>()
|
|
|
|
|
|
// .Include<JobAutoControl, JobAutoControlResponse>();
|
2024-09-11 14:59:37 +10:00
|
|
|
|
|
2025-12-05 14:07:48 +10:00
|
|
|
|
//CreateMap<JobAutoControl, JobAutoControlResponse>()
|
|
|
|
|
|
// .ForMember(d => d.EkMasks, o => o.MapFrom(s => s.JobEkMasks.OrderBy(t => t.Name)))
|
|
|
|
|
|
// .ForMember(d => d.EnabledEkStatuses, o => o.MapFrom(s => s.JobAutoControlInEkStatuses.Select(t => t.EkStatus).OrderBy(t => t.Name)))
|
|
|
|
|
|
// .ForMember(d => d.WorkGroups, o => o.MapFrom(s => s.ApplicationsInWork!.WorkGroups.Select(t => t.WorkGroup).OrderBy(t => t.Name)));
|
2024-09-09 15:48:49 +10:00
|
|
|
|
|
|
|
|
|
|
|
2025-12-05 14:07:48 +10:00
|
|
|
|
//#endregion
|
2024-09-09 15:48:49 +10:00
|
|
|
|
|
2024-06-19 11:24:14 +10:00
|
|
|
|
#region ResponseArea
|
|
|
|
|
|
CreateMap<ResponseArea, ResponseAreaResponse>();
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
2025-12-05 14:07:48 +10:00
|
|
|
|
//CreateMap<JobEkMask, JobEkMaskResponse>();
|
2024-09-09 15:48:49 +10:00
|
|
|
|
|
2024-03-14 10:14:25 +10:00
|
|
|
|
|
|
|
|
|
|
CreateMap<EkStatus, EkStatusResponse>();
|
2024-09-17 11:55:55 +10:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
CreateMap<WeekendDay, WeekendResponse>();
|
2024-10-08 13:53:57 +10:00
|
|
|
|
|
|
|
|
|
|
#region TemplateHistory
|
|
|
|
|
|
|
|
|
|
|
|
CreateMap<TemplateHistory, TemplateHistoryResponse>()
|
|
|
|
|
|
.ForMember(d => d.TemplateId, o => o.MapFrom(s => s.ParentId))
|
|
|
|
|
|
.ForMember(d => d.Initiator, o => o.MapFrom(s => s));
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region Initiator
|
|
|
|
|
|
|
|
|
|
|
|
CreateMap<IHistoryInitiator, HistoryInitiatorResponse>()
|
|
|
|
|
|
.ForMember(d => d.Ip, o => o.MapFrom(s => s.InitiatorIp))
|
|
|
|
|
|
.ForMember(d => d.Comment, o => o.MapFrom(s => s.InitiatorComment))
|
|
|
|
|
|
.ForMember(d => d.ParrComponentId, o => o.MapFrom(s => s.InitiatorParrComponentId))
|
|
|
|
|
|
.ForMember(d => d.ParrComponent, o => o.MapFrom<HistoryInitiatorParrComponentResolver>())
|
|
|
|
|
|
.ForMember(d => d.User, o => o.MapFrom<HistoryInitiatorUserResolver>());
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
2025-12-10 11:55:58 +10:00
|
|
|
|
CreateMap<ShortcodeInfoDto, ShortcodeResponse>();
|
2026-01-16 11:04:26 +10:00
|
|
|
|
|
|
|
|
|
|
#region MatchingStatus -> MatchingStatusResponse
|
|
|
|
|
|
|
|
|
|
|
|
CreateMap<MatchingStatus, MatchingStatusResponse>()
|
|
|
|
|
|
.ForMember(d => d.DetailsJobGroups, o => o.MapFrom(s => s.DetailsJobGroups != null ? s.DetailsJobGroups.Select(t => t.Data) : null))
|
|
|
|
|
|
.ForMember(d => d.DetailsJobs, o => o.MapFrom(s => s.DetailsJobs != null ? s.DetailsJobs.Select(t => t.Data) : null));
|
|
|
|
|
|
|
|
|
|
|
|
#endregion
|
2023-05-17 16:00:50 +10:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2024-10-08 13:53:57 +10:00
|
|
|
|
|
|
|
|
|
|
|
2023-05-17 16:00:50 +10:00
|
|
|
|
}
|