diff --git a/AsbCloudInfrastructure/Services/LimitingParameterBackgroundService.cs b/AsbCloudInfrastructure/Services/LimitingParameterBackgroundService.cs index fdcf0ec1..4ce22ce4 100644 --- a/AsbCloudInfrastructure/Services/LimitingParameterBackgroundService.cs +++ b/AsbCloudInfrastructure/Services/LimitingParameterBackgroundService.cs @@ -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 { diff --git a/AsbCloudInfrastructure/Services/LimitingParameterService.cs b/AsbCloudInfrastructure/Services/LimitingParameterService.cs index 78587efb..695321de 100644 --- a/AsbCloudInfrastructure/Services/LimitingParameterService.cs +++ b/AsbCloudInfrastructure/Services/LimitingParameterService.cs @@ -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 {