6623067 nit

This commit is contained in:
ngfrolov 2022-10-19 14:54:53 +05:00
parent 9d67a7089b
commit 34e0781287
2 changed files with 23 additions and 11 deletions

View File

@ -288,7 +288,8 @@ namespace AsbCloudInfrastructure.Services.WellOperationService
while (iterator.MoveNext()) while (iterator.MoveNext())
{ {
if (iterator.Current.IdCategory == WellOperationService.idOperationTypeRepair) if (iterator.Current.IdCategory == WellOperationService.idOperationTypeRepair)
race.Repair += iterator.Current.DurationHours; race.RepairHours += iterator.Current.DurationHours;
if (iterator.Current.IdCategory == WellOperationService.idOperationNonProductiveTime) if (iterator.Current.IdCategory == WellOperationService.idOperationNonProductiveTime)
race.NonProductiveHours += iterator.Current.DurationHours; race.NonProductiveHours += iterator.Current.DurationHours;
@ -312,7 +313,7 @@ namespace AsbCloudInfrastructure.Services.WellOperationService
var dHours = 0d; var dHours = 0d;
foreach (var race in races) foreach (var race in races)
{ {
dHours += race.DeltaHoursTimeNoNptAndRepair; dHours += race.DeltaHours - race.NonProductiveHours - race.RepairHours;
dDepth += race.DeltaDepth; dDepth += race.DeltaDepth;
} }
return dDepth / (dHours + double.Epsilon); return dDepth / (dHours + double.Epsilon);
@ -431,8 +432,6 @@ namespace AsbCloudInfrastructure.Services.WellOperationService
var lastMatchPlan = merged[iLastMatch].Item1; var lastMatchPlan = merged[iLastMatch].Item1;
var lastMatchPlanOperationEnd = lastMatchPlan.DateStart.AddHours(lastMatchPlan.DurationHours); var lastMatchPlanOperationEnd = lastMatchPlan.DateStart.AddHours(lastMatchPlan.DurationHours);
//var lastMatchFact = merged[iLastMatch].Item2;
//var lastMatchFactDateEnd = lastMatchFact.DateStart.AddHours(lastMatchFact.DurationHours);
var lastFact = merged[iLastFact].Item2; var lastFact = merged[iLastFact].Item2;
var lastFactDateEnd = lastFact.DateStart.AddHours(lastFact.DurationHours); var lastFactDateEnd = lastFact.DateStart.AddHours(lastFact.DurationHours);
var startOffset = lastFactDateEnd - lastMatchPlanOperationEnd; var startOffset = lastFactDateEnd - lastMatchPlanOperationEnd;

View File

@ -13,7 +13,7 @@ namespace AsbCloudInfrastructure.Services.WellOperationService
public DateTime StartDate { get; set; } public DateTime StartDate { get; set; }
/// <summary> /// <summary>
/// Глубина начала рейса /// Глубина начала рейса, м
/// </summary> /// </summary>
public double StartWellDepth { get; set; } public double StartWellDepth { get; set; }
@ -23,7 +23,7 @@ namespace AsbCloudInfrastructure.Services.WellOperationService
public DateTime EndDate { get; set; } public DateTime EndDate { get; set; }
/// <summary> /// <summary>
/// Глубина окончания рейса /// Глубина окончания рейса, м
/// </summary> /// </summary>
public double EndWellDepth { get; set; } public double EndWellDepth { get; set; }
@ -38,15 +38,28 @@ namespace AsbCloudInfrastructure.Services.WellOperationService
public double NonProductiveHours { get; set; } public double NonProductiveHours { get; set; }
/// <summary> /// <summary>
/// Ремонт /// Ремонт, часы
/// </summary> /// </summary>
public double Repair { get; set; } public double RepairHours { get; set; }
/// <summary>
/// проходка за рейс, м
/// </summary>
public double DeltaDepth => EndWellDepth - StartWellDepth; public double DeltaDepth => EndWellDepth - StartWellDepth;
public double DeltaHoursTimeNoNpt => (EndDate - StartDate).TotalHours - NonProductiveHours;
public double DeltaHoursTimeNoNptAndRepair => DeltaHoursTimeNoNpt - Repair;
public double Speed => DeltaDepth / (DeltaHoursTimeNoNpt + double.Epsilon);
/// <summary>
/// Полное время рейса, часы
/// </summary>
public double DeltaHours => (EndDate - StartDate).TotalHours;
/// <summary>
/// Скорость за рейс, м/час
/// </summary>
public double Speed => DeltaDepth / (DeltaHours - NonProductiveHours - RepairHours + double.Epsilon);
/// <summary>
/// Список операций за рейс
/// </summary>
public List<WellOperation>? Operations { get; internal set; } public List<WellOperation>? Operations { get; internal set; }
} }
#nullable disable #nullable disable