From 2415647dce12daba7099d4eaef558ed9a63df707 Mon Sep 17 00:00:00 2001 From: ngfrolov Date: Mon, 22 May 2023 10:52:27 +0500 Subject: [PATCH] WellInfoService add another source for planned well depth. --- AsbCloudInfrastructure/Services/WellInfoService.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/AsbCloudInfrastructure/Services/WellInfoService.cs b/AsbCloudInfrastructure/Services/WellInfoService.cs index e298fe7c..d24b04a3 100644 --- a/AsbCloudInfrastructure/Services/WellInfoService.cs +++ b/AsbCloudInfrastructure/Services/WellInfoService.cs @@ -79,6 +79,7 @@ namespace AsbCloudInfrastructure.Services var wellLastFactSection = wellOperationsStat?.Sections.LastOrDefault(s => s.Fact is not null); double? currentDepth = null; + double? planTotalDepth = null; DateTime lastTelemetryDate = default; if (well.IdTelemetry.HasValue) @@ -110,9 +111,12 @@ namespace AsbCloudInfrastructure.Services idSection ??= welllProcessMap?.IdWellSectionType; } + planTotalDepth = wellDepthByProcessMap.FirstOrDefault(p => p.Id == well.Id)?.DepthEnd; + planTotalDepth ??= wellOperationsStat?.Total.Plan?.WellDepthEnd; + wellMapInfo.WellDepth = new() { - Plan = wellDepthByProcessMap.FirstOrDefault(p => p.Id == well.Id)?.DepthEnd, + Plan = planTotalDepth, Fact = currentDepth, };