forked from ddrilling/AsbCloudServer
OperationsStatService add calc cumulative non productive time
This commit is contained in:
parent
3f0f292209
commit
3ebb0020f5
@ -38,6 +38,11 @@ namespace AsbCloudApp.Data
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public double Day { get; set; }
|
public double Day { get; set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Кол-во дней НПВ от даты начала первой плановой (а если её нет, то фактической) операции
|
||||||
|
/// </summary>
|
||||||
|
public double NptDays { get; set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Дата начала операции
|
/// Дата начала операции
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -417,14 +417,22 @@ namespace AsbCloudInfrastructure.Services.WellOperationService
|
|||||||
var dateStart = firstPoint.Item1?.DateStart ?? firstPoint.Item2.DateStart;
|
var dateStart = firstPoint.Item1?.DateStart ?? firstPoint.Item2.DateStart;
|
||||||
int iLastMatch = 0;
|
int iLastMatch = 0;
|
||||||
int iLastFact = 0;
|
int iLastFact = 0;
|
||||||
|
var nptDays = 0d;
|
||||||
for (int i = 0; i < merged.Count; i++)
|
for (int i = 0; i < merged.Count; i++)
|
||||||
{
|
{
|
||||||
var item = merged[i];
|
var item = merged[i];
|
||||||
|
var plan = item.Item1;
|
||||||
|
var fact = item.Item2;
|
||||||
|
|
||||||
|
if (fact?.IdCategory == idOperationNonProductiveTime)
|
||||||
|
{
|
||||||
|
nptDays += fact.DurationHours;
|
||||||
|
}
|
||||||
|
|
||||||
var planFactPredict = new PlanFactPredictBase<WellOperationDto>
|
var planFactPredict = new PlanFactPredictBase<WellOperationDto>
|
||||||
{
|
{
|
||||||
Plan = item.Item1?.Adapt(WellOperationDtoMutation),
|
Plan = plan?.Adapt(WellOperationDtoMutation),
|
||||||
Fact = item.Item2?.Adapt(WellOperationDtoMutation),
|
Fact = fact?.Adapt(WellOperationDtoMutation),
|
||||||
Predict = null,
|
Predict = null,
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -432,12 +440,15 @@ namespace AsbCloudInfrastructure.Services.WellOperationService
|
|||||||
planFactPredict.Plan.Day = (planFactPredict.Plan.DateStart - dateStart).TotalDays;
|
planFactPredict.Plan.Day = (planFactPredict.Plan.DateStart - dateStart).TotalDays;
|
||||||
|
|
||||||
if (planFactPredict.Fact is not null)
|
if (planFactPredict.Fact is not null)
|
||||||
|
{
|
||||||
planFactPredict.Fact.Day = (planFactPredict.Fact.DateStart - dateStart).TotalDays;
|
planFactPredict.Fact.Day = (planFactPredict.Fact.DateStart - dateStart).TotalDays;
|
||||||
|
planFactPredict.Fact.NptDays = nptDays;
|
||||||
|
}
|
||||||
|
|
||||||
tvd.Add(planFactPredict);
|
tvd.Add(planFactPredict);
|
||||||
if ((item.Item1 is not null) && (item.Item2 is not null))
|
if ((plan is not null) && (fact is not null))
|
||||||
iLastMatch = i;
|
iLastMatch = i;
|
||||||
if (item.Item2 is not null)
|
if (fact is not null)
|
||||||
iLastFact = i;
|
iLastFact = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user