feat(dal): Добавлена генерация кодового обозначения в подробное описание шаблона, чтобы можно было отследить наряды от агента
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
using Microsoft.EntityFrameworkCore;
|
using Microsoft.EntityFrameworkCore;
|
||||||
using PARR.DAL.Context;
|
using PARR.DAL.Context;
|
||||||
using PARR.DAL.Models.Base;
|
using PARR.DAL.Models.Base;
|
||||||
|
using PARR.DAL.Settings;
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
using System.ComponentModel.DataAnnotations.Schema;
|
using System.ComponentModel.DataAnnotations.Schema;
|
||||||
|
|
||||||
@@ -35,7 +36,22 @@ namespace PARR.DAL.Models.Job
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Поле Подробное описания шаблона АСУ ЕСПП
|
/// Поле Подробное описания шаблона АСУ ЕСПП
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public required string FullDescription { get; set; }
|
private string _fullDescription = string.Empty;
|
||||||
|
public required string FullDescription
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
//В полное описание подставляем префикс, для дальнейшего поиска наряда
|
||||||
|
return $"{_fullDescription}\r\n{PrefixSettings.PrefixWithoutVariable}";
|
||||||
|
}
|
||||||
|
set
|
||||||
|
{
|
||||||
|
//удаляем префикс, если он есть
|
||||||
|
//_fullDescription = value.Replace($"\r\n{PrefixSettings.PrefixWithoutVariable}", string.Empty);
|
||||||
|
_fullDescription = value.Replace($"{PrefixSettings.PrefixWithoutVariable}", string.Empty).TrimEnd();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//public required string FullDescription { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Поле Решение описания шаблона АСУ ЕСПП
|
/// Поле Решение описания шаблона АСУ ЕСПП
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ namespace PARR.TemplateGeneratorWorker
|
|||||||
|
|
||||||
if (!await templateService.CreateAsync(template) || !await templateService.CommitAsync(new HistoryInitiator { InitiatorComment = "Запрос на генерацию с тестового шаблона", InitiatorParrComponentId = ParrComponentsEnum.TemplateGenerator }))
|
if (!await templateService.CreateAsync(template) || !await templateService.CommitAsync(new HistoryInitiator { InitiatorComment = "Запрос на генерацию с тестового шаблона", InitiatorParrComponentId = ParrComponentsEnum.TemplateGenerator }))
|
||||||
{
|
{
|
||||||
logger.LogError($"Ошибка при создании шаблона: Name: {template.Name}, {nameof(template.Job)}: {template.Job}, {nameof(template.Unit)}: {template.UnitId}");
|
logger.LogError($"Ошибка при создании шаблона: Name: {template.Name}, {nameof(template.Job)}: {template.JobId}, {nameof(template.Unit)}: {template.UnitId}");
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user