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