From e142e1eff57f45809aaf1aa7b44c9e057d48427e Mon Sep 17 00:00:00 2001 From: Olga Nemt Date: Fri, 31 Mar 2023 15:20:27 +0500 Subject: [PATCH 1/3] =?UTF-8?q?=D0=97=D0=B0=D0=BF=D0=B8=D1=81=D1=8C=20?= =?UTF-8?q?=D0=B4=D0=BB=D1=8F=20=D1=84=D0=BE=D1=80=D0=BC=D0=B8=D1=80=D0=BE?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD=D0=B8=D1=8F=20=D0=BE=D1=82=D1=87=D0=B5=D1=82?= =?UTF-8?q?=D0=B0=20=D0=A0=D0=A2=D0=9A=20-=20=D0=BF=D0=BB=D0=BE=D1=81?= =?UTF-8?q?=D0=BA=D0=B8=D0=B9=20=D1=81=D0=BF=D0=B8=D1=81=D0=BE=D0=BA:=201.?= =?UTF-8?q?=20=D0=A3=D0=B1=D1=80=D0=B0=D0=BD=D1=8B=20=D0=BD=D0=B0=D0=B2?= =?UTF-8?q?=D0=B8=D0=B3=D0=B0=D1=86=D0=B8=D0=BE=D0=BD=D0=BD=D1=8B=D0=B5=20?= =?UTF-8?q?=D1=81=D0=B2=D0=BE=D0=B9=D1=81=D1=82=D0=B2=D0=B0=20Rotor=20?= =?UTF-8?q?=D0=B8=20Slide=20(=D0=B8=20=D1=81=D0=BE=D0=BE=D1=82=D0=B2=D0=B5?= =?UTF-8?q?=D1=82=D1=81=D1=82=D0=B2=D1=83=D1=8E=D1=89=D0=B0=D1=8F=20DTO)?= =?UTF-8?q?=202.=20=D0=97=D0=B0=D0=BA=D0=BE=D0=BC=D0=BC=D0=B5=D0=BD=D1=82?= =?UTF-8?q?=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=20=D0=BA=D0=BE=D0=B4=20?= =?UTF-8?q?=D1=84=D0=BE=D1=80=D0=BC=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD?= =?UTF-8?q?=D0=B8=D1=8F=20=D0=BE=D1=82=D1=87=D0=B5=D1=82=D0=B0=20=D0=A0?= =?UTF-8?q?=D0=A2=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) { From 4d32b57390f6061ae81e615015c8d8040bc20c16 Mon Sep 17 00:00:00 2001 From: ngfrolov Date: Fri, 31 Mar 2023 16:40:34 +0500 Subject: [PATCH 2/3] Add Example.http --- AsbCloudWebApi/Rest/Example.http | 35 ++++++++++++++++++++++++++++++++ AsbCloudWebApi/Rest/Readme.md | 7 +++++++ 2 files changed, 42 insertions(+) create mode 100644 AsbCloudWebApi/Rest/Example.http create mode 100644 AsbCloudWebApi/Rest/Readme.md diff --git a/AsbCloudWebApi/Rest/Example.http b/AsbCloudWebApi/Rest/Example.http new file mode 100644 index 00000000..bd156b32 --- /dev/null +++ b/AsbCloudWebApi/Rest/Example.http @@ -0,0 +1,35 @@ +@baseUrl = http://127.0.0.1:5000 +@contentType = application/json +@auth = Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCIsImN0eSI6IkpXVCJ9.eyJpZCI6IjEiLCJodHRwOi8vc2NoZW1hcy54bWxzb2FwLm9yZy93cy8yMDA1LzA1L2lkZW50aXR5L2NsYWltcy9uYW1lIjoiZGV2IiwiaWRDb21wYW55IjoiMSIsImh0dHA6Ly9zY2hlbWFzLm1pY3Jvc29mdC5jb20vd3MvMjAwOC8wNi9pZGVudGl0eS9jbGFpbXMvcm9sZSI6InJvb3QiLCJuYmYiOjE2NjI1NDgxNjIsImV4cCI6MTY5NDEwNTc2MiwiaXNzIjoiYSIsImF1ZCI6ImEifQ.OEAlNzxi7Jat6pzDBTAjTbChskc-tdJthJexyWwwUKE + +# https://marketplace.visualstudio.com/items?itemName=humao.rest-client + +### +GET {{baseUrl}}/api/schedule/test +Content-Type: {{contentType}} +accept: */* +Authorization: {{auth}} + +### +POST {{baseUrl}}/api/schedule/test +Content-Type: {{contentType}} +accept: */* +Authorization: {{auth}} + +{ + "id": 0, + "items": [ + { + "id": 1, + "value": 0.1 + }, + { + "id": 2, + "value": 1. + }, + { + "id": 3, + "value": 2.0 + } + ] +} \ No newline at end of file diff --git a/AsbCloudWebApi/Rest/Readme.md b/AsbCloudWebApi/Rest/Readme.md new file mode 100644 index 00000000..92f52c05 --- /dev/null +++ b/AsbCloudWebApi/Rest/Readme.md @@ -0,0 +1,7 @@ +# / web-api. + + *.http ( *.rest) endpoint api swagger ( postman). + +[ ](https://marketplace.visualstudio.com/items?itemName=humao.rest-client) + + 1 1 . From 225d6ef827437c88d527a4698bc0347d54d5ec4b Mon Sep 17 00:00:00 2001 From: ngfrolov Date: Fri, 31 Mar 2023 16:57:20 +0500 Subject: [PATCH 3/3] =?UTF-8?q?=D0=9D=D0=B5=D0=B7=D0=BD=D0=B0=D1=87=D0=B8?= =?UTF-8?q?=D1=82=D0=B5=D0=BB=D1=8C=D0=BD=D1=8B=D0=B5=20=D0=BF=D0=B5=D1=80?= =?UTF-8?q?=D0=B5=D0=B8=D0=BC=D0=B5=D0=BD=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...{ProcessMapDto.cs => ProcessMapPlanDto.cs} | 3 +- .../Data/ProcessMap/ProcessMapReportDto.cs | 31 +++++++++++++------ .../ProcessMap/ProcessMapReportParamsDto.cs | 2 +- .../Repositories/IProcessMapRepository.cs | 6 ++-- .../Repositories/IWellCompositeRepository.cs | 2 +- .../Repository/ProcessMapRepository.cs | 16 +++++----- .../Repository/WellCompositeRepository.cs | 2 +- .../ProcessMap/ProcessMapReportService.cs | 4 +-- .../Services/ProcessMap/ProcessMapService.cs | 4 +-- .../Services/WellInfoService.cs | 2 +- .../Controllers/ProcessMapController.cs | 12 +++---- .../Controllers/WellCompositeController.cs | 2 +- 12 files changed, 49 insertions(+), 37 deletions(-) rename AsbCloudApp/Data/ProcessMap/{ProcessMapDto.cs => ProcessMapPlanDto.cs} (96%) diff --git a/AsbCloudApp/Data/ProcessMap/ProcessMapDto.cs b/AsbCloudApp/Data/ProcessMap/ProcessMapPlanDto.cs similarity index 96% rename from AsbCloudApp/Data/ProcessMap/ProcessMapDto.cs rename to AsbCloudApp/Data/ProcessMap/ProcessMapPlanDto.cs index 94989d70..ce64f1a3 100644 --- a/AsbCloudApp/Data/ProcessMap/ProcessMapDto.cs +++ b/AsbCloudApp/Data/ProcessMap/ProcessMapPlanDto.cs @@ -1,13 +1,12 @@ using System; using System.ComponentModel.DataAnnotations; -using System.ComponentModel.DataAnnotations.Schema; namespace AsbCloudApp.Data.ProcessMap { /// /// РТК /// - public class ProcessMapDto : IId, IWellRelated + public class ProcessMapPlanDto : IId, IWellRelated { /// public int Id { get; set; } diff --git a/AsbCloudApp/Data/ProcessMap/ProcessMapReportDto.cs b/AsbCloudApp/Data/ProcessMap/ProcessMapReportDto.cs index 7d9b9c03..9e753c01 100644 --- a/AsbCloudApp/Data/ProcessMap/ProcessMapReportDto.cs +++ b/AsbCloudApp/Data/ProcessMap/ProcessMapReportDto.cs @@ -13,16 +13,34 @@ namespace AsbCloudApp.Data.ProcessMap public int IdWell { get; set; } /// - /// Глубина по стволу, м + /// название секции скважины + /// + public int IdWellSectionType { get; set; } + + /// + /// название секции скважины + /// + public string WellSectionTypeName { get; set; } = null!; + + /// + /// Глубина по стволу от, м /// /// на начало интервала /// /// public double DepthStart { get; set; } + /// + /// Глубина по стволу до, м + /// + /// на конец интервала + /// + /// + public double DepthEnd { get; set; } + /// /// Дата/ время - /// + /// /// на начало интервала /// /// @@ -34,14 +52,9 @@ namespace AsbCloudApp.Data.ProcessMap public double MechDrillingHours { get; set; } /// - /// название секции скважины + /// Режим бурения (Ротор/слайд/ручной) /// - public int IdWellSectionType { get; set; } - - /// - /// название секции скважины - /// - public string WellSectionTypeName { get; set; } = null!; + public string DrillingMode { get; set; } = null!; /// /// Проходка, м diff --git a/AsbCloudApp/Data/ProcessMap/ProcessMapReportParamsDto.cs b/AsbCloudApp/Data/ProcessMap/ProcessMapReportParamsDto.cs index 6557283f..da002d5c 100644 --- a/AsbCloudApp/Data/ProcessMap/ProcessMapReportParamsDto.cs +++ b/AsbCloudApp/Data/ProcessMap/ProcessMapReportParamsDto.cs @@ -34,6 +34,6 @@ namespace AsbCloudApp.Data.ProcessMap /// /// Процент бурения по уставке, % /// - public double? PercDrillingSetpoint { get; set; } + public double? PercDrillingBySetpoint { get; set; } } } diff --git a/AsbCloudApp/Repositories/IProcessMapRepository.cs b/AsbCloudApp/Repositories/IProcessMapRepository.cs index 3a1da4d5..c0f347e2 100644 --- a/AsbCloudApp/Repositories/IProcessMapRepository.cs +++ b/AsbCloudApp/Repositories/IProcessMapRepository.cs @@ -11,7 +11,7 @@ namespace AsbCloudApp.Repositories /// /// /// - public interface IProcessMapRepository : IRepositoryWellRelated + public interface IProcessMapRepository : IRepositoryWellRelated { /// /// . @@ -20,7 +20,7 @@ namespace AsbCloudApp.Repositories /// /// /// - Task> GetAllAsync(int idWell, + Task> GetAllAsync(int idWell, DateTime? updateFrom, CancellationToken token = default); /// @@ -29,6 +29,6 @@ namespace AsbCloudApp.Repositories /// /// /// - Task> GetProcessMapAsync(IEnumerable requests, CancellationToken token); + Task> GetProcessMapAsync(IEnumerable requests, CancellationToken token); } } \ No newline at end of file diff --git a/AsbCloudApp/Repositories/IWellCompositeRepository.cs b/AsbCloudApp/Repositories/IWellCompositeRepository.cs index 06413176..c54c7e27 100644 --- a/AsbCloudApp/Repositories/IWellCompositeRepository.cs +++ b/AsbCloudApp/Repositories/IWellCompositeRepository.cs @@ -34,6 +34,6 @@ namespace AsbCloudApp.Repositories /// /// /// - Task> GetCompositeProcessMap(int idWell, CancellationToken token); + Task> GetCompositeProcessMap(int idWell, CancellationToken token); } } diff --git a/AsbCloudInfrastructure/Repository/ProcessMapRepository.cs b/AsbCloudInfrastructure/Repository/ProcessMapRepository.cs index 35d51724..dc0539c7 100644 --- a/AsbCloudInfrastructure/Repository/ProcessMapRepository.cs +++ b/AsbCloudInfrastructure/Repository/ProcessMapRepository.cs @@ -18,7 +18,7 @@ using System.Threading.Tasks; namespace AsbCloudInfrastructure.Repository { #nullable enable - public class ProcessMapRepository : CrudWellRelatedRepositoryBase, + public class ProcessMapRepository : CrudWellRelatedRepositoryBase, IProcessMapRepository { private readonly IWellService wellService; @@ -32,7 +32,7 @@ namespace AsbCloudInfrastructure.Repository this.wellService = wellService; } - public async Task> GetAllAsync(int idWell, + public async Task> GetAllAsync(int idWell, DateTime? updateFrom, CancellationToken token) { var requests = new[] @@ -53,7 +53,7 @@ namespace AsbCloudInfrastructure.Repository return dtos; } - public async Task> GetProcessMapAsync(IEnumerable requests, CancellationToken token) + public async Task> GetProcessMapAsync(IEnumerable requests, CancellationToken token) { var entities = await BuildQuery(requests) .ToListAsync(token) @@ -62,7 +62,7 @@ namespace AsbCloudInfrastructure.Repository return dtos; } - public override async Task InsertAsync(ProcessMapDto dto, + public override async Task InsertAsync(ProcessMapPlanDto dto, CancellationToken token) { dto.LastUpdate = DateTime.UtcNow; @@ -70,7 +70,7 @@ namespace AsbCloudInfrastructure.Repository return result; } - public override async Task UpdateAsync(ProcessMapDto dto, + public override async Task UpdateAsync(ProcessMapPlanDto dto, CancellationToken token) { dto.LastUpdate = DateTime.UtcNow; @@ -105,9 +105,9 @@ namespace AsbCloudInfrastructure.Repository } return query; } - protected override ProcessMapDto Convert(ProcessMap entity) + protected override ProcessMapPlanDto Convert(ProcessMap entity) { - var dto = entity.Adapt(); + var dto = entity.Adapt(); dto.LastUpdate = entity.LastUpdate.ToRemoteDateTime(entity.Well.Timezone.Hours); dto.AxialLoad = new PlanLimitDto { @@ -137,7 +137,7 @@ namespace AsbCloudInfrastructure.Repository return dto; } - protected override ProcessMap Convert(ProcessMapDto dto) + protected override ProcessMap Convert(ProcessMapPlanDto dto) { var entity = dto.Adapt(); entity.AxialLoadPlan = dto.AxialLoad.Plan; diff --git a/AsbCloudInfrastructure/Repository/WellCompositeRepository.cs b/AsbCloudInfrastructure/Repository/WellCompositeRepository.cs index 5fd50aaf..0ec8d6b9 100644 --- a/AsbCloudInfrastructure/Repository/WellCompositeRepository.cs +++ b/AsbCloudInfrastructure/Repository/WellCompositeRepository.cs @@ -50,7 +50,7 @@ namespace AsbCloudInfrastructure.Repository } /// - public async Task> GetCompositeProcessMap(int idWell, CancellationToken token) + public async Task> GetCompositeProcessMap(int idWell, CancellationToken token) { var dtos = await GetAsync(idWell, token); diff --git a/AsbCloudInfrastructure/Services/ProcessMap/ProcessMapReportService.cs b/AsbCloudInfrastructure/Services/ProcessMap/ProcessMapReportService.cs index cacb341d..430da7b4 100644 --- a/AsbCloudInfrastructure/Services/ProcessMap/ProcessMapReportService.cs +++ b/AsbCloudInfrastructure/Services/ProcessMap/ProcessMapReportService.cs @@ -168,7 +168,7 @@ namespace AsbCloudInfrastructure.Services.ProcessMap .SetVal(dataParam.Limit); sheet.Cell(row, column + columnOffsetPercent) - .SetVal(dataParam.PercDrillingSetpoint); + .SetVal(dataParam.PercDrillingBySetpoint); } private static void FillIntervalModeDataSpeed(IXLWorksheet sheet, ProcessMapReportParamsDto dataParam, int column, int row) @@ -192,7 +192,7 @@ namespace AsbCloudInfrastructure.Services.ProcessMap .SetVal(dataParam.Limit); sheet.Cell(row, column + columnOffsetPercent) - .SetVal(dataParam.PercDrillingSetpoint); + .SetVal(dataParam.PercDrillingBySetpoint); } private static Stream GetExcelTemplateStream() diff --git a/AsbCloudInfrastructure/Services/ProcessMap/ProcessMapService.cs b/AsbCloudInfrastructure/Services/ProcessMap/ProcessMapService.cs index a8228d7e..5688e0ff 100644 --- a/AsbCloudInfrastructure/Services/ProcessMap/ProcessMapService.cs +++ b/AsbCloudInfrastructure/Services/ProcessMap/ProcessMapService.cs @@ -96,7 +96,7 @@ namespace AsbCloudInfrastructure.Services.ProcessMap private static IEnumerable HandleSection( IEnumerable sectionOperations, - IEnumerable sectionProcessMap, + IEnumerable sectionProcessMap, IEnumerable telemetryDataStat, IEnumerable limitingParameters, IEnumerable subsystemsOperationTime) @@ -116,7 +116,7 @@ namespace AsbCloudInfrastructure.Services.ProcessMap private static ProcessMapReportDto MakeProcessMapReportDto( (double min, double max) depthInterval, IEnumerable sectionOperations, - IEnumerable sectionProcessMap, + IEnumerable sectionProcessMap, IEnumerable telemetryDataStat, IEnumerable limitingParameters, IEnumerable subsystemsOperationTime) diff --git a/AsbCloudInfrastructure/Services/WellInfoService.cs b/AsbCloudInfrastructure/Services/WellInfoService.cs index d627dc4e..79d59003 100644 --- a/AsbCloudInfrastructure/Services/WellInfoService.cs +++ b/AsbCloudInfrastructure/Services/WellInfoService.cs @@ -105,7 +105,7 @@ namespace AsbCloudInfrastructure.Services int? idSection = wellLastFactSection?.Id; - ProcessMapDto? welllProcessMap; + ProcessMapPlanDto? welllProcessMap; if (idSection is not null) { welllProcessMap = wellProcessMaps.FirstOrDefault(p => p.IdWellSectionType == idSection); diff --git a/AsbCloudWebApi/Controllers/ProcessMapController.cs b/AsbCloudWebApi/Controllers/ProcessMapController.cs index 2837af73..9f5617a2 100644 --- a/AsbCloudWebApi/Controllers/ProcessMapController.cs +++ b/AsbCloudWebApi/Controllers/ProcessMapController.cs @@ -18,7 +18,7 @@ namespace AsbCloudWebApi.Controllers [ApiController] [Route("api/[controller]")] [Authorize] - public class ProcessMapController : CrudWellRelatedController + public class ProcessMapController : CrudWellRelatedController { private readonly ITelemetryService telemetryService; private readonly IProcessMapReportService processMapReportService; @@ -49,14 +49,14 @@ namespace AsbCloudWebApi.Controllers [Obsolete("use GetByUidAsync(..) instead")] [Route("/api/telemetry/{uid}/drillFlowChart")] [AllowAnonymous] - [ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] + [ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] public IActionResult GetByTelemetry(string uid, DateTime updateFrom, CancellationToken token) { var idWell = telemetryService.GetIdWellByTelemetryUid(uid); if (idWell is null) return BadRequest($"Wrong uid {uid}"); - var dto = Enumerable.Empty(); + var dto = Enumerable.Empty(); return Ok(dto); } @@ -70,7 +70,7 @@ namespace AsbCloudWebApi.Controllers [HttpGet] [Route("/api/telemetry/{uid}/processMap")] [AllowAnonymous] - [ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] + [ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] public async Task GetByUidAsync(string uid, DateTime updateFrom, CancellationToken token) { var idWell = telemetryService.GetIdWellByTelemetryUid(uid); @@ -133,7 +133,7 @@ namespace AsbCloudWebApi.Controllers /// /// [HttpPost] - public override async Task> InsertAsync([FromBody] ProcessMapDto value, CancellationToken token) + public override async Task> InsertAsync([FromBody] ProcessMapPlanDto value, CancellationToken token) { value.IdUser = User.GetUserId() ?? -1; return await base.InsertAsync(value, token); @@ -146,7 +146,7 @@ namespace AsbCloudWebApi.Controllers /// /// 1 - успешно отредактировано, 0 - нет [HttpPut] - public override async Task> UpdateAsync([FromBody] ProcessMapDto value, CancellationToken token) + public override async Task> UpdateAsync([FromBody] ProcessMapPlanDto value, CancellationToken token) { value.IdUser = User.GetUserId() ?? -1; return await base.UpdateAsync(value, token); diff --git a/AsbCloudWebApi/Controllers/WellCompositeController.cs b/AsbCloudWebApi/Controllers/WellCompositeController.cs index 66a0d65b..0bfe40c1 100644 --- a/AsbCloudWebApi/Controllers/WellCompositeController.cs +++ b/AsbCloudWebApi/Controllers/WellCompositeController.cs @@ -73,7 +73,7 @@ namespace AsbCloudWebApi.Controllers /// [HttpGet("getCompositeProcessMap")] [Permission] - [ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] + [ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] public async Task GetCompositeProcessMap(int idWell, CancellationToken token = default) { if (!await CanUserAccessToWellAsync(idWell, token).ConfigureAwait(false))