feat(dal): добавлен новый шотркод %ГРУППА_РАБОТ%
This commit is contained in:
@@ -34,6 +34,7 @@ namespace PARR.DAL.DomainServices.Implementations
|
||||
var job = await jobService
|
||||
.Get().AsNoTracking()
|
||||
.Include(t=>t.Tnk)
|
||||
.Include(t=>t.Group)
|
||||
.FirstOrDefaultAsync(t => t.Id == jobId);
|
||||
|
||||
var unit = await unitService.Get().AsNoTracking().FirstOrDefaultAsync(t => t.Id == unitId);
|
||||
@@ -103,12 +104,15 @@ namespace PARR.DAL.DomainServices.Implementations
|
||||
|
||||
private static string ReplaceShortcodes(Models.Job.Job job, Models.Unit.Unit unit, string resultName, List<Match> shortcodesInMask)
|
||||
{
|
||||
if (shortcodesInMask.Any(x => x.Value == "%РАБОТА%"))
|
||||
resultName = resultName.Replace("%РАБОТА%", job.WorkName);
|
||||
|
||||
if (shortcodesInMask.Any(x => x.Value == "%ЭК%"))
|
||||
resultName = resultName.Replace("%ЭК%", unit.Name);
|
||||
|
||||
if (shortcodesInMask.Any(x => x.Value == "%ГРУППА_РАБОТ%"))
|
||||
resultName = resultName.Replace("%ГРУППА_РАБОТ%", job.Group!.GroupName);
|
||||
|
||||
if (shortcodesInMask.Any(x => x.Value == "%РАБОТА%"))
|
||||
resultName = resultName.Replace("%РАБОТА%", job.WorkName);
|
||||
|
||||
if (shortcodesInMask.Any(x => x.Value == "%ТНК%"))
|
||||
resultName = resultName.Replace("%ТНК%", job.Tnk!.Name);
|
||||
|
||||
@@ -137,6 +141,7 @@ namespace PARR.DAL.DomainServices.Implementations
|
||||
{
|
||||
var result = new List<string> {
|
||||
"%ЭК%",
|
||||
"%ГРУППА_РАБОТ%",
|
||||
"%РАБОТА%",
|
||||
"%ТНК%"
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user