From 51fb66b80aaeba9b5bb949890adbc368897e6779 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=82=D0=B5=D0=BF=D0=B0=D0=BD=D0=BE=D0=B2=20=D0=94?= =?UTF-8?q?=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9=20=D0=90=D0=BB=D0=B5=D0=BA?= =?UTF-8?q?=D1=81=D0=B0=D0=BD=D0=B4=D1=80=D0=BE=D0=B2=D0=B8=D1=87?= Date: Mon, 31 Jul 2023 16:34:43 +0500 Subject: [PATCH 1/2] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=20=D1=81=D0=BE?= =?UTF-8?q?=D0=B7=D0=B4=D0=B0=D0=BD=D0=B8=D1=8F=20=D0=BE=D0=B3=D1=80=D0=B0?= =?UTF-8?q?=D0=BD=D0=B8=D1=87=D0=B8=D0=B2=D0=B0=D1=8E=D1=89=D0=B8=D1=85=20?= =?UTF-8?q?=D0=BF=D0=B0=D1=80=D0=B0=D0=BC=D0=B5=D1=82=D1=80=D0=BE=D0=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/LimitingParameterBackgroundService.cs | 4 ++-- .../Services/LimitingParameterService.cs | 9 ++------- 2 files changed, 4 insertions(+), 9 deletions(-) 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 { From 85ba539c8298d4fc8db369da864b7c9940be54e3 Mon Sep 17 00:00:00 2001 From: ngfrolov Date: Fri, 4 Aug 2023 13:46:58 +0500 Subject: [PATCH 2/2] =?UTF-8?q?LimitingParameterCalcWorkFactory=20=D0=B8?= =?UTF-8?q?=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=B8=D0=BB=20=D1=83=D1=81=D0=BB?= =?UTF-8?q?=D0=BE=D0=B2=D0=B8=D0=B5=20=D0=BE=D0=BF=D1=80=D0=B5=D0=B4=D0=B5?= =?UTF-8?q?=D0=BB=D0=B5=D0=BD=D0=B8=D1=8F=20=D0=BA=D0=BE=D0=BD=D1=86=D0=B0?= =?UTF-8?q?=20=D0=B8=D0=BD=D1=82=D0=B5=D1=80=D0=B2=D0=B0=D0=BB=D0=B0=20?= =?UTF-8?q?=D0=B4=D0=B5=D0=B9=D1=81=D1=82=D0=B2=D0=B8=D1=8F=20=D0=BE=D0=B3?= =?UTF-8?q?=D1=80=D0=B0=D0=BD=D0=B8=D1=87=D0=B5=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Services/LimitingParameterBackgroundService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AsbCloudInfrastructure/Services/LimitingParameterBackgroundService.cs b/AsbCloudInfrastructure/Services/LimitingParameterBackgroundService.cs index 4ce22ce4..7c875e70 100644 --- a/AsbCloudInfrastructure/Services/LimitingParameterBackgroundService.cs +++ b/AsbCloudInfrastructure/Services/LimitingParameterBackgroundService.cs @@ -105,7 +105,7 @@ namespace AsbCloudInfrastructure.Services }; } - if (limitingLast.IdFeedRegulator != idLimiting && limitingLast.DepthStart < wellDepth) + if (limitingLast.IdFeedRegulator != idLimiting || limitingLast.DepthStart < wellDepth) { limitingParameters.Add(new LimitingParameter { IdTelemetry = idTelemetry,