diff --git a/AsbCloudInfrastructure/Services/WellOperationService/OperationsStatService.cs b/AsbCloudInfrastructure/Services/WellOperationService/OperationsStatService.cs
index debdc405..7edb68fe 100644
--- a/AsbCloudInfrastructure/Services/WellOperationService/OperationsStatService.cs
+++ b/AsbCloudInfrastructure/Services/WellOperationService/OperationsStatService.cs
@@ -287,10 +287,11 @@ namespace AsbCloudInfrastructure.Services.WellOperationService
};
while (iterator.MoveNext())
{
+ if (iterator.Current.IdCategory == WellOperationService.idOperationTypeRepair)
+ race.Repair += iterator.Current.DurationHours;
if (iterator.Current.IdCategory == WellOperationService.idOperationNonProductiveTime)
- {
race.NonProductiveHours += iterator.Current.DurationHours;
- }
+
if (iterator.Current.IdCategory == WellOperationService.idOperationBhaDisassembly)
{
race.EndDate = iterator.Current.DateStart.ToRemoteDateTime(timezoneOffsetH);
@@ -311,7 +312,7 @@ namespace AsbCloudInfrastructure.Services.WellOperationService
var dHours = 0d;
foreach (var race in races)
{
- dHours += race.DeltaHoursTimeNoNpt;
+ dHours += race.DeltaHoursTimeNoNptAndRepair;
dDepth += race.DeltaDepth;
}
return dDepth / (dHours + double.Epsilon);
diff --git a/AsbCloudInfrastructure/Services/WellOperationService/Race.cs b/AsbCloudInfrastructure/Services/WellOperationService/Race.cs
index 65593f84..6377e597 100644
--- a/AsbCloudInfrastructure/Services/WellOperationService/Race.cs
+++ b/AsbCloudInfrastructure/Services/WellOperationService/Race.cs
@@ -4,18 +4,50 @@ using System.Collections.Generic;
namespace AsbCloudInfrastructure.Services.WellOperationService
{
+#nullable enable
class Race
{
+ ///
+ /// Дата начала рейса
+ ///
public DateTime StartDate { get; set; }
+
+ ///
+ /// Глубина начала рейса
+ ///
public double StartWellDepth { get; set; }
+
+ ///
+ /// Дата окончания рейса
+ ///
public DateTime EndDate { get; set; }
+
+ ///
+ /// Глубина окончания рейса
+ ///
public double EndWellDepth { get; set; }
+
+ ///
+ /// Время рейса, часы
+ ///
public double DrillingTime { get; set; }
+
+ ///
+ /// Время НПВ, часы
+ ///
public double NonProductiveHours { get; set; }
+
+ ///
+ /// Ремонт
+ ///
+ public double Repair { get; set; }
+
public double DeltaDepth => EndWellDepth - StartWellDepth;
public double DeltaHoursTimeNoNpt => (EndDate - StartDate).TotalHours - NonProductiveHours;
+ public double DeltaHoursTimeNoNptAndRepair => DeltaHoursTimeNoNpt - Repair;
public double Speed => DeltaDepth / (DeltaHoursTimeNoNpt + double.Epsilon);
-
- public List Operations { get; internal set; }
+
+ public List? Operations { get; internal set; }
}
+#nullable disable
}
diff --git a/AsbCloudInfrastructure/Services/WellOperationService/WellOperationService.cs b/AsbCloudInfrastructure/Services/WellOperationService/WellOperationService.cs
index 9ad570b4..3b1ef55a 100644
--- a/AsbCloudInfrastructure/Services/WellOperationService/WellOperationService.cs
+++ b/AsbCloudInfrastructure/Services/WellOperationService/WellOperationService.cs
@@ -31,6 +31,7 @@ namespace AsbCloudInfrastructure.Services.WellOperationService
public const int idOperationCasingDown = 1048;
public const int idOperationTypePlan = 0;
public const int idOperationTypeFact = 1;
+ public const int idOperationTypeRepair = 1031;
public WellOperationService(IAsbCloudDbContext db, CacheDb cache, IWellService wellService)
{