From 594033b3bc41f47b90f45882a9854d58bb6e5674 Mon Sep 17 00:00:00 2001 From: "ai.astrakhantsev" Date: Wed, 22 Feb 2023 09:00:47 +0500 Subject: [PATCH 01/27] #9156004 --- AsbCloudApp/AsbCloudApp.csproj | 2 +- AsbCloudApp/Comparators/ComparerIId.cs | 20 +++++++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/AsbCloudApp/AsbCloudApp.csproj b/AsbCloudApp/AsbCloudApp.csproj index 11ffe050..79ec9867 100644 --- a/AsbCloudApp/AsbCloudApp.csproj +++ b/AsbCloudApp/AsbCloudApp.csproj @@ -3,7 +3,7 @@ net6.0 true - disable + enable diff --git a/AsbCloudApp/Comparators/ComparerIId.cs b/AsbCloudApp/Comparators/ComparerIId.cs index 7dbf5cb5..93b0d91a 100644 --- a/AsbCloudApp/Comparators/ComparerIId.cs +++ b/AsbCloudApp/Comparators/ComparerIId.cs @@ -9,7 +9,7 @@ namespace AsbCloudApp.Comparators /// public class ComparerIId : IComparer, IEqualityComparer { - private static readonly ComparerIId instance = new (); + private static readonly ComparerIId instance = new(); private ComparerIId() { } /// @@ -24,8 +24,13 @@ namespace AsbCloudApp.Comparators /// /// /// - public int Compare(IId x, IId y) => - x.Id.CompareTo(y.Id); + public int Compare(IId? x, IId? y) + { + if (x is null || y is null) + return 0; + else + return x.Id.CompareTo(y.Id); + } /// /// @@ -33,8 +38,13 @@ namespace AsbCloudApp.Comparators /// /// /// - public bool Equals(IId x, IId y) => - x.Id == y.Id; + public bool Equals(IId? x, IId? y) + { + if (x is null || y is null) + return false; + else + return x.Id == y.Id; + } /// /// From e9f3175b56624efbc4ba2d2564f8a3bab229c152 Mon Sep 17 00:00:00 2001 From: "ai.astrakhantsev" Date: Wed, 22 Feb 2023 09:01:54 +0500 Subject: [PATCH 02/27] #9156004 --- AsbCloudApp/Comparators/TelemetryUserDtoComparer.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AsbCloudApp/Comparators/TelemetryUserDtoComparer.cs b/AsbCloudApp/Comparators/TelemetryUserDtoComparer.cs index 42ed1e86..eac2d83d 100644 --- a/AsbCloudApp/Comparators/TelemetryUserDtoComparer.cs +++ b/AsbCloudApp/Comparators/TelemetryUserDtoComparer.cs @@ -7,7 +7,7 @@ namespace AsbCloudApp.Comparators public class TelemetryUserDtoComparer : IEqualityComparer { /// - public bool Equals(TelemetryUserDto prevUser, TelemetryUserDto nextUser) + public bool Equals(TelemetryUserDto? prevUser, TelemetryUserDto? nextUser) { if (prevUser is null || nextUser is null) return false; From 1417013cbdcfffddfa37845f8935aeb3bc555bc2 Mon Sep 17 00:00:00 2001 From: "ai.astrakhantsev" Date: Wed, 22 Feb 2023 09:11:01 +0500 Subject: [PATCH 03/27] #9156004 BhaDto, HeadDto --- AsbCloudApp/Data/DailyReport/BhaDto.cs | 78 ++++++++++++------------- AsbCloudApp/Data/DailyReport/HeadDto.cs | 12 ++-- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/AsbCloudApp/Data/DailyReport/BhaDto.cs b/AsbCloudApp/Data/DailyReport/BhaDto.cs index 681ae8a8..43d5e45f 100644 --- a/AsbCloudApp/Data/DailyReport/BhaDto.cs +++ b/AsbCloudApp/Data/DailyReport/BhaDto.cs @@ -8,57 +8,57 @@ /// /// КНБК описание /// - public string BHADescription { get; set; } + public string BHADescription { get; set; } = string.Empty; /// /// Бурение с наращиваниями в инт. 2195-2763м. Время начала /// - public string ExtensionDrillingOneBegin{ get; set; } + public string ExtensionDrillingOneBegin{ get; set; } = string.Empty; - /// - /// Бурение с наращиваниями в инт. 2195-2763м. Время окончания - /// - public string ExtensionDrillingOneFinish { get; set; } + /// + /// Бурение с наращиваниями в инт. 2195-2763м. Время окончания + /// + public string ExtensionDrillingOneFinish { get; set; } = string.Empty; - /// - /// Промывка. Время начала - /// - public string SluiceBegin { get; set; } + /// + /// Промывка. Время начала + /// + public string SluiceBegin { get; set; } = string.Empty; - /// - /// Промывка. Время окончания - /// - public string SluiceFinish { get; set; } + /// + /// Промывка. Время окончания + /// + public string SluiceFinish { get; set; } = string.Empty; - /// - /// Подъем КНБК. Время начала - /// - public string ClimbBegin { get; set; } + /// + /// Подъем КНБК. Время начала + /// + public string ClimbBegin { get; set; } = string.Empty; - /// - /// Подъем КНБК. Время окончания - /// - public string ClimbFinish { get; set; } + /// + /// Подъем КНБК. Время окончания + /// + public string ClimbFinish { get; set; } = string.Empty; - /// - /// Спуск КНБК. Время начала - /// - public string DescentBegin { get; set; } + /// + /// Спуск КНБК. Время начала + /// + public string DescentBegin { get; set; } = string.Empty; - /// - /// Спуск КНБК. Время окончания - /// - public string DescentFinish { get; set; } + /// + /// Спуск КНБК. Время окончания + /// + public string DescentFinish { get; set; } = string.Empty; - /// - /// Бурение с наращиваниями в инт. 2763-2850м. Время начала - /// - public string ExtensionDrillingTwoBegin { get; set; } + /// + /// Бурение с наращиваниями в инт. 2763-2850м. Время начала + /// + public string ExtensionDrillingTwoBegin { get; set; } = string.Empty; - /// - /// Бурение с наращиваниями в инт. 2763-2850м. Время окончания - /// - public string ExtensionDrillingTwoFinish { get; set; } - } + /// + /// Бурение с наращиваниями в инт. 2763-2850м. Время окончания + /// + public string ExtensionDrillingTwoFinish { get; set; } = string.Empty; + } } diff --git a/AsbCloudApp/Data/DailyReport/HeadDto.cs b/AsbCloudApp/Data/DailyReport/HeadDto.cs index 05537aae..c789783c 100644 --- a/AsbCloudApp/Data/DailyReport/HeadDto.cs +++ b/AsbCloudApp/Data/DailyReport/HeadDto.cs @@ -9,22 +9,22 @@ namespace AsbCloudApp.Data.DailyReport /// /// название скважины /// - public string WellName { get; set; } + public string WellName { get; set; } = null!; /// /// название куста /// - public string ClusterName { get; set; } + public string ClusterName { get; set; } = null!; /// /// заказчик /// - public string Customer { get; set; } + public string Customer { get; set; } = string.Empty; /// /// подрядчик /// - public string Contractor { get; set; } + public string Contractor { get; set; } = string.Empty; /// /// дата рапорта @@ -64,12 +64,12 @@ namespace AsbCloudApp.Data.DailyReport /// /// ФИО бурильщиков /// - public string FirstDriller { get; set; } + public string FirstDriller { get; set; } = string.Empty; /// /// ФИО бурильщиков /// - public string SecondDriller { get; set; } + public string SecondDriller { get; set; } = string.Empty; /// /// Время работы АПД From 7b61b5ed39568761f9ee015eaf1dec22f1860595 Mon Sep 17 00:00:00 2001 From: "ai.astrakhantsev" Date: Wed, 22 Feb 2023 09:13:46 +0500 Subject: [PATCH 04/27] #9156004 SaubDto --- AsbCloudApp/Data/DailyReport/SaubDto.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/AsbCloudApp/Data/DailyReport/SaubDto.cs b/AsbCloudApp/Data/DailyReport/SaubDto.cs index e0a22102..00a86398 100644 --- a/AsbCloudApp/Data/DailyReport/SaubDto.cs +++ b/AsbCloudApp/Data/DailyReport/SaubDto.cs @@ -10,12 +10,12 @@ namespace AsbCloudApp.Data.DailyReport /// /// Режимы бурения в роторе /// - public string RotorDrillingModes { get; set; } + public string RotorDrillingModes { get; set; } = string.Empty; /// /// режимы бурения в слайде /// - public string SlideDrillingModes { get; set; } + public string SlideDrillingModes { get; set; } = string.Empty; /// /// Количество метров пробуренных в роторе за отчетный период @@ -75,32 +75,32 @@ namespace AsbCloudApp.Data.DailyReport /// /// указываются все причины, которые влияют на снижение МСП. /// - public string DeclinesReasonsROP { get; set; } + public string DeclinesReasonsROP { get; set; } = string.Empty; /// /// Увеличение мех скорости за секцию % /// - public string IncreaseSpeedSection { get; set; } + public string IncreaseSpeedSection { get; set; } = string.Empty; /// /// Увеличение мех скорости за сутки % /// - public string IncreaseSpeedDay { get; set; } + public string IncreaseSpeedDay { get; set; } = string.Empty; /// /// Сокращение времени бурения за секцию, ч /// - public string ReductionTimeDrilling { get; set; } + public string ReductionTimeDrilling { get; set; } = string.Empty; /// /// Ротор/Слайд % /// - public string RotorSlidePercent { get; set; } + public string RotorSlidePercent { get; set; } = string.Empty; /// /// МСП /// - public string MspSection { get; set; } + public string MspSection { get; set; } = string.Empty; } } From d36139c0378767daae1ec899906840b9933451b2 Mon Sep 17 00:00:00 2001 From: "ai.astrakhantsev" Date: Wed, 22 Feb 2023 09:20:04 +0500 Subject: [PATCH 05/27] #9156004 SignBlock, TimeBalanceBlock --- AsbCloudApp/Data/DailyReport/SignDto.cs | 4 +- .../Data/DailyReport/TimeBalanceDto.cs | 166 +++++++++--------- 2 files changed, 85 insertions(+), 85 deletions(-) diff --git a/AsbCloudApp/Data/DailyReport/SignDto.cs b/AsbCloudApp/Data/DailyReport/SignDto.cs index 3c75bf33..fe0a6e67 100644 --- a/AsbCloudApp/Data/DailyReport/SignDto.cs +++ b/AsbCloudApp/Data/DailyReport/SignDto.cs @@ -8,12 +8,12 @@ /// /// ФИО Мастера буровой /// - public string DrillingMaster { get; set; } + public string DrillingMaster { get; set; } = null!; /// /// ФИО супервайзера /// - public string Supervisor { get; set; } + public string Supervisor { get; set; } = null!; } } diff --git a/AsbCloudApp/Data/DailyReport/TimeBalanceDto.cs b/AsbCloudApp/Data/DailyReport/TimeBalanceDto.cs index 40634148..061f2ab6 100644 --- a/AsbCloudApp/Data/DailyReport/TimeBalanceDto.cs +++ b/AsbCloudApp/Data/DailyReport/TimeBalanceDto.cs @@ -8,112 +8,112 @@ /// /// Бурение /// - public string Drilling { get; set; } + public string Drilling { get; set; } = string.Empty; /// /// Промывка /// - public string Flushing { get; set; } + public string Flushing { get; set; } = string.Empty; - /// - /// Наращивание - /// - public string Building { get; set; } + /// + /// Наращивание + /// + public string Building { get; set; } = string.Empty; - /// - /// Проработка - /// - public string Elaboration { get; set; } + /// + /// Проработка + /// + public string Elaboration { get; set; } = string.Empty; - /// - /// Расширка - /// - public string Extension { get; set; } + /// + /// Расширка + /// + public string Extension { get; set; } = string.Empty; - /// - /// Ремонт - /// - public string Repair { get; set; } + /// + /// Ремонт + /// + public string Repair { get; set; } = string.Empty; - /// - /// КНБК - /// - public string Knbk { get; set; } + /// + /// КНБК + /// + public string Knbk { get; set; } = string.Empty; - /// - /// СПО - /// - public string Spo { get; set; } + /// + /// СПО + /// + public string Spo { get; set; } = string.Empty; - /// - /// ПЗР - /// - public string Pzr { get; set; } + /// + /// ПЗР + /// + public string Pzr { get; set; } = string.Empty; - /// - /// ПВО - /// - public string Pvo { get; set; } + /// + /// ПВО + /// + public string Pvo { get; set; } = string.Empty; - /// - /// ПГР - /// - public string Pgr { get; set; } + /// + /// ПГР + /// + public string Pgr { get; set; } = string.Empty; - /// - /// ГИС - /// - public string Gis { get; set; } + /// + /// ГИС + /// + public string Gis { get; set; } = string.Empty; - /// - /// ОЗЦ - /// - public string Ozc { get; set; } + /// + /// ОЗЦ + /// + public string Ozc { get; set; } = string.Empty; - /// - /// Тех. работы - /// - public string EngineeringWorks { get; set; } + /// + /// Тех. работы + /// + public string EngineeringWorks { get; set; } = string.Empty; - /// - /// Снятие замера - /// - public string TakingMeasure { get; set; } + /// + /// Снятие замера + /// + public string TakingMeasure { get; set; } = string.Empty; - /// - /// Цементирование - /// - public string Cementing { get; set; } + /// + /// Цементирование + /// + public string Cementing { get; set; } = string.Empty; - /// - /// Простой - /// - public string Simple { get; set; } + /// + /// Простой + /// + public string Simple { get; set; } = string.Empty; - /// - /// НПВ - /// - public string Npv { get; set; } + /// + /// НПВ + /// + public string Npv { get; set; } = string.Empty; - /// - /// Проработка перед наращиванием - /// - public string ElaborationBeforeBuilding { get; set; } + /// + /// Проработка перед наращиванием + /// + public string ElaborationBeforeBuilding { get; set; } = string.Empty; - /// - /// Шаблонировка перед наращиванием - /// - public string TemplatingBeforeBuilding { get; set; } + /// + /// Шаблонировка перед наращиванием + /// + public string TemplatingBeforeBuilding { get; set; } = string.Empty; - /// - /// Промывка перед наращиванием - /// - public string FlushingBeforeBuilding { get; set; } + /// + /// Промывка перед наращиванием + /// + public string FlushingBeforeBuilding { get; set; } = string.Empty; - /// - /// Статический замер телесистемы - /// - public string StaticSurveying { get; set; } - } + /// + /// Статический замер телесистемы + /// + public string StaticSurveying { get; set; } = string.Empty; + } } From 5178b59ba7149c53e6b8b090dbcbbc18a8c9d255 Mon Sep 17 00:00:00 2001 From: "ai.astrakhantsev" Date: Wed, 22 Feb 2023 09:26:22 +0500 Subject: [PATCH 06/27] #9156004 DailyReportDto, HeadDto. DetectedOperationDto, DetectedOperationListDto, DetectedOperationStatDto --- AsbCloudApp/Data/DailyReport/DailyReportDto.cs | 2 -- AsbCloudApp/Data/DailyReport/HeadDto.cs | 5 ----- .../DetectedOperation/DetectedOperationDrillersStatDto.cs | 2 -- AsbCloudApp/Data/DetectedOperation/DetectedOperationDto.cs | 2 -- .../Data/DetectedOperation/DetectedOperationListDto.cs | 3 --- .../Data/DetectedOperation/DetectedOperationStatDto.cs | 2 -- 6 files changed, 16 deletions(-) diff --git a/AsbCloudApp/Data/DailyReport/DailyReportDto.cs b/AsbCloudApp/Data/DailyReport/DailyReportDto.cs index 920aeb54..c47b8934 100644 --- a/AsbCloudApp/Data/DailyReport/DailyReportDto.cs +++ b/AsbCloudApp/Data/DailyReport/DailyReportDto.cs @@ -1,6 +1,5 @@ namespace AsbCloudApp.Data.DailyReport { -#nullable enable /// /// Блоки для формирования суточного рапорта /// @@ -36,5 +35,4 @@ /// public SignDto Sign { get; set; } = new(); } -#nullable disable } diff --git a/AsbCloudApp/Data/DailyReport/HeadDto.cs b/AsbCloudApp/Data/DailyReport/HeadDto.cs index c789783c..d94674dc 100644 --- a/AsbCloudApp/Data/DailyReport/HeadDto.cs +++ b/AsbCloudApp/Data/DailyReport/HeadDto.cs @@ -105,11 +105,6 @@ namespace AsbCloudApp.Data.DailyReport /// Количество запусков МСЕ /// public int CountLaunchesMSE { get; set; } - - - - - } } diff --git a/AsbCloudApp/Data/DetectedOperation/DetectedOperationDrillersStatDto.cs b/AsbCloudApp/Data/DetectedOperation/DetectedOperationDrillersStatDto.cs index 65cce4aa..2eb06f63 100644 --- a/AsbCloudApp/Data/DetectedOperation/DetectedOperationDrillersStatDto.cs +++ b/AsbCloudApp/Data/DetectedOperation/DetectedOperationDrillersStatDto.cs @@ -1,6 +1,5 @@ namespace AsbCloudApp.Data.DetectedOperation { -#nullable enable /// /// Статистика по операциям бурильщика /// @@ -36,5 +35,4 @@ /// public double? Loss { get; set; } } -#nullable disable } diff --git a/AsbCloudApp/Data/DetectedOperation/DetectedOperationDto.cs b/AsbCloudApp/Data/DetectedOperation/DetectedOperationDto.cs index 62837213..9ca920b9 100644 --- a/AsbCloudApp/Data/DetectedOperation/DetectedOperationDto.cs +++ b/AsbCloudApp/Data/DetectedOperation/DetectedOperationDto.cs @@ -2,7 +2,6 @@ namespace AsbCloudApp.Data.DetectedOperation { -#nullable enable /// /// Автоматически определяемая операция /// @@ -74,5 +73,4 @@ namespace AsbCloudApp.Data.DetectedOperation /// public double Value { get; set; } } -#nullable disable } diff --git a/AsbCloudApp/Data/DetectedOperation/DetectedOperationListDto.cs b/AsbCloudApp/Data/DetectedOperation/DetectedOperationListDto.cs index ad9ff5c3..496fcd60 100644 --- a/AsbCloudApp/Data/DetectedOperation/DetectedOperationListDto.cs +++ b/AsbCloudApp/Data/DetectedOperation/DetectedOperationListDto.cs @@ -3,8 +3,6 @@ using System.Linq; namespace AsbCloudApp.Data.DetectedOperation { - -#nullable enable /// /// Автоматически определяемая операция /// @@ -20,5 +18,4 @@ namespace AsbCloudApp.Data.DetectedOperation /// public IEnumerable Stats { get; set; } = Enumerable.Empty(); } -#nullable disable } diff --git a/AsbCloudApp/Data/DetectedOperation/DetectedOperationStatDto.cs b/AsbCloudApp/Data/DetectedOperation/DetectedOperationStatDto.cs index aebe2f46..251345aa 100644 --- a/AsbCloudApp/Data/DetectedOperation/DetectedOperationStatDto.cs +++ b/AsbCloudApp/Data/DetectedOperation/DetectedOperationStatDto.cs @@ -1,6 +1,5 @@ namespace AsbCloudApp.Data.DetectedOperation { -#nullable enable /// /// Статистика по операциям например за период. /// @@ -56,5 +55,4 @@ /// public double MinutesAverage { get; set; } } -#nullable disable } From 7cc951d10209b9d941767e2ed7f27fd5acbe5d68 Mon Sep 17 00:00:00 2001 From: "ai.astrakhantsev" Date: Wed, 22 Feb 2023 09:43:32 +0500 Subject: [PATCH 07/27] #9156004 TelemetryDataSaubDto, SetpointsRequestDto, SetpointInfoDto, EventDto, ProcessMapReportRowDto, ProcessMapReportParamsDto, ProcessMapReportDto, ProcessMapDto --- AsbCloudApp/Data/ProcessMap/ProcessMapDto.cs | 2 -- AsbCloudApp/Data/ProcessMap/ProcessMapReportDto.cs | 2 -- AsbCloudApp/Data/ProcessMap/ProcessMapReportParamsDto.cs | 4 +--- AsbCloudApp/Data/ProcessMap/ProcessMapReportRowDto.cs | 2 -- AsbCloudApp/Data/SAUB/EventDto.cs | 1 - AsbCloudApp/Data/SAUB/SetpointInfoDto.cs | 1 - AsbCloudApp/Data/SAUB/SetpointsRequestDto.cs | 1 - AsbCloudApp/Data/SAUB/TelemetryDataSaubDto.cs | 1 - 8 files changed, 1 insertion(+), 13 deletions(-) diff --git a/AsbCloudApp/Data/ProcessMap/ProcessMapDto.cs b/AsbCloudApp/Data/ProcessMap/ProcessMapDto.cs index 9a460acb..f76a98dd 100644 --- a/AsbCloudApp/Data/ProcessMap/ProcessMapDto.cs +++ b/AsbCloudApp/Data/ProcessMap/ProcessMapDto.cs @@ -2,7 +2,6 @@ namespace AsbCloudApp.Data.ProcessMap { -#nullable enable /// /// РТК /// @@ -69,5 +68,4 @@ namespace AsbCloudApp.Data.ProcessMap /// public double RopPlan { get; set; } } -#nullable disable } diff --git a/AsbCloudApp/Data/ProcessMap/ProcessMapReportDto.cs b/AsbCloudApp/Data/ProcessMap/ProcessMapReportDto.cs index 514de0f9..6af7c3ec 100644 --- a/AsbCloudApp/Data/ProcessMap/ProcessMapReportDto.cs +++ b/AsbCloudApp/Data/ProcessMap/ProcessMapReportDto.cs @@ -2,7 +2,6 @@ namespace AsbCloudApp.Data.ProcessMap { -#nullable enable /// /// Модель РТК /// @@ -54,5 +53,4 @@ namespace AsbCloudApp.Data.ProcessMap /// public string WellSectionTypeName { get; set; } = null!; } -#nullable disable } diff --git a/AsbCloudApp/Data/ProcessMap/ProcessMapReportParamsDto.cs b/AsbCloudApp/Data/ProcessMap/ProcessMapReportParamsDto.cs index cf180f07..6557283f 100644 --- a/AsbCloudApp/Data/ProcessMap/ProcessMapReportParamsDto.cs +++ b/AsbCloudApp/Data/ProcessMap/ProcessMapReportParamsDto.cs @@ -6,7 +6,6 @@ using System.Threading.Tasks; namespace AsbCloudApp.Data.ProcessMap { -#nullable enable /// /// Параметры РТК /// @@ -33,9 +32,8 @@ namespace AsbCloudApp.Data.ProcessMap public double? Limit { get; set; } /// - /// Процент бурения по уставке ,% + /// Процент бурения по уставке, % /// public double? PercDrillingSetpoint { get; set; } } -#nullable disable } diff --git a/AsbCloudApp/Data/ProcessMap/ProcessMapReportRowDto.cs b/AsbCloudApp/Data/ProcessMap/ProcessMapReportRowDto.cs index 737f73ea..331df5da 100644 --- a/AsbCloudApp/Data/ProcessMap/ProcessMapReportRowDto.cs +++ b/AsbCloudApp/Data/ProcessMap/ProcessMapReportRowDto.cs @@ -1,6 +1,5 @@ namespace AsbCloudApp.Data.ProcessMap { -#nullable enable /// /// Строки РТК /// @@ -41,5 +40,4 @@ /// public double Rop { get; set; } } -#nullable disable } diff --git a/AsbCloudApp/Data/SAUB/EventDto.cs b/AsbCloudApp/Data/SAUB/EventDto.cs index 31899078..94b16aa7 100644 --- a/AsbCloudApp/Data/SAUB/EventDto.cs +++ b/AsbCloudApp/Data/SAUB/EventDto.cs @@ -1,6 +1,5 @@ namespace AsbCloudApp.Data.SAUB { -#nullable enable /// /// Описание шаблона события панели оператора /// diff --git a/AsbCloudApp/Data/SAUB/SetpointInfoDto.cs b/AsbCloudApp/Data/SAUB/SetpointInfoDto.cs index 5d2ef1f5..f5d08608 100644 --- a/AsbCloudApp/Data/SAUB/SetpointInfoDto.cs +++ b/AsbCloudApp/Data/SAUB/SetpointInfoDto.cs @@ -1,6 +1,5 @@ namespace AsbCloudApp.Data.SAUB { -#nullable enable /// /// DTO рекомендации уставок передаваемых на панель оператора /// diff --git a/AsbCloudApp/Data/SAUB/SetpointsRequestDto.cs b/AsbCloudApp/Data/SAUB/SetpointsRequestDto.cs index 12c39a9d..f9544e9d 100644 --- a/AsbCloudApp/Data/SAUB/SetpointsRequestDto.cs +++ b/AsbCloudApp/Data/SAUB/SetpointsRequestDto.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; namespace AsbCloudApp.Data.SAUB { -#nullable enable /// /// DTO запроса для предложения по изменению уставок на панели оператора /// diff --git a/AsbCloudApp/Data/SAUB/TelemetryDataSaubDto.cs b/AsbCloudApp/Data/SAUB/TelemetryDataSaubDto.cs index e8d6cc52..cf2ee0ad 100644 --- a/AsbCloudApp/Data/SAUB/TelemetryDataSaubDto.cs +++ b/AsbCloudApp/Data/SAUB/TelemetryDataSaubDto.cs @@ -1,5 +1,4 @@ using System; -#nullable enable namespace AsbCloudApp.Data.SAUB { /// From a067c478630c8f8f982dcb69d5e5598010b4182f Mon Sep 17 00:00:00 2001 From: "ai.astrakhantsev" Date: Wed, 22 Feb 2023 09:50:11 +0500 Subject: [PATCH 08/27] #9156004 TelemetryDataSaubStatDto, TelemetryDataSpinDto, TelemetryInfoDto, TelemetryMessageDto, TelemetryUserDto, TelemetryWirelineRunOutBaseDto --- AsbCloudApp/Data/SAUB/TelemetryDataSaubStatDto.cs | 2 -- AsbCloudApp/Data/SAUB/TelemetryDataSpinDto.cs | 2 -- AsbCloudApp/Data/SAUB/TelemetryInfoDto.cs | 1 - AsbCloudApp/Data/SAUB/TelemetryMessageDto.cs | 1 - AsbCloudApp/Data/SAUB/TelemetryUserDto.cs | 1 - AsbCloudApp/Data/SAUB/TelemetryWirelineRunOutDto.cs | 3 --- 6 files changed, 10 deletions(-) diff --git a/AsbCloudApp/Data/SAUB/TelemetryDataSaubStatDto.cs b/AsbCloudApp/Data/SAUB/TelemetryDataSaubStatDto.cs index 478f227c..2ca5293c 100644 --- a/AsbCloudApp/Data/SAUB/TelemetryDataSaubStatDto.cs +++ b/AsbCloudApp/Data/SAUB/TelemetryDataSaubStatDto.cs @@ -2,7 +2,6 @@ namespace AsbCloudApp.Data.SAUB { -#nullable enable /// /// Статистика телеметрии САУБ (усредненные значения) по интервалам глубины /// @@ -118,5 +117,4 @@ namespace AsbCloudApp.Data.SAUB /// public float BlockSpeedSpSlide { get; set; } } -#nullable disable } diff --git a/AsbCloudApp/Data/SAUB/TelemetryDataSpinDto.cs b/AsbCloudApp/Data/SAUB/TelemetryDataSpinDto.cs index 09eeff23..46b9cf28 100644 --- a/AsbCloudApp/Data/SAUB/TelemetryDataSpinDto.cs +++ b/AsbCloudApp/Data/SAUB/TelemetryDataSpinDto.cs @@ -2,7 +2,6 @@ namespace AsbCloudApp.Data.SAUB { -#nullable enable /// /// телеметрия спин мастер /// @@ -87,5 +86,4 @@ namespace AsbCloudApp.Data.SAUB /// public bool IsDampening => State == 7 && (Mode & 2) > 0; } -#nullable disable } diff --git a/AsbCloudApp/Data/SAUB/TelemetryInfoDto.cs b/AsbCloudApp/Data/SAUB/TelemetryInfoDto.cs index 408f940f..66501c18 100644 --- a/AsbCloudApp/Data/SAUB/TelemetryInfoDto.cs +++ b/AsbCloudApp/Data/SAUB/TelemetryInfoDto.cs @@ -2,7 +2,6 @@ namespace AsbCloudApp.Data.SAUB { -#nullable enable /// /// общая информация о панели оператора /// diff --git a/AsbCloudApp/Data/SAUB/TelemetryMessageDto.cs b/AsbCloudApp/Data/SAUB/TelemetryMessageDto.cs index dc70db22..6c246f16 100644 --- a/AsbCloudApp/Data/SAUB/TelemetryMessageDto.cs +++ b/AsbCloudApp/Data/SAUB/TelemetryMessageDto.cs @@ -2,7 +2,6 @@ namespace AsbCloudApp.Data.SAUB { -#nullable enable /// /// Сообщение получаемое от телеметрии с буровой /// diff --git a/AsbCloudApp/Data/SAUB/TelemetryUserDto.cs b/AsbCloudApp/Data/SAUB/TelemetryUserDto.cs index 4f59e69d..5d93813e 100644 --- a/AsbCloudApp/Data/SAUB/TelemetryUserDto.cs +++ b/AsbCloudApp/Data/SAUB/TelemetryUserDto.cs @@ -1,6 +1,5 @@ namespace AsbCloudApp.Data.SAUB { -#nullable enable /// /// Пользователь панели оператора /// diff --git a/AsbCloudApp/Data/SAUB/TelemetryWirelineRunOutDto.cs b/AsbCloudApp/Data/SAUB/TelemetryWirelineRunOutDto.cs index de9baccb..69ac6929 100644 --- a/AsbCloudApp/Data/SAUB/TelemetryWirelineRunOutDto.cs +++ b/AsbCloudApp/Data/SAUB/TelemetryWirelineRunOutDto.cs @@ -2,8 +2,6 @@ namespace AsbCloudApp.Data.SAUB { -#nullable enable - /// /// DTO телеметрии наработки талевого каната от панели бурильщика /// @@ -46,5 +44,4 @@ namespace AsbCloudApp.Data.SAUB /// public WellInfoDto WellInfo { get; set; } = null!; } -#nullable disable } From dd3a2f4ff66705b379413952a4c26b7912d38a8b Mon Sep 17 00:00:00 2001 From: "ai.astrakhantsev" Date: Wed, 22 Feb 2023 09:56:01 +0500 Subject: [PATCH 09/27] #9156004 SubsystemActiveWellStatDto, SubsystemDto, SubsystemOperationTimeDto, SubsystemStatDto --- AsbCloudApp/Data/Subsystems/SubsystemActiveWellStatDto.cs | 2 -- AsbCloudApp/Data/Subsystems/SubsystemDto.cs | 4 ++-- AsbCloudApp/Data/Subsystems/SubsystemOperationTimeDto.cs | 2 +- AsbCloudApp/Data/Subsystems/SubsystemStatDto.cs | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/AsbCloudApp/Data/Subsystems/SubsystemActiveWellStatDto.cs b/AsbCloudApp/Data/Subsystems/SubsystemActiveWellStatDto.cs index 3d16d518..4032358f 100644 --- a/AsbCloudApp/Data/Subsystems/SubsystemActiveWellStatDto.cs +++ b/AsbCloudApp/Data/Subsystems/SubsystemActiveWellStatDto.cs @@ -1,7 +1,6 @@ using System.Collections.Generic; namespace AsbCloudApp.Data.Subsystems { -#nullable enable /// /// Статистика наработки подсистем по активным скважинам /// @@ -28,5 +27,4 @@ namespace AsbCloudApp.Data.Subsystems /// public SubsystemStatDto? SubsystemTorqueMaster { get; set; } } -#nullable disable } \ No newline at end of file diff --git a/AsbCloudApp/Data/Subsystems/SubsystemDto.cs b/AsbCloudApp/Data/Subsystems/SubsystemDto.cs index 515c69a7..bfb7f9d2 100644 --- a/AsbCloudApp/Data/Subsystems/SubsystemDto.cs +++ b/AsbCloudApp/Data/Subsystems/SubsystemDto.cs @@ -12,10 +12,10 @@ /// /// Наименование подсистемы /// - public string Name { get; set; } + public string Name { get; set; } = null!; /// /// Детальное описание подсистемы /// - public string Description { get; set; } + public string Description { get; set; } = string.Empty; } } diff --git a/AsbCloudApp/Data/Subsystems/SubsystemOperationTimeDto.cs b/AsbCloudApp/Data/Subsystems/SubsystemOperationTimeDto.cs index 98047c84..50a373d0 100644 --- a/AsbCloudApp/Data/Subsystems/SubsystemOperationTimeDto.cs +++ b/AsbCloudApp/Data/Subsystems/SubsystemOperationTimeDto.cs @@ -17,7 +17,7 @@ namespace AsbCloudApp.Data.Subsystems /// /// Название подсистемы /// - public string SubsystemName { get; set; } + public string SubsystemName { get; set; } = null!; /// /// дата/время включения подсистемы /// diff --git a/AsbCloudApp/Data/Subsystems/SubsystemStatDto.cs b/AsbCloudApp/Data/Subsystems/SubsystemStatDto.cs index c257d029..aec6c6b8 100644 --- a/AsbCloudApp/Data/Subsystems/SubsystemStatDto.cs +++ b/AsbCloudApp/Data/Subsystems/SubsystemStatDto.cs @@ -13,7 +13,7 @@ namespace AsbCloudApp.Data.Subsystems /// /// Название подсистемы /// - public string SubsystemName { get; set; } + public string SubsystemName { get; set; } = null!; /// /// наработка подсистемы /// From 4634d8d4c6916457e354fc6ba62176338dc64892 Mon Sep 17 00:00:00 2001 From: "ai.astrakhantsev" Date: Wed, 22 Feb 2023 10:10:46 +0500 Subject: [PATCH 10/27] #9156004 Record7Dto, AuthDto, ClusterDto, CompanyDto, CompanyTypeDto, DrillerDto, DrillingProgramPartDto, DrillingProgramStateDto --- AsbCloudApp/Data/AuthDto.cs | 4 ++-- AsbCloudApp/Data/ClusterDto.cs | 1 - AsbCloudApp/Data/CompanyDto.cs | 1 - AsbCloudApp/Data/CompanyTypeDto.cs | 2 +- AsbCloudApp/Data/DrillerDto.cs | 2 -- AsbCloudApp/Data/DrillingProgramPartDto.cs | 1 - AsbCloudApp/Data/DrillingProgramStateDto.cs | 1 - AsbCloudApp/Data/WITS/Record7Dto.cs | 2 +- 8 files changed, 4 insertions(+), 10 deletions(-) diff --git a/AsbCloudApp/Data/AuthDto.cs b/AsbCloudApp/Data/AuthDto.cs index 9235b40f..6b3d42ad 100644 --- a/AsbCloudApp/Data/AuthDto.cs +++ b/AsbCloudApp/Data/AuthDto.cs @@ -8,11 +8,11 @@ /// /// Имя пользователя для входа /// - public string Login { get; set; } + public string Login { get; set; } = null!; /// /// Пароль пользователя для входа /// - public string Password { get; set; } + public string Password { get; set; } = null!; } } diff --git a/AsbCloudApp/Data/ClusterDto.cs b/AsbCloudApp/Data/ClusterDto.cs index d73bffb6..d625c9c2 100644 --- a/AsbCloudApp/Data/ClusterDto.cs +++ b/AsbCloudApp/Data/ClusterDto.cs @@ -3,7 +3,6 @@ using System.Linq; namespace AsbCloudApp.Data { -#nullable enable /// /// DTO кустов /// diff --git a/AsbCloudApp/Data/CompanyDto.cs b/AsbCloudApp/Data/CompanyDto.cs index 99e1fc47..0349013c 100644 --- a/AsbCloudApp/Data/CompanyDto.cs +++ b/AsbCloudApp/Data/CompanyDto.cs @@ -2,7 +2,6 @@ namespace AsbCloudApp.Data { -#nullable enable /// /// DTO компании /// diff --git a/AsbCloudApp/Data/CompanyTypeDto.cs b/AsbCloudApp/Data/CompanyTypeDto.cs index a2a83697..1e46787a 100644 --- a/AsbCloudApp/Data/CompanyTypeDto.cs +++ b/AsbCloudApp/Data/CompanyTypeDto.cs @@ -11,7 +11,7 @@ /// /// Название типа компании /// - public string Caption { get; set; } + public string Caption { get; set; } = null!; } } diff --git a/AsbCloudApp/Data/DrillerDto.cs b/AsbCloudApp/Data/DrillerDto.cs index a7fc255b..cf1a9ea5 100644 --- a/AsbCloudApp/Data/DrillerDto.cs +++ b/AsbCloudApp/Data/DrillerDto.cs @@ -1,6 +1,5 @@ namespace AsbCloudApp.Data { -#nullable enable /// /// Описание данных для бурильщика /// @@ -26,5 +25,4 @@ /// public string? Patronymic { get; set; } } -#nullable disable } diff --git a/AsbCloudApp/Data/DrillingProgramPartDto.cs b/AsbCloudApp/Data/DrillingProgramPartDto.cs index 131b328b..482fe0c4 100644 --- a/AsbCloudApp/Data/DrillingProgramPartDto.cs +++ b/AsbCloudApp/Data/DrillingProgramPartDto.cs @@ -3,7 +3,6 @@ using System.Linq; namespace AsbCloudApp.Data { -#nullable enable /// /// Часть программы бурения /// diff --git a/AsbCloudApp/Data/DrillingProgramStateDto.cs b/AsbCloudApp/Data/DrillingProgramStateDto.cs index 9752786d..791d80b4 100644 --- a/AsbCloudApp/Data/DrillingProgramStateDto.cs +++ b/AsbCloudApp/Data/DrillingProgramStateDto.cs @@ -3,7 +3,6 @@ using System.Linq; namespace AsbCloudApp.Data { -#nullable enable /// /// DTO состояния формирования программы бурения /// diff --git a/AsbCloudApp/Data/WITS/Record7Dto.cs b/AsbCloudApp/Data/WITS/Record7Dto.cs index 43c370d1..0e7664ff 100644 --- a/AsbCloudApp/Data/WITS/Record7Dto.cs +++ b/AsbCloudApp/Data/WITS/Record7Dto.cs @@ -82,7 +82,7 @@ namespace AsbCloudApp.Data.WITS /// ValueType = "A" /// - public string Svytype { get; set; } + public string Svytype { get; set; } = string.Empty; /// /// RecordId = 7, From e39a701738152f93947e1a3eecdc710d7e34a525 Mon Sep 17 00:00:00 2001 From: "ai.astrakhantsev" Date: Wed, 22 Feb 2023 11:35:35 +0500 Subject: [PATCH 11/27] #9156004 DrillParamsDto, FileCategoryDto, FileInfoDto, FileMarkDto, IId, IMapPoint, IWellRelated, JobState, LimitingParameterDataDto, LimitingParameterDto --- AsbCloudApp/Data/DrillParamsDto.cs | 14 ++++++++------ AsbCloudApp/Data/FileCategoryDto.cs | 2 -- AsbCloudApp/Data/FileInfoDto.cs | 1 - AsbCloudApp/Data/FileMarkDto.cs | 1 - AsbCloudApp/Data/IId.cs | 1 - AsbCloudApp/Data/IMapPoint.cs | 1 - AsbCloudApp/Data/IWellRelated.cs | 1 - AsbCloudApp/Data/JobDto.cs | 5 +---- AsbCloudApp/Data/LimitingParameterDataDto.cs | 2 -- AsbCloudApp/Data/LimitingParameterDto.cs | 2 -- 10 files changed, 9 insertions(+), 21 deletions(-) diff --git a/AsbCloudApp/Data/DrillParamsDto.cs b/AsbCloudApp/Data/DrillParamsDto.cs index d79f2451..b8111410 100644 --- a/AsbCloudApp/Data/DrillParamsDto.cs +++ b/AsbCloudApp/Data/DrillParamsDto.cs @@ -1,3 +1,5 @@ +using System.Linq; + namespace AsbCloudApp.Data { @@ -15,7 +17,7 @@ namespace AsbCloudApp.Data /// /// /// - public MinMaxDto Depth { get; set; } + public MinMaxDto Depth { get; set; } = null!; /// /// id well section type. @@ -25,26 +27,26 @@ namespace AsbCloudApp.Data /// /// axial load /// - public MinMaxExtendedViewDto AxialLoad { get; set; } + public MinMaxExtendedViewDto AxialLoad { get; set; } = null!; /// /// pressure /// - public MinMaxExtendedViewDto Pressure { get; set; } + public MinMaxExtendedViewDto Pressure { get; set; } = null!; /// /// rotor torque /// - public MinMaxExtendedViewDto RotorTorque { get; set; } + public MinMaxExtendedViewDto RotorTorque { get; set; } = null!; /// /// rotor speed /// - public MinMaxExtendedViewDto RotorSpeed { get; set; } + public MinMaxExtendedViewDto RotorSpeed { get; set; } = null!; /// /// flow /// - public MinMaxExtendedViewDto Flow { get; set; } + public MinMaxExtendedViewDto Flow { get; set; } = null!; } } \ No newline at end of file diff --git a/AsbCloudApp/Data/FileCategoryDto.cs b/AsbCloudApp/Data/FileCategoryDto.cs index 6d553dcd..2174af01 100644 --- a/AsbCloudApp/Data/FileCategoryDto.cs +++ b/AsbCloudApp/Data/FileCategoryDto.cs @@ -1,6 +1,5 @@ namespace AsbCloudApp.Data { -#nullable enable /// /// DTO категории файла /// @@ -19,5 +18,4 @@ /// public string ShortName { get; set; } = string.Empty; } -#nullable disable } diff --git a/AsbCloudApp/Data/FileInfoDto.cs b/AsbCloudApp/Data/FileInfoDto.cs index 1dde4735..05dfa1ff 100644 --- a/AsbCloudApp/Data/FileInfoDto.cs +++ b/AsbCloudApp/Data/FileInfoDto.cs @@ -4,7 +4,6 @@ using System.Linq; namespace AsbCloudApp.Data { -#nullable enable /// /// DTO информации о файле. Используется для загрузки файла. /// diff --git a/AsbCloudApp/Data/FileMarkDto.cs b/AsbCloudApp/Data/FileMarkDto.cs index a92ccfc9..57139367 100644 --- a/AsbCloudApp/Data/FileMarkDto.cs +++ b/AsbCloudApp/Data/FileMarkDto.cs @@ -2,7 +2,6 @@ using System; namespace AsbCloudApp.Data { -#nullable enable /// /// /// diff --git a/AsbCloudApp/Data/IId.cs b/AsbCloudApp/Data/IId.cs index 1e60b9b9..e5ad455e 100644 --- a/AsbCloudApp/Data/IId.cs +++ b/AsbCloudApp/Data/IId.cs @@ -1,6 +1,5 @@ namespace AsbCloudApp.Data { -#nullable enable /// /// Интерфейс данных с Id /// diff --git a/AsbCloudApp/Data/IMapPoint.cs b/AsbCloudApp/Data/IMapPoint.cs index c5a18cef..f71bd7fa 100644 --- a/AsbCloudApp/Data/IMapPoint.cs +++ b/AsbCloudApp/Data/IMapPoint.cs @@ -1,6 +1,5 @@ namespace AsbCloudApp.Data { -#nullable enable /// /// точка на карте /// diff --git a/AsbCloudApp/Data/IWellRelated.cs b/AsbCloudApp/Data/IWellRelated.cs index 7771766b..f79a03a9 100644 --- a/AsbCloudApp/Data/IWellRelated.cs +++ b/AsbCloudApp/Data/IWellRelated.cs @@ -1,6 +1,5 @@ namespace AsbCloudApp.Data { -#nullable enable /// /// Well related DTO /// diff --git a/AsbCloudApp/Data/JobDto.cs b/AsbCloudApp/Data/JobDto.cs index 2e9b336a..ea5a8e24 100644 --- a/AsbCloudApp/Data/JobDto.cs +++ b/AsbCloudApp/Data/JobDto.cs @@ -1,9 +1,7 @@ -using System; -using System.Collections; +using System.Collections; namespace AsbCloudApp.Data { -#nullable enable /// /// Состояние фоновой задачи /// @@ -52,5 +50,4 @@ namespace AsbCloudApp.Data /// public string? Error { get; set; } } -#nullable disable } diff --git a/AsbCloudApp/Data/LimitingParameterDataDto.cs b/AsbCloudApp/Data/LimitingParameterDataDto.cs index 83db213b..1bf982dc 100644 --- a/AsbCloudApp/Data/LimitingParameterDataDto.cs +++ b/AsbCloudApp/Data/LimitingParameterDataDto.cs @@ -2,7 +2,6 @@ namespace AsbCloudApp.Data { -#nullable enable /// /// Статистика по ограничивающим параметрам /// @@ -43,5 +42,4 @@ namespace AsbCloudApp.Data /// public short IdFeedRegulator { get; set; } } -#nullable disable } diff --git a/AsbCloudApp/Data/LimitingParameterDto.cs b/AsbCloudApp/Data/LimitingParameterDto.cs index a1f03219..45a3da74 100644 --- a/AsbCloudApp/Data/LimitingParameterDto.cs +++ b/AsbCloudApp/Data/LimitingParameterDto.cs @@ -2,7 +2,6 @@ namespace AsbCloudApp.Data { -#nullable enable /// /// Статистика по ограничивающим параметрам /// @@ -38,5 +37,4 @@ namespace AsbCloudApp.Data /// public int NumberInclusions { get; set; } } -#nullable disable } From c94a2f29049087b596d8c1909cc96b0babfe4f33 Mon Sep 17 00:00:00 2001 From: ngfrolov Date: Wed, 22 Feb 2023 12:37:43 +0500 Subject: [PATCH 12/27] fix tests --- AsbCloudWebApi.Tests/CacheTests/CacheTest.cs | 61 ------------ .../CacheTests/TelemetryDataCacheTest.cs | 93 ------------------- .../ServicesTests/EventServiceTest.cs | 4 +- .../TelemetryDataSaubServiceTest.cs | 2 +- ConsoleApp1/ServiceFactory.cs | 12 +-- 5 files changed, 9 insertions(+), 163 deletions(-) delete mode 100644 AsbCloudWebApi.Tests/CacheTests/CacheTest.cs delete mode 100644 AsbCloudWebApi.Tests/CacheTests/TelemetryDataCacheTest.cs diff --git a/AsbCloudWebApi.Tests/CacheTests/CacheTest.cs b/AsbCloudWebApi.Tests/CacheTests/CacheTest.cs deleted file mode 100644 index f67a0a46..00000000 --- a/AsbCloudWebApi.Tests/CacheTests/CacheTest.cs +++ /dev/null @@ -1,61 +0,0 @@ -using AsbCloudApp.Data; -using AsbCloudApp.Services; -using AsbCloudDb.Model; -using AsbCloudInfrastructure.EfCache; -using DocumentFormat.OpenXml.Spreadsheet; -using Mapster; -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading; -using System.Threading.Tasks; -using Xunit; - -namespace AsbCloudWebApi.Tests.CacheTests -{ - public class CacheTest - { - private readonly string userCacheTag = "Users"; - private static readonly TimeSpan cacheObsolence = TimeSpan.FromMinutes(15); - public IEnumerable UsersCache = new List { - new User { Id = 1, Name = "test1", Email = "test1@mail.com" }, - new User { Id = 2, Name = "test2", Email = "test2@mail.com" }, - new User { Id = 3, Name = "test3", Email = "test3@mail.com" }, - new User { Id = 4, Name = "test4", Email = "test4@mail.com" }, - new User { Id = 5, Name = "test5", Email = "test5@mail.com" }, - new User { Id = 6, Name = "test6", Email = "test6@mail.com" }, - new User { Id = 7, Name = "test7", Email = "test7@mail.com" } - }; - - [Fact] - public void Send_n_requests_cache_user() - { - const int iterations = 1230; - var cache = UsersCache.AsQueryable(); - var cacheCount = UsersCache.Count(); - var fail = false; - - var tasks = new int[iterations].Select(_=> new Task(() => - { - var data = cache.FromCache(userCacheTag, cacheObsolence, Convert).ToArray(); - if (data.Count() != cacheCount) - fail = true; - })) - .ToArray(); - - foreach(var task in tasks) - task.Start(); - - Task.WaitAll(tasks); - Assert.False(fail); - } - - private UserExtendedDto Convert(User entity) - { - var dto = entity.Adapt(); - return dto; - } - } -} diff --git a/AsbCloudWebApi.Tests/CacheTests/TelemetryDataCacheTest.cs b/AsbCloudWebApi.Tests/CacheTests/TelemetryDataCacheTest.cs deleted file mode 100644 index 5ae1d78c..00000000 --- a/AsbCloudWebApi.Tests/CacheTests/TelemetryDataCacheTest.cs +++ /dev/null @@ -1,93 +0,0 @@ -using AsbCloudDb.Model; -using AsbCloudInfrastructure.Services.SAUB; -using Moq; -using System; -using System.Linq; -using System.Threading.Tasks; -using Xunit; - -namespace AsbCloudWebApi.Tests.CacheTests -{ - public class TelemetryDataCacheTest - { - private const int IdTelemetryOk = 10; - private static readonly DateTime baseDate = DateTime.Now; - private static readonly SimpleTimezone timezone = new() { Hours = TimeZoneInfo.Local.BaseUtcOffset.TotalHours }; - - private static readonly Well[] wellData = new Well[]{ - new(){ Id = 1, IdTelemetry = IdTelemetryOk, IdState = 1, Caption = "", Timezone = timezone} - }; - private static readonly TTelemetryData[] telemetryData = new TTelemetryData[]{ - new ( IdTelemetryOk, baseDate.AddSeconds(1), timezone.Hours ), - new ( IdTelemetryOk, baseDate.AddSeconds(2), timezone.Hours ), - new ( IdTelemetryOk, baseDate.AddSeconds(3), timezone.Hours ), - new ( IdTelemetryOk, baseDate.AddSeconds(4), timezone.Hours ), - }; - private readonly Mock dbMock; - - private TelemetryDataCache cacheTest; - - public class TTelemetryData : ITelemetryData, AsbCloudApp.Data.ITelemetryData - { - private DateTimeOffset _dateTime; - - public TTelemetryData(int idTelemetry, DateTime dateTime, double hoursOffset) - { - IdTelemetry = idTelemetry; - DateTime = dateTime; - var offset = TimeSpan.FromHours(hoursOffset); - var dateTimeUTC = DateTime.SpecifyKind(dateTime, DateTimeKind.Unspecified); - _dateTime = new DateTimeOffset(dateTimeUTC, offset) - .ToUniversalTime(); - } - - public int IdTelemetry { get; set; } - public DateTime DateTime { get; set; } - DateTimeOffset ITelemetryData.DateTime { get => _dateTime; set => _dateTime = value; } - } - - public TelemetryDataCacheTest() - { - dbMock = new Mock(); - dbMock - .AddDbSetMock(wellData) - .AddDbSetMock(telemetryData); - - cacheTest = TelemetryDataCache.GetInstance(dbMock.Object, out Task cacheInitialization); - cacheInitialization.Wait(); - } - - [Fact] - public void Get_existing_cache_returns_some() - { - var startDate = baseDate.AddSeconds(3); - var data = cacheTest.GetOrDefault(IdTelemetryOk, startDate, 600, 600); - Assert.NotNull(data); - Assert.NotEmpty(data); - } - - [Fact] - public void Get_non_existing_cache_returns_null() - { - var startDate = baseDate.AddSeconds(-1); - var data = cacheTest.GetOrDefault(IdTelemetryOk, startDate, 600, 600); - Assert.Null(data); - } - - [Fact] - public void Add_new_data_should_replace_IdTelemetry() - { - var startDate = baseDate.AddSeconds(4); - var newTelemetryData = new TTelemetryData[]{ - new ( 0, startDate, timezone.Hours), - new ( 0, startDate.AddSeconds(1), timezone.Hours), - }; - cacheTest.AddRange(IdTelemetryOk, newTelemetryData); - var data = cacheTest.GetOrDefault(IdTelemetryOk, startDate, 600, 600); - - Assert.NotNull(data); - Assert.True(data?.Count() > 2); - Assert.All(data!, p => Assert.Equal(IdTelemetryOk, p.IdTelemetry)); - } - } -} diff --git a/AsbCloudWebApi.Tests/ServicesTests/EventServiceTest.cs b/AsbCloudWebApi.Tests/ServicesTests/EventServiceTest.cs index b13cab4e..d39eb3f1 100644 --- a/AsbCloudWebApi.Tests/ServicesTests/EventServiceTest.cs +++ b/AsbCloudWebApi.Tests/ServicesTests/EventServiceTest.cs @@ -20,8 +20,8 @@ public class EventServiceTest context = TestHelpter.MakeRealTestContext(); var telemetryTracker = new Mock(); var imezoneServiceMock = new Mock(); - var telemetryService = new TelemetryService(context, telemetryTracker.Object, imezoneServiceMock.Object); - service = new EventService(context, telemetryService); + var telemetryService = new TelemetryService(context, TestHelpter.MemoryCache, telemetryTracker.Object, imezoneServiceMock.Object); + service = new EventService(context, TestHelpter.MemoryCache, telemetryService); } [Fact] diff --git a/AsbCloudWebApi.Tests/ServicesTests/TelemetryDataSaubServiceTest.cs b/AsbCloudWebApi.Tests/ServicesTests/TelemetryDataSaubServiceTest.cs index 6d395cf2..153de97f 100644 --- a/AsbCloudWebApi.Tests/ServicesTests/TelemetryDataSaubServiceTest.cs +++ b/AsbCloudWebApi.Tests/ServicesTests/TelemetryDataSaubServiceTest.cs @@ -40,7 +40,7 @@ namespace AsbCloudWebApi.Tests.ServicesTests .Returns(timezone); context = TestHelpter.MakeRealTestContext(); - telemetryService = new TelemetryService(context, telemetryTracker.Object, timezoneService.Object); + telemetryService = new TelemetryService(context, TestHelpter.MemoryCache, telemetryTracker.Object, timezoneService.Object); telemetryUserService = new TelemetryUserService(context, telemetryService, TestHelpter.MemoryCache); telemetryDataSaubCache = TelemetryDataCache.GetInstance(context, out Task _); var info = new TelemetryInfoDto diff --git a/ConsoleApp1/ServiceFactory.cs b/ConsoleApp1/ServiceFactory.cs index 1dcc9c08..836f975e 100644 --- a/ConsoleApp1/ServiceFactory.cs +++ b/ConsoleApp1/ServiceFactory.cs @@ -53,7 +53,7 @@ namespace ConsoleApp1 public static AsbCloudDbContext MakeContext() => MakeContext(options); - public static IMemoryCache memoryCache = new MemoryCache(new MemoryCacheOptions()); + public static IMemoryCache MemoryCache = new MemoryCache(new MemoryCacheOptions()); public static AsbCloudDbContext MakeContext(DbContextOptions options) => new (options); @@ -65,19 +65,19 @@ namespace ConsoleApp1 => AsbCloudInfrastructure.DependencyInjection.MapsterSetup(); public static TelemetryTracker MakeTelemetryTracker() - => new (ConfigurationService, memoryCache); + => new (ConfigurationService, MemoryCache); public static TelemetryService MakeTelemetryService() - => new (Context, MakeTelemetryTracker(), TimezoneService); + => new (Context, MemoryCache, MakeTelemetryTracker(), TimezoneService); public static WellService MakeWellService() - => new (Context, memoryCache, MakeTelemetryService(), TimezoneService); + => new (Context, MemoryCache, MakeTelemetryService(), TimezoneService); public static WellOperationRepository MakeWellOperationRepository() - => new (Context, memoryCache, MakeWellService()); + => new (Context, MemoryCache, MakeWellService()); public static OperationsStatService MakeOperationsStatService() - => new (Context, memoryCache, MakeWellService()); + => new (Context, MemoryCache, MakeWellService()); public static ScheduleReportService MakeScheduleReportService() => new(MakeOperationsStatService(), MakeWellService()); From 496f8d18fba5ea7e96da62c66e6c94f98e5984b4 Mon Sep 17 00:00:00 2001 From: ngfrolov Date: Wed, 22 Feb 2023 12:53:13 +0500 Subject: [PATCH 13/27] Fix plan trajectory template file path. Remove permissions from plan trajectory. --- .../Services/Trajectory/PlannedTrajectoryImportService.cs | 2 +- AsbCloudWebApi/Controllers/PlannedTrajectoryController.cs | 7 ------- 2 files changed, 1 insertion(+), 8 deletions(-) diff --git a/AsbCloudInfrastructure/Services/Trajectory/PlannedTrajectoryImportService.cs b/AsbCloudInfrastructure/Services/Trajectory/PlannedTrajectoryImportService.cs index 810530d5..859b2ad1 100644 --- a/AsbCloudInfrastructure/Services/Trajectory/PlannedTrajectoryImportService.cs +++ b/AsbCloudInfrastructure/Services/Trajectory/PlannedTrajectoryImportService.cs @@ -22,7 +22,7 @@ namespace AsbCloudInfrastructure.Services.Trajectory private readonly IPlannedTrajectoryRepository plannedTrajectoryService; private const string templateFileName = "PlannedTrajectoryTemplate.xlsx"; - private const string usingTemplateFile = "AsbCloudInfrastructure.Services.PlannedTrajectory"; + private const string usingTemplateFile = "AsbCloudInfrastructure.Services.Trajectory"; private const string sheetNamePlannedTrajectory = "Плановая траектория"; private const int headerRowsCount = 2; private const int ColumnWellboreDepth = 1; diff --git a/AsbCloudWebApi/Controllers/PlannedTrajectoryController.cs b/AsbCloudWebApi/Controllers/PlannedTrajectoryController.cs index f44f1600..df564558 100644 --- a/AsbCloudWebApi/Controllers/PlannedTrajectoryController.cs +++ b/AsbCloudWebApi/Controllers/PlannedTrajectoryController.cs @@ -59,7 +59,6 @@ namespace AsbCloudWebApi.Controllers /// Запрашиваемый файл [HttpGet] [Route("export")] - [Permission] [ProducesResponseType(typeof(PhysicalFileResult), (int)System.Net.HttpStatusCode.OK)] public async Task ExportAsync([FromRoute] int idWell, CancellationToken token = default) { @@ -80,7 +79,6 @@ namespace AsbCloudWebApi.Controllers /// Токен отмены задачи /// количество успешно записанных строк в БД [HttpPost] - [Permission] [Route("import/{deleteBeforeImport}")] [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] public async Task ImportAsync(int idWell, @@ -120,7 +118,6 @@ namespace AsbCloudWebApi.Controllers /// Список добавленных координат плановой траектории [HttpGet] [Route("getRows")] - [Permission] [ProducesResponseType(typeof(IEnumerable), (int)System.Net.HttpStatusCode.OK)] public async Task GetAsync([FromRoute] int idWell, CancellationToken token = default) { @@ -140,7 +137,6 @@ namespace AsbCloudWebApi.Controllers /// количество успешно записанных строк в БД [HttpPost] [Route("addRow")] - [Permission] [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] public async Task AddAsync(int idWell, [FromBody] PlannedTrajectoryDto row, CancellationToken token = default) @@ -165,7 +161,6 @@ namespace AsbCloudWebApi.Controllers /// количество успешно записанных строк в БД [HttpPost] [Route("addRangeRows")] - [Permission] [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] public async Task AddRangeAsync(int idWell, [FromBody] IEnumerable rows, CancellationToken token = default) @@ -193,7 +188,6 @@ namespace AsbCloudWebApi.Controllers /// /// количество успешно обновленных строк в БД [HttpPut("{idRow}")] - [Permission] [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] public async Task UpdateAsync(int idWell, int idRow, [FromBody] PlannedTrajectoryDto row, CancellationToken token = default) @@ -218,7 +212,6 @@ namespace AsbCloudWebApi.Controllers /// /// количество успешно удаленных строк из БД [HttpDelete("{idRow}")] - [Permission] [ProducesResponseType(typeof(int), (int)System.Net.HttpStatusCode.OK)] public async Task DeleteAsync(int idWell, int idRow, CancellationToken token = default) { From 2b84cd5b8f6eb41920f1f4085460a7a06c966d73 Mon Sep 17 00:00:00 2001 From: ngfrolov Date: Wed, 22 Feb 2023 15:00:43 +0500 Subject: [PATCH 14/27] Tests Add extension method to replace services in webhost --- AsbCloudWebApi.Tests/AspExtentions.cs | 19 ++++++++ .../UserConnectionsLimitMiddlwareTest.cs | 47 ++++++++++--------- 2 files changed, 43 insertions(+), 23 deletions(-) create mode 100644 AsbCloudWebApi.Tests/AspExtentions.cs diff --git a/AsbCloudWebApi.Tests/AspExtentions.cs b/AsbCloudWebApi.Tests/AspExtentions.cs new file mode 100644 index 00000000..62f0cbf7 --- /dev/null +++ b/AsbCloudWebApi.Tests/AspExtentions.cs @@ -0,0 +1,19 @@ +using Microsoft.Extensions.DependencyInjection; +using System.Linq; + +namespace AsbCloudWebApi.Tests +{ + public static class AspExtentions + { + public static IServiceCollection ReplaceService(this IServiceCollection services, T instance) + where T : notnull + { + var typeofT = typeof(T); + var originalDecriptor = services.Last(s => s.ServiceType == typeofT); + var newDecriptor = new ServiceDescriptor(typeofT, instance); + services.Remove(originalDecriptor); + services.Add(newDecriptor); + return services; + } + } +} diff --git a/AsbCloudWebApi.Tests/Middlware/UserConnectionsLimitMiddlwareTest.cs b/AsbCloudWebApi.Tests/Middlware/UserConnectionsLimitMiddlwareTest.cs index 9b2c99a7..7c2166be 100644 --- a/AsbCloudWebApi.Tests/Middlware/UserConnectionsLimitMiddlwareTest.cs +++ b/AsbCloudWebApi.Tests/Middlware/UserConnectionsLimitMiddlwareTest.cs @@ -1,7 +1,14 @@ -using Microsoft.AspNetCore.Hosting; +using AsbCloudApp.Data.SAUB; +using AsbCloudApp.Services; +using Microsoft.AspNetCore.Hosting; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Hosting; using System; +using System.Collections.Generic; +using System.Linq; using System.Net.Http; +using System.Threading; using System.Threading.Tasks; using Xunit; @@ -11,27 +18,6 @@ namespace AsbCloudWebApi.Tests.Middlware { const int iterations2Block = 8; - //Данные в тестовой БД - //select - // tw.id, - // t_stat.minDate, - // t_stat.maxDate - //from( - // select - - // id_telemetry, - // count(1) as count, - // min("date") as minDate, - // max("date") as maxDate - - // from t_telemetry_data_saub - - // group by id_telemetry - //) as t_stat - //join t_well tw on tw.id_telemetry = t_stat.id_telemetry - //where tw is not null - //order by t_stat.count - //limit 10; private readonly (int, DateTime, DateTime)[] wells = new[] { (191, new DateTime(2022, 09, 01, 21, 43, 00, DateTimeKind.Utc), new DateTime(2022, 09, 04, 07, 37, 31, DateTimeKind.Utc)), @@ -46,12 +32,28 @@ namespace AsbCloudWebApi.Tests.Middlware (112, new DateTime(2022, 04, 20, 16, 47, 51, DateTimeKind.Utc), new DateTime(2022, 04, 28, 15, 04, 33, DateTimeKind.Utc)), }; + public class TelemetryDataSaubService : ITelemetryDataSaubService + { + public async Task?> GetOrDefaultAsync(int idWell, DateTime dateBegin = default, double intervalSec = 600, int approxPointsCount = 1024, CancellationToken token = default) + { + await Task.Delay(1000, token); + return Enumerable.Empty(); + } + + public Task> GetTelemetryDataStatAsync(int idTelemetry, CancellationToken token) => throw new NotImplementedException(); + + public Task UpdateDataAsync(string uid, IEnumerable dtos, CancellationToken token) => throw new NotImplementedException(); + } + public UserConnectionsLimitMiddlwareTest() { var host = Host.CreateDefaultBuilder(Array.Empty()) .ConfigureWebHostDefaults(webBuilder => { webBuilder.UseStartup(); + webBuilder.ConfigureServices(serviceCollection => { + serviceCollection.ReplaceService(new TelemetryDataSaubService()); + }); }) .Build(); host.Start(); @@ -67,7 +69,6 @@ namespace AsbCloudWebApi.Tests.Middlware var well = wells[i]; var url = MakeUrl(well.Item1, well.Item2, well.Item3); var response = await MakeHttpClient().GetAsync(url); - //await response.Content.ReadAsStringAsync(); await Task.Delay(1000); }); From ad5ac0007911364e34b5390665c38da0104245c0 Mon Sep 17 00:00:00 2001 From: "ai.astrakhantsev" Date: Wed, 22 Feb 2023 15:03:15 +0500 Subject: [PATCH 15/27] #9156004 MapPointBaseDto, HeadDto, MeasureDto, MessageDto, MinMaxDto, MinMaxExtendedViewDto, PermissionDto, PlanFactPredictBase, PlannedTrajectoryDto --- AsbCloudApp/Data/DailyReport/HeadDto.cs | 4 ++-- AsbCloudApp/Data/MapPointBaseDto.cs | 4 ++-- AsbCloudApp/Data/MeasureDto.cs | 1 - AsbCloudApp/Data/MessageDto.cs | 4 ++-- AsbCloudApp/Data/MinMaxDto.cs | 2 -- AsbCloudApp/Data/MinMaxExtendedViewDto.cs | 2 -- AsbCloudApp/Data/PermissionDto.cs | 1 - AsbCloudApp/Data/PlanFactPredictBase.cs | 6 +++--- AsbCloudApp/Data/PlannedTrajectoryDto.cs | 2 -- 9 files changed, 9 insertions(+), 17 deletions(-) diff --git a/AsbCloudApp/Data/DailyReport/HeadDto.cs b/AsbCloudApp/Data/DailyReport/HeadDto.cs index d94674dc..400d8211 100644 --- a/AsbCloudApp/Data/DailyReport/HeadDto.cs +++ b/AsbCloudApp/Data/DailyReport/HeadDto.cs @@ -9,12 +9,12 @@ namespace AsbCloudApp.Data.DailyReport /// /// название скважины /// - public string WellName { get; set; } = null!; + public string WellName { get; set; } = string.Empty; /// /// название куста /// - public string ClusterName { get; set; } = null!; + public string ClusterName { get; set; } = string.Empty; /// /// заказчик diff --git a/AsbCloudApp/Data/MapPointBaseDto.cs b/AsbCloudApp/Data/MapPointBaseDto.cs index f23f0299..f4580983 100644 --- a/AsbCloudApp/Data/MapPointBaseDto.cs +++ b/AsbCloudApp/Data/MapPointBaseDto.cs @@ -11,7 +11,7 @@ /// /// Название /// - public string Caption { get; set; } + public string Caption { get; set; } = string.Empty; /// public double? Latitude { get; set; } @@ -20,6 +20,6 @@ public double? Longitude { get; set; } /// - public SimpleTimezoneDto Timezone { get; set; } + public SimpleTimezoneDto Timezone { get; set; } = null!; } } diff --git a/AsbCloudApp/Data/MeasureDto.cs b/AsbCloudApp/Data/MeasureDto.cs index 9f3bb2e0..b19abdcc 100644 --- a/AsbCloudApp/Data/MeasureDto.cs +++ b/AsbCloudApp/Data/MeasureDto.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; namespace AsbCloudApp.Data { -#nullable enable /// /// инфо о результатах замера /// diff --git a/AsbCloudApp/Data/MessageDto.cs b/AsbCloudApp/Data/MessageDto.cs index 31c9a794..a8b982c2 100644 --- a/AsbCloudApp/Data/MessageDto.cs +++ b/AsbCloudApp/Data/MessageDto.cs @@ -28,11 +28,11 @@ namespace AsbCloudApp.Data /// /// пользователь панели оператора /// - public string User { get; set; } + public string User { get; set; } = null!; /// /// текст сообщения /// - public string Message { get; set; } + public string Message { get; set; } = string.Empty; } } diff --git a/AsbCloudApp/Data/MinMaxDto.cs b/AsbCloudApp/Data/MinMaxDto.cs index 291574bc..f3c076d4 100644 --- a/AsbCloudApp/Data/MinMaxDto.cs +++ b/AsbCloudApp/Data/MinMaxDto.cs @@ -6,7 +6,6 @@ using System.Threading.Tasks; namespace AsbCloudApp.Data { -#nullable enable /// /// Минимальное и максимальное значение /// @@ -22,5 +21,4 @@ namespace AsbCloudApp.Data /// public T? Max { get; set; } } -#nullable disable } diff --git a/AsbCloudApp/Data/MinMaxExtendedViewDto.cs b/AsbCloudApp/Data/MinMaxExtendedViewDto.cs index cb66e60d..4b4df0fc 100644 --- a/AsbCloudApp/Data/MinMaxExtendedViewDto.cs +++ b/AsbCloudApp/Data/MinMaxExtendedViewDto.cs @@ -6,7 +6,6 @@ using System.Threading.Tasks; namespace AsbCloudApp.Data { -#nullable enable /// /// Расширение для класса MinMaxDto /// @@ -27,5 +26,4 @@ namespace AsbCloudApp.Data /// public bool IsMin { get; set; } } -#nullable disable } diff --git a/AsbCloudApp/Data/PermissionDto.cs b/AsbCloudApp/Data/PermissionDto.cs index b4a07de3..f4d02a2e 100644 --- a/AsbCloudApp/Data/PermissionDto.cs +++ b/AsbCloudApp/Data/PermissionDto.cs @@ -1,6 +1,5 @@ namespace AsbCloudApp.Data { -#nullable enable /// /// Разрешение для группы пользователей сделать что-либо через web-api.
/// применяется как возможность доступа к Endpoint.
diff --git a/AsbCloudApp/Data/PlanFactPredictBase.cs b/AsbCloudApp/Data/PlanFactPredictBase.cs index 2147aa7f..636e0620 100644 --- a/AsbCloudApp/Data/PlanFactPredictBase.cs +++ b/AsbCloudApp/Data/PlanFactPredictBase.cs @@ -8,16 +8,16 @@ /// /// плановое значение /// - public T Plan { get; set; } + public T? Plan { get; set; } /// /// фактическое значение /// - public T Fact { get; set; } + public T? Fact { get; set; } /// /// предсказанное значение /// - public T Predict { get; set; } + public T? Predict { get; set; } } } diff --git a/AsbCloudApp/Data/PlannedTrajectoryDto.cs b/AsbCloudApp/Data/PlannedTrajectoryDto.cs index cf36bc6b..b1e34ba2 100644 --- a/AsbCloudApp/Data/PlannedTrajectoryDto.cs +++ b/AsbCloudApp/Data/PlannedTrajectoryDto.cs @@ -1,7 +1,6 @@ using System; namespace AsbCloudApp.Data { -#nullable enable /// /// Формирование данных по плановой траектории /// @@ -99,6 +98,5 @@ namespace AsbCloudApp.Data ///
public string? Comment { get; set; } } -#nullable disable } From cd130264c43028404b2c683b9b371e645c0a1c2a Mon Sep 17 00:00:00 2001 From: ngfrolov Date: Wed, 22 Feb 2023 15:06:18 +0500 Subject: [PATCH 16/27] remove wrong test --- .../ServicesTests/ScheduleServiceTest.cs | 146 ------------------ 1 file changed, 146 deletions(-) delete mode 100644 AsbCloudWebApi.Tests/ServicesTests/ScheduleServiceTest.cs diff --git a/AsbCloudWebApi.Tests/ServicesTests/ScheduleServiceTest.cs b/AsbCloudWebApi.Tests/ServicesTests/ScheduleServiceTest.cs deleted file mode 100644 index ff009dea..00000000 --- a/AsbCloudWebApi.Tests/ServicesTests/ScheduleServiceTest.cs +++ /dev/null @@ -1,146 +0,0 @@ -using AsbCloudApp.Data; -using AsbCloudApp.Services; -using AsbCloudDb.Model; -using AsbCloudInfrastructure.Repository; -using Moq; -using System; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using Xunit; - -namespace AsbCloudWebApi.Tests.ServicesTests -{ - public class ScheduleServiceTest - { - private readonly AsbCloudDbContext context; - private readonly ScheduleRepository scheduleService; - private Deposit deposit = new Deposit { Id = 1, Caption = "Депозит 1" }; - private Cluster clater = new Cluster { Id = 1, Caption = "Кластер 1", IdDeposit = 1, Timezone = new SimpleTimezone() }; - private Schedule scd = new Schedule - { - Id = 1, - IdWell = 1, - IdDriller = 1, - ShiftStart = new TimeOnly(10, 00), - ShiftEnd = new TimeOnly(18, 00), - DrillStart = DateTimeOffset.Parse("2022-05-16T10:00:00.286Z"), - DrillEnd = DateTimeOffset.Parse("2022-05-16T18:00:00.286Z") - }; - - private ScheduleDto MakeScheduleDto(ScheduleDto? dto = null) - { - return new ScheduleDto - { - IdWell = dto?.IdWell ?? 1, - IdDriller = dto?.IdDriller ?? 1, - //ShiftStart = dto?.ShiftStart ?? new TimeOnly(10, 00), - //ShiftEnd = dto?.ShiftEnd ?? new TimeOnly(18, 00), - DrillStart = dto?.DrillStart ?? DateTime.Parse("2022-05-16T10:00:00.286Z"), - DrillEnd = dto?.DrillEnd ?? DateTime.Parse("2022-05-16T18:00:00.286Z") - }; - } - - private Well well = new Well - { - Id = 1, - Caption = "Test well 1", - IdCluster = 1, - Timezone = new SimpleTimezone { Hours = 5 } - }; - private Driller driller = new Driller - { - Id = 1, - Name = "Тестовый", - Patronymic = "Тест", - Surname = "Тестович" - }; - - public ScheduleServiceTest() - { - context = TestHelpter.MakeRealTestContext(); - context.SaveChanges(); - - context.Deposits.Add(deposit); - context.Clusters.Add(clater); - context.Wells.Add(well); - context.Drillers.Add(driller); - - context.SaveChanges(); - - var timezone = new SimpleTimezoneDto { Hours = 5 }; - var wellServiceMock = new Mock(); - wellServiceMock.Setup(s => s.GetTimezone(It.IsAny())).Returns(timezone); - scheduleService = new ScheduleRepository(context, wellServiceMock.Object); - AsbCloudInfrastructure.DependencyInjection.MapsterSetup(); - } - - ~ScheduleServiceTest() - { - } - - [Fact] - public async Task GetListAsync_count() - { - var id = await scheduleService.InsertAsync(MakeScheduleDto(), CancellationToken.None); - id = await scheduleService.InsertAsync(MakeScheduleDto(), CancellationToken.None); - id = await scheduleService.InsertAsync(MakeScheduleDto(), CancellationToken.None); - - var newCount = (await scheduleService.GetAllAsync(CancellationToken.None)).Count(); - Assert.Equal(3, newCount); - } - - [Fact] - public async Task InsertAsync_returns_id() - { - var id = await scheduleService.InsertAsync(MakeScheduleDto(), CancellationToken.None); - Assert.NotEqual(0, id); - } - - [Fact] - public async Task UpdateAsync_not_add_if_exists() - { - context.Schedule.Add(scd); - var oldCount = (await scheduleService.GetAllAsync(CancellationToken.None)).Count(); - - var dto = MakeScheduleDto(); - dto.Id = 1; - dto.DrillEnd = dto.DrillEnd.AddHours(-3); - await scheduleService.UpdateAsync(dto, CancellationToken.None); - var newCount = (await scheduleService.GetAllAsync(CancellationToken.None)).Count(); - Assert.Equal(newCount, oldCount); - } - - [Fact] - public async Task GetDriller_by_workTime_shift1() - { - var dto = MakeScheduleDto(); - dto.ShiftStart = new TimeDto(8, 00); - dto.ShiftEnd = new TimeDto(20, 00); - var id = await scheduleService.InsertAsync(dto, CancellationToken.None); - var drillerWorkTime = new DateTime( - dto.DrillStart.Year, - dto.DrillStart.Month, - dto.DrillStart.Day, - 16, 1, 0, DateTimeKind.Unspecified); - var res = await scheduleService.GetDrillerAsync(well.Id, drillerWorkTime, CancellationToken.None); - Assert.Equal(id, res?.Id); - } - - [Fact] - public async Task GetDriller_by_workTime_shift2() - { - var dto = MakeScheduleDto(); - dto.ShiftStart = new TimeDto(20, 00); - dto.ShiftEnd = new TimeDto(8, 00); - var id = await scheduleService.InsertAsync(dto, CancellationToken.None); - var drillerWorkTime = new DateTime( - dto.DrillStart.Year, - dto.DrillStart.Month, - dto.DrillStart.Day, - 20, 1, 0, DateTimeKind.Unspecified); - var res = await scheduleService.GetDrillerAsync(well.Id, drillerWorkTime, CancellationToken.None); - Assert.Equal(id, res?.Id); - } - } -} From bc35e187038838881f52367c7ab5f4b1f789833f Mon Sep 17 00:00:00 2001 From: ngfrolov Date: Wed, 22 Feb 2023 15:31:16 +0500 Subject: [PATCH 17/27] fix nullable --- AsbCloudApp/Data/MapPointBaseDto.cs | 2 +- AsbCloudApp/Data/MessageDto.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/AsbCloudApp/Data/MapPointBaseDto.cs b/AsbCloudApp/Data/MapPointBaseDto.cs index f4580983..2a3a7ff0 100644 --- a/AsbCloudApp/Data/MapPointBaseDto.cs +++ b/AsbCloudApp/Data/MapPointBaseDto.cs @@ -11,7 +11,7 @@ /// /// Название /// - public string Caption { get; set; } = string.Empty; + public string Caption { get; set; } = null!; /// public double? Latitude { get; set; } diff --git a/AsbCloudApp/Data/MessageDto.cs b/AsbCloudApp/Data/MessageDto.cs index a8b982c2..b8d930c5 100644 --- a/AsbCloudApp/Data/MessageDto.cs +++ b/AsbCloudApp/Data/MessageDto.cs @@ -28,7 +28,7 @@ namespace AsbCloudApp.Data /// /// пользователь панели оператора /// - public string User { get; set; } = null!; + public string? User { get; set; } /// /// текст сообщения From 1e86c24258d4d50b270a2fb7fd5b0a505a932917 Mon Sep 17 00:00:00 2001 From: ngfrolov Date: Wed, 22 Feb 2023 17:10:29 +0500 Subject: [PATCH 18/27] Fix comparators implementation and revise some dtos --- AsbCloudApp/Comparators/ComparerIId.cs | 16 ++++++---------- .../Comparators/TelemetryUserDtoComparer.cs | 10 ++++------ AsbCloudApp/Data/ReportProgressDto.cs | 2 +- AsbCloudApp/Data/ReportPropertiesDto.cs | 1 - AsbCloudApp/Data/RequestLogDto.cs | 2 -- AsbCloudApp/Data/RequestLogUserDto.cs | 2 -- AsbCloudApp/Data/ScheduleDto.cs | 6 +++--- AsbCloudApp/Data/SimpleTimezoneDto.cs | 1 - AsbCloudApp/Data/StatClusterDto.cs | 5 +++-- AsbCloudApp/Data/StatSectionDto.cs | 2 +- AsbCloudApp/Data/StatWellDto.cs | 13 +++++++------ AsbCloudApp/Data/TelemetryDto.cs | 8 ++++---- AsbCloudApp/Data/TimeDto.cs | 6 +++--- 13 files changed, 32 insertions(+), 42 deletions(-) diff --git a/AsbCloudApp/Comparators/ComparerIId.cs b/AsbCloudApp/Comparators/ComparerIId.cs index 93b0d91a..4c02af80 100644 --- a/AsbCloudApp/Comparators/ComparerIId.cs +++ b/AsbCloudApp/Comparators/ComparerIId.cs @@ -25,12 +25,8 @@ namespace AsbCloudApp.Comparators /// /// public int Compare(IId? x, IId? y) - { - if (x is null || y is null) - return 0; - else - return x.Id.CompareTo(y.Id); - } + => (x?.Id??0).CompareTo(y?.Id??0); + /// /// @@ -39,11 +35,11 @@ namespace AsbCloudApp.Comparators /// /// public bool Equals(IId? x, IId? y) - { - if (x is null || y is null) - return false; - else + { + if (x is not null && y is not null) return x.Id == y.Id; + + return x == y; } /// diff --git a/AsbCloudApp/Comparators/TelemetryUserDtoComparer.cs b/AsbCloudApp/Comparators/TelemetryUserDtoComparer.cs index eac2d83d..2c8035ed 100644 --- a/AsbCloudApp/Comparators/TelemetryUserDtoComparer.cs +++ b/AsbCloudApp/Comparators/TelemetryUserDtoComparer.cs @@ -9,12 +9,10 @@ namespace AsbCloudApp.Comparators /// public bool Equals(TelemetryUserDto? prevUser, TelemetryUserDto? nextUser) { - if (prevUser is null || nextUser is null) - return false; - else if (prevUser.Id == nextUser.Id) - return true; - else - return false; + if (prevUser is not null && nextUser is not null) + return prevUser.Id == nextUser.Id; + + return prevUser == nextUser; } /// diff --git a/AsbCloudApp/Data/ReportProgressDto.cs b/AsbCloudApp/Data/ReportProgressDto.cs index 6a3caa51..c7bf4cbb 100644 --- a/AsbCloudApp/Data/ReportProgressDto.cs +++ b/AsbCloudApp/Data/ReportProgressDto.cs @@ -13,7 +13,7 @@ /// /// название текущей операции генерации /// - public string Operation { get; set; } + public string? Operation { get; set; } /// /// номер текущей страницы diff --git a/AsbCloudApp/Data/ReportPropertiesDto.cs b/AsbCloudApp/Data/ReportPropertiesDto.cs index e8527d90..217f7598 100644 --- a/AsbCloudApp/Data/ReportPropertiesDto.cs +++ b/AsbCloudApp/Data/ReportPropertiesDto.cs @@ -2,7 +2,6 @@ namespace AsbCloudApp.Data { -#nullable enable /// /// DTO формирования рапорта /// diff --git a/AsbCloudApp/Data/RequestLogDto.cs b/AsbCloudApp/Data/RequestLogDto.cs index eb3231c0..ecdb183e 100644 --- a/AsbCloudApp/Data/RequestLogDto.cs +++ b/AsbCloudApp/Data/RequestLogDto.cs @@ -2,7 +2,6 @@ namespace AsbCloudApp.Data { -#nullable enable /// /// DTO журнала запросов /// @@ -63,5 +62,4 @@ namespace AsbCloudApp.Data /// public string? ExceptionStack { get; set; } = null!; } -#nullable disable } \ No newline at end of file diff --git a/AsbCloudApp/Data/RequestLogUserDto.cs b/AsbCloudApp/Data/RequestLogUserDto.cs index bd39eaef..3f5d6a39 100644 --- a/AsbCloudApp/Data/RequestLogUserDto.cs +++ b/AsbCloudApp/Data/RequestLogUserDto.cs @@ -2,7 +2,6 @@ namespace AsbCloudApp.Data { -#nullable enable /// /// DTO статистики запросов по пользователю /// @@ -48,5 +47,4 @@ namespace AsbCloudApp.Data /// public UserDto User { get; set; } = null!; } -#nullable disable } diff --git a/AsbCloudApp/Data/ScheduleDto.cs b/AsbCloudApp/Data/ScheduleDto.cs index 00fb51bb..cd0175b1 100644 --- a/AsbCloudApp/Data/ScheduleDto.cs +++ b/AsbCloudApp/Data/ScheduleDto.cs @@ -21,12 +21,12 @@ namespace AsbCloudApp.Data /// /// Начало смены /// - public TimeDto ShiftStart { get; set; } + public TimeDto ShiftStart { get; set; } = null!; /// /// Конец смены /// - public TimeDto ShiftEnd { get; set; } + public TimeDto ShiftEnd { get; set; } = null!; /// /// Начало бурения @@ -41,6 +41,6 @@ namespace AsbCloudApp.Data /// /// Бурильщик /// - public DrillerDto Driller { get; set; } + public DrillerDto? Driller { get; set; } } } diff --git a/AsbCloudApp/Data/SimpleTimezoneDto.cs b/AsbCloudApp/Data/SimpleTimezoneDto.cs index 100ede09..3ec75814 100644 --- a/AsbCloudApp/Data/SimpleTimezoneDto.cs +++ b/AsbCloudApp/Data/SimpleTimezoneDto.cs @@ -1,6 +1,5 @@ namespace AsbCloudApp.Data { -#nullable enable /// /// /// diff --git a/AsbCloudApp/Data/StatClusterDto.cs b/AsbCloudApp/Data/StatClusterDto.cs index 0bcbfe65..db768ab1 100644 --- a/AsbCloudApp/Data/StatClusterDto.cs +++ b/AsbCloudApp/Data/StatClusterDto.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Linq; namespace AsbCloudApp.Data { @@ -13,11 +14,11 @@ namespace AsbCloudApp.Data /// /// название куста /// - public string Caption { get; set; } + public string Caption { get; set; } = string.Empty; /// /// список статистик скважин куста /// - public IEnumerable StatsWells { get; set; } + public IEnumerable StatsWells { get; set; } = Enumerable.Empty(); } } diff --git a/AsbCloudApp/Data/StatSectionDto.cs b/AsbCloudApp/Data/StatSectionDto.cs index f0da2188..58fff71b 100644 --- a/AsbCloudApp/Data/StatSectionDto.cs +++ b/AsbCloudApp/Data/StatSectionDto.cs @@ -11,6 +11,6 @@ /// /// название секции /// - public string Caption { get; set; } + public string Caption { get; set; } = string.Empty; } } diff --git a/AsbCloudApp/Data/StatWellDto.cs b/AsbCloudApp/Data/StatWellDto.cs index 08581313..9793e858 100644 --- a/AsbCloudApp/Data/StatWellDto.cs +++ b/AsbCloudApp/Data/StatWellDto.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Linq; namespace AsbCloudApp.Data { @@ -14,12 +15,12 @@ namespace AsbCloudApp.Data /// /// название /// - public string Caption { get; set; } + public string Caption { get; set; } = string.Empty; /// /// тип скважины /// - public string WellType { get; set; } + public string WellType { get; set; } = string.Empty; /// /// ИД состояния скважины @@ -29,7 +30,7 @@ namespace AsbCloudApp.Data /// /// текст состояния скважины /// - public string State { get; set; } + public string State { get; set; } = string.Empty; /// /// дата прихода последней телеметрии @@ -39,16 +40,16 @@ namespace AsbCloudApp.Data /// /// Статистика по секциям /// - public IEnumerable Sections { get; set; } + public IEnumerable Sections { get; set; } = Enumerable.Empty(); /// /// статистика за всю скважину /// - public PlanFactBase Total { get; set; } + public PlanFactBase Total { get; set; } = new(); /// /// компании участвующие в строительстве скважины /// - public IEnumerable Companies { get; set; } + public IEnumerable Companies { get; set; } = Enumerable.Empty(); } } diff --git a/AsbCloudApp/Data/TelemetryDto.cs b/AsbCloudApp/Data/TelemetryDto.cs index d71afdd4..d243c749 100644 --- a/AsbCloudApp/Data/TelemetryDto.cs +++ b/AsbCloudApp/Data/TelemetryDto.cs @@ -9,16 +9,16 @@ namespace AsbCloudApp.Data { /// public int Id { get; set; } - + /// /// уникальный идентификатор телеметрии по которому панель оператора присылает данные /// - public string RemoteUid { get; set; } + public string RemoteUid { get; set; } = null!; /// /// информация о бурении, панели оператора и контроллерах /// - public TelemetryInfoDto Info { get; set; } + public TelemetryInfoDto? Info { get; set; } } /// @@ -34,6 +34,6 @@ namespace AsbCloudApp.Data /// /// DTO скважины /// - public WellInfoDto Well { get; set; } + public WellInfoDto? Well { get; set; } } } diff --git a/AsbCloudApp/Data/TimeDto.cs b/AsbCloudApp/Data/TimeDto.cs index faf99427..6a3620f2 100644 --- a/AsbCloudApp/Data/TimeDto.cs +++ b/AsbCloudApp/Data/TimeDto.cs @@ -118,11 +118,11 @@ namespace AsbCloudApp.Data public static bool operator >(TimeDto a, TimeDto b) => a.TotalSeconds > b.TotalSeconds; /// - public int CompareTo(TimeDto other) - => TotalSeconds - other.TotalSeconds; + public int CompareTo(TimeDto? other) + => TotalSeconds - other?.TotalSeconds??0; /// - public override bool Equals(object obj) + public override bool Equals(object? obj) { if (ReferenceEquals(this, obj)) { From 9410c55b8dc561fea2b379d0190e8c39438ff08f Mon Sep 17 00:00:00 2001 From: "ai.astrakhantsev" Date: Fri, 24 Feb 2023 14:37:57 +0500 Subject: [PATCH 19/27] #9156004 CompanyDto, ReportProgressDto, ScheduleDto, StatClusterDto, StatSectionDto, StatWellDto, TelemetryBaseDto --- AsbCloudApp/Data/ReportProgressDto.cs | 2 +- AsbCloudApp/Data/ScheduleDto.cs | 6 +++--- AsbCloudApp/Data/StatClusterDto.cs | 5 +++-- AsbCloudApp/Data/StatSectionDto.cs | 2 +- AsbCloudApp/Data/StatWellDto.cs | 13 +++++++------ AsbCloudApp/Data/TelemetryDto.cs | 8 ++++---- 6 files changed, 19 insertions(+), 17 deletions(-) diff --git a/AsbCloudApp/Data/ReportProgressDto.cs b/AsbCloudApp/Data/ReportProgressDto.cs index 6a3caa51..b1c15479 100644 --- a/AsbCloudApp/Data/ReportProgressDto.cs +++ b/AsbCloudApp/Data/ReportProgressDto.cs @@ -13,7 +13,7 @@ /// /// название текущей операции генерации /// - public string Operation { get; set; } + public string Operation { get; set; } = string.Empty; /// /// номер текущей страницы diff --git a/AsbCloudApp/Data/ScheduleDto.cs b/AsbCloudApp/Data/ScheduleDto.cs index 00fb51bb..8e071492 100644 --- a/AsbCloudApp/Data/ScheduleDto.cs +++ b/AsbCloudApp/Data/ScheduleDto.cs @@ -21,12 +21,12 @@ namespace AsbCloudApp.Data /// /// Начало смены /// - public TimeDto ShiftStart { get; set; } + public TimeDto ShiftStart { get; set; } = null!; /// /// Конец смены /// - public TimeDto ShiftEnd { get; set; } + public TimeDto ShiftEnd { get; set; } = null!; /// /// Начало бурения @@ -41,6 +41,6 @@ namespace AsbCloudApp.Data /// /// Бурильщик /// - public DrillerDto Driller { get; set; } + public DrillerDto Driller { get; set; } = null!; } } diff --git a/AsbCloudApp/Data/StatClusterDto.cs b/AsbCloudApp/Data/StatClusterDto.cs index 0bcbfe65..db768ab1 100644 --- a/AsbCloudApp/Data/StatClusterDto.cs +++ b/AsbCloudApp/Data/StatClusterDto.cs @@ -1,4 +1,5 @@ using System.Collections.Generic; +using System.Linq; namespace AsbCloudApp.Data { @@ -13,11 +14,11 @@ namespace AsbCloudApp.Data /// /// название куста /// - public string Caption { get; set; } + public string Caption { get; set; } = string.Empty; /// /// список статистик скважин куста /// - public IEnumerable StatsWells { get; set; } + public IEnumerable StatsWells { get; set; } = Enumerable.Empty(); } } diff --git a/AsbCloudApp/Data/StatSectionDto.cs b/AsbCloudApp/Data/StatSectionDto.cs index f0da2188..58fff71b 100644 --- a/AsbCloudApp/Data/StatSectionDto.cs +++ b/AsbCloudApp/Data/StatSectionDto.cs @@ -11,6 +11,6 @@ /// /// название секции /// - public string Caption { get; set; } + public string Caption { get; set; } = string.Empty; } } diff --git a/AsbCloudApp/Data/StatWellDto.cs b/AsbCloudApp/Data/StatWellDto.cs index 08581313..d2ebe0ae 100644 --- a/AsbCloudApp/Data/StatWellDto.cs +++ b/AsbCloudApp/Data/StatWellDto.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.Linq; namespace AsbCloudApp.Data { @@ -14,12 +15,12 @@ namespace AsbCloudApp.Data /// /// название /// - public string Caption { get; set; } + public string Caption { get; set; } = string.Empty; /// /// тип скважины /// - public string WellType { get; set; } + public string WellType { get; set; } = string.Empty; /// /// ИД состояния скважины @@ -29,7 +30,7 @@ namespace AsbCloudApp.Data /// /// текст состояния скважины /// - public string State { get; set; } + public string State { get; set; } = string.Empty; /// /// дата прихода последней телеметрии @@ -39,16 +40,16 @@ namespace AsbCloudApp.Data /// /// Статистика по секциям /// - public IEnumerable Sections { get; set; } + public IEnumerable Sections { get; set; } = Enumerable.Empty(); /// /// статистика за всю скважину /// - public PlanFactBase Total { get; set; } + public PlanFactBase? Total { get; set; } /// /// компании участвующие в строительстве скважины /// - public IEnumerable Companies { get; set; } + public IEnumerable Companies { get; set; } = Enumerable.Empty(); } } diff --git a/AsbCloudApp/Data/TelemetryDto.cs b/AsbCloudApp/Data/TelemetryDto.cs index d71afdd4..e728a022 100644 --- a/AsbCloudApp/Data/TelemetryDto.cs +++ b/AsbCloudApp/Data/TelemetryDto.cs @@ -9,16 +9,16 @@ namespace AsbCloudApp.Data { /// public int Id { get; set; } - + /// /// уникальный идентификатор телеметрии по которому панель оператора присылает данные /// - public string RemoteUid { get; set; } + public string RemoteUid { get; set; } = null!; /// /// информация о бурении, панели оператора и контроллерах /// - public TelemetryInfoDto Info { get; set; } + public TelemetryInfoDto? Info { get; set; } } /// @@ -34,6 +34,6 @@ namespace AsbCloudApp.Data /// /// DTO скважины /// - public WellInfoDto Well { get; set; } + public WellInfoDto Well { get; set; } = null!; } } From f0ba243afe51fb712ce95a9cbe576c1f501c82a6 Mon Sep 17 00:00:00 2001 From: "ai.astrakhantsev" Date: Mon, 27 Feb 2023 10:02:51 +0500 Subject: [PATCH 20/27] RecordBaseDto, MinMaxExtendedViewDto, MinMaxDto, PlanFactDto, TrajectoryVisualizationDto, UserDto, UserExtendedDto, UserRegistrationDto, UserRoleDto, UserTokenDto, WellCaseDto, WellDto, WellFinalDocumentDBDto, WellFinalDocumentDto, WellFinalDocumentInputDto, WellFinalDocumentsHistoryDto, WellGroupOpertionDto, WellInfoDto, WellMapInfoDto, WellOperationCategoryDto, WellOperationDto --- AsbCloudApp/Data/MinMaxDto.cs | 8 +------- AsbCloudApp/Data/MinMaxExtendedViewDto.cs | 8 +------- AsbCloudApp/Data/PlanFactDto.cs | 8 +------- AsbCloudApp/Data/TrajectoryVisualizationDto.cs | 1 - AsbCloudApp/Data/UserDto.cs | 1 - AsbCloudApp/Data/UserExtendedDto.cs | 1 - AsbCloudApp/Data/UserRegistrationDto.cs | 1 - AsbCloudApp/Data/UserRoleDto.cs | 1 - AsbCloudApp/Data/UserTokenDto.cs | 1 - AsbCloudApp/Data/WITS/RecordBaseDto.cs | 2 +- AsbCloudApp/Data/WellCaseDto.cs | 6 +----- AsbCloudApp/Data/WellDto.cs | 1 - AsbCloudApp/Data/WellFinalDocumentDBDto.cs | 2 -- AsbCloudApp/Data/WellFinalDocumentDto.cs | 2 -- AsbCloudApp/Data/WellFinalDocumentInputDto.cs | 2 -- AsbCloudApp/Data/WellFinalDocumentsHistoryDto.cs | 2 -- AsbCloudApp/Data/WellGroupOpertionDto.cs | 1 - AsbCloudApp/Data/WellInfoDto.cs | 1 - AsbCloudApp/Data/WellMapInfoDto.cs | 2 -- AsbCloudApp/Data/WellOperationCategoryDto.cs | 1 - AsbCloudApp/Data/WellOperationDto.cs | 2 -- 21 files changed, 5 insertions(+), 49 deletions(-) diff --git a/AsbCloudApp/Data/MinMaxDto.cs b/AsbCloudApp/Data/MinMaxDto.cs index f3c076d4..ac2a2aa1 100644 --- a/AsbCloudApp/Data/MinMaxDto.cs +++ b/AsbCloudApp/Data/MinMaxDto.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace AsbCloudApp.Data +namespace AsbCloudApp.Data { /// /// Минимальное и максимальное значение diff --git a/AsbCloudApp/Data/MinMaxExtendedViewDto.cs b/AsbCloudApp/Data/MinMaxExtendedViewDto.cs index 4b4df0fc..9b1b07b5 100644 --- a/AsbCloudApp/Data/MinMaxExtendedViewDto.cs +++ b/AsbCloudApp/Data/MinMaxExtendedViewDto.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace AsbCloudApp.Data +namespace AsbCloudApp.Data { /// /// Расширение для класса MinMaxDto diff --git a/AsbCloudApp/Data/PlanFactDto.cs b/AsbCloudApp/Data/PlanFactDto.cs index ce6a8d61..670ecbcb 100644 --- a/AsbCloudApp/Data/PlanFactDto.cs +++ b/AsbCloudApp/Data/PlanFactDto.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace AsbCloudApp.Data +namespace AsbCloudApp.Data { /// /// Плановое и фактическое значения diff --git a/AsbCloudApp/Data/TrajectoryVisualizationDto.cs b/AsbCloudApp/Data/TrajectoryVisualizationDto.cs index 1deb4fbd..8e47ccd5 100644 --- a/AsbCloudApp/Data/TrajectoryVisualizationDto.cs +++ b/AsbCloudApp/Data/TrajectoryVisualizationDto.cs @@ -1,6 +1,5 @@ namespace AsbCloudApp.Data { -#nullable enable /// /// Визуализация траектории 3D /// diff --git a/AsbCloudApp/Data/UserDto.cs b/AsbCloudApp/Data/UserDto.cs index 455e6110..e988f7e4 100644 --- a/AsbCloudApp/Data/UserDto.cs +++ b/AsbCloudApp/Data/UserDto.cs @@ -2,7 +2,6 @@ namespace AsbCloudApp.Data { -#nullable enable /// /// DTO пользователя платформы /// diff --git a/AsbCloudApp/Data/UserExtendedDto.cs b/AsbCloudApp/Data/UserExtendedDto.cs index 80361a45..8585532c 100644 --- a/AsbCloudApp/Data/UserExtendedDto.cs +++ b/AsbCloudApp/Data/UserExtendedDto.cs @@ -3,7 +3,6 @@ using System.Linq; namespace AsbCloudApp.Data { -#nullable enable /// public class UserExtendedDto : UserDto { diff --git a/AsbCloudApp/Data/UserRegistrationDto.cs b/AsbCloudApp/Data/UserRegistrationDto.cs index cf68b147..b919f9cf 100644 --- a/AsbCloudApp/Data/UserRegistrationDto.cs +++ b/AsbCloudApp/Data/UserRegistrationDto.cs @@ -1,6 +1,5 @@ namespace AsbCloudApp.Data { -#nullable enable /// public class UserRegistrationDto : UserDto { diff --git a/AsbCloudApp/Data/UserRoleDto.cs b/AsbCloudApp/Data/UserRoleDto.cs index 3d0816bf..069db593 100644 --- a/AsbCloudApp/Data/UserRoleDto.cs +++ b/AsbCloudApp/Data/UserRoleDto.cs @@ -4,7 +4,6 @@ using System.Linq; namespace AsbCloudApp.Data { -#nullable enable /// /// Роль пользователя платформы /// diff --git a/AsbCloudApp/Data/UserTokenDto.cs b/AsbCloudApp/Data/UserTokenDto.cs index d63436a1..06016008 100644 --- a/AsbCloudApp/Data/UserTokenDto.cs +++ b/AsbCloudApp/Data/UserTokenDto.cs @@ -3,7 +3,6 @@ using System.Linq; namespace AsbCloudApp.Data { -#nullable enable /// public class UserTokenDto : UserExtendedDto { diff --git a/AsbCloudApp/Data/WITS/RecordBaseDto.cs b/AsbCloudApp/Data/WITS/RecordBaseDto.cs index e5daede1..03d77f47 100644 --- a/AsbCloudApp/Data/WITS/RecordBaseDto.cs +++ b/AsbCloudApp/Data/WITS/RecordBaseDto.cs @@ -34,7 +34,7 @@ namespace AsbCloudApp.Data.WITS /// ValueType = "A" /// - public string Wellid { get; set; } + public string Wellid { get; set; } = string.Empty; /// /// RecordId = 1, diff --git a/AsbCloudApp/Data/WellCaseDto.cs b/AsbCloudApp/Data/WellCaseDto.cs index a572c2f2..046cd0d5 100644 --- a/AsbCloudApp/Data/WellCaseDto.cs +++ b/AsbCloudApp/Data/WellCaseDto.cs @@ -1,12 +1,8 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace AsbCloudApp.Data { -#nullable enable /// /// Дела скважины /// diff --git a/AsbCloudApp/Data/WellDto.cs b/AsbCloudApp/Data/WellDto.cs index 95fb2e82..b5b1ac64 100644 --- a/AsbCloudApp/Data/WellDto.cs +++ b/AsbCloudApp/Data/WellDto.cs @@ -5,7 +5,6 @@ using System.Linq; namespace AsbCloudApp.Data { -#nullable enable /// /// Скважина /// diff --git a/AsbCloudApp/Data/WellFinalDocumentDBDto.cs b/AsbCloudApp/Data/WellFinalDocumentDBDto.cs index 778aa69d..db229147 100644 --- a/AsbCloudApp/Data/WellFinalDocumentDBDto.cs +++ b/AsbCloudApp/Data/WellFinalDocumentDBDto.cs @@ -1,6 +1,5 @@ namespace AsbCloudApp.Data { -#nullable enable /// /// DTO Дело скважины /// @@ -21,5 +20,4 @@ /// public int IdCategory { get; set; } } -#nullable disable } diff --git a/AsbCloudApp/Data/WellFinalDocumentDto.cs b/AsbCloudApp/Data/WellFinalDocumentDto.cs index 6c9df1f5..6fd72407 100644 --- a/AsbCloudApp/Data/WellFinalDocumentDto.cs +++ b/AsbCloudApp/Data/WellFinalDocumentDto.cs @@ -3,7 +3,6 @@ using System.Linq; namespace AsbCloudApp.Data { -#nullable enable /// /// DTO Документ дела скважины /// @@ -39,5 +38,4 @@ namespace AsbCloudApp.Data /// public FileInfoDto? File { get; set; } } -#nullable disable } diff --git a/AsbCloudApp/Data/WellFinalDocumentInputDto.cs b/AsbCloudApp/Data/WellFinalDocumentInputDto.cs index 967d2540..80052e5c 100644 --- a/AsbCloudApp/Data/WellFinalDocumentInputDto.cs +++ b/AsbCloudApp/Data/WellFinalDocumentInputDto.cs @@ -3,7 +3,6 @@ using System.Linq; namespace AsbCloudApp.Data { -#nullable enable /// /// DTO Для сохранения категорий дела скважины /// @@ -19,5 +18,4 @@ namespace AsbCloudApp.Data /// public IEnumerable IdsPublishers { get; set; } = Enumerable.Empty(); } -#nullable disable } diff --git a/AsbCloudApp/Data/WellFinalDocumentsHistoryDto.cs b/AsbCloudApp/Data/WellFinalDocumentsHistoryDto.cs index f7887b25..789dc9c0 100644 --- a/AsbCloudApp/Data/WellFinalDocumentsHistoryDto.cs +++ b/AsbCloudApp/Data/WellFinalDocumentsHistoryDto.cs @@ -2,7 +2,6 @@ namespace AsbCloudApp.Data { -#nullable enable /// /// DTO Дело скважины, история файлов /// @@ -23,5 +22,4 @@ namespace AsbCloudApp.Data /// public IEnumerable Files { get; set; } = null!; } -#nullable disable } diff --git a/AsbCloudApp/Data/WellGroupOpertionDto.cs b/AsbCloudApp/Data/WellGroupOpertionDto.cs index 9100a21b..582d03ec 100644 --- a/AsbCloudApp/Data/WellGroupOpertionDto.cs +++ b/AsbCloudApp/Data/WellGroupOpertionDto.cs @@ -2,7 +2,6 @@ using System.Text.Json.Serialization; namespace AsbCloudApp.Data; -#nullable enable /// /// Модель группированных операций по скважине /// diff --git a/AsbCloudApp/Data/WellInfoDto.cs b/AsbCloudApp/Data/WellInfoDto.cs index ff245604..bb1128b2 100644 --- a/AsbCloudApp/Data/WellInfoDto.cs +++ b/AsbCloudApp/Data/WellInfoDto.cs @@ -2,7 +2,6 @@ namespace AsbCloudApp.Data { -#nullable enable /// /// базовая информация о скважине /// diff --git a/AsbCloudApp/Data/WellMapInfoDto.cs b/AsbCloudApp/Data/WellMapInfoDto.cs index 392d1877..aead2677 100644 --- a/AsbCloudApp/Data/WellMapInfoDto.cs +++ b/AsbCloudApp/Data/WellMapInfoDto.cs @@ -2,7 +2,6 @@ namespace AsbCloudApp.Data { -#nullable enable /// /// Инфо о скважине для отображения на карте /// @@ -50,5 +49,4 @@ namespace AsbCloudApp.Data /// public double SpinUsage { get; set; } } -#nullable disable } diff --git a/AsbCloudApp/Data/WellOperationCategoryDto.cs b/AsbCloudApp/Data/WellOperationCategoryDto.cs index fe8212bc..37a5178b 100644 --- a/AsbCloudApp/Data/WellOperationCategoryDto.cs +++ b/AsbCloudApp/Data/WellOperationCategoryDto.cs @@ -2,7 +2,6 @@ namespace AsbCloudApp.Data { -#nullable enable /// /// DTO категория операции /// diff --git a/AsbCloudApp/Data/WellOperationDto.cs b/AsbCloudApp/Data/WellOperationDto.cs index 4bed0b54..de3ee4de 100644 --- a/AsbCloudApp/Data/WellOperationDto.cs +++ b/AsbCloudApp/Data/WellOperationDto.cs @@ -3,7 +3,6 @@ using System.ComponentModel.DataAnnotations; namespace AsbCloudApp.Data { -#nullable enable /// /// Операции на скважине (заведенные пользователем) /// @@ -94,5 +93,4 @@ namespace AsbCloudApp.Data [StringLength(8192)] public string? Comment { get; set; } } -#nullable disable } From 9549b62d3e77331a738c57de1e1def3ab51dcc49 Mon Sep 17 00:00:00 2001 From: "ai.astrakhantsev" Date: Mon, 27 Feb 2023 10:06:54 +0500 Subject: [PATCH 21/27] IDepositRepository, IFileRepository, IFileStorageRepository, ILimitingParameterRepository, IProcessMapRepository, ITelemetryWirelineRunOutRepository, IUserRoleRepository, IWellCompositeRepository, IWellFinalDocumentsRepository, IWellOperationRepository --- AsbCloudApp/Repositories/IDepositRepository.cs | 2 -- AsbCloudApp/Repositories/IFileRepository.cs | 2 -- AsbCloudApp/Repositories/IFileStorageRepository.cs | 2 -- AsbCloudApp/Repositories/ILimitingParameterRepository.cs | 2 -- AsbCloudApp/Repositories/IPlannedTrajectoryRepository.cs | 2 -- AsbCloudApp/Repositories/IProcessMapRepository.cs | 2 -- AsbCloudApp/Repositories/ITelemetryWirelineRunOutRepository.cs | 2 -- AsbCloudApp/Repositories/IUserRoleRepository.cs | 2 -- AsbCloudApp/Repositories/IWellCompositeRepository.cs | 2 -- AsbCloudApp/Repositories/IWellFinalDocumentsRepository.cs | 2 -- AsbCloudApp/Repositories/IWellOperationRepository.cs | 2 -- 11 files changed, 22 deletions(-) diff --git a/AsbCloudApp/Repositories/IDepositRepository.cs b/AsbCloudApp/Repositories/IDepositRepository.cs index 44c5fe1d..87f732fb 100644 --- a/AsbCloudApp/Repositories/IDepositRepository.cs +++ b/AsbCloudApp/Repositories/IDepositRepository.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; namespace AsbCloudApp.Repositories { -#nullable enable /// /// Сервис информации о кустах /// @@ -40,5 +39,4 @@ namespace AsbCloudApp.Repositories int depositId, CancellationToken token); } -#nullable disable } diff --git a/AsbCloudApp/Repositories/IFileRepository.cs b/AsbCloudApp/Repositories/IFileRepository.cs index a62aa0d5..8967f08c 100644 --- a/AsbCloudApp/Repositories/IFileRepository.cs +++ b/AsbCloudApp/Repositories/IFileRepository.cs @@ -7,7 +7,6 @@ using System.Threading.Tasks; namespace AsbCloudApp.Repositories { -#nullable enable /// /// Сервис доступа к файлам /// @@ -79,5 +78,4 @@ namespace AsbCloudApp.Repositories Task MarkFileMarkAsDeletedAsync(IEnumerable idsMarks, CancellationToken token); } -#nullable disable } diff --git a/AsbCloudApp/Repositories/IFileStorageRepository.cs b/AsbCloudApp/Repositories/IFileStorageRepository.cs index 6118cc7a..ce5d693b 100644 --- a/AsbCloudApp/Repositories/IFileStorageRepository.cs +++ b/AsbCloudApp/Repositories/IFileStorageRepository.cs @@ -6,7 +6,6 @@ using System.Threading.Tasks; namespace AsbCloudApp.Repositories { -#nullable enable /// /// Репозиторий хранения фалов /// @@ -75,5 +74,4 @@ namespace AsbCloudApp.Repositories /// string GetUrl(int idWell, int idCategory, int idFile, string dotExtention); } -#nullable disable } diff --git a/AsbCloudApp/Repositories/ILimitingParameterRepository.cs b/AsbCloudApp/Repositories/ILimitingParameterRepository.cs index a9b61823..e8d7198b 100644 --- a/AsbCloudApp/Repositories/ILimitingParameterRepository.cs +++ b/AsbCloudApp/Repositories/ILimitingParameterRepository.cs @@ -6,7 +6,6 @@ using System.Threading; namespace AsbCloudApp.Repositories { -#nullable enable /// /// Репозиторий по ограничивающим параметрам с фильтрацией /// @@ -31,5 +30,4 @@ namespace AsbCloudApp.Repositories /// Task> GetLimitingParametersAsync(LimitingParameterRequest request, int idTelemetry, double timezoneHours, CancellationToken token); } -#nullable disable } diff --git a/AsbCloudApp/Repositories/IPlannedTrajectoryRepository.cs b/AsbCloudApp/Repositories/IPlannedTrajectoryRepository.cs index b18f72cf..94f19162 100644 --- a/AsbCloudApp/Repositories/IPlannedTrajectoryRepository.cs +++ b/AsbCloudApp/Repositories/IPlannedTrajectoryRepository.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; namespace AsbCloudApp.Repositories { -#nullable enable /// /// CRUD для работы с плановой траекторией из клиента /// @@ -61,5 +60,4 @@ namespace AsbCloudApp.Repositories /// Task DeleteByIdWellAsync(int idWell, CancellationToken token); } -#nullable disable } diff --git a/AsbCloudApp/Repositories/IProcessMapRepository.cs b/AsbCloudApp/Repositories/IProcessMapRepository.cs index 0bc9ac7b..3a1da4d5 100644 --- a/AsbCloudApp/Repositories/IProcessMapRepository.cs +++ b/AsbCloudApp/Repositories/IProcessMapRepository.cs @@ -8,7 +8,6 @@ using System.Threading.Tasks; namespace AsbCloudApp.Repositories { -#nullable enable /// /// /// @@ -32,5 +31,4 @@ namespace AsbCloudApp.Repositories /// Task> GetProcessMapAsync(IEnumerable requests, CancellationToken token); } -#nullable disable } \ No newline at end of file diff --git a/AsbCloudApp/Repositories/ITelemetryWirelineRunOutRepository.cs b/AsbCloudApp/Repositories/ITelemetryWirelineRunOutRepository.cs index c22c86ad..194a00fe 100644 --- a/AsbCloudApp/Repositories/ITelemetryWirelineRunOutRepository.cs +++ b/AsbCloudApp/Repositories/ITelemetryWirelineRunOutRepository.cs @@ -6,7 +6,6 @@ using System.Threading.Tasks; namespace AsbCloudApp.Repositories { -#nullable enable /// /// Наработка талевого каната /// @@ -37,5 +36,4 @@ namespace AsbCloudApp.Repositories /// Task> GetAllAsync(int idCompany, CancellationToken token); } -#nullable disable } diff --git a/AsbCloudApp/Repositories/IUserRoleRepository.cs b/AsbCloudApp/Repositories/IUserRoleRepository.cs index d20a42cb..2ad7b8ee 100644 --- a/AsbCloudApp/Repositories/IUserRoleRepository.cs +++ b/AsbCloudApp/Repositories/IUserRoleRepository.cs @@ -6,7 +6,6 @@ using System.Threading; namespace AsbCloudApp.Repositories { -#nullable enable /// /// Разрешения на доступ к данным /// @@ -36,5 +35,4 @@ namespace AsbCloudApp.Repositories /// bool HasPermission(IEnumerable rolesIds, string permissionName); } -#nullable disable } diff --git a/AsbCloudApp/Repositories/IWellCompositeRepository.cs b/AsbCloudApp/Repositories/IWellCompositeRepository.cs index 8b24d32f..06413176 100644 --- a/AsbCloudApp/Repositories/IWellCompositeRepository.cs +++ b/AsbCloudApp/Repositories/IWellCompositeRepository.cs @@ -6,7 +6,6 @@ using System.Threading.Tasks; namespace AsbCloudApp.Repositories { -#nullable enable /// /// Репозиторий создания композитной скважины /// @@ -37,5 +36,4 @@ namespace AsbCloudApp.Repositories /// Task> GetCompositeProcessMap(int idWell, CancellationToken token); } -#nullable disable } diff --git a/AsbCloudApp/Repositories/IWellFinalDocumentsRepository.cs b/AsbCloudApp/Repositories/IWellFinalDocumentsRepository.cs index 69c19f98..46efa847 100644 --- a/AsbCloudApp/Repositories/IWellFinalDocumentsRepository.cs +++ b/AsbCloudApp/Repositories/IWellFinalDocumentsRepository.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; namespace AsbCloudApp.Repositories { -#nullable enable /// /// Репозиторий "Дело скважины" /// @@ -47,5 +46,4 @@ namespace AsbCloudApp.Repositories /// Task GetCategoryAsync(int idWell, int idCategory, int idUser, CancellationToken token); } -#nullable disable } diff --git a/AsbCloudApp/Repositories/IWellOperationRepository.cs b/AsbCloudApp/Repositories/IWellOperationRepository.cs index d7a99b54..0db0490c 100644 --- a/AsbCloudApp/Repositories/IWellOperationRepository.cs +++ b/AsbCloudApp/Repositories/IWellOperationRepository.cs @@ -7,7 +7,6 @@ using System.Threading.Tasks; namespace AsbCloudApp.Repositories { -#nullable enable /// /// сервис операций по скважине /// @@ -98,5 +97,4 @@ namespace AsbCloudApp.Repositories /// Task DeleteAsync(IEnumerable ids, CancellationToken token); } -#nullable disable } \ No newline at end of file From dea93ac9c029d9b2822105ecd4eabd8daebc3390 Mon Sep 17 00:00:00 2001 From: "ai.astrakhantsev" Date: Mon, 27 Feb 2023 10:11:50 +0500 Subject: [PATCH 22/27] DetectedOperationRequest, FileRequest, LimitingParameterRequest, MessageRequestBase, ProcessMapRequest, RequestBase, SubsystemOperationTimeRequest, WellOperationRequest, WellRequest --- AsbCloudApp/Requests/DetectedOperationRequest.cs | 2 +- AsbCloudApp/Requests/FileRequest.cs | 2 -- AsbCloudApp/Requests/LimitingParameterRequest.cs | 2 -- AsbCloudApp/Requests/MessageRequest.cs | 1 - AsbCloudApp/Requests/ProcessMapRequest.cs | 3 --- AsbCloudApp/Requests/RequestBase.cs | 2 -- AsbCloudApp/Requests/SubsystemOperationTimeRequest.cs | 2 -- AsbCloudApp/Requests/WellOperationRequest.cs | 2 -- AsbCloudApp/Requests/WellRequest.cs | 2 -- 9 files changed, 1 insertion(+), 17 deletions(-) diff --git a/AsbCloudApp/Requests/DetectedOperationRequest.cs b/AsbCloudApp/Requests/DetectedOperationRequest.cs index a6097b9c..9bfa22f7 100644 --- a/AsbCloudApp/Requests/DetectedOperationRequest.cs +++ b/AsbCloudApp/Requests/DetectedOperationRequest.cs @@ -18,7 +18,7 @@ namespace AsbCloudApp.Requests /// /// категории операций /// - public IEnumerable IdsCategories { get; set; } + public IEnumerable? IdsCategories { get; set; } /// /// Больше или равно дате diff --git a/AsbCloudApp/Requests/FileRequest.cs b/AsbCloudApp/Requests/FileRequest.cs index 14a799e0..7ea84c7e 100644 --- a/AsbCloudApp/Requests/FileRequest.cs +++ b/AsbCloudApp/Requests/FileRequest.cs @@ -3,7 +3,6 @@ using System.ComponentModel.DataAnnotations; namespace AsbCloudApp.Requests { -#nullable enable /// /// Параметры запроса для файлового сервиса /// @@ -46,5 +45,4 @@ namespace AsbCloudApp.Requests /// public bool? IsDeleted { get; set; } } -#nullable disable } diff --git a/AsbCloudApp/Requests/LimitingParameterRequest.cs b/AsbCloudApp/Requests/LimitingParameterRequest.cs index 0fa64feb..31fb02f0 100644 --- a/AsbCloudApp/Requests/LimitingParameterRequest.cs +++ b/AsbCloudApp/Requests/LimitingParameterRequest.cs @@ -3,7 +3,6 @@ using System.ComponentModel.DataAnnotations; namespace AsbCloudApp.Requests { -#nullable enable /// /// Класс с фильтрами для запроса по ограничивающим параметрам /// @@ -35,5 +34,4 @@ namespace AsbCloudApp.Requests /// public double? LtDepth { get; set; } } -#nullable disable } diff --git a/AsbCloudApp/Requests/MessageRequest.cs b/AsbCloudApp/Requests/MessageRequest.cs index 8f7f06f6..1bfba1a2 100644 --- a/AsbCloudApp/Requests/MessageRequest.cs +++ b/AsbCloudApp/Requests/MessageRequest.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; namespace AsbCloudApp.Requests { -#nullable enable /// /// параметры для запроса списка сообщений /// diff --git a/AsbCloudApp/Requests/ProcessMapRequest.cs b/AsbCloudApp/Requests/ProcessMapRequest.cs index 55adb7fd..8fc481e4 100644 --- a/AsbCloudApp/Requests/ProcessMapRequest.cs +++ b/AsbCloudApp/Requests/ProcessMapRequest.cs @@ -1,9 +1,7 @@ using System; -using System.Collections.Generic; namespace AsbCloudApp.Requests { -#nullable enable /// /// Параметры для запроса получения РТК /// @@ -24,5 +22,4 @@ namespace AsbCloudApp.Requests /// public DateTime? UpdateFrom { get; set; } } -#nullable disable } diff --git a/AsbCloudApp/Requests/RequestBase.cs b/AsbCloudApp/Requests/RequestBase.cs index 368dfe4f..2ae96e54 100644 --- a/AsbCloudApp/Requests/RequestBase.cs +++ b/AsbCloudApp/Requests/RequestBase.cs @@ -2,7 +2,6 @@ namespace AsbCloudApp.Requests { -#nullable enable /// /// Базовые параметры запроса /// @@ -25,5 +24,4 @@ namespace AsbCloudApp.Requests /// public IEnumerable? SortFields { get; set; } } -#nullable disable } diff --git a/AsbCloudApp/Requests/SubsystemOperationTimeRequest.cs b/AsbCloudApp/Requests/SubsystemOperationTimeRequest.cs index 2b666467..11aafa3c 100644 --- a/AsbCloudApp/Requests/SubsystemOperationTimeRequest.cs +++ b/AsbCloudApp/Requests/SubsystemOperationTimeRequest.cs @@ -4,7 +4,6 @@ using System.ComponentModel.DataAnnotations; namespace AsbCloudApp.Requests { -#nullable enable /// /// класс с фильтрами для запроса /// @@ -60,5 +59,4 @@ namespace AsbCloudApp.Requests /// public int SelectMode { get; set; } = SelectModeOuter; } -#nullable disable } diff --git a/AsbCloudApp/Requests/WellOperationRequest.cs b/AsbCloudApp/Requests/WellOperationRequest.cs index 16c355d1..eaa91790 100644 --- a/AsbCloudApp/Requests/WellOperationRequest.cs +++ b/AsbCloudApp/Requests/WellOperationRequest.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; namespace AsbCloudApp.Requests { -#nullable enable /// /// параметры для запроса списка операций /// @@ -83,5 +82,4 @@ namespace AsbCloudApp.Requests this.SortFields = request.SortFields; } } -#nullable disable } diff --git a/AsbCloudApp/Requests/WellRequest.cs b/AsbCloudApp/Requests/WellRequest.cs index 0d7d6e85..3f5195d0 100644 --- a/AsbCloudApp/Requests/WellRequest.cs +++ b/AsbCloudApp/Requests/WellRequest.cs @@ -2,7 +2,6 @@ namespace AsbCloudApp.Requests { -#nullable enable /// /// Запрос на получение скважин /// @@ -23,5 +22,4 @@ namespace AsbCloudApp.Requests /// public IEnumerable? Ids { get; set; } } -#nullable disable } From 57fc19396e5a55ee79a30c749e68bb556f69afaf Mon Sep 17 00:00:00 2001 From: "ai.astrakhantsev" Date: Mon, 27 Feb 2023 10:21:17 +0500 Subject: [PATCH 23/27] ISubsystemOperationTimeService, ISubsystemService, FileService, IAuthService, ICrudRepository, IDetectedOperationService, ILimitingParameterService, IMessageService, IPlannedTrajectoryImportService, IProcessMapService, IReduceSamplingService, IReportService, IRepositoryWellRelated, IRequerstTrackerService, ISetpointsService, ITelemetryDataSaubService, ITelemetryDataService, ITelemetryService, ITelemetryUserService, ITrajectoryVisualizationService, IWellFinalDocumentsService, IWellService --- AsbCloudApp/Services/FileService.cs | 2 -- AsbCloudApp/Services/IAuthService.cs | 2 -- AsbCloudApp/Services/ICrudRepository.cs | 3 --- AsbCloudApp/Services/IDetectedOperationService.cs | 2 -- AsbCloudApp/Services/ILimitingParameterService.cs | 2 -- AsbCloudApp/Services/IMessageService.cs | 1 - AsbCloudApp/Services/IPlannedTrajectoryImportService.cs | 2 -- AsbCloudApp/Services/IProcessMapService.cs | 2 -- AsbCloudApp/Services/IReduceSamplingService.cs | 2 -- AsbCloudApp/Services/IReportService.cs | 3 --- AsbCloudApp/Services/IRepositoryWellRelated.cs | 2 -- AsbCloudApp/Services/IRequestTracker.cs | 3 --- AsbCloudApp/Services/ISetpointsService.cs | 1 - AsbCloudApp/Services/ITelemetryDataSaubService.cs | 4 +--- AsbCloudApp/Services/ITelemetryDataService.cs | 4 +--- AsbCloudApp/Services/ITelemetryService.cs | 3 --- AsbCloudApp/Services/ITelemetryUserService.cs | 2 -- AsbCloudApp/Services/ITrajectoryVisualizationService.cs | 2 -- AsbCloudApp/Services/IWellFinalDocumentsService.cs | 2 -- AsbCloudApp/Services/IWellService.cs | 2 -- .../Services/Subsystems/ISubsystemOperationTimeService.cs | 2 -- AsbCloudApp/Services/Subsystems/ISubsystemService.cs | 2 -- 22 files changed, 2 insertions(+), 48 deletions(-) diff --git a/AsbCloudApp/Services/FileService.cs b/AsbCloudApp/Services/FileService.cs index d361cf38..54853b51 100644 --- a/AsbCloudApp/Services/FileService.cs +++ b/AsbCloudApp/Services/FileService.cs @@ -9,7 +9,6 @@ using System.Threading.Tasks; namespace AsbCloudApp.Services { -#nullable enable /// /// Сервис доступа к файлам /// @@ -299,5 +298,4 @@ namespace AsbCloudApp.Services return fileStream; } } -#nullable disable } diff --git a/AsbCloudApp/Services/IAuthService.cs b/AsbCloudApp/Services/IAuthService.cs index 93d14124..1b332a84 100644 --- a/AsbCloudApp/Services/IAuthService.cs +++ b/AsbCloudApp/Services/IAuthService.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; namespace AsbCloudApp.Services { -#nullable enable /// /// Сервис авторизации /// @@ -53,5 +52,4 @@ namespace AsbCloudApp.Services /// int Register(UserRegistrationDto userDto); } -#nullable disable } \ No newline at end of file diff --git a/AsbCloudApp/Services/ICrudRepository.cs b/AsbCloudApp/Services/ICrudRepository.cs index f402ebb9..55cfad99 100644 --- a/AsbCloudApp/Services/ICrudRepository.cs +++ b/AsbCloudApp/Services/ICrudRepository.cs @@ -4,8 +4,6 @@ using System.Threading.Tasks; namespace AsbCloudApp.Services { -#nullable enable - /// /// Сервис получения, добавления, изменения, удаления данных /// @@ -73,5 +71,4 @@ namespace AsbCloudApp.Services /// количество добавленных, если меньше 0 - код ошибки Task DeleteAsync(int id, CancellationToken token); } -#nullable disable } \ No newline at end of file diff --git a/AsbCloudApp/Services/IDetectedOperationService.cs b/AsbCloudApp/Services/IDetectedOperationService.cs index 8418557c..901f7b3f 100644 --- a/AsbCloudApp/Services/IDetectedOperationService.cs +++ b/AsbCloudApp/Services/IDetectedOperationService.cs @@ -9,7 +9,6 @@ using System.Threading.Tasks; namespace AsbCloudApp.Services { -#nullable enable /// /// Сервис автоматически определенных по телеметрии операций /// @@ -74,5 +73,4 @@ namespace AsbCloudApp.Services /// Task ExportAsync(IEnumerable idsWells, CancellationToken token); } -#nullable disable } diff --git a/AsbCloudApp/Services/ILimitingParameterService.cs b/AsbCloudApp/Services/ILimitingParameterService.cs index 5f752a62..670448e5 100644 --- a/AsbCloudApp/Services/ILimitingParameterService.cs +++ b/AsbCloudApp/Services/ILimitingParameterService.cs @@ -6,7 +6,6 @@ using System.Threading.Tasks; namespace AsbCloudApp.Services { -#nullable enable /// /// Сервис по ограничивающим параметрам с фильтрацией /// @@ -26,5 +25,4 @@ namespace AsbCloudApp.Services /// Dictionary GetLimitingParameteraNames(); } -#nullable disable } diff --git a/AsbCloudApp/Services/IMessageService.cs b/AsbCloudApp/Services/IMessageService.cs index b3abd842..68592619 100644 --- a/AsbCloudApp/Services/IMessageService.cs +++ b/AsbCloudApp/Services/IMessageService.cs @@ -1,7 +1,6 @@ using AsbCloudApp.Data; using AsbCloudApp.Data.SAUB; using AsbCloudApp.Requests; -using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; diff --git a/AsbCloudApp/Services/IPlannedTrajectoryImportService.cs b/AsbCloudApp/Services/IPlannedTrajectoryImportService.cs index f3e3a162..9d00caf0 100644 --- a/AsbCloudApp/Services/IPlannedTrajectoryImportService.cs +++ b/AsbCloudApp/Services/IPlannedTrajectoryImportService.cs @@ -4,7 +4,6 @@ using System.Threading.Tasks; namespace AsbCloudApp.Services { -#nullable enable /// /// Сервис загрузки и обработки плановой траектории из файла /// @@ -38,5 +37,4 @@ namespace AsbCloudApp.Services /// Очистить старые координаты перед импортом (если файл проходит валидацию) Task ImportAsync(int idWell, int idUser, Stream stream, bool deleteBeforeImport, CancellationToken token); } -#nullable disable } diff --git a/AsbCloudApp/Services/IProcessMapService.cs b/AsbCloudApp/Services/IProcessMapService.cs index 11bb2846..63a611c8 100644 --- a/AsbCloudApp/Services/IProcessMapService.cs +++ b/AsbCloudApp/Services/IProcessMapService.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; namespace AsbCloudApp.Services { -#nullable enable /// /// Сервис формирования РТК /// @@ -19,5 +18,4 @@ namespace AsbCloudApp.Services /// Task> GetProcessMapAsync(int idWell, CancellationToken token); } -#nullable disable } diff --git a/AsbCloudApp/Services/IReduceSamplingService.cs b/AsbCloudApp/Services/IReduceSamplingService.cs index a0220c58..ce4d491d 100644 --- a/AsbCloudApp/Services/IReduceSamplingService.cs +++ b/AsbCloudApp/Services/IReduceSamplingService.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; namespace AsbCloudApp.Services { -#nullable enable /// /// Делегат обновления состояния задачи /// @@ -39,5 +38,4 @@ namespace AsbCloudApp.Services /// задача добавлена == true bool TryEnqueueRediceSamplingJob(int idTelemetry, OnJobProgressDelagate onProgress, out JobDto jobDto); } -#nullable disable } \ No newline at end of file diff --git a/AsbCloudApp/Services/IReportService.cs b/AsbCloudApp/Services/IReportService.cs index e5e24648..1f4a7d35 100644 --- a/AsbCloudApp/Services/IReportService.cs +++ b/AsbCloudApp/Services/IReportService.cs @@ -6,7 +6,6 @@ using System.Threading.Tasks; namespace AsbCloudApp.Services { -#nullable enable /// /// Сервис рапортов /// @@ -58,7 +57,5 @@ namespace AsbCloudApp.Services /// /// Task> GetAllReportsByWellAsync(int idWell, CancellationToken token); - -#nullable disable } } diff --git a/AsbCloudApp/Services/IRepositoryWellRelated.cs b/AsbCloudApp/Services/IRepositoryWellRelated.cs index 112cff89..9c771657 100644 --- a/AsbCloudApp/Services/IRepositoryWellRelated.cs +++ b/AsbCloudApp/Services/IRepositoryWellRelated.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; namespace AsbCloudApp.Services { -#nullable enable /// /// Репозиторий получения, добавления, изменения, удаления данных
/// Для сущностей относящихся к скважине @@ -30,5 +29,4 @@ namespace AsbCloudApp.Services /// emptyList if nothing found Task> GetByIdWellAsync(IEnumerable idsWells, CancellationToken token); } -#nullable disable } \ No newline at end of file diff --git a/AsbCloudApp/Services/IRequestTracker.cs b/AsbCloudApp/Services/IRequestTracker.cs index 3a4c0fe3..b83d5146 100644 --- a/AsbCloudApp/Services/IRequestTracker.cs +++ b/AsbCloudApp/Services/IRequestTracker.cs @@ -4,8 +4,6 @@ using System.Collections.Generic; namespace AsbCloudApp.Services { -#nullable enable - /// /// Отслеживание и сбор статистики по запросам /// @@ -59,5 +57,4 @@ namespace AsbCloudApp.Services /// IEnumerable GetUsersStat(int? take); } -#nullable disable } diff --git a/AsbCloudApp/Services/ISetpointsService.cs b/AsbCloudApp/Services/ISetpointsService.cs index 0d2127a1..cd80feef 100644 --- a/AsbCloudApp/Services/ISetpointsService.cs +++ b/AsbCloudApp/Services/ISetpointsService.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; namespace AsbCloudApp.Services { -#nullable enable /// /// Сервис рекомендаций новых уставок для панели оператора САУБ /// diff --git a/AsbCloudApp/Services/ITelemetryDataSaubService.cs b/AsbCloudApp/Services/ITelemetryDataSaubService.cs index d6bdcb6f..f8d9c3be 100644 --- a/AsbCloudApp/Services/ITelemetryDataSaubService.cs +++ b/AsbCloudApp/Services/ITelemetryDataSaubService.cs @@ -3,7 +3,6 @@ using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; -#nullable enable namespace AsbCloudApp.Services { /// @@ -22,5 +21,4 @@ namespace AsbCloudApp.Services /// Task> GetTelemetryDataStatAsync(int idTelemetry, CancellationToken token); } -} -#nullable disable \ No newline at end of file +} \ No newline at end of file diff --git a/AsbCloudApp/Services/ITelemetryDataService.cs b/AsbCloudApp/Services/ITelemetryDataService.cs index 585843ff..af80eb23 100644 --- a/AsbCloudApp/Services/ITelemetryDataService.cs +++ b/AsbCloudApp/Services/ITelemetryDataService.cs @@ -4,7 +4,6 @@ using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; -#nullable enable namespace AsbCloudApp.Services { /// @@ -36,5 +35,4 @@ namespace AsbCloudApp.Services /// Task UpdateDataAsync(string uid, IEnumerable dtos, CancellationToken token); } -} -#nullable disable \ No newline at end of file +} \ No newline at end of file diff --git a/AsbCloudApp/Services/ITelemetryService.cs b/AsbCloudApp/Services/ITelemetryService.cs index 62b8f8e1..b7f81c32 100644 --- a/AsbCloudApp/Services/ITelemetryService.cs +++ b/AsbCloudApp/Services/ITelemetryService.cs @@ -6,7 +6,6 @@ using System.Threading.Tasks; namespace AsbCloudApp.Services { -#nullable enable /// /// Сервис телеметрии /// @@ -82,6 +81,4 @@ namespace AsbCloudApp.Services /// Task MergeAsync(int from, int to, CancellationToken token); } - -#nullable disable } \ No newline at end of file diff --git a/AsbCloudApp/Services/ITelemetryUserService.cs b/AsbCloudApp/Services/ITelemetryUserService.cs index 558f24c5..2b9204ab 100644 --- a/AsbCloudApp/Services/ITelemetryUserService.cs +++ b/AsbCloudApp/Services/ITelemetryUserService.cs @@ -6,7 +6,6 @@ using System.Threading.Tasks; namespace AsbCloudApp.Services { -#nullable enable /// /// сервис пользователей телеметрии /// @@ -37,5 +36,4 @@ namespace AsbCloudApp.Services /// Task UpsertAsync(string uid, IEnumerable dtos, CancellationToken token = default); } -#nullable disable } \ No newline at end of file diff --git a/AsbCloudApp/Services/ITrajectoryVisualizationService.cs b/AsbCloudApp/Services/ITrajectoryVisualizationService.cs index a387e501..31d77271 100644 --- a/AsbCloudApp/Services/ITrajectoryVisualizationService.cs +++ b/AsbCloudApp/Services/ITrajectoryVisualizationService.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; namespace AsbCloudApp.Services { -#nullable enable /// /// Сервис "Визуализация траектории 3D" /// @@ -19,5 +18,4 @@ namespace AsbCloudApp.Services /// Task> GetTrajectoryAsync(int idWell, CancellationToken token); } -#nullable disable } diff --git a/AsbCloudApp/Services/IWellFinalDocumentsService.cs b/AsbCloudApp/Services/IWellFinalDocumentsService.cs index 63536c7c..1d6196ca 100644 --- a/AsbCloudApp/Services/IWellFinalDocumentsService.cs +++ b/AsbCloudApp/Services/IWellFinalDocumentsService.cs @@ -6,7 +6,6 @@ using System.Threading.Tasks; namespace AsbCloudApp.Services { -#nullable enable /// /// Сервис "Дело скважины" /// @@ -52,5 +51,4 @@ namespace AsbCloudApp.Services /// count of notified publishers Task ReNotifyPublishersAsync(int idWell, int idUser, int idCategory, CancellationToken token); } -#nullable disable } \ No newline at end of file diff --git a/AsbCloudApp/Services/IWellService.cs b/AsbCloudApp/Services/IWellService.cs index 23873015..057b3444 100644 --- a/AsbCloudApp/Services/IWellService.cs +++ b/AsbCloudApp/Services/IWellService.cs @@ -7,7 +7,6 @@ using System.Threading.Tasks; namespace AsbCloudApp.Services { -#nullable enable /// /// сервис скважин /// @@ -104,5 +103,4 @@ namespace AsbCloudApp.Services /// Task> GetWellTreeAsync(int idCompany, CancellationToken token); } -#nullable disable } diff --git a/AsbCloudApp/Services/Subsystems/ISubsystemOperationTimeService.cs b/AsbCloudApp/Services/Subsystems/ISubsystemOperationTimeService.cs index 8df7ee07..2f6fb8f5 100644 --- a/AsbCloudApp/Services/Subsystems/ISubsystemOperationTimeService.cs +++ b/AsbCloudApp/Services/Subsystems/ISubsystemOperationTimeService.cs @@ -8,7 +8,6 @@ using System.Threading.Tasks; namespace AsbCloudApp.Services.Subsystems { -#nullable enable /// /// Получение инфо о наработке подсистем /// @@ -66,5 +65,4 @@ namespace AsbCloudApp.Services.Subsystems /// Task> GetStatByActiveWells(IEnumerable wellIds, CancellationToken token); } -#nullable disable } diff --git a/AsbCloudApp/Services/Subsystems/ISubsystemService.cs b/AsbCloudApp/Services/Subsystems/ISubsystemService.cs index ff26a4d2..b343b055 100644 --- a/AsbCloudApp/Services/Subsystems/ISubsystemService.cs +++ b/AsbCloudApp/Services/Subsystems/ISubsystemService.cs @@ -5,7 +5,6 @@ using System.Threading.Tasks; namespace AsbCloudApp.Services.Subsystems { -#nullable enable // TODO: move this to repositories /// @@ -21,5 +20,4 @@ namespace AsbCloudApp.Services.Subsystems /// Task?> GetSubsystemAsync(int? idWell, CancellationToken token); } -#nullable disable } From 73f2fe08263ba955606188e58bed1b715a418629 Mon Sep 17 00:00:00 2001 From: "ai.astrakhantsev" Date: Mon, 27 Feb 2023 10:33:59 +0500 Subject: [PATCH 24/27] PlanFactBase, ArgumentInvalidException --- AsbCloudApp/CyclycArray.cs | 6 ++---- AsbCloudApp/Data/PlanFactBase.cs | 4 ++-- AsbCloudApp/Exceptions/ArgumentInvalidException.cs | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/AsbCloudApp/CyclycArray.cs b/AsbCloudApp/CyclycArray.cs index f47edc5b..b551d1c2 100644 --- a/AsbCloudApp/CyclycArray.cs +++ b/AsbCloudApp/CyclycArray.cs @@ -1,5 +1,4 @@ -#nullable enable -using System.Linq; +using System.Linq; namespace System.Collections.Generic { @@ -194,5 +193,4 @@ namespace System.Collections.Generic current = -1; } } -} -#nullable disable \ No newline at end of file +} \ No newline at end of file diff --git a/AsbCloudApp/Data/PlanFactBase.cs b/AsbCloudApp/Data/PlanFactBase.cs index fc3dcff4..343156b4 100644 --- a/AsbCloudApp/Data/PlanFactBase.cs +++ b/AsbCloudApp/Data/PlanFactBase.cs @@ -9,11 +9,11 @@ /// /// Плановое значение /// - public T Plan { get; set; } + public T? Plan { get; set; } /// /// Фактическое значение /// - public T Fact { get; set; } + public T? Fact { get; set; } } } diff --git a/AsbCloudApp/Exceptions/ArgumentInvalidException.cs b/AsbCloudApp/Exceptions/ArgumentInvalidException.cs index 2e70b871..b8014098 100644 --- a/AsbCloudApp/Exceptions/ArgumentInvalidException.cs +++ b/AsbCloudApp/Exceptions/ArgumentInvalidException.cs @@ -10,14 +10,14 @@ namespace AsbCloudApp.Exceptions /// /// название аргумента /// - public string ParamName { get; } + public string ParamName { get; } = string.Empty; /// /// конструктор /// /// /// - public ArgumentInvalidException(string message, string paramName = default) + public ArgumentInvalidException(string message, string paramName) : base(message) { ParamName = paramName; From 15fdfa11ede1fa292fe9268991bb0aaa19a6db0f Mon Sep 17 00:00:00 2001 From: "ai.astrakhantsev" Date: Mon, 27 Feb 2023 11:29:06 +0500 Subject: [PATCH 25/27] ArgumentInvalidException --- .../Repository/WellFinalDocumentsRepository.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/AsbCloudInfrastructure/Repository/WellFinalDocumentsRepository.cs b/AsbCloudInfrastructure/Repository/WellFinalDocumentsRepository.cs index fc8e6f0f..ade0ad73 100644 --- a/AsbCloudInfrastructure/Repository/WellFinalDocumentsRepository.cs +++ b/AsbCloudInfrastructure/Repository/WellFinalDocumentsRepository.cs @@ -34,7 +34,7 @@ namespace AsbCloudInfrastructure.Repository public async Task> UpdateRangeAsync(int idWell, IEnumerable? dtos, CancellationToken token) { if (dtos is null) - throw new ArgumentInvalidException("Данные по категориям отсутствуют."); + throw new ArgumentInvalidException("Данные по категориям отсутствуют.", nameof(dtos)); var entities = dtos .Where(dto => dto.IdsPublishers?.Any() == true) @@ -130,7 +130,7 @@ namespace AsbCloudInfrastructure.Repository .FirstOrDefaultAsync(x => x.IdWell == idWell && x.IdCategory == idCategory && x.IdUser == idUser, token); if (entity is null) - throw new ArgumentInvalidException("Пользователь не является ответственным за загрузку файла для данной категории."); + throw new ArgumentInvalidException("Пользователь не является ответственным за загрузку файла для данной категории.", nameof(entity)); var dto = Convert(entity); return dto; From feb26232001c40a66efd223d565a252261514f7f Mon Sep 17 00:00:00 2001 From: "ai.astrakhantsev" Date: Mon, 27 Feb 2023 12:12:55 +0500 Subject: [PATCH 26/27] IDailyReportService, WellInfoService, WellInfoService --- AsbCloudApp/Services/IDailyReportService.cs | 2 +- AsbCloudInfrastructure/Repository/ScheduleRepository.cs | 4 +--- AsbCloudInfrastructure/Services/WellInfoService.cs | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/AsbCloudApp/Services/IDailyReportService.cs b/AsbCloudApp/Services/IDailyReportService.cs index 1b8a29d9..333a8821 100644 --- a/AsbCloudApp/Services/IDailyReportService.cs +++ b/AsbCloudApp/Services/IDailyReportService.cs @@ -57,6 +57,6 @@ namespace AsbCloudApp.Services /// /// /// - Task MakeReportAsync(int idWell, DateTime date, CancellationToken token = default); + Task MakeReportAsync(int idWell, DateTime date, CancellationToken token = default); } } diff --git a/AsbCloudInfrastructure/Repository/ScheduleRepository.cs b/AsbCloudInfrastructure/Repository/ScheduleRepository.cs index b43abe98..03c38cc7 100644 --- a/AsbCloudInfrastructure/Repository/ScheduleRepository.cs +++ b/AsbCloudInfrastructure/Repository/ScheduleRepository.cs @@ -10,7 +10,6 @@ using System.Threading.Tasks; namespace AsbCloudInfrastructure.Repository { -#nullable enable public class ScheduleRepository : CrudWellRelatedRepositoryBase, IScheduleRepository { private readonly IWellService wellService; @@ -21,7 +20,7 @@ namespace AsbCloudInfrastructure.Repository this.wellService = wellService; } - public async Task GetDrillerAsync(int idWell, DateTime workTime, CancellationToken token) + public async Task GetDrillerAsync(int idWell, DateTime workTime, CancellationToken token) { var hoursOffset = wellService.GetTimezone(idWell).Hours; var date = workTime.ToUtcDateTimeOffset(hoursOffset); @@ -64,5 +63,4 @@ namespace AsbCloudInfrastructure.Repository return dto; } } -#nullable disable } diff --git a/AsbCloudInfrastructure/Services/WellInfoService.cs b/AsbCloudInfrastructure/Services/WellInfoService.cs index b8b6128a..9b6986bf 100644 --- a/AsbCloudInfrastructure/Services/WellInfoService.cs +++ b/AsbCloudInfrastructure/Services/WellInfoService.cs @@ -97,7 +97,7 @@ namespace AsbCloudInfrastructure.Services var wellSubsystemStat = subsystemStat.FirstOrDefault(s => s.Well.Id == well.Id); double currentDepth = wellLastTelemetryInfo?.WellDepth - ?? wellLastFactSection?.Fact.WellDepthEnd + ?? wellLastFactSection?.Fact?.WellDepthEnd ?? 0d; var wellProcessMaps = processMaps From 6d5232231deb2ca42c11f634a7f2ebd3df2d424b Mon Sep 17 00:00:00 2001 From: ngfrolov Date: Mon, 27 Feb 2023 12:30:44 +0500 Subject: [PATCH 27/27] fix nullable ScheduleRepository --- AsbCloudApp/Services/IScheduleService.cs | 2 +- AsbCloudInfrastructure/Repository/ScheduleRepository.cs | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/AsbCloudApp/Services/IScheduleService.cs b/AsbCloudApp/Services/IScheduleService.cs index 375b9103..832c2839 100644 --- a/AsbCloudApp/Services/IScheduleService.cs +++ b/AsbCloudApp/Services/IScheduleService.cs @@ -18,6 +18,6 @@ namespace AsbCloudApp.Services /// /// /// - Task GetDrillerAsync(int idWell, DateTime workTime, CancellationToken token); + Task GetDrillerAsync(int idWell, DateTime workTime, CancellationToken token); } } diff --git a/AsbCloudInfrastructure/Repository/ScheduleRepository.cs b/AsbCloudInfrastructure/Repository/ScheduleRepository.cs index 03c38cc7..b43abe98 100644 --- a/AsbCloudInfrastructure/Repository/ScheduleRepository.cs +++ b/AsbCloudInfrastructure/Repository/ScheduleRepository.cs @@ -10,6 +10,7 @@ using System.Threading.Tasks; namespace AsbCloudInfrastructure.Repository { +#nullable enable public class ScheduleRepository : CrudWellRelatedRepositoryBase, IScheduleRepository { private readonly IWellService wellService; @@ -20,7 +21,7 @@ namespace AsbCloudInfrastructure.Repository this.wellService = wellService; } - public async Task GetDrillerAsync(int idWell, DateTime workTime, CancellationToken token) + public async Task GetDrillerAsync(int idWell, DateTime workTime, CancellationToken token) { var hoursOffset = wellService.GetTimezone(idWell).Hours; var date = workTime.ToUtcDateTimeOffset(hoursOffset); @@ -63,4 +64,5 @@ namespace AsbCloudInfrastructure.Repository return dto; } } +#nullable disable }