Merge pull request '#7887519 Добавление параметров' (#13) from feature/7887519 into dev

Reviewed-on: http://46.146.209.148:8080/DDrilling/AsbCloudServer/pulls/13
This commit is contained in:
ai.astrakhantsev 2022-11-28 12:15:28 +05:00
commit daaad5b8d1
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.GetValueOrDefault(item.Key) ?? $"Id: {item.Key}"
});
}