feat(dal,templateMatcher): Shortcodes добавлены %МАКС:ИМЯ АТРИБУТА%, %ГР_ПОЛЕ-ПН%, %БУКВЫ:ИМЯ АТРИБУТА%, исправлена фильтрация в UnitFilter, TemplateMatcher отдельные классы для типов работ, Shortcodes теперь работает по своим моделям Dto

This commit is contained in:
Mikhail Kuznetsov
2025-12-23 18:27:31 +10:00
parent 7ca536ce52
commit 00cace4255
32 changed files with 2471 additions and 1399 deletions

View File

@@ -3,7 +3,8 @@ using PARR.BLL.Domain.Mq;
using PARR.BLL.Services.Interfaces;
using PARR.Common.Domain;
using PARR.Constants;
using PARR.DAL.DomainServices.Interfaces;
using PARR.DAL.DomainServices.Shortcodes;
using PARR.DAL.DomainServices.Shortcodes.Models;
using PARR.DAL.Models;
using PARR.DAL.Models.Job;
using PARR.DAL.Models.Unit;
@@ -79,7 +80,35 @@ namespace PARR.TemplateGeneratorWorker
return;
}
var templateName = await shortcodesService.ApplyShortcodesAsync(job!.TemplateNameMask!, query.UnitId, query.JobId);
var templateForShortcodes = new TemplateForShortcodes
{
Id = Guid.Empty, // шаблон ещё не создан
Index = query.Index,
JobId = query.JobId,
UnitId = query.UnitId,
Job = job == null ? null : new JobForShortcodes
{
Group = job.Group == null ? null : new JobGroupForShortcodes
{
GroupingUnitFieldId = job.Group.GroupingUnitFieldId,
GroupType = job.Group.GroupType == null ? null : new JobGroupTypeForShortcodes
{
Code = job.Group.GroupType.Code
},
GroupName = job.Group.GroupName
},
Tnk = job.Tnk == null ? null : new TnkForShortcodes
{
Name = job.Tnk.Name,
ShortName = job.Tnk.ShortName
},
WorkName = job.WorkName,
Name = job.Name
},
UnitsInTemplate = query.UnitsInTemplate?.Select(guid => new UnitInTemplateForShortcodes { UnitId = guid }).ToList() ?? new List<UnitInTemplateForShortcodes>()
};
var templateName = await shortcodesService.ApplyShortcodesAsync(job!.TemplateNameMask!, templateForShortcodes);
var nextRun = await esppScheduleTransformService.GetNextDateAsync(job.GroupId, job.Group!.ReferenceDate);