feat(all): в таблицу Order добавлено поле ExpirationDate, обновлены сервисы для записи этого поля. Начало логики закрытия нарядов в ЕСПП.
This commit is contained in:
@@ -66,7 +66,7 @@ namespace PARR.GeneratorTemplates
|
||||
|
||||
if (!await validatorService.IsValidApplicationAndWorksAsync(query.ApplicationId, query.WorkId))
|
||||
{
|
||||
logger.LogError($"Невалидны параметры {nameof(query.ApplicationId)}: {query.ApplicationId}, " +
|
||||
logger.LogError($"Не валидны параметры {nameof(query.ApplicationId)}: {query.ApplicationId}, " +
|
||||
$"{nameof(query.WorkId)}: {query.WorkId}," +
|
||||
$" нет таких значений или они не связаны в таблице ${nameof(ApplicationsInWork)}");
|
||||
return;
|
||||
|
||||
@@ -21,7 +21,6 @@ namespace PARR.GeneratorTemplates
|
||||
|
||||
//add other services
|
||||
services.AddTransient<IGeneratorTemplate, GeneratorTemplate>();
|
||||
services.AddTransient<ITransformService, TransformService>();
|
||||
services.AddTransient<IValidatorService, ValidatorService>();
|
||||
services.AddTransient<ITemplateManager, TemplateManager>();
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace PARR.GeneratorTemplates.Services
|
||||
{
|
||||
internal interface ITransformService
|
||||
{
|
||||
T? GetModelFromJson<T>(string str);
|
||||
}
|
||||
}
|
||||
@@ -1,29 +0,0 @@
|
||||
using Microsoft.Extensions.Logging;
|
||||
using System.Text.Json;
|
||||
|
||||
namespace PARR.GeneratorTemplates.Services
|
||||
{
|
||||
internal class TransformService : ITransformService
|
||||
{
|
||||
private readonly ILogger<TransformService> logger;
|
||||
|
||||
public TransformService(ILogger<TransformService> logger)
|
||||
{
|
||||
this.logger = logger;
|
||||
}
|
||||
|
||||
public T? GetModelFromJson<T>(string str)
|
||||
{
|
||||
try
|
||||
{
|
||||
return JsonSerializer.Deserialize<T>(str);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
logger.LogError(ex, $"Ошибка при конвертации строки в модель. {str}");
|
||||
|
||||
return default;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user