forked from ddrilling/AsbCloudServer
Hotfix OperationsStatService.CalcTvdLagDays()
This commit is contained in:
parent
db1bd49d60
commit
1f130c0d48
@ -178,13 +178,16 @@ namespace AsbCloudInfrastructure.Services.WellOperationService
|
|||||||
if (lastCorrespondingFactOperation is null)
|
if (lastCorrespondingFactOperation is null)
|
||||||
return 0d;
|
return 0d;
|
||||||
|
|
||||||
|
var lastCorrespondingPlanOperation = wellOperations.FirstOrDefault(o => o.Id == lastCorrespondingFactOperation.IdPlan);
|
||||||
|
|
||||||
var lastFactOperation = factOperations.LastOrDefault();
|
var lastFactOperation = factOperations.LastOrDefault();
|
||||||
|
|
||||||
var remainingPlanOperations = operationsOrdered
|
var remainingPlanOperations = operationsOrdered
|
||||||
.Where(o => o.IdType == WellOperation.IdOperationTypePlan)
|
.Where(o => o.IdType == WellOperation.IdOperationTypePlan)
|
||||||
.Where(o => o.DateStart > lastCorrespondingFactOperation.OperationPlan.DateStart);
|
.Where(o => o.DateStart > lastCorrespondingPlanOperation.DateStart);
|
||||||
|
|
||||||
var durationRemain = remainingPlanOperations.Sum(o => o.DurationHours);
|
var durationRemain = remainingPlanOperations.Sum(o => o.DurationHours);
|
||||||
|
|
||||||
var factEnd = lastFactOperation.DateStart.AddHours(durationRemain + lastFactOperation.DurationHours);
|
var factEnd = lastFactOperation.DateStart.AddHours(durationRemain + lastFactOperation.DurationHours);
|
||||||
var planEnd = lastCorrespondingFactOperation.DateStart.AddHours(durationRemain + lastCorrespondingFactOperation.DurationHours);
|
var planEnd = lastCorrespondingFactOperation.DateStart.AddHours(durationRemain + lastCorrespondingFactOperation.DurationHours);
|
||||||
var lagDays = (planEnd - factEnd).TotalDays;
|
var lagDays = (planEnd - factEnd).TotalDays;
|
||||||
|
@ -0,0 +1,22 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<!--
|
||||||
|
https://go.microsoft.com/fwlink/?LinkID=208121.
|
||||||
|
-->
|
||||||
|
<Project>
|
||||||
|
<PropertyGroup>
|
||||||
|
<DeleteExistingFiles>false</DeleteExistingFiles>
|
||||||
|
<ExcludeApp_Data>false</ExcludeApp_Data>
|
||||||
|
<LaunchSiteAfterPublish>true</LaunchSiteAfterPublish>
|
||||||
|
<LastUsedBuildConfiguration>Debug</LastUsedBuildConfiguration>
|
||||||
|
<LastUsedPlatform>Any CPU</LastUsedPlatform>
|
||||||
|
<PublishProvider>FileSystem</PublishProvider>
|
||||||
|
<PublishUrl>bin\pubLinuxDebug\</PublishUrl>
|
||||||
|
<WebPublishMethod>FileSystem</WebPublishMethod>
|
||||||
|
<_TargetId>Folder</_TargetId>
|
||||||
|
<SiteUrlToLaunchAfterPublish />
|
||||||
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
<RuntimeIdentifier>linux-x64</RuntimeIdentifier>
|
||||||
|
<ProjectGuid>a2768702-47cb-4127-941c-e339d5efcffe</ProjectGuid>
|
||||||
|
<SelfContained>true</SelfContained>
|
||||||
|
</PropertyGroup>
|
||||||
|
</Project>
|
Loading…
Reference in New Issue
Block a user