Merge pull request 'Фикс создания ограничивающих параметров' (#91) from fix/limiting_parameters into dev

Reviewed-on: http://test.digitaldrilling.ru:8080/DDrilling/AsbCloudServer/pulls/91
This commit is contained in:
Никита Фролов 2023-08-04 13:47:26 +05:00
commit 02c84a3d5b
2 changed files with 4 additions and 9 deletions

View File

@ -105,7 +105,7 @@ namespace AsbCloudInfrastructure.Services
};
}
if (limitingLast.IdFeedRegulator != idLimiting)
if (limitingLast.IdFeedRegulator != idLimiting || limitingLast.DepthStart < wellDepth)
{
limitingParameters.Add(new LimitingParameter {
IdTelemetry = idTelemetry,
@ -114,7 +114,7 @@ namespace AsbCloudInfrastructure.Services
DateEnd = date,
DepthStart = limitingLast.DepthStart,
DepthEnd = wellDepth
});
});
limitingLast = new LimitingParameter
{

View File

@ -45,13 +45,8 @@ namespace AsbCloudInfrastructure.Services
{
var trimData = TrimLimitingParameters(item, request).ToArray();
//TODO: временный фикс, нужно избежать отрицательных значений в ограничивающих параметрах.
//Проблема возникает при при формировании LimitingParameter в LimitingParameterCalcWorkFactory.
//Начальная глубина ограничивающего параметра не может быть больше конечной.
var allItemDepths = trimData.Where(x => x.DepthStart < x.DepthEnd)
.Sum(x => x.DepthEnd - x.DepthStart);
var allItemDates = trimData.Where(x => x.DepthStart < x.DepthEnd)
.Sum(x => (x.DateEnd - x.DateStart).TotalMinutes);
var allItemDepths = trimData.Sum(x => x.DepthEnd - x.DepthStart);
var allItemDates = trimData.Sum(x => (x.DateEnd - x.DateStart).TotalMinutes);
result.Add(new LimitingParameterDto
{