#7887519 Добавление параметров

This commit is contained in:
ai.astrakhantsev 2022-11-28 11:54:02 +05:00
parent ddcade44a3
commit 65e8c7d8c1
2 changed files with 21 additions and 1 deletions

View File

@ -27,6 +27,16 @@ namespace AsbCloudApp.Data
/// Идентификатор критерия бурения
/// </summary>
public short IdFeedRegulator { get; set; }
/// <summary>
/// Наименование критерия бурения
/// </summary>
public string NameFeedRegulator { get; set; } = string.Empty;
/// <summary>
/// Количество включений
/// </summary>
public int NumberInclusions { get; set; }
}
#nullable disable
}

View File

@ -15,6 +15,14 @@ namespace AsbCloudInfrastructure.Services
{
private readonly ILimitingParameterRepository limitingParameterRepository;
private readonly IWellService wellService;
private readonly Dictionary<int, string> feedRegulatorData = new Dictionary<int, string>()
{
{ 0, "Нет ограничения" },
{ 1, "МСП" },
{ 2, "Давление" },
{ 3, "Осевая нагрузка" },
{ 4, "Момент" }
};
public LimitingParameterService(ILimitingParameterRepository limitingParameterRepository,
IWellService wellService)
@ -46,7 +54,9 @@ namespace AsbCloudInfrastructure.Services
IdWell = well.Id,
IdFeedRegulator = item.Key,
Depth = allItemDepths,
TotalMinutes = (float)allItemDates
TotalMinutes = (float)allItemDates,
NumberInclusions = item.Count(),
NameFeedRegulator = feedRegulatorData.FirstOrDefault(x => x.Key == item.Key).Value
});
}