forked from ddrilling/AsbCloudServer
Правки - 2
This commit is contained in:
parent
e649d1f61c
commit
d5d97acb7d
@ -6,14 +6,9 @@
|
||||
public class ProcessMapReportDataSaubStatParamsDto
|
||||
{
|
||||
/// <summary>
|
||||
/// Уставка план (максимум)
|
||||
/// Уставка план
|
||||
/// </summary>
|
||||
public double? SetpointPlanMax { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Уставка план (минимум)
|
||||
/// </summary>
|
||||
public double? SetpointPlanMin { get; set; }
|
||||
public double? SetpointPlan { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Уставка факт
|
||||
|
@ -73,9 +73,16 @@ namespace AsbCloudInfrastructure.Services.ProcessMaps.Report
|
||||
if (!dataSaubStats.Any())
|
||||
return Enumerable.Empty<ProcessMapReportDataSaubStatDto>();
|
||||
|
||||
var wellOperationCategories = wellOperationRepository.GetCategories(false);
|
||||
var wellOperationCategories = wellOperationCategoryRepository.Get(false);
|
||||
var wellSectionTypes = wellOperationRepository.GetSectionTypes();
|
||||
|
||||
var result = CalcByIntervals(request, processMapPlanWellDrillings, dataSaubStats, wellOperations, wellOperationCategories);
|
||||
var result = CalcByIntervals(
|
||||
request,
|
||||
processMapPlanWellDrillings,
|
||||
dataSaubStats,
|
||||
wellOperations,
|
||||
wellOperationCategories,
|
||||
wellSectionTypes);
|
||||
|
||||
return result;
|
||||
}
|
||||
@ -84,7 +91,9 @@ namespace AsbCloudInfrastructure.Services.ProcessMaps.Report
|
||||
DataSaubStatRequest request,
|
||||
IEnumerable<ProcessMapPlanDrillingDto> processMapPlanWellDrillings,
|
||||
Span<DataSaubStatDto> dataSaubStats,
|
||||
IEnumerable<WellOperationDto> wellOperations
|
||||
IEnumerable<WellOperationDto> wellOperations,
|
||||
IEnumerable<WellOperationCategoryDto> wellOperationCategories,
|
||||
IEnumerable<WellSectionTypeDto> wellSectionTypes
|
||||
)
|
||||
{
|
||||
var list = new List<ProcessMapReportDataSaubStatDto>();
|
||||
@ -98,7 +107,7 @@ namespace AsbCloudInfrastructure.Services.ProcessMaps.Report
|
||||
.Where(p => p.IdWellSectionType == idWellSectionType)
|
||||
.Where(p => p.DepthStart <= data.DepthStart)
|
||||
.Where(p => p.DepthEnd >= data.DepthStart)
|
||||
.Where(p => IsModeMatchOperationCategory(p.IdMode, data.IdCategory))
|
||||
//.Where(p => IsModeMatchOperationCategory(p.IdMode, data.IdCategory))
|
||||
.WhereActualAtMoment(data.DateStart)
|
||||
.FirstOrDefault();
|
||||
|
||||
@ -125,7 +134,15 @@ namespace AsbCloudInfrastructure.Services.ProcessMaps.Report
|
||||
var firstElemInSpan = span[0];
|
||||
var lastElemInISpan = span[^1];
|
||||
|
||||
var elem = CalcStat(processMapPlan, idWellSectionType, span);
|
||||
var wellOperationCategoryName = wellOperationCategories
|
||||
.Where(c => c.Id == firstElemInSpan.IdCategory)
|
||||
.FirstOrDefault()?.Name ?? string.Empty;
|
||||
|
||||
var wellSectionTypeName = wellSectionTypes
|
||||
.Where(c => c.Id == idWellSectionType)
|
||||
.FirstOrDefault()?.Caption ?? string.Empty;
|
||||
|
||||
var elem = CalcStat(processMapPlan, span, idWellSectionType, wellOperationCategoryName, wellSectionTypeName);
|
||||
if (elem is not null)
|
||||
list.Add(elem);
|
||||
}
|
||||
@ -140,8 +157,10 @@ namespace AsbCloudInfrastructure.Services.ProcessMaps.Report
|
||||
|
||||
private ProcessMapReportDataSaubStatDto? CalcStat(
|
||||
ProcessMapPlanDrillingDto? processMapPlanFilteredByDepth,
|
||||
Span<DataSaubStatDto> span,
|
||||
int idWellSectionType,
|
||||
Span<DataSaubStatDto> span
|
||||
string wellOperationCategoryName,
|
||||
string wellSectionTypeName
|
||||
)
|
||||
{
|
||||
var firstElemInInterval = span[0];
|
||||
@ -155,7 +174,7 @@ namespace AsbCloudInfrastructure.Services.ProcessMaps.Report
|
||||
return new ProcessMapReportDataSaubStatDto()
|
||||
{
|
||||
DateStart = firstElemInInterval.DateStart.DateTime,
|
||||
WellSectionTypeName = nearestOperation.WellSectionTypeName ?? string.Empty,
|
||||
WellSectionTypeName = wellSectionTypeName,
|
||||
DepthStart = firstElemInInterval.DepthStart,
|
||||
DepthEnd = lastElemInInterval.DepthEnd,
|
||||
DeltaDepth = deltaDepth,
|
||||
@ -163,57 +182,51 @@ namespace AsbCloudInfrastructure.Services.ProcessMaps.Report
|
||||
DrillingMode = wellOperationCategoryName,
|
||||
PressureDiff = new ProcessMapReportDataSaubStatParamsDto()
|
||||
{
|
||||
SetpointPlanMax = processMapPlanFilteredByDepth?.DeltaPressurePlan,
|
||||
SetpointPlanMin = processMapPlanFilteredByDepth.Min(p => p.DeltaPressurePlan),
|
||||
SetpointPlan = processMapPlanFilteredByDepth?.DeltaPressurePlan,
|
||||
SetpointFact = firstElemInInterval.PressureSp - firstElemInInterval.PressureIdle,
|
||||
FactWavg = aggregatedValues.Pressure,
|
||||
Limit = processMapPlanFilteredByDepth.Max(p => p.DeltaPressureLimitMax),
|
||||
Limit = processMapPlanFilteredByDepth?.DeltaPressureLimitMax,
|
||||
SetpointUsage = aggregatedValues.SetpointUsagePressure
|
||||
},
|
||||
AxialLoad = new ProcessMapReportDataSaubStatParamsDto()
|
||||
{
|
||||
SetpointPlanMax = processMapPlanFilteredByDepth.Max(p => p.AxialLoadPlan),
|
||||
SetpointPlanMin = processMapPlanFilteredByDepth.Min(p => p.AxialLoadPlan),
|
||||
SetpointPlan = processMapPlanFilteredByDepth?.AxialLoadPlan,
|
||||
SetpointFact = aggregatedValues.AxialLoadSp,
|
||||
FactWavg = aggregatedValues.AxialLoad,
|
||||
Limit = processMapPlanFilteredByDepth.Max(p => p.AxialLoadLimitMax),
|
||||
Limit = processMapPlanFilteredByDepth?.AxialLoadLimitMax,
|
||||
SetpointUsage = aggregatedValues.SetpointUsageAxialLoad
|
||||
},
|
||||
TopDriveTorque = new ProcessMapReportDataSaubStatParamsDto()
|
||||
{
|
||||
SetpointPlanMax = processMapPlanFilteredByDepth.Max(p => p.TopDriveTorquePlan),
|
||||
SetpointPlanMin = processMapPlanFilteredByDepth.Min(p => p.TopDriveTorquePlan),
|
||||
SetpointPlan = processMapPlanFilteredByDepth?.TopDriveTorquePlan,
|
||||
SetpointFact = aggregatedValues.RotorTorqueSp,
|
||||
FactWavg = aggregatedValues.RotorTorque,
|
||||
FactMax = aggregatedValues.RotorTorqueMax,
|
||||
Limit = processMapPlanFilteredByDepth.Max(p => p.TopDriveTorqueLimitMax),
|
||||
Limit = processMapPlanFilteredByDepth?.TopDriveTorqueLimitMax,
|
||||
SetpointUsage = aggregatedValues.SetpointUsageRotorTorque
|
||||
},
|
||||
SpeedLimit = new ProcessMapReportDataSaubStatParamsDto
|
||||
{
|
||||
SetpointPlanMax = processMapPlanFilteredByDepth.Max(p => p.RopPlan),
|
||||
SetpointPlanMin = processMapPlanFilteredByDepth.Min(p => p.RopPlan),
|
||||
SetpointPlan = processMapPlanFilteredByDepth?.RopPlan,
|
||||
SetpointFact = aggregatedValues.BlockSpeedSp,
|
||||
FactWavg = deltaDepth / aggregatedValues.DrilledTime,
|
||||
SetpointUsage = aggregatedValues.SetpointUsageRopPlan
|
||||
},
|
||||
Turnover = new ProcessMapReportDataSaubStatParamsDto
|
||||
{
|
||||
SetpointPlanMax = processMapPlanFilteredByDepth.Max(p => p.TopDriveSpeedPlan),
|
||||
SetpointPlanMin = processMapPlanFilteredByDepth.Min(p => p.TopDriveSpeedPlan),
|
||||
SetpointPlan = processMapPlanFilteredByDepth?.TopDriveSpeedPlan,
|
||||
FactWavg = aggregatedValues.RotorSpeed,
|
||||
FactMax = aggregatedValues.RotorSpeedMax
|
||||
},
|
||||
Flow = new ProcessMapReportDataSaubStatParamsDto
|
||||
{
|
||||
SetpointPlanMax = processMapPlanFilteredByDepth.Max(p => p.FlowPlan),
|
||||
SetpointPlanMin = processMapPlanFilteredByDepth.Min(p => p.FlowPlan),
|
||||
SetpointPlan = processMapPlanFilteredByDepth?.FlowPlan,
|
||||
FactWavg = aggregatedValues.MaxFlow,
|
||||
Limit = processMapPlanFilteredByDepth.Max(p => p.FlowLimitMax),
|
||||
Limit = processMapPlanFilteredByDepth?.FlowLimitMax,
|
||||
},
|
||||
Rop = new PlanFactDto<double?>
|
||||
{
|
||||
Plan = CalcRopPlan(processMapPlanFilteredByDepth),
|
||||
//Plan = CalcRopPlan(processMapPlanFilteredByDepth),
|
||||
Fact = deltaDepth / aggregatedValues.DrilledTime
|
||||
},
|
||||
};
|
||||
|
@ -57,7 +57,7 @@ public class ProcessMapWellDrillingController : ProcessMapBaseController<Process
|
||||
/// <param name="request">параметры запроса</param>
|
||||
/// <param name="cancellationToken"></param>
|
||||
/// <returns></returns>
|
||||
[HttpGet("report")]
|
||||
[HttpPost("report")]
|
||||
[ProducesResponseType(typeof(IEnumerable<ProcessMapReportDataSaubStatDto>), StatusCodes.Status200OK)]
|
||||
public async Task<IActionResult> GetReportAsync(int idWell, DataSaubStatRequest request, CancellationToken cancellationToken)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user