add IdState to StatWell

This commit is contained in:
Фролов 2021-10-20 14:15:53 +05:00
parent eab95cb7a1
commit 4968ca4382
2 changed files with 4 additions and 2 deletions

View File

@ -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<StatSectionDto> Sections { get; set; }

View File

@ -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<StatOperationsDto> GetStat(IEnumerable<WellOperation> operations)
private static PlanFactBase<StatOperationsDto> GetStatTotal(IEnumerable<WellOperation> operations)
{
var operationsPlan = operations.Where(o => o.IdType == idOperationTypePlan);
var operationsFact = operations.Where(o => o.IdType == idOperationTypeFact);