From 4968ca43829a2a113cb255d57d37a45b62905ac3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A4=D1=80=D0=BE=D0=BB=D0=BE=D0=B2?= Date: Wed, 20 Oct 2021 14:15:53 +0500 Subject: [PATCH] add IdState to StatWell --- AsbCloudApp/Data/StatWellDto.cs | 1 + .../WellOperationService/WellOperationsStatService.cs | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/AsbCloudApp/Data/StatWellDto.cs b/AsbCloudApp/Data/StatWellDto.cs index f72a29a6..81d20ff3 100644 --- a/AsbCloudApp/Data/StatWellDto.cs +++ b/AsbCloudApp/Data/StatWellDto.cs @@ -8,6 +8,7 @@ namespace AsbCloudApp.Data public int Id { get; set; } public string Caption { get; set; } public string WellType { get; set; } + public int IdState { get; set; } public string State { get; set; } public DateTime LastTelemetryDate { get; set; } public IEnumerable Sections { get; set; } diff --git a/AsbCloudInfrastructure/Services/WellOperationService/WellOperationsStatService.cs b/AsbCloudInfrastructure/Services/WellOperationService/WellOperationsStatService.cs index 7f765575..8a16358d 100644 --- a/AsbCloudInfrastructure/Services/WellOperationService/WellOperationsStatService.cs +++ b/AsbCloudInfrastructure/Services/WellOperationService/WellOperationsStatService.cs @@ -102,6 +102,7 @@ namespace AsbCloudInfrastructure.Services.WellOperationService Id = well.Id, Caption = well.Caption, WellType = wellType.Caption, + IdState = well.IdState, State = wellService.GetStateText(well.IdState), LastTelemetryDate = wellService.GetLastTelemetryDate(well.Id), }; @@ -119,7 +120,7 @@ namespace AsbCloudInfrastructure.Services.WellOperationService return statWellDto; statWellDto.Sections = CalcSectionsStats(wellOperations); - statWellDto.Total = GetStat(wellOperations); + statWellDto.Total = GetStatTotal(wellOperations); return statWellDto; } @@ -152,7 +153,7 @@ namespace AsbCloudInfrastructure.Services.WellOperationService return sections; } - private static PlanFactBase GetStat(IEnumerable operations) + private static PlanFactBase GetStatTotal(IEnumerable operations) { var operationsPlan = operations.Where(o => o.IdType == idOperationTypePlan); var operationsFact = operations.Where(o => o.IdType == idOperationTypeFact);