feat(templateMatcher,dal): небольшой рефакторинг, добавлен Dockerfile

This commit is contained in:
Mikhail Kuznetsov
2025-11-20 11:37:44 +10:00
parent 974ec3c9e0
commit d90924bfa2
9 changed files with 273 additions and 166 deletions

View File

@@ -11,6 +11,7 @@ using PARR.API.Controllers.V1.Base;
using PARR.Constants;
using PARR.DAL.DomainServices.Interfaces;
using PARR.DAL.Models.Job;
using PARR.DAL.Services.Interfaces.Job;
using PARR.DAL.Services.Interfaces.Unit;
using static PARR.API.Contracts.V1.ApiRoutes;
using Job = PARR.DAL.Models.Job.Job;
@@ -27,6 +28,7 @@ namespace PARR.API.Controllers.V1
private readonly IUnitFilterService unitFilterService;
private readonly IValidator<JobRequest> jobValidator;
private readonly IUnitService unitService;
private readonly IJobGroupService jobGroupService;
private readonly IMapper mapper;
public JobUnitPreviewController(
@@ -34,6 +36,7 @@ namespace PARR.API.Controllers.V1
IUnitFilterService unitFilterService,
IValidator<JobRequest> jobValidator,
IUnitService unitService,
IJobGroupService jobGroupService,
IMapper mapper
)
{
@@ -41,6 +44,7 @@ namespace PARR.API.Controllers.V1
this.unitFilterService = unitFilterService;
this.jobValidator = jobValidator;
this.unitService = unitService;
this.jobGroupService = jobGroupService;
this.mapper = mapper;
}
@@ -61,6 +65,11 @@ namespace PARR.API.Controllers.V1
var job = mapper.Map<Job>(request);
var jobGroup = await jobGroupService.Get().AsNoTracking()
.Include(t=>t.GroupType)
.FirstAsync(t=>t.Id == job.GroupId);
job.Group = jobGroup;
var unitIds = await unitFilterService.GetUnitsIdByJobFilterAsync(job, 100);
if (unitIds == null || !unitIds.Any())