From e142e1eff57f45809aaf1aa7b44c9e057d48427e Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Fri, 31 Mar 2023 15:20:27 +0500 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D0=BF=D0=B8=D1=81=D1=8C=20=D0=B4?= =?UTF-8?q?=D0=BB=D1=8F=20=D1=84=D0=BE=D1=80=D0=BC=D0=B8=D1=80=D0=BE=D0=B2?= =?UTF-8?q?=D0=B0=D0=BD=D0=B8=D1=8F=20=D0=BE=D1=82=D1=87=D0=B5=D1=82=D0=B0?= =?UTF-8?q?=20=D0=A0=D0=A2=D0=9A=20-=20=D0=BF=D0=BB=D0=BE=D1=81=D0=BA?= =?UTF-8?q?=D0=B8=D0=B9=20=D1=81=D0=BF=D0=B8=D1=81=D0=BE=D0=BA:=201.=20?= =?UTF-8?q?=D0=A3=D0=B1=D1=80=D0=B0=D0=BD=D1=8B=20=D0=BD=D0=B0=D0=B2=D0=B8?= =?UTF-8?q?=D0=B3=D0=B0=D1=86=D0=B8=D0=BE=D0=BD=D0=BD=D1=8B=D0=B5=20=D1=81?= =?UTF-8?q?=D0=B2=D0=BE=D0=B9=D1=81=D1=82=D0=B2=D0=B0=20Rotor=20=D0=B8=20S?= =?UTF-8?q?lide=20(=D0=B8=20=D1=81=D0=BE=D0=BE=D1=82=D0=B2=D0=B5=D1=82?= =?UTF-8?q?=D1=81=D1=82=D0=B2=D1=83=D1=8E=D1=89=D0=B0=D1=8F=20DTO)=202.=20?= =?UTF-8?q?=D0=97=D0=B0=D0=BA=D0=BE=D0=BC=D0=BC=D0=B5=D0=BD=D1=82=D0=B8?= =?UTF-8?q?=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=20=D0=BA=D0=BE=D0=B4=20=D1=84?= =?UTF-8?q?=D0=BE=D1=80=D0=BC=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=20=D0=BE=D1=82=D1=87=D0=B5=D1=82=D0=B0=20=D0=A0=D0=A2?= =?UTF-8?q?=D0=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Data/ProcessMap/ProcessMapReportDto.cs | 45 ++++-- .../Data/ProcessMap/ProcessMapReportRowDto.cs | 43 ------ .../ProcessMap/ProcessMapReportService.cs | 56 +++---- .../Services/ProcessMap/ProcessMapService.cs | 146 +++++++++--------- 4 files changed, 136 insertions(+), 154 deletions(-) delete mode 100644 AsbCloudApp/Data/ProcessMap/ProcessMapReportRowDto.cs diff --git a/AsbCloudApp/Data/ProcessMap/ProcessMapReportDto.cs b/AsbCloudApp/Data/ProcessMap/ProcessMapReportDto.cs index 6af7c3ec..7d9b9c03 100644 --- a/AsbCloudApp/Data/ProcessMap/ProcessMapReportDto.cs +++ b/AsbCloudApp/Data/ProcessMap/ProcessMapReportDto.cs @@ -33,16 +33,6 @@ namespace AsbCloudApp.Data.ProcessMap /// public double MechDrillingHours { get; set; } - /// - /// Слайд - /// - public ProcessMapReportRowDto Slide { get; set; } = null!; - - /// - /// Ротор - /// - public ProcessMapReportRowDto Rotor { get; set; } = null!; - /// /// название секции скважины /// @@ -52,5 +42,40 @@ namespace AsbCloudApp.Data.ProcessMap /// название секции скважины /// public string WellSectionTypeName { get; set; } = null!; + + /// + /// Проходка, м + /// + public double? DeltaDepth { get; set; } + + /// + /// Перепад давления, атм + /// + public ProcessMapReportParamsDto PressureDiff { get; set; } = new(); + + /// + /// Нагрузка, т + /// + public ProcessMapReportParamsDto AxialLoad { get; set; } = new(); + + /// + /// Момент на ВСП, кНхМ + /// + public ProcessMapReportParamsDto TopDriveTorque { get; set; } = new(); + + /// + /// Ограничение скорости, м/ч + /// + public ProcessMapReportParamsDto SpeedL​imit { get; set; } = new(); + + /// + /// Процент использования системы АПД, % + /// + public double Usage { get; set; } + + /// + /// Фактическая механическая скорость, м/ч + /// + public double Rop { get; set; } } } diff --git a/AsbCloudApp/Data/ProcessMap/ProcessMapReportRowDto.cs b/AsbCloudApp/Data/ProcessMap/ProcessMapReportRowDto.cs deleted file mode 100644 index 331df5da..00000000 --- a/AsbCloudApp/Data/ProcessMap/ProcessMapReportRowDto.cs +++ /dev/null @@ -1,43 +0,0 @@ -namespace AsbCloudApp.Data.ProcessMap -{ - /// - /// Строки РТК - /// - public class ProcessMapReportRowDto - { - /// - /// Проходка, м - /// - public double? DeltaDepth { get; set; } - - /// - /// Перепад давления, атм - /// - public ProcessMapReportParamsDto PressureDiff { get; set; } = new(); - - /// - /// Нагрузка, т - /// - public ProcessMapReportParamsDto AxialLoad { get; set; } = new(); - - /// - /// Момент на ВСП, кНхМ - /// - public ProcessMapReportParamsDto TopDriveTorque { get; set; } = new(); - - /// - /// Ограничение скорости, м/ч - /// - public ProcessMapReportParamsDto SpeedL​imit { get; set; } = new(); - - /// - /// Процент использования системы АПД, % - /// - public double Usage { get; set; } - - /// - /// Фактическая механическая скорость, м/ч - /// - public double Rop { get; set; } - } -} diff --git a/AsbCloudInfrastructure/Services/ProcessMap/ProcessMapReportService.cs b/AsbCloudInfrastructure/Services/ProcessMap/ProcessMapReportService.cs index 923a6bf5..cacb341d 100644 --- a/AsbCloudInfrastructure/Services/ProcessMap/ProcessMapReportService.cs +++ b/AsbCloudInfrastructure/Services/ProcessMap/ProcessMapReportService.cs @@ -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) { diff --git a/AsbCloudInfrastructure/Services/ProcessMap/ProcessMapService.cs b/AsbCloudInfrastructure/Services/ProcessMap/ProcessMapService.cs index 0c1769c7..a8228d7e 100644 --- a/AsbCloudInfrastructure/Services/ProcessMap/ProcessMapService.cs +++ b/AsbCloudInfrastructure/Services/ProcessMap/ProcessMapService.cs @@ -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 intervalModeOperations, - IEnumerable intervalProcessMap, - TelemetryDataSaubStatDto? telemetryDataStat, - IEnumerable intervalLimitingParametrs, - IEnumerable 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 intervalModeOperations, + // IEnumerable intervalProcessMap, + // TelemetryDataSaubStatDto? telemetryDataStat, + // IEnumerable intervalLimitingParametrs, + // IEnumerable 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 intervalOperations) {