Merge branch 'dev' into RefactorRoles

This commit is contained in:
Фролов 2022-01-12 17:50:21 +05:00
commit 7487dfb342
2 changed files with 15 additions and 0 deletions

View File

@ -33,6 +33,11 @@ namespace AsbCloudApp.Data
/// </summary>
public double DepthEnd { get; set; }
/// <summary>
/// Кол-во дней от даты начала первой плановой (а если её нет, то фактической) операции
/// </summary>
public double Day { get; set; }
/// <summary>
/// Дата начала операции
/// </summary>

View File

@ -413,6 +413,8 @@ namespace AsbCloudInfrastructure.Services.WellOperationService
var merged = MergeArraysBySections(sectionsIds, wellOperationsPlan, wellOperationsFact);
var tvd = new List<PlanFactPredictBase<WellOperationDto>>(merged.Count);
var firstPoint = merged.First();
var dateStart = firstPoint.Item1?.DateStart ?? firstPoint.Item2.DateStart;
int iLastMatch = 0;
int iLastFact = 0;
for (int i = 0; i < merged.Count; i++)
@ -426,6 +428,12 @@ namespace AsbCloudInfrastructure.Services.WellOperationService
Predict = null,
};
if(planFactPredict.Plan is not null)
planFactPredict.Plan.Day = (planFactPredict.Plan.DateStart - dateStart).TotalDays;
if (planFactPredict.Fact is not null)
planFactPredict.Fact.Day = (planFactPredict.Fact.DateStart - dateStart).TotalDays;
tvd.Add(planFactPredict);
if ((item.Item1 is not null) && (item.Item2 is not null))
iLastMatch = i;
@ -451,7 +459,9 @@ namespace AsbCloudInfrastructure.Services.WellOperationService
tvd[i].Predict = merged[i].Item1.Adapt<WellOperationDto>();
tvd[i].Predict.IdType = 2;
tvd[i].Predict.DateStart = tvd[i].Predict.DateStart + startOffset;
tvd[i].Predict.Day = (tvd[i].Predict.DateStart - dateStart).TotalDays;
}
return tvd;
}