forked from ddrilling/AsbCloudServer
Запись для формирования отчета РТК - плоский список:
1. Убраны навигационные свойства Rotor и Slide (и соответствующая DTO) 2. Закомментирован код формирования отчета РТК
This commit is contained in:
parent
6f51048ae7
commit
e142e1eff5
@ -33,16 +33,6 @@ namespace AsbCloudApp.Data.ProcessMap
|
||||
/// </summary>
|
||||
public double MechDrillingHours { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Слайд
|
||||
/// </summary>
|
||||
public ProcessMapReportRowDto Slide { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Ротор
|
||||
/// </summary>
|
||||
public ProcessMapReportRowDto Rotor { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// название секции скважины
|
||||
/// </summary>
|
||||
@ -52,5 +42,40 @@ namespace AsbCloudApp.Data.ProcessMap
|
||||
/// название секции скважины
|
||||
/// </summary>
|
||||
public string WellSectionTypeName { get; set; } = null!;
|
||||
|
||||
/// <summary>
|
||||
/// Проходка, м
|
||||
/// </summary>
|
||||
public double? DeltaDepth { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Перепад давления, атм
|
||||
/// </summary>
|
||||
public ProcessMapReportParamsDto PressureDiff { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Нагрузка, т
|
||||
/// </summary>
|
||||
public ProcessMapReportParamsDto AxialLoad { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Момент на ВСП, кНхМ
|
||||
/// </summary>
|
||||
public ProcessMapReportParamsDto TopDriveTorque { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Ограничение скорости, м/ч
|
||||
/// </summary>
|
||||
public ProcessMapReportParamsDto SpeedLimit { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Процент использования системы АПД, %
|
||||
/// </summary>
|
||||
public double Usage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Фактическая механическая скорость, м/ч
|
||||
/// </summary>
|
||||
public double Rop { get; set; }
|
||||
}
|
||||
}
|
||||
|
@ -1,43 +0,0 @@
|
||||
namespace AsbCloudApp.Data.ProcessMap
|
||||
{
|
||||
/// <summary>
|
||||
/// Строки РТК
|
||||
/// </summary>
|
||||
public class ProcessMapReportRowDto
|
||||
{
|
||||
/// <summary>
|
||||
/// Проходка, м
|
||||
/// </summary>
|
||||
public double? DeltaDepth { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Перепад давления, атм
|
||||
/// </summary>
|
||||
public ProcessMapReportParamsDto PressureDiff { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Нагрузка, т
|
||||
/// </summary>
|
||||
public ProcessMapReportParamsDto AxialLoad { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Момент на ВСП, кНхМ
|
||||
/// </summary>
|
||||
public ProcessMapReportParamsDto TopDriveTorque { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Ограничение скорости, м/ч
|
||||
/// </summary>
|
||||
public ProcessMapReportParamsDto SpeedLimit { get; set; } = new();
|
||||
|
||||
/// <summary>
|
||||
/// Процент использования системы АПД, %
|
||||
/// </summary>
|
||||
public double Usage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Фактическая механическая скорость, м/ч
|
||||
/// </summary>
|
||||
public double Rop { get; set; }
|
||||
}
|
||||
}
|
@ -107,45 +107,45 @@ namespace AsbCloudInfrastructure.Services.ProcessMap
|
||||
.Merge().FirstCell()
|
||||
.SetVal(interval.MechDrillingHours);
|
||||
|
||||
row = FillIntervalModeData(sheet, "Ротор", interval.Rotor, columnMode, row);
|
||||
row = FillIntervalModeData(sheet, "Слайд", interval.Slide, columnMode, row);
|
||||
//row = FillIntervalModeData(sheet, "Ротор", interval.Rotor, columnMode, row);
|
||||
//row = FillIntervalModeData(sheet, "Слайд", interval.Slide, columnMode, row);
|
||||
|
||||
return row;
|
||||
}
|
||||
|
||||
private static int FillIntervalModeData(IXLWorksheet sheet, string modeName, ProcessMapReportRowDto modeData, int column, int row)
|
||||
{
|
||||
int columnDeltaDepth = column + 1;
|
||||
int columnPressure = columnDeltaDepth + 1;
|
||||
int columnLoad = columnPressure + 5;
|
||||
int columnTorque = columnLoad + 5;
|
||||
int columnSpeed = columnTorque + 5;
|
||||
int columnUsagePlan = columnSpeed + 5;
|
||||
int columnUsageFact = columnUsagePlan + 1;
|
||||
int columnRop = columnUsageFact + 12;
|
||||
//private static int FillIntervalModeData(IXLWorksheet sheet, string modeName, ProcessMapReportRowDto modeData, int column, int row)
|
||||
//{
|
||||
// int columnDeltaDepth = column + 1;
|
||||
// int columnPressure = columnDeltaDepth + 1;
|
||||
// int columnLoad = columnPressure + 5;
|
||||
// int columnTorque = columnLoad + 5;
|
||||
// int columnSpeed = columnTorque + 5;
|
||||
// int columnUsagePlan = columnSpeed + 5;
|
||||
// int columnUsageFact = columnUsagePlan + 1;
|
||||
// int columnRop = columnUsageFact + 12;
|
||||
|
||||
sheet.Cell(row, column)
|
||||
.SetVal(modeName);
|
||||
// sheet.Cell(row, column)
|
||||
// .SetVal(modeName);
|
||||
|
||||
sheet.Cell(row, columnDeltaDepth)
|
||||
.SetVal(modeData.DeltaDepth);
|
||||
// sheet.Cell(row, columnDeltaDepth)
|
||||
// .SetVal(modeData.DeltaDepth);
|
||||
|
||||
FillIntervalModeDataParam(sheet, modeData.PressureDiff, columnPressure, row);
|
||||
FillIntervalModeDataParam(sheet, modeData.AxialLoad, columnLoad, row);
|
||||
FillIntervalModeDataParam(sheet, modeData.TopDriveTorque, columnTorque, row);
|
||||
FillIntervalModeDataSpeed(sheet, modeData.SpeedLimit, columnSpeed, row);
|
||||
// FillIntervalModeDataParam(sheet, modeData.PressureDiff, columnPressure, row);
|
||||
// FillIntervalModeDataParam(sheet, modeData.AxialLoad, columnLoad, row);
|
||||
// FillIntervalModeDataParam(sheet, modeData.TopDriveTorque, columnTorque, row);
|
||||
// FillIntervalModeDataSpeed(sheet, modeData.SpeedLimit, columnSpeed, row);
|
||||
|
||||
sheet.Cell(row, columnUsagePlan)
|
||||
.SetVal(100);
|
||||
// sheet.Cell(row, columnUsagePlan)
|
||||
// .SetVal(100);
|
||||
|
||||
sheet.Cell(row, columnUsageFact)
|
||||
.SetVal(modeData.Usage);
|
||||
// sheet.Cell(row, columnUsageFact)
|
||||
// .SetVal(modeData.Usage);
|
||||
|
||||
sheet.Cell(row, columnRop)
|
||||
.SetVal(modeData.Rop);
|
||||
// sheet.Cell(row, columnRop)
|
||||
// .SetVal(modeData.Rop);
|
||||
|
||||
return row + 1;
|
||||
}
|
||||
// return row + 1;
|
||||
//}
|
||||
|
||||
private static void FillIntervalModeDataParam(IXLWorksheet sheet, ProcessMapReportParamsDto dataParam, int column, int row)
|
||||
{
|
||||
|
@ -146,8 +146,8 @@ namespace AsbCloudInfrastructure.Services.ProcessMap
|
||||
var slideOperations = intervalOperations.Where(o => o.IdCategory == WellOperationCategory.IdSlide);
|
||||
var rotorOperations = intervalOperations.Where(o => o.IdCategory == WellOperationCategory.IdRotor);
|
||||
|
||||
dto.Slide = CalcDrillModeStat(depthInterval, slideOperations, intervalProcessMap, intervalTelemetryDataStat, intervalLimitingParametrs, intervalSubsystemsOperationTime);
|
||||
dto.Rotor = CalcDrillModeStat(depthInterval, rotorOperations, intervalProcessMap, intervalTelemetryDataStat, intervalLimitingParametrs, intervalSubsystemsOperationTime);
|
||||
//dto.Slide = CalcDrillModeStat(depthInterval, slideOperations, intervalProcessMap, intervalTelemetryDataStat, intervalLimitingParametrs, intervalSubsystemsOperationTime);
|
||||
//dto.Rotor = CalcDrillModeStat(depthInterval, rotorOperations, intervalProcessMap, intervalTelemetryDataStat, intervalLimitingParametrs, intervalSubsystemsOperationTime);
|
||||
|
||||
return dto;
|
||||
}
|
||||
@ -201,91 +201,91 @@ namespace AsbCloudInfrastructure.Services.ProcessMap
|
||||
return result;
|
||||
}
|
||||
|
||||
private static ProcessMapReportRowDto CalcDrillModeStat(
|
||||
(double min, double max) depthInterval,
|
||||
IEnumerable<WellOperationDto> intervalModeOperations,
|
||||
IEnumerable<ProcessMapDto> intervalProcessMap,
|
||||
TelemetryDataSaubStatDto? telemetryDataStat,
|
||||
IEnumerable<LimitingParameterDataDto> intervalLimitingParametrs,
|
||||
IEnumerable<SubsystemOperationTimeDto> intervalSubsystemsOperationTime)
|
||||
{
|
||||
var dto = new ProcessMapReportRowDto();
|
||||
if (intervalModeOperations.Any())
|
||||
{
|
||||
var deltaDepth = CalcDeltaDepth(depthInterval, intervalModeOperations);
|
||||
dto.DeltaDepth = deltaDepth;
|
||||
dto.Rop = deltaDepth / CalcHours(depthInterval, intervalModeOperations);
|
||||
};
|
||||
//private static ProcessMapReportRowDto CalcDrillModeStat(
|
||||
// (double min, double max) depthInterval,
|
||||
// IEnumerable<WellOperationDto> intervalModeOperations,
|
||||
// IEnumerable<ProcessMapDto> intervalProcessMap,
|
||||
// TelemetryDataSaubStatDto? telemetryDataStat,
|
||||
// IEnumerable<LimitingParameterDataDto> intervalLimitingParametrs,
|
||||
// IEnumerable<SubsystemOperationTimeDto> intervalSubsystemsOperationTime)
|
||||
//{
|
||||
// var dto = new ProcessMapReportRowDto();
|
||||
// if (intervalModeOperations.Any())
|
||||
// {
|
||||
// var deltaDepth = CalcDeltaDepth(depthInterval, intervalModeOperations);
|
||||
// dto.DeltaDepth = deltaDepth;
|
||||
// dto.Rop = deltaDepth / CalcHours(depthInterval, intervalModeOperations);
|
||||
// };
|
||||
|
||||
if (intervalProcessMap.Any())
|
||||
{
|
||||
var processMapFirst = intervalProcessMap.First();
|
||||
dto.PressureDiff.SetpointPlan = processMapFirst.Pressure.Plan;
|
||||
dto.AxialLoad.SetpointPlan = processMapFirst.AxialLoad.Plan;
|
||||
dto.TopDriveTorque.SetpointPlan = processMapFirst.TopDriveTorque.Plan;
|
||||
//dto.SpeedLimit.SetpointPlan = null;
|
||||
}
|
||||
// if (intervalProcessMap.Any())
|
||||
// {
|
||||
// var processMapFirst = intervalProcessMap.First();
|
||||
// dto.PressureDiff.SetpointPlan = processMapFirst.Pressure.Plan;
|
||||
// dto.AxialLoad.SetpointPlan = processMapFirst.AxialLoad.Plan;
|
||||
// dto.TopDriveTorque.SetpointPlan = processMapFirst.TopDriveTorque.Plan;
|
||||
// //dto.SpeedLimit.SetpointPlan = null;
|
||||
// }
|
||||
|
||||
if (telemetryDataStat is not null)
|
||||
{
|
||||
dto.PressureDiff.SetpointFact = telemetryDataStat.PressureSp;
|
||||
dto.PressureDiff.Fact = telemetryDataStat.PressureDelta;
|
||||
dto.PressureDiff.Limit = telemetryDataStat.PressureDeltaLimitMax;
|
||||
// if (telemetryDataStat is not null)
|
||||
// {
|
||||
// dto.PressureDiff.SetpointFact = telemetryDataStat.PressureSp;
|
||||
// dto.PressureDiff.Fact = telemetryDataStat.PressureDelta;
|
||||
// dto.PressureDiff.Limit = telemetryDataStat.PressureDeltaLimitMax;
|
||||
|
||||
dto.AxialLoad.SetpointFact = telemetryDataStat.AxialLoadSp;
|
||||
dto.AxialLoad.Fact = telemetryDataStat.AxialLoad;
|
||||
dto.AxialLoad.Limit = telemetryDataStat.AxialLoadLimitMax;
|
||||
// dto.AxialLoad.SetpointFact = telemetryDataStat.AxialLoadSp;
|
||||
// dto.AxialLoad.Fact = telemetryDataStat.AxialLoad;
|
||||
// dto.AxialLoad.Limit = telemetryDataStat.AxialLoadLimitMax;
|
||||
|
||||
dto.TopDriveTorque.SetpointFact = telemetryDataStat.RotorTorqueSp;
|
||||
dto.TopDriveTorque.Fact = telemetryDataStat.RotorTorque;
|
||||
dto.TopDriveTorque.Limit = telemetryDataStat.RotorTorqueLimitMax;
|
||||
// dto.TopDriveTorque.SetpointFact = telemetryDataStat.RotorTorqueSp;
|
||||
// dto.TopDriveTorque.Fact = telemetryDataStat.RotorTorque;
|
||||
// dto.TopDriveTorque.Limit = telemetryDataStat.RotorTorqueLimitMax;
|
||||
|
||||
dto.SpeedLimit.SetpointFact = telemetryDataStat.BlockSpeedSp;
|
||||
dto.SpeedLimit.Fact = telemetryDataStat.BlockSpeed;
|
||||
//dto.SpeedLimit.Limit = mull;
|
||||
}
|
||||
// dto.SpeedLimit.SetpointFact = telemetryDataStat.BlockSpeedSp;
|
||||
// dto.SpeedLimit.Fact = telemetryDataStat.BlockSpeed;
|
||||
// //dto.SpeedLimit.Limit = mull;
|
||||
// }
|
||||
|
||||
if(intervalLimitingParametrs.Any())
|
||||
{
|
||||
const int idLimParamRop = 1;
|
||||
const int idLimParamPressure = 2;
|
||||
const int idLimParamAxialLoad = 3;
|
||||
const int idLimParamTorque = 4;
|
||||
// if(intervalLimitingParametrs.Any())
|
||||
// {
|
||||
// const int idLimParamRop = 1;
|
||||
// const int idLimParamPressure = 2;
|
||||
// const int idLimParamAxialLoad = 3;
|
||||
// const int idLimParamTorque = 4;
|
||||
|
||||
var intervalLimitingParametrsStat = intervalLimitingParametrs
|
||||
.GroupBy(p => p.IdFeedRegulator)
|
||||
.Select(g => new
|
||||
{
|
||||
IdLimParam = g.Key,
|
||||
SumDepth = g.Sum(p => p.DepthEnd - p.DepthStart),
|
||||
});
|
||||
// var intervalLimitingParametrsStat = intervalLimitingParametrs
|
||||
// .GroupBy(p => p.IdFeedRegulator)
|
||||
// .Select(g => new
|
||||
// {
|
||||
// IdLimParam = g.Key,
|
||||
// SumDepth = g.Sum(p => p.DepthEnd - p.DepthStart),
|
||||
// });
|
||||
|
||||
var totalDepth = intervalLimitingParametrsStat
|
||||
.Sum(s => s.SumDepth);
|
||||
// var totalDepth = intervalLimitingParametrsStat
|
||||
// .Sum(s => s.SumDepth);
|
||||
|
||||
if (totalDepth > 0)
|
||||
{
|
||||
dto.AxialLoad.PercDrillingSetpoint = intervalLimitingParametrsStat
|
||||
.FirstOrDefault(s => s.IdLimParam == idLimParamAxialLoad)?.SumDepth / totalDepth;
|
||||
// if (totalDepth > 0)
|
||||
// {
|
||||
// dto.AxialLoad.PercDrillingSetpoint = intervalLimitingParametrsStat
|
||||
// .FirstOrDefault(s => s.IdLimParam == idLimParamAxialLoad)?.SumDepth / totalDepth;
|
||||
|
||||
dto.PressureDiff.PercDrillingSetpoint = intervalLimitingParametrsStat
|
||||
.FirstOrDefault(s => s.IdLimParam == idLimParamPressure)?.SumDepth / totalDepth;
|
||||
// dto.PressureDiff.PercDrillingSetpoint = intervalLimitingParametrsStat
|
||||
// .FirstOrDefault(s => s.IdLimParam == idLimParamPressure)?.SumDepth / totalDepth;
|
||||
|
||||
dto.TopDriveTorque.PercDrillingSetpoint = intervalLimitingParametrsStat
|
||||
.FirstOrDefault(s => s.IdLimParam == idLimParamTorque)?.SumDepth / totalDepth;
|
||||
// dto.TopDriveTorque.PercDrillingSetpoint = intervalLimitingParametrsStat
|
||||
// .FirstOrDefault(s => s.IdLimParam == idLimParamTorque)?.SumDepth / totalDepth;
|
||||
|
||||
dto.SpeedLimit.PercDrillingSetpoint = intervalLimitingParametrsStat
|
||||
.FirstOrDefault(s => s.IdLimParam == idLimParamRop)?.SumDepth / totalDepth;
|
||||
}
|
||||
}
|
||||
// dto.SpeedLimit.PercDrillingSetpoint = intervalLimitingParametrsStat
|
||||
// .FirstOrDefault(s => s.IdLimParam == idLimParamRop)?.SumDepth / totalDepth;
|
||||
// }
|
||||
// }
|
||||
|
||||
if (intervalSubsystemsOperationTime.Any() && dto.DeltaDepth > 0)
|
||||
{
|
||||
dto.Usage = intervalSubsystemsOperationTime.Sum(t => t.DepthEnd - t.DepthStart) / dto.DeltaDepth.Value;
|
||||
}
|
||||
// if (intervalSubsystemsOperationTime.Any() && dto.DeltaDepth > 0)
|
||||
// {
|
||||
// dto.Usage = intervalSubsystemsOperationTime.Sum(t => t.DepthEnd - t.DepthStart) / dto.DeltaDepth.Value;
|
||||
// }
|
||||
|
||||
return dto;
|
||||
}
|
||||
// return dto;
|
||||
//}
|
||||
|
||||
private static double CalcDeltaDepth((double min, double max) depthInterval, IEnumerable<WellOperationDto> intervalOperations)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user