From 070cd185cbd3b44cf750300d8a031f08b24b45bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D1=82=D0=B5=D0=BF=D0=B0=D0=BD=D0=BE=D0=B2=20=D0=94?= =?UTF-8?q?=D0=BC=D0=B8=D1=82=D1=80=D0=B8=D0=B9?= Date: Fri, 3 Nov 2023 17:49:28 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A3=D0=B4=D0=B0=D0=BB=D0=B5=D0=BD=D1=8B=20?= =?UTF-8?q?=D1=81=D1=82=D0=B0=D1=80=D1=8B=D0=B5=20=D1=80=D0=B5=D0=B0=D0=BB?= =?UTF-8?q?=D0=B8=D0=B7=D0=B0=D1=86=D0=B8=D0=B8=20=D1=81=D1=83=D1=82=D0=BE?= =?UTF-8?q?=D1=87=D0=BD=D0=BE=D0=B3=D0=BE=20=D1=80=D0=B0=D0=BF=D0=BE=D1=80?= =?UTF-8?q?=D1=82=D0=B0=20=D0=B8=20=D0=B0=D0=B2=D1=82=D0=BE=20=D0=B3=D0=B5?= =?UTF-8?q?=D0=BD=D0=B5=D1=80=D0=B8=D1=80=D1=83=D0=B5=D0=BC=D0=BE=D0=B3?= =?UTF-8?q?=D0=BE=20=D0=BE=D1=82=D1=87=D1=91=D1=82=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AutoGeneratedDailyReportDto.cs | 30 -- .../AutoGeneratedDailyReportInfoDto.cs | 14 - .../AutogeneratedDailyReport/HeadBlockDto.cs | 37 --- .../LimitingParameterRecordDto.cs | 27 -- .../SubsystemRecordDto.cs | 27 -- .../TimeBalanceRecordDto.cs | 17 -- AsbCloudApp/Data/DailyReport/BhaDto.cs | 64 ----- AsbCloudApp/Data/DailyReport/HeadDto.cs | 110 -------- AsbCloudApp/Data/DailyReport/NoDrillingDto.cs | 29 -- AsbCloudApp/Data/DailyReport/SaubDto.cs | 107 ------- AsbCloudApp/Data/DailyReport/SignDto.cs | 19 -- .../Data/DailyReport/TimeBalanceDto.cs | 18 -- .../IAutoGeneratedDailyReportService.cs | 44 --- AsbCloudApp/Services/IDailyReportService.cs | 55 ---- AsbCloudDb/Model/DailyReport/Bha.cs | 61 ---- AsbCloudDb/Model/DailyReport/DailyReport.cs | 22 -- .../Model/DailyReport/DailyReportInfo.cs | 13 - AsbCloudDb/Model/DailyReport/Head.cs | 110 -------- AsbCloudDb/Model/DailyReport/NoDrilling.cs | 26 -- AsbCloudDb/Model/DailyReport/Saub.cs | 101 ------- AsbCloudDb/Model/DailyReport/Sign.cs | 16 -- .../AutoGeneratedDailyReportMakerService.cs | 55 ---- .../AutoGeneratedDailyReportService.cs | 262 ------------------ .../HeadExcelBlockWriter.cs | 34 --- .../IExcelBlockWriter.cs | 9 - .../LimitingParameterExcelBlockWriter.cs | 28 -- .../SubsystemExcelBlockWriter.cs | 28 -- .../TimeBalanceExcelBlockWriter.cs | 34 --- .../AutogeneratedDailyReportTemplate.xlsx | Bin 10158 -> 0 bytes .../Services/DailyReport/BlockAbstract.cs | 13 - .../Services/DailyReport/CellAddress.cs | 174 ------------ .../DailyReport/DailyReportBlocks/BhaBlock.cs | 118 -------- .../DailyReportBlocks/DimensionlessBlock.cs | 119 -------- .../DailyReportBlocks/HeadBlock.cs | 181 ------------ .../DailyReportBlocks/SaubBlock.cs | 230 --------------- .../DailyReportBlocks/SignBlock.cs | 51 ---- .../DailyReportBlocks/TimeBalanceBlock.cs | 93 ------- .../DailyReport/DailyReportMakerExcel.cs | 61 ---- .../DailyReport/DailyReportTemplate.xlsx | Bin 20959 -> 0 bytes .../AutoGeneratedDailyReportController.cs | 105 ------- 40 files changed, 2542 deletions(-) delete mode 100644 AsbCloudApp/Data/AutogeneratedDailyReport/AutoGeneratedDailyReportDto.cs delete mode 100644 AsbCloudApp/Data/AutogeneratedDailyReport/AutoGeneratedDailyReportInfoDto.cs delete mode 100644 AsbCloudApp/Data/AutogeneratedDailyReport/HeadBlockDto.cs delete mode 100644 AsbCloudApp/Data/AutogeneratedDailyReport/LimitingParameterRecordDto.cs delete mode 100644 AsbCloudApp/Data/AutogeneratedDailyReport/SubsystemRecordDto.cs delete mode 100644 AsbCloudApp/Data/AutogeneratedDailyReport/TimeBalanceRecordDto.cs delete mode 100644 AsbCloudApp/Data/DailyReport/BhaDto.cs delete mode 100644 AsbCloudApp/Data/DailyReport/HeadDto.cs delete mode 100644 AsbCloudApp/Data/DailyReport/NoDrillingDto.cs delete mode 100644 AsbCloudApp/Data/DailyReport/SaubDto.cs delete mode 100644 AsbCloudApp/Data/DailyReport/SignDto.cs delete mode 100644 AsbCloudApp/Data/DailyReport/TimeBalanceDto.cs delete mode 100644 AsbCloudApp/Services/AutoGeneratedDailyReports/IAutoGeneratedDailyReportService.cs delete mode 100644 AsbCloudApp/Services/IDailyReportService.cs delete mode 100644 AsbCloudDb/Model/DailyReport/Bha.cs delete mode 100644 AsbCloudDb/Model/DailyReport/DailyReport.cs delete mode 100644 AsbCloudDb/Model/DailyReport/DailyReportInfo.cs delete mode 100644 AsbCloudDb/Model/DailyReport/Head.cs delete mode 100644 AsbCloudDb/Model/DailyReport/NoDrilling.cs delete mode 100644 AsbCloudDb/Model/DailyReport/Saub.cs delete mode 100644 AsbCloudDb/Model/DailyReport/Sign.cs delete mode 100644 AsbCloudInfrastructure/Services/AutoGeneratedDailyReports/AutoGeneratedDailyReportMakerService.cs delete mode 100644 AsbCloudInfrastructure/Services/AutoGeneratedDailyReports/AutoGeneratedDailyReportService.cs delete mode 100644 AsbCloudInfrastructure/Services/AutoGeneratedDailyReports/AutogeneratedDailyReportBlocks/HeadExcelBlockWriter.cs delete mode 100644 AsbCloudInfrastructure/Services/AutoGeneratedDailyReports/AutogeneratedDailyReportBlocks/IExcelBlockWriter.cs delete mode 100644 AsbCloudInfrastructure/Services/AutoGeneratedDailyReports/AutogeneratedDailyReportBlocks/LimitingParameterExcelBlockWriter.cs delete mode 100644 AsbCloudInfrastructure/Services/AutoGeneratedDailyReports/AutogeneratedDailyReportBlocks/SubsystemExcelBlockWriter.cs delete mode 100644 AsbCloudInfrastructure/Services/AutoGeneratedDailyReports/AutogeneratedDailyReportBlocks/TimeBalanceExcelBlockWriter.cs delete mode 100644 AsbCloudInfrastructure/Services/AutoGeneratedDailyReports/AutogeneratedDailyReportTemplate.xlsx delete mode 100644 AsbCloudInfrastructure/Services/DailyReport/BlockAbstract.cs delete mode 100644 AsbCloudInfrastructure/Services/DailyReport/CellAddress.cs delete mode 100644 AsbCloudInfrastructure/Services/DailyReport/DailyReportBlocks/BhaBlock.cs delete mode 100644 AsbCloudInfrastructure/Services/DailyReport/DailyReportBlocks/DimensionlessBlock.cs delete mode 100644 AsbCloudInfrastructure/Services/DailyReport/DailyReportBlocks/HeadBlock.cs delete mode 100644 AsbCloudInfrastructure/Services/DailyReport/DailyReportBlocks/SaubBlock.cs delete mode 100644 AsbCloudInfrastructure/Services/DailyReport/DailyReportBlocks/SignBlock.cs delete mode 100644 AsbCloudInfrastructure/Services/DailyReport/DailyReportBlocks/TimeBalanceBlock.cs delete mode 100644 AsbCloudInfrastructure/Services/DailyReport/DailyReportMakerExcel.cs delete mode 100644 AsbCloudInfrastructure/Services/DailyReport/DailyReportTemplate.xlsx delete mode 100644 AsbCloudWebApi/Controllers/AutoGeneratedDailyReportController.cs diff --git a/AsbCloudApp/Data/AutogeneratedDailyReport/AutoGeneratedDailyReportDto.cs b/AsbCloudApp/Data/AutogeneratedDailyReport/AutoGeneratedDailyReportDto.cs deleted file mode 100644 index ec87e260..00000000 --- a/AsbCloudApp/Data/AutogeneratedDailyReport/AutoGeneratedDailyReportDto.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.Collections; -using System.Collections.Generic; - -namespace AsbCloudApp.Data.AutogeneratedDailyReport; - -/// -/// DTO авто-сгенерированного суточного отчёта -/// -public class AutoGeneratedDailyReportDto : AutoGeneratedDailyReportInfoDto -{ - /// - /// Блок заголовка - /// - public HeadBlockDto Head { get; set; } = null!; - - /// - /// Блок подсистем - /// - public IEnumerable Subsystems { get; set; } = null!; - - /// - /// Блок ограничивающих параметров - /// - public IEnumerable LimitingParameters { get; set; } = null!; - - /// - /// Баланс времени - /// - public IEnumerable TimeBalance { get; set; } = null!; -} \ No newline at end of file diff --git a/AsbCloudApp/Data/AutogeneratedDailyReport/AutoGeneratedDailyReportInfoDto.cs b/AsbCloudApp/Data/AutogeneratedDailyReport/AutoGeneratedDailyReportInfoDto.cs deleted file mode 100644 index 22e34cf2..00000000 --- a/AsbCloudApp/Data/AutogeneratedDailyReport/AutoGeneratedDailyReportInfoDto.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; - -namespace AsbCloudApp.Data.AutogeneratedDailyReport; - -/// -/// Базовая информация о суточном отчёте -/// -public class AutoGeneratedDailyReportInfoDto : ReportInfoDto -{ - /// - /// Дата формирования отчёта - /// - public DateOnly ReportDate { get; set; } -} \ No newline at end of file diff --git a/AsbCloudApp/Data/AutogeneratedDailyReport/HeadBlockDto.cs b/AsbCloudApp/Data/AutogeneratedDailyReport/HeadBlockDto.cs deleted file mode 100644 index 43ff5246..00000000 --- a/AsbCloudApp/Data/AutogeneratedDailyReport/HeadBlockDto.cs +++ /dev/null @@ -1,37 +0,0 @@ -namespace AsbCloudApp.Data.AutogeneratedDailyReport; - -/// -/// Блок заголовка -/// -public class HeadBlockDto -{ - /// - /// Название скважины - /// - public string Well { get; set; } = null!; - - /// - /// Название куста - /// - public string Cluster { get; set; } = null!; - - /// - /// Заказчик - /// - public string Customer { get; set; } = null!; - - /// - /// Месторождение - /// - public string Deposit { get; set; } = null!; - - /// - /// Глубина забоя на дату начала интервала - /// - public double DepthFrom { get; set; } - - /// - /// Глубина забоя на дату окончания интервала - /// - public double DepthTo { get; set; } -} \ No newline at end of file diff --git a/AsbCloudApp/Data/AutogeneratedDailyReport/LimitingParameterRecordDto.cs b/AsbCloudApp/Data/AutogeneratedDailyReport/LimitingParameterRecordDto.cs deleted file mode 100644 index e62b32d9..00000000 --- a/AsbCloudApp/Data/AutogeneratedDailyReport/LimitingParameterRecordDto.cs +++ /dev/null @@ -1,27 +0,0 @@ -namespace AsbCloudApp.Data.AutogeneratedDailyReport; - -/// -/// Блок ограничивающих параметров -/// -public class LimitingParameterRecordDto -{ - /// - /// Время использования, мин - /// - public double Hours { get; set; } - - /// - /// Проходка, м - /// - public double Depth { get; set; } - - /// - /// Название ограничивающего параметра - /// - public string NameFeedRegulator { get; set; } = null!; - - /// - /// Процент по проходке, % - /// - public double PercentDepth { get; set; } -} \ No newline at end of file diff --git a/AsbCloudApp/Data/AutogeneratedDailyReport/SubsystemRecordDto.cs b/AsbCloudApp/Data/AutogeneratedDailyReport/SubsystemRecordDto.cs deleted file mode 100644 index 34b2e4a7..00000000 --- a/AsbCloudApp/Data/AutogeneratedDailyReport/SubsystemRecordDto.cs +++ /dev/null @@ -1,27 +0,0 @@ -namespace AsbCloudApp.Data.AutogeneratedDailyReport; - -/// -/// Блок подсистем -/// -public class SubsystemRecordDto -{ - /// - /// Название подсистемы - /// - public string Name { get; set; } = null!; - - /// - /// Использование, % - /// - public double KUsage { get; set; } - - /// - /// Время работы, ч - /// - public double UsedTimeHours { get; set; } - - /// - /// Проходка - /// - public double Depth { get; set; } -} \ No newline at end of file diff --git a/AsbCloudApp/Data/AutogeneratedDailyReport/TimeBalanceRecordDto.cs b/AsbCloudApp/Data/AutogeneratedDailyReport/TimeBalanceRecordDto.cs deleted file mode 100644 index a6ac9845..00000000 --- a/AsbCloudApp/Data/AutogeneratedDailyReport/TimeBalanceRecordDto.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace AsbCloudApp.Data.AutogeneratedDailyReport; - -/// -/// Баланс времени -/// -public class TimeBalanceRecordDto -{ - /// - /// Название операции - /// - public string Name { get; set; } = null!; - - /// - /// Продолжительность, часы - /// - public double DurationHours { get; set; } -} \ No newline at end of file diff --git a/AsbCloudApp/Data/DailyReport/BhaDto.cs b/AsbCloudApp/Data/DailyReport/BhaDto.cs deleted file mode 100644 index b39ba11c..00000000 --- a/AsbCloudApp/Data/DailyReport/BhaDto.cs +++ /dev/null @@ -1,64 +0,0 @@ -namespace AsbCloudApp.Data.DailyReport -{ - /// - /// блок КНБК - /// - public class BhaDto : ItemInfoDto - { - /// - /// КНБК описание - /// - public string BHADescription { get; set; } = string.Empty; - - /// - /// Бурение с наращиваниями в инт. 2195-2763м. Время начала - /// - public string ExtensionDrillingOneBegin{ get; set; } = string.Empty; - - /// - /// Бурение с наращиваниями в инт. 2195-2763м. Время окончания - /// - public string ExtensionDrillingOneFinish { get; set; } = string.Empty; - - /// - /// Промывка. Время начала - /// - public string SluiceBegin { get; set; } = string.Empty; - - /// - /// Промывка. Время окончания - /// - public string SluiceFinish { get; set; } = string.Empty; - - /// - /// Подъем КНБК. Время начала - /// - public string ClimbBegin { get; set; } = string.Empty; - - /// - /// Подъем КНБК. Время окончания - /// - public string ClimbFinish { get; set; } = string.Empty; - - /// - /// Спуск КНБК. Время начала - /// - public string DescentBegin { get; set; } = string.Empty; - - /// - /// Спуск КНБК. Время окончания - /// - public string DescentFinish { get; set; } = string.Empty; - - /// - /// Бурение с наращиваниями в инт. 2763-2850м. Время начала - /// - public string ExtensionDrillingTwoBegin { get; set; } = string.Empty; - - /// - /// Бурение с наращиваниями в инт. 2763-2850м. Время окончания - /// - public string ExtensionDrillingTwoFinish { get; set; } = string.Empty; - } -} - diff --git a/AsbCloudApp/Data/DailyReport/HeadDto.cs b/AsbCloudApp/Data/DailyReport/HeadDto.cs deleted file mode 100644 index 173d4e63..00000000 --- a/AsbCloudApp/Data/DailyReport/HeadDto.cs +++ /dev/null @@ -1,110 +0,0 @@ -using System; -namespace AsbCloudApp.Data.DailyReport -{ - /// - /// блок заголовка - /// - public class HeadDto : ItemInfoDto - { - /// - /// название скважины - /// - public string WellName { get; set; } = string.Empty; - - /// - /// название куста - /// - public string ClusterName { get; set; } = string.Empty; - - /// - /// заказчик - /// - public string Customer { get; set; } = string.Empty; - - /// - /// подрядчик - /// - public string Contractor { get; set; } = string.Empty; - - /// - /// дата рапорта - /// - public DateOnly ReportDate { get; set; } - - /// - /// глубина забоя на дату начала интервала - /// - public double? WellDepthIntervalStartDate { get; set; } - - /// - /// глубина забоя на дату окончания интервала - /// - public double? WellDepthIntervalFinishDate { get; set; } - - /// - /// Глубина забоя по стволу на окончание отчетного периода - /// - public double? BottomholeDepth { get; set; } - - /// - /// Глубина забоя по вертикали на дату окончания отчетного периода - /// - public double? VerticalDepth { get; set; } - - /// - /// Зенитный угол на дату окончания отчетного периода - /// - public double? ZenithAngle { get; set; } - - /// - /// Азимутальный угол на дату окончания отчетного периода - /// - public double? AzimuthAngle { get; set; } - - /// - /// ФИО бурильщиков - /// - public string FirstDriller { get; set; } = string.Empty; - - /// - /// ФИО бурильщиков - /// - public string SecondDriller { get; set; } = string.Empty; - - /// - /// Время работы АПД - /// - public double? WorkTimeSAUB { get; set; } - - /// - /// Время работы спин мастер - /// - public double? WorkTimeSpinMaster { get; set; } - - /// - /// Время работы torqueMaster - /// - public double? WorkTimeTorkMaster { get; set; } - - /// - /// количество метров пробуренных с включенным АПД - /// - public double? PenetrationSAUB { get; set; } - - /// - /// количество метров пробуренных с включенным Спин мастер - /// - public double? PenetrationSpinMaster { get; set; } - - /// - /// количество метров пробуренных с включенным torqueMaster - /// - public double? PenetrationTorkMaster { get; set; } - - /// - /// Количество запусков МСЕ - /// - public int CountLaunchesMSE { get; set; } - } -} - diff --git a/AsbCloudApp/Data/DailyReport/NoDrillingDto.cs b/AsbCloudApp/Data/DailyReport/NoDrillingDto.cs deleted file mode 100644 index ff08eb2f..00000000 --- a/AsbCloudApp/Data/DailyReport/NoDrillingDto.cs +++ /dev/null @@ -1,29 +0,0 @@ -namespace AsbCloudApp.Data.DailyReport -{ - /// - /// блок безметражные работы - /// - public class NoDrillingDto : ItemInfoDto - { - /// - /// Нормативное время на одну операцию по подготовке ствола скважины к наращиванию - /// - public double? StandardTimeBarrelPreparation { get; set; } - - /// - /// Нормативное время на одну операцию по наращиванию - /// - public double? StandardTimeExtension { get; set; } - - /// - /// Фактическое время проработок при подготовке ствола скважины к наращиванию. - /// - public double? ActualTimeBarrelPreparation { get; set; } - - /// - /// Фактическое время наращиваний - /// - public double? ActualTimeExtension { get; set; } - } -} - diff --git a/AsbCloudApp/Data/DailyReport/SaubDto.cs b/AsbCloudApp/Data/DailyReport/SaubDto.cs deleted file mode 100644 index b59ef9ff..00000000 --- a/AsbCloudApp/Data/DailyReport/SaubDto.cs +++ /dev/null @@ -1,107 +0,0 @@ -using System.Collections.Generic; - -namespace AsbCloudApp.Data.DailyReport -{ - /// - /// блок САУБ - /// - public class SaubDto : ItemInfoDto - { - /// - /// Режимы бурения в роторе - /// - public string RotorDrillingModes { get; set; } = string.Empty; - - /// - /// режимы бурения в слайде - /// - public string SlideDrillingModes { get; set; } = string.Empty; - - /// - /// Количество метров пробуренных в роторе за отчетный период - /// - public double? PenetrationInRotor { get; set; } - - /// - /// Количество часов бурения в роторе за отчетный период - /// - public double? NumberDrillingHours { get; set; } - - /// - /// средний диф перепад в роторе за отчетный период - /// - public double? AVGDiffDropRotor { get; set; } - - /// - /// количество метров пробуренных в слайде за отчетный период - /// - public double? PenetrationInSlide { get; set; } - - /// - /// время бурения в роторе за отчетный период - /// - public double? DrillingTimeInRotor { get; set; } - - /// - /// средний диф. перепад в слайде за отчетный период - /// - public double? AVGDiffPressureSlide { get; set; } - - /// - /// Плановая МСП за секцию - /// - public double? SectionROPPlan { get; set; } - - /// - /// Общее время бурения за секцию - /// - public double? SectionDrillingTimeTotal { get; set; } - - /// - /// Общая проходка за секцию - /// - public double? SectionPenetrationTotal { get; set; } - - /// - /// Количество наращиваний за отчетный период - /// - public int ExtensionsCount { get; set; } - - /// - /// Отклонение относительно ГГД - /// - public double? DeviationFromTVD { get; set; } - - /// - /// указываются все причины, которые влияют на снижение МСП. - /// - public string DeclinesReasonsROP { get; set; } = string.Empty; - - /// - /// Увеличение мех скорости за секцию % - /// - public string IncreaseSpeedSection { get; set; } = string.Empty; - - /// - /// Увеличение мех скорости за сутки % - /// - public string IncreaseSpeedDay { get; set; } = string.Empty; - - /// - /// Сокращение времени бурения за секцию, ч - /// - public string ReductionTimeDrilling { get; set; } = string.Empty; - - /// - /// Ротор/Слайд % - /// - public string RotorSlidePercent { get; set; } = string.Empty; - - /// - /// МСП - /// - public string MspSection { get; set; } = string.Empty; - - } -} - diff --git a/AsbCloudApp/Data/DailyReport/SignDto.cs b/AsbCloudApp/Data/DailyReport/SignDto.cs deleted file mode 100644 index f6726bb7..00000000 --- a/AsbCloudApp/Data/DailyReport/SignDto.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace AsbCloudApp.Data.DailyReport -{ - /// - /// блок подписи - /// - public class SignDto : ItemInfoDto - { - /// - /// ФИО Мастера буровой - /// - public string DrillingMaster { get; set; } = null!; - - /// - /// ФИО супервайзера - /// - public string Supervisor { get; set; } = null!; - } -} - diff --git a/AsbCloudApp/Data/DailyReport/TimeBalanceDto.cs b/AsbCloudApp/Data/DailyReport/TimeBalanceDto.cs deleted file mode 100644 index 855d5fd7..00000000 --- a/AsbCloudApp/Data/DailyReport/TimeBalanceDto.cs +++ /dev/null @@ -1,18 +0,0 @@ -using System.Collections.Generic; - -namespace AsbCloudApp.Data.DailyReport -{ - - /// - /// Блок баланса времени - /// - public class TimeBalanceDto : ItemInfoDto - { - /// - /// Статистика по операциям - /// - public Dictionary OperationsStat { get; set; } = new Dictionary(); - - } -} - diff --git a/AsbCloudApp/Services/AutoGeneratedDailyReports/IAutoGeneratedDailyReportService.cs b/AsbCloudApp/Services/AutoGeneratedDailyReports/IAutoGeneratedDailyReportService.cs deleted file mode 100644 index 979f948c..00000000 --- a/AsbCloudApp/Services/AutoGeneratedDailyReports/IAutoGeneratedDailyReportService.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using System.IO; -using System.Threading; -using System.Threading.Tasks; -using AsbCloudApp.Data; -using AsbCloudApp.Data.AutogeneratedDailyReport; -using AsbCloudApp.Requests; - -namespace AsbCloudApp.Services.AutoGeneratedDailyReports; - -/// -/// Сервис для работы с авто-генерируемыми суточными отчётами -/// -public interface IAutoGeneratedDailyReportService -{ - /// - /// Список файлов суточных отчётов - /// - /// - /// - /// - /// - Task> GetListAsync(int idWell, - FileReportRequest request, - CancellationToken cancellationToken); - - /// - /// Генерация файла с отчётом - /// - /// - /// - /// - /// - Task<(string fileName, Stream stream)> GenerateAsync(int idWell, DateOnly reportDate, - CancellationToken cancellationToken); - - /// - /// Получение диапазона дат - /// - /// - /// - /// - Task GetDatesRangeAsync(int idWell, CancellationToken cancellationToken); -} \ No newline at end of file diff --git a/AsbCloudApp/Services/IDailyReportService.cs b/AsbCloudApp/Services/IDailyReportService.cs deleted file mode 100644 index 66e7bd71..00000000 --- a/AsbCloudApp/Services/IDailyReportService.cs +++ /dev/null @@ -1,55 +0,0 @@ -using AsbCloudApp.Data; -using AsbCloudApp.Data.DailyReport; -using System; -using System.Collections.Generic; -using System.IO; -using System.Threading; -using System.Threading.Tasks; - -namespace AsbCloudApp.Services -{ - /// - /// Суточный рапорт (сводка) - /// - public interface IDailyReportService - { - /// - /// получить список сформированных рапортов по скважине за период времени - /// - /// - /// - /// - /// - /// - Task> GetListAsync(int idWell, DateOnly? begin, DateOnly? end, CancellationToken cancellationToken); - - /// - /// Добавить новый рапорт - /// - /// - /// - /// - /// - /// - Task AddAsync(int idWell, DateOnly startDate, int idUser, CancellationToken token); - - /// - /// Сформировать файл рапорта - /// - /// - /// - /// - /// - Task MakeReportAsync(int idWell, DateOnly date, CancellationToken token); - - /// - /// изменить блок данных для суточного рапорта - /// - /// - /// - /// - /// - /// - Task UpdateBlockAsync(int idWell, DateOnly startDate, ItemInfoDto dto, CancellationToken token); - } -} diff --git a/AsbCloudDb/Model/DailyReport/Bha.cs b/AsbCloudDb/Model/DailyReport/Bha.cs deleted file mode 100644 index b1765c19..00000000 --- a/AsbCloudDb/Model/DailyReport/Bha.cs +++ /dev/null @@ -1,61 +0,0 @@ -namespace AsbCloudDb.Model.DailyReport -{ - public class Bha : ItemInfo - { - /// - /// КНБК описание - /// - public string BHADescription { get; set; } = string.Empty; - - /// - /// Бурение с наращиваниями в инт. 2195-2763м. Время начала - /// - public string ExtensionDrillingOneBegin { get; set; } = string.Empty; - - /// - /// Бурение с наращиваниями в инт. 2195-2763м. Время окончания - /// - public string ExtensionDrillingOneFinish { get; set; } = string.Empty; - - /// - /// Промывка. Время начала - /// - public string SluiceBegin { get; set; } = string.Empty; - - /// - /// Промывка. Время окончания - /// - public string SluiceFinish { get; set; } = string.Empty; - - /// - /// Подьем КНБК. Время начала - /// - public string ClimbBegin { get; set; } = string.Empty; - - /// - /// Подьем КНБК. Время окончания - /// - public string ClimbFinish { get; set; } = string.Empty; - - /// - /// Спуск КНБК. Время начала - /// - public string DescentBegin { get; set; } = string.Empty; - - /// - /// Спуск КНБК. Время окончания - /// - public string DescentFinish { get; set; } = string.Empty; - - /// - /// Бурение с наращиваниями в инт. 2763-2850м. Время начала - /// - public string ExtensionDrillingTwoBegin { get; set; } = string.Empty; - - /// - /// Бурение с наращиваниями в инт. 2763-2850м. Время окончания - /// - public string ExtensionDrillingTwoFinish { get; set; } = string.Empty; - - } -} diff --git a/AsbCloudDb/Model/DailyReport/DailyReport.cs b/AsbCloudDb/Model/DailyReport/DailyReport.cs deleted file mode 100644 index f620221f..00000000 --- a/AsbCloudDb/Model/DailyReport/DailyReport.cs +++ /dev/null @@ -1,22 +0,0 @@ -using Microsoft.EntityFrameworkCore; -using System; -using System.ComponentModel.DataAnnotations.Schema; - -namespace AsbCloudDb.Model.DailyReport -{ - [Table("t_daily_report"), Comment("Ежедневные отчёты")] - public class DailyReport - { - [Column("id_well"), Comment("ID скважины")] - public int IdWell { get; set; } - - [Column("start_date", TypeName = "date"), Comment("Дата отчёта")] - public DateOnly StartDate { get; set; } - - [Column("info", TypeName = "jsonb"), Comment("Список параметров для отчёта")] - public DailyReportInfo Info { get; set; } = null!; - - [ForeignKey(nameof(IdWell))] - public virtual Well Well { get; set; } = null!; - } -} \ No newline at end of file diff --git a/AsbCloudDb/Model/DailyReport/DailyReportInfo.cs b/AsbCloudDb/Model/DailyReport/DailyReportInfo.cs deleted file mode 100644 index d5a7bfd6..00000000 --- a/AsbCloudDb/Model/DailyReport/DailyReportInfo.cs +++ /dev/null @@ -1,13 +0,0 @@ -using AsbCloudDb.Model.DailyReport; - -namespace AsbCloudDb.Model -{ - public class DailyReportInfo - { - public Head Head { get; set; } = null!; - public Bha Bha { get; set; } = new(); - public NoDrilling NoDrilling { get; set; } = new(); - public Saub Saub { get; set; } = new(); - public Sign Sign { get; set; } = new(); - } -} diff --git a/AsbCloudDb/Model/DailyReport/Head.cs b/AsbCloudDb/Model/DailyReport/Head.cs deleted file mode 100644 index fc5542e8..00000000 --- a/AsbCloudDb/Model/DailyReport/Head.cs +++ /dev/null @@ -1,110 +0,0 @@ -using System; -using System.Text.Json.Serialization; - -namespace AsbCloudDb.Model.DailyReport -{ - public class Head : ItemInfo - { - /// - /// название скважины - /// - public string WellName { get; set; } = string.Empty; - - /// - /// название куста - /// - public string ClusterName { get; set; } = string.Empty; - - /// - /// заказчик - /// - public string Customer { get; set; } = string.Empty; - - /// - /// подрядчик - /// - public string Contractor { get; set; } = string.Empty; - - /// - /// дата рапорта - /// - [JsonConverter(typeof(DateOnlyJsonConverter))] - public DateOnly ReportDate { get; set; } - - /// - /// глубина забоя на дату начала интервала - /// - public double? WellDepthIntervalStartDate { get; set; } - - /// - /// глубина забоя на дату окончания интервала - /// - public double? WellDepthIntervalFinishDate { get; set; } - - /// - /// Глубина забоя по стволу на окончание отчетного периода - /// - public double? BottomholeDepth { get; set; } - - /// - /// Глубина забоя по вертикали на дату окончания отчетного периода - /// - public double? VerticalDepth { get; set; } - - /// - /// Зенитный угол на дату окончания отчетного периода - /// - public double? ZenithAngle { get; set; } - - /// - /// Азимутальный угол на дату окончания отчетного периода - /// - public double? AzimuthAngle { get; set; } - - /// - /// ФИО бурильщиков - /// - public string FirstDriller { get; set; } = string.Empty; - - /// - /// ФИО бурильщиков - /// - public string SecondDriller { get; set; } = string.Empty; - - /// - /// Время работы АПД - /// - public double? WorkTimeSAUB { get; set; } - - /// - /// Время работы спин мастер - /// - public double? WorkTimeSpinMaster { get; set; } - - /// - /// Время работы torqueMaster - /// - public double? WorkTimeTorkMaster { get; set; } - - /// - /// количество метров пробуренных с включенным АПД - /// - public double? PenetrationSAUB { get; set; } - - /// - /// количество метров пробуренных с включенным Спин мастер - /// - public double? PenetrationSpinMaster { get; set; } - - /// - /// количество метров пробуренных с включенным torqueMaster - /// - public double? PenetrationTorkMaster { get; set; } - - /// - /// Количество запусков МСЕ - /// - public int CountLaunchesMSE { get; set; } - } -} - diff --git a/AsbCloudDb/Model/DailyReport/NoDrilling.cs b/AsbCloudDb/Model/DailyReport/NoDrilling.cs deleted file mode 100644 index c1a3b604..00000000 --- a/AsbCloudDb/Model/DailyReport/NoDrilling.cs +++ /dev/null @@ -1,26 +0,0 @@ -namespace AsbCloudDb.Model.DailyReport -{ - public class NoDrilling : ItemInfo - { - /// - /// Нормативное время на одну операцию по подготовке ствола скважины к наращиванию - /// - public double? StandardTimeBarrelPreparation { get; set; } - - /// - /// Нормативное время на одну операцию по наращиванию - /// - public double? StandardTimeExtension { get; set; } - - /// - /// Фактическое время проработок при подготовке ствола скважины к наращиванию. - /// - public double? ActualTimeBarrelPreparation { get; set; } - - /// - /// Фактическое время наращиваний - /// - public double? ActualTimeExtension { get; set; } - } -} - diff --git a/AsbCloudDb/Model/DailyReport/Saub.cs b/AsbCloudDb/Model/DailyReport/Saub.cs deleted file mode 100644 index 43202677..00000000 --- a/AsbCloudDb/Model/DailyReport/Saub.cs +++ /dev/null @@ -1,101 +0,0 @@ -namespace AsbCloudDb.Model.DailyReport -{ - public class Saub : ItemInfo - { - /// - /// Режимы бурения в роторе - /// - public string? RotorDrillingModes { get; set; } - - /// - /// режимы бурения в слайде - /// - public string? SlideDrillingModes { get; set; } - - /// - /// Количество метров пробуренных в роторе за отчетный период - /// - public double? PenetrationInRotor { get; set; } - - /// - /// Количество часов бурения в роторе за отчетный период - /// - public double? NumberDrillingHours { get; set; } - - /// - /// средний диф перепад в роторе за отчетный период - /// - public double? AVGDiffDropRotor { get; set; } - - /// - /// количество метров пробуренных в слайде за отчетный период - /// - public double? PenetrationInSlide { get; set; } - - /// - /// время бурения в роторе за отчетный период - /// - public double? DrillingTimeInRotor { get; set; } - - /// - /// средний диф. перепад в слайде за отчетный период - /// - public double? AVGDiffPressureSlide { get; set; } - - /// - /// Плановая МСП за секцию - /// - public double? SectionROPPlan { get; set; } - - /// - /// Общее время бурения за секцию - /// - public double? SectionDrillingTimeTotal { get; set; } - - /// - /// Общая проходка за секцию - /// - public double? SectionPenetrationTotal { get; set; } - - /// - /// Количество наращиваний за отчетный период - /// - public int ExtensionsCount { get; set; } - - /// - /// Отклонение относительно ГГД - /// - public double? DeviationFromTVD { get; set; } - - /// - /// указываются все причины, которые влияют на снижение МСП. - /// - public string DeclinesReasonsROP { get; set; } = string.Empty; - - /// - /// Увеличение мех скорости за секцию % - /// - public string IncreaseSpeedSection { get; set; } = string.Empty; - - /// - /// Увеличение мех скорости за сутки % - /// - public string IncreaseSpeedDay { get; set; } = string.Empty; - - /// - /// Сокращение времени бурения за секцию, ч - /// - public string ReductionTimeDrilling { get; set; } = string.Empty; - - /// - /// Ротор/Слайд % - /// - public string RotorSlidePercent { get; set; } = string.Empty; - - /// - /// МСП - /// - public string MspSection { get; set; } = string.Empty; - } -} - diff --git a/AsbCloudDb/Model/DailyReport/Sign.cs b/AsbCloudDb/Model/DailyReport/Sign.cs deleted file mode 100644 index 1b443348..00000000 --- a/AsbCloudDb/Model/DailyReport/Sign.cs +++ /dev/null @@ -1,16 +0,0 @@ -namespace AsbCloudDb.Model.DailyReport -{ - public class Sign : ItemInfo - { - /// - /// ФИО Мастера буровой - /// - public string DrillingMaster { get; set; } = string.Empty; - - /// - /// ФИО супервайзера - /// - public string Supervisor { get; set; } = string.Empty; - } -} - diff --git a/AsbCloudInfrastructure/Services/AutoGeneratedDailyReports/AutoGeneratedDailyReportMakerService.cs b/AsbCloudInfrastructure/Services/AutoGeneratedDailyReports/AutoGeneratedDailyReportMakerService.cs deleted file mode 100644 index cfc95753..00000000 --- a/AsbCloudInfrastructure/Services/AutoGeneratedDailyReports/AutoGeneratedDailyReportMakerService.cs +++ /dev/null @@ -1,55 +0,0 @@ -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Reflection; -using System.Threading; -using System.Threading.Tasks; -using AsbCloudApp.Data.AutogeneratedDailyReport; -using AsbCloudApp.Services; -using AsbCloudInfrastructure.Services.AutoGeneratedDailyReports.AutogeneratedDailyReportBlocks; -using ClosedXML.Excel; - -namespace AsbCloudInfrastructure.Services.AutoGeneratedDailyReports; - -public class AutoGeneratedDailyReportMakerService : IReportMakerService -{ - private readonly string templateName = "AutogeneratedDailyReportTemplate.xlsx"; - - private readonly IEnumerable blockWriters = new List() - { - new HeadExcelBlockWriter(), - new SubsystemExcelBlockWriter(), - new LimitingParameterExcelBlockWriter(), - new TimeBalanceExcelBlockWriter() - }; - - public async Task MakeReportAsync(AutoGeneratedDailyReportDto report, CancellationToken cancellationToken) - { - using var excelTemplateStream = await Assembly - .GetExecutingAssembly() - .GetTemplateCopyStreamAsync(templateName, cancellationToken); - - using var workbook = new XLWorkbook(excelTemplateStream, XLEventTracking.Disabled); - - AddToWorkbook(workbook, report); - - MemoryStream memoryStream = new MemoryStream(); - workbook.SaveAs(memoryStream, new SaveOptions { }); - memoryStream.Seek(0, SeekOrigin.Begin); - - return memoryStream; - } - - private void AddToWorkbook(XLWorkbook workbook, AutoGeneratedDailyReportDto report) - { - const string sheetName = "Рапорт"; - - var sheet = workbook.Worksheets.FirstOrDefault(ws => ws.Name == sheetName) - ?? throw new FileFormatException($"Книга excel не содержит листа {sheetName}."); - - foreach (var blockBuilder in blockWriters) - { - blockBuilder.Write(sheet, report); - } - } -} \ No newline at end of file diff --git a/AsbCloudInfrastructure/Services/AutoGeneratedDailyReports/AutoGeneratedDailyReportService.cs b/AsbCloudInfrastructure/Services/AutoGeneratedDailyReports/AutoGeneratedDailyReportService.cs deleted file mode 100644 index 1ada2676..00000000 --- a/AsbCloudInfrastructure/Services/AutoGeneratedDailyReports/AutoGeneratedDailyReportService.cs +++ /dev/null @@ -1,262 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using AsbCloudApp.Data; -using AsbCloudApp.Data.AutogeneratedDailyReport; -using AsbCloudApp.Data.Subsystems; -using AsbCloudApp.Exceptions; -using AsbCloudApp.Repositories; -using AsbCloudApp.Requests; -using AsbCloudApp.Services; -using AsbCloudApp.Services.AutoGeneratedDailyReports; -using AsbCloudApp.Services.Subsystems; -using AsbCloudDb.Model; - -namespace AsbCloudInfrastructure.Services.AutoGeneratedDailyReports; - -public class AutoGeneratedDailyReportService : IAutoGeneratedDailyReportService -{ - private const string fileNameTemplate = "Суточный_отчёт_по_скважине_{0}_куст_{1}_от_{2}.xlsx"; - - private readonly IWellService wellService; - private readonly IWellOperationRepository wellOperationRepository; - private readonly ISubsystemOperationTimeService subsystemOperationTimeService; - private readonly ICrudRepository subsystemRepository; - private readonly ILimitingParameterService limitingParameterService; - private readonly IReportMakerService autoGeneratedDailyReportMakerService; - - public AutoGeneratedDailyReportService(IWellService wellService, - IWellOperationRepository wellOperationRepository, - ISubsystemOperationTimeService subsystemOperationTimeService, - ICrudRepository subsystemRepository, - ILimitingParameterService limitingParameterService, - IReportMakerService autoGeneratedDailyReportMakerService) - { - this.wellOperationRepository = wellOperationRepository; - this.wellService = wellService; - this.subsystemOperationTimeService = subsystemOperationTimeService; - this.subsystemRepository = subsystemRepository; - this.limitingParameterService = limitingParameterService; - this.autoGeneratedDailyReportMakerService = autoGeneratedDailyReportMakerService; - } - - public async Task> GetListAsync(int idWell, - FileReportRequest request, - CancellationToken cancellationToken) - { - var result = new PaginationContainer - { - Skip = request.Skip ?? 0, - Take = request.Take ?? 10, - Items = Enumerable.Empty() - }; - - var reports = new List(); - - var well = await wellService.GetOrDefaultAsync(idWell, cancellationToken) - ?? throw new ArgumentInvalidException(nameof(idWell), "Скважина не найдена"); - - if (!well.IdTelemetry.HasValue) - throw new ArgumentInvalidException(nameof(idWell), "Телеметрия для скважины отсутствует"); - - var datesRange = await GetDatesRangeAsync(idWell, cancellationToken); - - if (datesRange is null) - return result; - - if (request.GeDate.HasValue) - { - var startDate = new DateTime(request.GeDate.Value.Year, request.GeDate.Value.Month, - request.GeDate.Value.Day); - - if(startDate.Date >= datesRange.From.Date) - datesRange.From = startDate; - } - - if (request.LeDate.HasValue) - { - var finishDate = new DateTime(request.LeDate.Value.Year, request.LeDate.Value.Month, - request.LeDate.Value.Day); - - if (finishDate.Date <= datesRange.To.Date) - datesRange.To = finishDate; - } - - if (datesRange.From.AddDays(result.Skip) <= datesRange.To) - result.Count = (int)(Math.Ceiling((datesRange.To - DateTime.UnixEpoch).TotalDays) - Math.Floor((datesRange.From - DateTime.UnixEpoch).TotalDays)); - - for (int day = result.Skip; (day - result.Skip) < result.Take && (datesRange.From.AddDays(day)) <= datesRange.To; day++) - { - var reportDate = DateOnly.FromDateTime(datesRange.From.AddDays(day)); - - reports.Add(new AutoGeneratedDailyReportInfoDto - { - FileName = string.Format(fileNameTemplate, well.Caption, well.Cluster, reportDate), - ReportDate = reportDate, - FileSize = GetFileSize(reportDate, idWell), - }); - } - - result.Items = reports; - - return result; - } - - public async Task<(string fileName, Stream stream)> GenerateAsync(int idWell, DateOnly reportDate, - CancellationToken cancellationToken) - { - var startDate = new DateTime(reportDate.Year, reportDate.Month, reportDate.Day); - var finishDate = startDate.AddDays(1); - - var well = await wellService.GetOrDefaultAsync(idWell, cancellationToken) - ?? throw new ArgumentInvalidException(nameof(idWell), "Скважина не найдена"); - - if (!well.IdTelemetry.HasValue) - throw new ArgumentInvalidException(nameof(idWell), "Телеметрия для скважины отсутствует"); - - var factOperations = await GetFactOperationsAsync(well.Id, startDate, finishDate, - cancellationToken); - - var report = new AutoGeneratedDailyReportDto - { - FileName = string.Format(fileNameTemplate, well.Caption, well.Cluster, reportDate), - FileSize = GetFileSize(reportDate, idWell), - ReportDate = reportDate, - Head = CreateHeadBlock(well, factOperations), - Subsystems = (await CreateSubsystemBlockAsync(idWell, startDate, finishDate, cancellationToken)).ToArray(), - LimitingParameters = (await CreateLimitingParameterBlockAsync(idWell, startDate, finishDate, cancellationToken)).ToArray(), - TimeBalance = factOperations.GroupBy(w => w.CategoryName).Select(x => new TimeBalanceRecordDto - { - Name = x.Key ?? "Название операции отсутствует", - DurationHours = x.Sum(o => o.DurationHours) - }).ToArray(), - }; - - var stream = await autoGeneratedDailyReportMakerService.MakeReportAsync(report, cancellationToken); - - return (report.FileName, stream); - } - - public async Task GetDatesRangeAsync(int idWell, CancellationToken cancellationToken) - { - var factOperations = await GetFactOperationsAsync(idWell, null, null, - cancellationToken); - - if (!factOperations.Any()) - return null; - - return new DatesRangeDto - { - From = factOperations.Min(o => o.DateStart).Date, - To = factOperations.Max(o => o.DateStart).Date - }; - } - - private HeadBlockDto CreateHeadBlock(WellDto well, IEnumerable factOperations) - { - var customer = well.Companies.FirstOrDefault(company => company.IdCompanyType == 1); - var sortedFactOperations = factOperations.OrderBy(o => o.DateStart); - - return new HeadBlockDto - { - Customer = customer?.Caption ?? string.Empty, - Deposit = well.Deposit ?? string.Empty, - Cluster = well.Cluster ?? string.Empty, - Well = well.Caption, - DepthFrom = sortedFactOperations.FirstOrDefault()?.DepthStart ?? 0.00, - DepthTo = sortedFactOperations.LastOrDefault()?.DepthEnd ?? 0.00 - }; - } - - private async Task> CreateSubsystemBlockAsync(int idWell, DateTime startDate, - DateTime finishDate, - CancellationToken cancellationToken) - { - var subsystems = await subsystemRepository.GetAllAsync(cancellationToken); - var subsystemStats = await GetSubsystemStatsAsync(idWell, startDate, finishDate, - cancellationToken); - - return subsystems.Select(subsystem => - { - var subsytemStat = subsystemStats?.FirstOrDefault(s => s.IdSubsystem == subsystem.Id); - - return new SubsystemRecordDto - { - Name = subsystem.Name, - KUsage = subsytemStat?.KUsage ?? 0.00, - UsedTimeHours = subsytemStat?.UsedTimeHours ?? 0.00, - Depth = subsytemStat?.SumDepthInterval ?? 0.00, - }; - }); - } - - private async Task> CreateLimitingParameterBlockAsync(int idWell, - DateTime startDate, DateTime finishDate, CancellationToken cancellationToken) - { - var limitingParameterStats = (await GetLimitingParameterStatsAsync(idWell, - startDate, finishDate, cancellationToken)).ToArray(); - - var sumDepths = limitingParameterStats.Sum(x => x.Depth); - - return limitingParameterStats.Select(l => new LimitingParameterRecordDto - { - NameFeedRegulator = l.NameFeedRegulator, - Hours = l.TotalMinutes, - PercentDepth = sumDepths != 0 ? l.Depth / sumDepths : 0, - Depth = l.Depth, - }); - } - - private async Task> GetFactOperationsAsync(int idWell, DateTime? startDate, - DateTime? finishDate, CancellationToken cancellationToken) - { - var request = new WellOperationRequest - { - IdWell = idWell, - OperationType = WellOperation.IdOperationTypeFact, - GeDate = startDate, - LtDate = finishDate, - SortFields = new[] { "DateStart asc" }, - }; - - return (await wellOperationRepository.GetAsync(request, cancellationToken)) - .OrderBy(w => w.DateStart); - } - - private Task> GetSubsystemStatsAsync(int idWell, DateTime startDate, - DateTime finishDate, CancellationToken cancellationToken) - { - var request = new SubsystemOperationTimeRequest - { - IdWell = idWell, - GtDate = startDate, - LtDate = finishDate, - }; - - return subsystemOperationTimeService.GetStatAsync(request, cancellationToken); - } - - private Task> GetLimitingParameterStatsAsync(int idWell, - DateTime startDate, DateTime finishDate, CancellationToken cancellationToken) - { - var request = new LimitingParameterRequest - { - IdWell = idWell, - GtDate = startDate, - LtDate = finishDate, - }; - - return limitingParameterService.GetStatAsync(request, cancellationToken); - } - - private int GetFileSize(DateOnly reportDate, int idWell) - { - const int fileSizeTemplate = 10240; - long ticks = 1L * reportDate.Year * reportDate.Month * reportDate.Day * idWell; - int remainder = (int)(ticks % (fileSizeTemplate / 10)); - return fileSizeTemplate + remainder; - } -} \ No newline at end of file diff --git a/AsbCloudInfrastructure/Services/AutoGeneratedDailyReports/AutogeneratedDailyReportBlocks/HeadExcelBlockWriter.cs b/AsbCloudInfrastructure/Services/AutoGeneratedDailyReports/AutogeneratedDailyReportBlocks/HeadExcelBlockWriter.cs deleted file mode 100644 index dad6bf35..00000000 --- a/AsbCloudInfrastructure/Services/AutoGeneratedDailyReports/AutogeneratedDailyReportBlocks/HeadExcelBlockWriter.cs +++ /dev/null @@ -1,34 +0,0 @@ -using AsbCloudApp.Data.AutogeneratedDailyReport; -using ClosedXML.Excel; - -namespace AsbCloudInfrastructure.Services.AutoGeneratedDailyReports.AutogeneratedDailyReportBlocks; - -public class HeadExcelBlockWriter : IExcelBlockWriter -{ - private static readonly (int, int) customerCell = (2, 2); - private static readonly (int, int) depositCell = (4, 2); - private static readonly (int, int) clusterCell = (5, 2); - private static readonly (int, int) wellCell = (6, 2); - - private const int dateRow = 9; - private const int dateFromColumn = 2; - private const int dateFromToColumn = 3; - - private const int depthRow = 10; - private const int depthFromColumn = 2; - private const int depthToColumn = 3; - - public void Write(IXLWorksheet sheet, AutoGeneratedDailyReportDto report) - { - sheet.Cell(customerCell.Item1, customerCell.Item2).Value = report.Head.Customer; - sheet.Cell(depositCell.Item1, depositCell.Item2).Value = report.Head.Deposit; - sheet.Cell(clusterCell.Item1, clusterCell.Item2).Value = report.Head.Cluster; - sheet.Cell(wellCell.Item1, wellCell.Item2).Value = report.Head.Well; - - sheet.Cell(dateRow, dateFromColumn).Value = report.ReportDate; - sheet.Cell(dateRow, dateFromToColumn).Value = report.ReportDate.AddDays(1); - - sheet.Cell(depthRow, depthFromColumn).Value = report.Head.DepthFrom; - sheet.Cell(depthRow, depthToColumn).Value = report.Head.DepthTo; - } -} \ No newline at end of file diff --git a/AsbCloudInfrastructure/Services/AutoGeneratedDailyReports/AutogeneratedDailyReportBlocks/IExcelBlockWriter.cs b/AsbCloudInfrastructure/Services/AutoGeneratedDailyReports/AutogeneratedDailyReportBlocks/IExcelBlockWriter.cs deleted file mode 100644 index 0f83fe05..00000000 --- a/AsbCloudInfrastructure/Services/AutoGeneratedDailyReports/AutogeneratedDailyReportBlocks/IExcelBlockWriter.cs +++ /dev/null @@ -1,9 +0,0 @@ -using AsbCloudApp.Data.AutogeneratedDailyReport; -using ClosedXML.Excel; - -namespace AsbCloudInfrastructure.Services.AutoGeneratedDailyReports.AutogeneratedDailyReportBlocks; - -public interface IExcelBlockWriter -{ - void Write(IXLWorksheet sheet, AutoGeneratedDailyReportDto report); -} \ No newline at end of file diff --git a/AsbCloudInfrastructure/Services/AutoGeneratedDailyReports/AutogeneratedDailyReportBlocks/LimitingParameterExcelBlockWriter.cs b/AsbCloudInfrastructure/Services/AutoGeneratedDailyReports/AutogeneratedDailyReportBlocks/LimitingParameterExcelBlockWriter.cs deleted file mode 100644 index 30cf36f0..00000000 --- a/AsbCloudInfrastructure/Services/AutoGeneratedDailyReports/AutogeneratedDailyReportBlocks/LimitingParameterExcelBlockWriter.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.Linq; -using AsbCloudApp.Data.AutogeneratedDailyReport; -using ClosedXML.Excel; - -namespace AsbCloudInfrastructure.Services.AutoGeneratedDailyReports.AutogeneratedDailyReportBlocks; - -public class LimitingParameterExcelBlockWriter : IExcelBlockWriter -{ - private const int rowHeaderBlock = 20; - - private const int columnNameFeedRegulator = 1; - private const int columnDepth = 2; - private const int columnTotalHours = 3; - private const int columnPercentDepth = 4; - - public void Write(IXLWorksheet sheet, AutoGeneratedDailyReportDto report) - { - var i = 1; - foreach (var limitingParameter in report.LimitingParameters) - { - var row = sheet.Row( i++ + rowHeaderBlock); - row.Cell(columnNameFeedRegulator).Value = limitingParameter.NameFeedRegulator; - row.Cell(columnDepth).Value = limitingParameter.Depth; - row.Cell(columnTotalHours).Value = limitingParameter.Hours; - row.Cell(columnPercentDepth).Value = limitingParameter.PercentDepth; - } - } -} \ No newline at end of file diff --git a/AsbCloudInfrastructure/Services/AutoGeneratedDailyReports/AutogeneratedDailyReportBlocks/SubsystemExcelBlockWriter.cs b/AsbCloudInfrastructure/Services/AutoGeneratedDailyReports/AutogeneratedDailyReportBlocks/SubsystemExcelBlockWriter.cs deleted file mode 100644 index a1b25c88..00000000 --- a/AsbCloudInfrastructure/Services/AutoGeneratedDailyReports/AutogeneratedDailyReportBlocks/SubsystemExcelBlockWriter.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.Linq; -using AsbCloudApp.Data.AutogeneratedDailyReport; -using ClosedXML.Excel; - -namespace AsbCloudInfrastructure.Services.AutoGeneratedDailyReports.AutogeneratedDailyReportBlocks; - -public class SubsystemExcelBlockWriter : IExcelBlockWriter -{ - private const int rowHeaderBlock = 13; - - private const int columnName = 1; - private const int columnKUsage = 2; - private const int columnDepth = 3; - private const int columnUsedTimeHours = 4; - - public void Write(IXLWorksheet sheet, AutoGeneratedDailyReportDto report) - { - var i = 1; - foreach( var subsystem in report.Subsystems ) - { - var row = sheet.Row(i++ + rowHeaderBlock); - row.Cell(columnName).Value = subsystem.Name; - row.Cell(columnKUsage).Value = subsystem.KUsage; - row.Cell(columnDepth).Value = subsystem.Depth; - row.Cell(columnUsedTimeHours).Value = subsystem.UsedTimeHours; - } - } -} \ No newline at end of file diff --git a/AsbCloudInfrastructure/Services/AutoGeneratedDailyReports/AutogeneratedDailyReportBlocks/TimeBalanceExcelBlockWriter.cs b/AsbCloudInfrastructure/Services/AutoGeneratedDailyReports/AutogeneratedDailyReportBlocks/TimeBalanceExcelBlockWriter.cs deleted file mode 100644 index 51e4643e..00000000 --- a/AsbCloudInfrastructure/Services/AutoGeneratedDailyReports/AutogeneratedDailyReportBlocks/TimeBalanceExcelBlockWriter.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.Linq; -using AsbCloudApp.Data.AutogeneratedDailyReport; -using ClosedXML.Excel; - -namespace AsbCloudInfrastructure.Services.AutoGeneratedDailyReports.AutogeneratedDailyReportBlocks; - -public class TimeBalanceExcelBlockWriter : IExcelBlockWriter -{ - private const int rowHeaderBlock = 27; - - private const int columnName = 1; - private const int columnDurationHours = 2; - - public void Write(IXLWorksheet sheet, AutoGeneratedDailyReportDto report) - { - var i = 1; - foreach(var timeBalance in report.TimeBalance) - { - var row = sheet.Row(i++ + rowHeaderBlock); - row.Cell(columnName).Value = timeBalance.Name; - row.Cell(columnDurationHours).Value = timeBalance.DurationHours; - AddBorderToCell(row.Cell(columnName)); - AddBorderToCell(row.Cell(columnDurationHours)); - } - } - - private static void AddBorderToCell(IXLCell cell) - { - cell.Style.Border.TopBorder = XLBorderStyleValues.Thin; - cell.Style.Border.BottomBorder = XLBorderStyleValues.Thin; - cell.Style.Border.LeftBorder = XLBorderStyleValues.Thin; - cell.Style.Border.RightBorder = XLBorderStyleValues.Thin; - } -} \ No newline at end of file diff --git a/AsbCloudInfrastructure/Services/AutoGeneratedDailyReports/AutogeneratedDailyReportTemplate.xlsx b/AsbCloudInfrastructure/Services/AutoGeneratedDailyReports/AutogeneratedDailyReportTemplate.xlsx deleted file mode 100644 index 0a887a4ea3cc1fc8e1837d15eef29dbde554180c..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 10158 zcmeHtgb~k&! zzu?}U=Q(}mnXWo>y56d;uD6xtp`ftss{xZ2$ey$S8j>~-00|!dzxH1|163)LZw6V=CGTXO#19$ewi-m>InRSf zG3ix=`i7E6D$Mk9Y;0a~q8`!3^095X>oI4yeA%w1ts5LbEy0l^ovO$&L1TRyh6LQq z!=q00uQn`Ml~^ZM%s}p zbjx_hHv4zqXnw@tnJ8aGKbQwD+1k+g8eShT%0kDG`)=WQ7#1s&X{*ths5~M%|v-f$i+!CRXIYZzzwxsn8usv}5S?)A#e~rHzldQGV#)!nQVI z)XNbGA`4zv11Q_YG~raUIn4SG31b&3OkNI|L3ee!Kq99si4c@Gq}k zm87UN$buYxA@dY5cDKBph%P4YDJs)Rrv5fib_=aJu8@*oyO)L#T^&CJN;;tX?bF2O zwm{sMF|ylzj;a_;EPj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Tm*R91<6^a5)$y+MWn)Lsh4*#NjLTEl-Gm?NYE4u6 ziR~Q%afp30264r!2cbQ|z8X_6Lz;InaV&Oa#5@UbCm*>FNcxVMt$xG^u_dtKi>x?Y|2C z#sU2QS?*u;{7QEIsp$fI`0E$y^HaCtN&xq_p6q_FV27J0008PsQJfI m{j2!j1La@E*~$MR{zuqUmWKgb7XUy6e*(eTz$>cXzWpDsbf_=@ diff --git a/AsbCloudInfrastructure/Services/DailyReport/BlockAbstract.cs b/AsbCloudInfrastructure/Services/DailyReport/BlockAbstract.cs deleted file mode 100644 index 92286ee6..00000000 --- a/AsbCloudInfrastructure/Services/DailyReport/BlockAbstract.cs +++ /dev/null @@ -1,13 +0,0 @@ -using ClosedXML.Excel; - -namespace AsbCloudInfrastructure.Services.DailyReport -{ - - abstract class BlockAbstract - { - public abstract CellAddress AddressBlockBegin { get; } - public abstract CellAddress AddressBlockEnd { get; } - public abstract void Draw(IXLWorksheet sheet); - } - -} diff --git a/AsbCloudInfrastructure/Services/DailyReport/CellAddress.cs b/AsbCloudInfrastructure/Services/DailyReport/CellAddress.cs deleted file mode 100644 index 10329a4c..00000000 --- a/AsbCloudInfrastructure/Services/DailyReport/CellAddress.cs +++ /dev/null @@ -1,174 +0,0 @@ -using ClosedXML.Excel; -using System; -using System.Diagnostics.CodeAnalysis; -using System.Text; - -namespace AsbCloudInfrastructure.Services.DailyReport -{ - - internal class CellAddress: IXLAddress - { - const int excelLettersCount = 'Z' - 'A' + 1; - public int RowNumber { get; set; } - public int ColumnNumber { get; set; } - - public string ColumnLetter - { - get { return CalcColumnLetter(); } - } - - public bool FixedColumn { get; set; } - - public bool FixedRow { get; set; } - - public string UniqueId => ToString(XLReferenceStyle.A1, true); - - public IXLWorksheet? Worksheet { get; set; } - - public CellAddress(IXLWorksheet? worksheet, int row, int colunm) - { - Worksheet = worksheet; - RowNumber = row; - ColumnNumber = colunm; - } - - public static CellAddress operator + (CellAddress a, CellAddress b) - => new CellAddress(a.Worksheet, a.RowNumber + b.RowNumber, a.ColumnNumber + b.ColumnNumber); - public static CellAddress operator +(CellAddress a, (int row, int column) b) - => new CellAddress(a.Worksheet, a.RowNumber + b.row, a.ColumnNumber + b.column); - public static CellAddress operator - (CellAddress a, CellAddress b) - => new CellAddress(a.Worksheet, a.RowNumber - b.RowNumber, a.ColumnNumber - b.ColumnNumber); - public static bool operator == (CellAddress a, CellAddress b) - => a.RowNumber == b.RowNumber && a.ColumnNumber == b.ColumnNumber; - public static bool operator !=(CellAddress a, CellAddress b) - => !(a == b); - - private string CalcColumnLetter() - { - string letter = ""; - var columnNumber = ColumnNumber; - while (columnNumber > 0) - { - int modulo = (columnNumber - 1) % excelLettersCount; - letter = Convert.ToChar('A' + modulo) + letter; - columnNumber = (columnNumber - modulo) / excelLettersCount; - } - - return letter; - } - - public CellAddress Copy() - => new CellAddress(Worksheet, RowNumber, ColumnNumber) - { - FixedColumn = this.FixedColumn, - FixedRow = this.FixedRow, - }; - - public override string ToString() - => ToString(XLReferenceStyle.A1); - - public string ToString(XLReferenceStyle referenceStyle) - => ToString(referenceStyle, false); - - public string ToString(XLReferenceStyle referenceStyle, bool includeSheet) - { - if (referenceStyle == XLReferenceStyle.R1C1) - throw new NotImplementedException("R1C1 - style doesn't implemented"); - - var sb = new StringBuilder(); - if (includeSheet && Worksheet is not null) - sb.Append('$') - .Append(Worksheet.Name) - .Append('.'); - - if (FixedColumn) - sb.Append('$'); - - sb.Append(ColumnLetter); - - if (FixedRow) - sb.Append('$'); - - sb.Append(RowNumber); - - return sb.ToString(); - } - - public string ToStringFixed() - => ToStringFixed(XLReferenceStyle.A1); - - public string ToStringFixed(XLReferenceStyle referenceStyle) - => ToStringFixed(referenceStyle, false); - - public string ToStringFixed(XLReferenceStyle referenceStyle, bool includeSheet) - { - if (referenceStyle == XLReferenceStyle.R1C1) - throw new NotImplementedException("R1C1 - style doesn't implemented"); - - var sb = new StringBuilder(); - if (includeSheet && Worksheet is not null) - sb.Append('$') - .Append(Worksheet.Name) - .Append('.'); - - sb.Append('$'); - sb.Append(ColumnLetter); - sb.Append('$'); - sb.Append(RowNumber); - - return sb.ToString(); - } - - public string ToStringRelative() - => ToStringRelative(false); - - public string ToStringRelative(bool includeSheet) - { - var sb = new StringBuilder(); - if (includeSheet && Worksheet is not null) - sb.Append('$') - .Append(Worksheet.Name) - .Append('.'); - - sb.Append(ColumnLetter); - sb.Append(RowNumber); - - return sb.ToString(); - } - - public bool Equals(IXLAddress? x, IXLAddress? y) - => x?.ColumnNumber == y?.ColumnNumber && - x?.RowNumber == y?.RowNumber && - x?.FixedColumn == y?.FixedColumn && - x?.FixedRow == y?.FixedRow && - x?.Worksheet == y?.Worksheet; - - public override int GetHashCode() - => base.GetHashCode(); - - public int GetHashCode([DisallowNull] IXLAddress obj) - => obj.GetHashCode(); - - public bool Equals(IXLAddress? other) - => Equals(this, other); - - public override bool Equals(object? obj) - { - if (ReferenceEquals(this, obj)) - { - return true; - } - - if (obj is null) - { - return false; - } - - if (obj is CellAddress address) - return this == address; - - return false; - } - } - -} diff --git a/AsbCloudInfrastructure/Services/DailyReport/DailyReportBlocks/BhaBlock.cs b/AsbCloudInfrastructure/Services/DailyReport/DailyReportBlocks/BhaBlock.cs deleted file mode 100644 index 9c3d1cdc..00000000 --- a/AsbCloudInfrastructure/Services/DailyReport/DailyReportBlocks/BhaBlock.cs +++ /dev/null @@ -1,118 +0,0 @@ -using AsbCloudApp.Data.DailyReport; -using ClosedXML.Excel; - -namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks -{ - - class BhaBlock : BlockAbstract - { - private readonly BhaDto blockDto; - - public CellAddress AddressBhaDescription { get; } - public CellAddress AddressOperationTitle { get; } - public CellAddress AddressDurationTitle { get; } - public CellAddress AddressTotalTitle { get; } - public CellAddress[] AddressOperationData { get; } - public CellAddress[] AddressDurationDataStart { get; } - public CellAddress[] AddressDurationDataFinish { get; } - public CellAddress[] AddressTotaData { get; } - public override CellAddress AddressBlockBegin { get; } - public override CellAddress AddressBlockEnd { get; } - - public BhaBlock(CellAddress addressBlockBegin, BhaDto blockDto) - { - this.blockDto = blockDto; - AddressBlockBegin = addressBlockBegin.Copy(); - AddressBhaDescription = addressBlockBegin + (1,0); - AddressOperationTitle = addressBlockBegin + (3, 0); - AddressDurationTitle = addressBlockBegin + (3, 5); - AddressTotalTitle = addressBlockBegin + (3, 7); - AddressOperationData = new CellAddress[5]; - AddressOperationData[0] = addressBlockBegin + (4, 0); - AddressOperationData[1] = addressBlockBegin + (5, 0); - AddressOperationData[2] = addressBlockBegin + (6, 0); - AddressOperationData[3] = addressBlockBegin + (7, 0); - AddressOperationData[4] = addressBlockBegin + (8, 0); - AddressDurationDataStart = new CellAddress[5]; - AddressDurationDataStart[0] = addressBlockBegin + (4, 5); - AddressDurationDataStart[1] = addressBlockBegin + (5, 5); - AddressDurationDataStart[2] = addressBlockBegin + (6, 5); - AddressDurationDataStart[3] = addressBlockBegin + (7, 5); - AddressDurationDataStart[4] = addressBlockBegin + (8, 5); - AddressDurationDataFinish = new CellAddress[5]; - AddressDurationDataFinish[0] = addressBlockBegin + (4, 6); - AddressDurationDataFinish[1] = addressBlockBegin + (5, 6); - AddressDurationDataFinish[2] = addressBlockBegin + (6, 6); - AddressDurationDataFinish[3] = addressBlockBegin + (7, 6); - AddressDurationDataFinish[4] = addressBlockBegin + (8, 6); - AddressTotaData = new CellAddress[5]; - AddressTotaData[0] = addressBlockBegin + (4, 7); - AddressTotaData[1] = addressBlockBegin + (5, 7); - AddressTotaData[2] = addressBlockBegin + (6, 7); - AddressTotaData[3] = addressBlockBegin + (7, 7); - AddressTotaData[4] = addressBlockBegin + (8, 7); - AddressBlockEnd = AddressTotaData[4]; - } - - private string FormulaBhaBlock(CellAddress beginTime, CellAddress endTime) - { - return string.Format("IF({0}>0,({0}-{1})*24, \"\")", endTime.ToString(), beginTime.ToString()); - } - - public override void Draw(IXLWorksheet sheet) - { - sheet._Range(AddressBhaDescription, AddressBhaDescription + (0, 7)) - ._SetValue($"{blockDto.BHADescription}"); - sheet._Range(AddressOperationTitle, AddressOperationTitle + (0, 4)) - ._SetValue("Выполняемые операции в отчетный период, комментарии:"); - sheet._Range(AddressDurationTitle, AddressDurationTitle + (0, 1)) - ._SetValue("Продолжительность, ч. "); - sheet.Cell(AddressTotalTitle) - ._SetValue("Итого"); - sheet._Range(AddressOperationData[0], AddressOperationData[0] + (0, 4)) - ._SetValue("Бурение с наращиваниями в инт. 2195-2763м."); - sheet.Cell(AddressDurationDataStart[0]) - ._SetValue($"{blockDto.ExtensionDrillingOneBegin}"); - sheet.Cell(AddressDurationDataFinish[0]) - ._SetValue($"{blockDto.ExtensionDrillingOneFinish}"); - sheet.Cell(AddressTotaData[0]) - .SetFormulaA1($"{FormulaBhaBlock(AddressDurationDataStart[0], AddressDurationDataFinish[0])}").Style.SetAllBorders(); - sheet._Range(AddressOperationData[1], AddressOperationData[1] + (0, 4)) - ._SetValue("Промывка."); - sheet.Cell(AddressDurationDataStart[1]) - ._SetValue($"{blockDto.SluiceBegin}"); - sheet.Cell(AddressDurationDataFinish[1]) - ._SetValue($"{blockDto.SluiceFinish}"); - sheet.Cell(AddressTotaData[1]) - .SetFormulaA1($"{FormulaBhaBlock(AddressDurationDataStart[1], AddressDurationDataFinish[1])}").Style.SetAllBorders(); - sheet._Range(AddressOperationData[2], AddressOperationData[2] + (0, 4)) - ._SetValue("Подъем КНБК в инт. 2763-2442м."); - sheet.Cell(AddressDurationDataStart[2]) - ._SetValue($"{blockDto.ClimbBegin}"); - sheet.Cell(AddressDurationDataFinish[2]) - ._SetValue($"{blockDto.ClimbFinish}"); - sheet.Cell(AddressTotaData[2]) - .SetFormulaA1($"{FormulaBhaBlock(AddressDurationDataStart[2], AddressDurationDataFinish[2])}").Style.SetAllBorders(); - sheet._Range(AddressOperationData[3], AddressOperationData[3] + (0, 4)) - ._SetValue("Спуск КНБК в инт. 2442-2763м."); - sheet.Cell(AddressDurationDataStart[3]) - ._SetValue($"{blockDto.DescentBegin}"); - sheet.Cell(AddressDurationDataFinish[3]) - ._SetValue($"{blockDto.DescentFinish}"); - sheet.Cell(AddressTotaData[3]) - .SetFormulaA1($"{FormulaBhaBlock(AddressDurationDataStart[3], AddressDurationDataFinish[3])}").Style.SetAllBorders(); - sheet._Range(AddressOperationData[4], AddressOperationData[4] + (0, 4)) - ._SetValue("Бурение с наращиваниями в инт. 2763-2850м."); - sheet.Cell(AddressDurationDataStart[4]) - ._SetValue($"{blockDto.ExtensionDrillingTwoBegin}"); - sheet.Cell(AddressDurationDataFinish[4]) - ._SetValue($"{blockDto.ExtensionDrillingTwoFinish}"); - sheet.Cell(AddressTotaData[4]) - .SetFormulaA1($"{FormulaBhaBlock(AddressDurationDataStart[4], AddressDurationDataFinish[4])}").Style.SetAllBorders(); - } - } - -} - - - diff --git a/AsbCloudInfrastructure/Services/DailyReport/DailyReportBlocks/DimensionlessBlock.cs b/AsbCloudInfrastructure/Services/DailyReport/DailyReportBlocks/DimensionlessBlock.cs deleted file mode 100644 index 18ee9fbc..00000000 --- a/AsbCloudInfrastructure/Services/DailyReport/DailyReportBlocks/DimensionlessBlock.cs +++ /dev/null @@ -1,119 +0,0 @@ -using AsbCloudApp.Data.DailyReport; -using ClosedXML.Excel; - -namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks -{ - - internal class DimensionlessBlock : BlockAbstract - { - private readonly NoDrillingDto blockDto; - - public SaubBlock SaubBlock { get; set; } = null!; - - public CellAddress AddressDimensionTitle { get; } - public CellAddress AddressPreparationTitle { get; } - public CellAddress AddressExtensionTitle { get; } - public CellAddress AddressPreparationDescription { get; } - public CellAddress AddressExtensionDescription { get; } - public CellAddress[] AddressPreparationHead { get; } - public CellAddress[] AddressPreparationValue { get; } - public CellAddress[] AddressExtensionHead { get; } - public CellAddress[] AddressExtensionValue { get; } - public CellAddress AddressBlockFormula { get; } = null!; - public override CellAddress AddressBlockBegin { get; } - public override CellAddress AddressBlockEnd { get; } - public DimensionlessBlock(CellAddress addressBlockBegin, NoDrillingDto blockDto) - { - AddressBlockBegin = addressBlockBegin.Copy(); - this.blockDto = blockDto; - - AddressDimensionTitle = addressBlockBegin + (2, 3); - AddressPreparationTitle = addressBlockBegin + (3, 1); - AddressExtensionTitle = addressBlockBegin + (3, 4); - AddressPreparationHead = new CellAddress[4]; - AddressPreparationHead[0] = addressBlockBegin + (4, 1); - AddressPreparationHead[1] = addressBlockBegin + (5, 1); - AddressPreparationHead[2] = addressBlockBegin + (6, 1); - AddressPreparationHead[3] = addressBlockBegin + (7, 1); - AddressPreparationValue = new CellAddress[4]; - AddressPreparationValue[0] = addressBlockBegin + (4, 3); - AddressPreparationValue[1] = addressBlockBegin + (5, 3); - AddressPreparationValue[2] = addressBlockBegin + (6, 3); - AddressPreparationValue[3] = addressBlockBegin + (7, 3); - AddressPreparationDescription = addressBlockBegin + (8, 1); - AddressExtensionHead = new CellAddress[4]; - AddressExtensionHead[0] = addressBlockBegin + (4, 4); - AddressExtensionHead[1] = addressBlockBegin + (5, 4); - AddressExtensionHead[2] = addressBlockBegin + (6, 4); - AddressExtensionHead[3] = addressBlockBegin + (7, 4); - AddressExtensionValue = new CellAddress[4]; - AddressExtensionValue[0] = addressBlockBegin + (4, 6); - AddressExtensionValue[1] = addressBlockBegin + (5, 6); - AddressExtensionValue[2] = addressBlockBegin + (6, 6); - AddressExtensionValue[3] = addressBlockBegin + (7, 6); - AddressExtensionDescription = addressBlockBegin + (8, 4); - AddressBlockEnd = addressBlockBegin + (9,0); - } - - private string FormulaBlockPlan(CellAddress cellTarget) - { - return $"={cellTarget}/60*{SaubBlock.AddressExtensionsCountValue}"; - } - - private string FormulaBlockExcess(CellAddress cellFact, CellAddress cellPlan) - { - return string.Format("={0}-{1}", cellFact.ToString(), cellPlan.ToString()); - } - - public override void Draw(IXLWorksheet sheet) - { - sheet.Range(AddressDimensionTitle.RowNumber, AddressDimensionTitle.ColumnNumber, - AddressDimensionTitle.RowNumber, AddressDimensionTitle.ColumnNumber + 1) - .Merge() - .Style.Alignment.SetWrapText(true); - sheet.Cell(AddressDimensionTitle.RowNumber, AddressDimensionTitle.ColumnNumber)._ValueNoBorder("БЕЗМЕТРАЖНЫЕ РАБОТЫ",true); - sheet._Range(AddressPreparationTitle, AddressPreparationTitle + (0, 2)) - ._SetValue("Подготовка ствола скв. к наращиванию"); - sheet._Range(AddressExtensionTitle, AddressExtensionTitle + (0, 2)) - ._SetValue("Наращивание"); - sheet._Range(AddressPreparationHead[0], AddressPreparationHead[0] + (0, 1)) - ._SetValue("Норматив на одну операцию, (мин):"); - sheet.Cell(AddressPreparationValue[0]) - ._SetValue($"{blockDto.StandardTimeBarrelPreparation}"); - sheet._Range(AddressPreparationHead[1], AddressPreparationHead[1] + (0, 1)) - ._SetValue("Проработка при бур, план (ч):"); - sheet.Cell(AddressPreparationValue[1]) - .SetFormulaA1($"{FormulaBlockPlan(AddressPreparationValue[0])}").Style.SetAllBorders(); - sheet._Range(AddressPreparationHead[2], AddressPreparationHead[2] + (0, 1)) - ._SetValue("Проработка при бур, факт (ч):"); - sheet.Cell(AddressPreparationValue[2]) - ._SetValue($"{blockDto.ActualTimeBarrelPreparation}"); - sheet._Range(AddressPreparationHead[3], AddressPreparationHead[3] + (0, 1)) - ._SetValue("Превышение плановых норм, (ч):"); - sheet.Cell(AddressPreparationValue[3]) - .SetFormulaA1($"{FormulaBlockExcess(AddressPreparationValue[2], AddressPreparationValue[1])}").Style.SetAllBorders(); - sheet._Range(AddressExtensionHead[0], AddressExtensionHead[0] + (0, 1)) - ._SetValue("Норматив на одну операцию, (мин):"); - sheet.Cell(AddressExtensionValue[0]) - ._SetValue($"{blockDto.StandardTimeExtension}"); - sheet._Range(AddressExtensionHead[1], AddressExtensionHead[1] + (0, 1)) - ._SetValue("Наращивание, план (ч):"); - sheet.Cell(AddressExtensionValue[1]) - .SetFormulaA1($"{FormulaBlockPlan(AddressExtensionValue[0])}").Style.SetAllBorders(); - sheet._Range(AddressExtensionHead[2], AddressExtensionHead[2] + (0, 1)) - ._SetValue("Наращивание, факт (ч):"); - sheet.Cell(AddressExtensionValue[2]) - ._SetValue($"{blockDto.ActualTimeExtension}"); - sheet._Range(AddressExtensionHead[3], AddressExtensionHead[3] + (0, 1)) - ._SetValue("Превышение плановых норм, (ч):"); - sheet.Cell(AddressExtensionValue[3]) - .SetFormulaA1($"{FormulaBlockExcess(AddressExtensionValue[2], AddressExtensionValue[1])}").Style.SetAllBorders(); - sheet._Range(AddressPreparationDescription, AddressPreparationDescription + (1, 2)) - ._SetValue("Подготовка ствола скв. к наращиванию"); - sheet._Range(AddressExtensionDescription, AddressExtensionDescription + (1, 2)) - ._SetValue("Наращивание"); - } - } - -} - diff --git a/AsbCloudInfrastructure/Services/DailyReport/DailyReportBlocks/HeadBlock.cs b/AsbCloudInfrastructure/Services/DailyReport/DailyReportBlocks/HeadBlock.cs deleted file mode 100644 index b7ae4dfe..00000000 --- a/AsbCloudInfrastructure/Services/DailyReport/DailyReportBlocks/HeadBlock.cs +++ /dev/null @@ -1,181 +0,0 @@ -using AsbCloudApp.Data.DailyReport; -using ClosedXML.Excel; - -namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks -{ - - class HeadBlock : BlockAbstract - { - private readonly HeadDto blockDto; - - public CellAddress AddressTitle { get; } - public CellAddress AddressCustomer { get; } - public CellAddress AddressDriller { get; } - public CellAddress AddressPeriod { get; } - public CellAddress AddressSlaughter { get; } - public CellAddress AddressTrajectoryTableTitle { get; } - public CellAddress AddressDrillerOneTitle { get; } - public CellAddress AddressDrillerOne { get; } - public CellAddress AddressDrillerTwoTitle { get; } - public CellAddress AddressDrillerTwo { get; } - public CellAddress AddressWorkSaubTitle { get; } - public CellAddress AddressWatchTitle { get; } - public CellAddress AddressMetreTitle { get; } - public CellAddress[] AddressWorkSaubData { get; } - public CellAddress[] AddressWatchData { get; } - public CellAddress[] AddressMetreData { get; } - public CellAddress[] AddressPeriodTableHeadArray { get; } - public CellAddress[] AddressPeriodTableDataArray { get; } - public CellAddress[] AddressTrajectoryTableHeadArray { get; } - public CellAddress[] AddressTrajectoryTableDataArray { get; } - public override CellAddress AddressBlockBegin { get; } - public override CellAddress AddressBlockEnd { get; } - public HeadBlock(CellAddress addressBlockBegin, HeadDto blockDto) - { - AddressBlockBegin = addressBlockBegin.Copy(); - this.blockDto = blockDto; - AddressTitle = addressBlockBegin + (0, 0); - AddressCustomer = addressBlockBegin + (1, 0); - AddressDriller = addressBlockBegin + (2, 0); - AddressPeriod = addressBlockBegin + (4, 0); - AddressSlaughter = addressBlockBegin + (4, 4); - AddressPeriodTableHeadArray = new CellAddress[4]; - AddressPeriodTableHeadArray[0]= addressBlockBegin + (5, 0); - AddressPeriodTableHeadArray[1] = addressBlockBegin + (5, 2); - AddressPeriodTableHeadArray[2] = addressBlockBegin + (5, 4); - AddressPeriodTableHeadArray[3] = addressBlockBegin + (5, 6); - AddressPeriodTableDataArray = new CellAddress[4]; - AddressPeriodTableDataArray[0] = addressBlockBegin + (6, 0); - AddressPeriodTableDataArray[1] = addressBlockBegin + (6, 2); - AddressPeriodTableDataArray[2] = addressBlockBegin + (6, 4); - AddressPeriodTableDataArray[3] = addressBlockBegin + (6, 6); - AddressTrajectoryTableTitle = addressBlockBegin + (8,0); - AddressTrajectoryTableHeadArray = new CellAddress[4]; - AddressTrajectoryTableHeadArray[0] = addressBlockBegin + (9, 0); - AddressTrajectoryTableHeadArray[1] = addressBlockBegin + (9, 2); - AddressTrajectoryTableHeadArray[2] = addressBlockBegin + (9, 4); - AddressTrajectoryTableHeadArray[3] = addressBlockBegin + (9, 6); - AddressTrajectoryTableDataArray = new CellAddress[4]; - AddressTrajectoryTableDataArray[0] = addressBlockBegin + (10, 0); - AddressTrajectoryTableDataArray[1] = addressBlockBegin + (10, 2); - AddressTrajectoryTableDataArray[2] = addressBlockBegin + (10, 4); - AddressTrajectoryTableDataArray[3] = addressBlockBegin + (10, 6); - AddressDrillerOneTitle = addressBlockBegin + (12, 0); - AddressDrillerOne = addressBlockBegin + (12, 2); - AddressDrillerTwoTitle = addressBlockBegin + (13, 0); - AddressDrillerTwo = addressBlockBegin + (13, 2); - AddressWorkSaubTitle = addressBlockBegin + (15, 0); - AddressWatchTitle = addressBlockBegin + (15, 3); - AddressMetreTitle = addressBlockBegin + (15, 4); - AddressWorkSaubData = new CellAddress[4]; - AddressWorkSaubData[0] = addressBlockBegin + (16, 0); - AddressWorkSaubData[1] = addressBlockBegin + (17, 0); - AddressWorkSaubData[2] = addressBlockBegin + (18, 0); - AddressWorkSaubData[3] = addressBlockBegin + (19, 0); - AddressWatchData = new CellAddress[4]; - AddressWatchData[0] = addressBlockBegin + (16, 3); - AddressWatchData[1] = addressBlockBegin + (17, 3); - AddressWatchData[2] = addressBlockBegin + (18, 3); - AddressWatchData[3] = addressBlockBegin + (19, 3); - AddressMetreData = new CellAddress[4]; - AddressMetreData[0] = addressBlockBegin + (16, 4); - AddressMetreData[1] = addressBlockBegin + (17, 4); - AddressMetreData[2] = addressBlockBegin + (18, 4); - AddressBlockEnd = AddressWatchData[3]+(0,1); - } - - public override void Draw(IXLWorksheet sheet) - { - sheet._Range(AddressTitle, AddressTitle + (0, 7)) - ._SetValue($"Суточная сводка бурения скважины: {blockDto.WellName}, куст: {blockDto.ClusterName}") - - .Style.SetH1(); - - sheet._Range(AddressCustomer, AddressCustomer + (0, 7)) - ._SetValue($"Заказчик: {blockDto.Customer}") - .Style.SetH1(); - sheet._Range(AddressDriller, AddressDriller + (0, 7)) - ._SetValue($"Подрядчик: {blockDto.Contractor}") - .Style.SetH1(); - sheet._Range(AddressPeriod, AddressPeriod + (0, 3)) - ._SetValue("Отчетный период"); - sheet._Range(AddressSlaughter, AddressSlaughter + (0, 3)) - ._SetValue("Забой за отчетный период, м"); - sheet._Range(AddressPeriodTableHeadArray[0], AddressPeriodTableHeadArray[0] + (0, 1)) - ._SetValue("От (дата, время)"); - sheet._Range(AddressPeriodTableHeadArray[1], AddressPeriodTableHeadArray[1] + (0, 1)) - ._SetValue("До (дата, время)"); - sheet._Range(AddressPeriodTableHeadArray[2], AddressPeriodTableHeadArray[2] + (0, 1)) - ._SetValue("От"); - sheet._Range(AddressPeriodTableHeadArray[3], AddressPeriodTableHeadArray[3] + (0, 1)) - ._SetValue("До"); - sheet._Range(AddressPeriodTableDataArray[0], AddressPeriodTableDataArray[0] + (0, 1)) - ._SetValue($"{blockDto.ReportDate}"); - sheet._Range(AddressPeriodTableDataArray[1], AddressPeriodTableDataArray[1] + (0, 1))._SetValue(""); - sheet.Cell(AddressPeriodTableDataArray[1]) - .SetFormulaA1(string.Format("{0}-1", AddressPeriodTableDataArray[0].ToString())) - .Style.DateFormat.Format= "DD.MM.YYYY HH:MM:SS"; - sheet._Range(AddressPeriodTableDataArray[2], AddressPeriodTableDataArray[2] + (0, 1)) - ._SetValue($"{blockDto.WellDepthIntervalStartDate}"); - sheet._Range(AddressPeriodTableDataArray[3], AddressPeriodTableDataArray[3] + (0, 1)) - ._SetValue($"{blockDto.WellDepthIntervalFinishDate}"); - sheet._Range(AddressTrajectoryTableTitle, AddressTrajectoryTableTitle + (0, 7)) - ._SetValue("Данные по траектории скважины на конец суток"); - sheet._Range(AddressTrajectoryTableHeadArray[0], AddressTrajectoryTableHeadArray[0] + (0, 1)) - ._SetValue("Глубина по стволу"); - sheet._Range(AddressTrajectoryTableHeadArray[1], AddressTrajectoryTableHeadArray[1] + (0, 1)) - ._SetValue("Глубина по вертикали"); - sheet._Range(AddressTrajectoryTableHeadArray[2], AddressTrajectoryTableHeadArray[2] + (0, 1)) - ._SetValue("Зенитный угол"); - sheet._Range(AddressTrajectoryTableHeadArray[3], AddressTrajectoryTableHeadArray[3] + (0, 1)) - ._SetValue("Азимут"); - sheet._Range(AddressTrajectoryTableDataArray[0], AddressTrajectoryTableDataArray[0] + (0, 1)) - ._SetValue($"{blockDto.BottomholeDepth}"); - sheet._Range(AddressTrajectoryTableDataArray[1], AddressTrajectoryTableDataArray[1] + (0, 1)) - ._SetValue($"{blockDto.VerticalDepth}"); - sheet._Range(AddressTrajectoryTableDataArray[2], AddressTrajectoryTableDataArray[2] + (0, 1)) - ._SetValue($"{blockDto.ZenithAngle}"); - sheet._Range(AddressTrajectoryTableDataArray[3], AddressTrajectoryTableDataArray[3] + (0, 1)) - ._SetValue($"{blockDto.AzimuthAngle}"); - sheet._Range(AddressDrillerOneTitle, AddressDrillerOneTitle + (0, 1)) - ._SetValue("Бурильщик 1 смена"); - sheet._Range(AddressDrillerOne, AddressDrillerOne + (0, 1)) - ._SetValue($"{blockDto.FirstDriller}"); - sheet._Range(AddressDrillerTwoTitle, AddressDrillerTwoTitle + (0, 1)) - ._SetValue("Бурильщик 2 смена"); - sheet._Range(AddressDrillerTwo, AddressDrillerTwo + (0, 1)) - ._SetValue($"{blockDto.SecondDriller}"); - sheet._Range(AddressWorkSaubTitle, AddressWorkSaubTitle + (0, 2)) - ._SetValue("Работа модулей САУБ:"); - sheet.Cell(AddressWatchTitle) - ._SetValue("Часов:"); - sheet.Cell(AddressMetreTitle) - ._SetValue("Метров:"); - sheet._Range(AddressWorkSaubData[0], AddressWorkSaubData[0] + (0, 2)) - ._SetValue("АПД (автоматическая подача долота), ч/м:"); - sheet.Cell(AddressWatchData[0]) - ._SetValue($"{blockDto.WorkTimeSAUB}"); - sheet.Cell(AddressMetreData[0]) - ._SetValue($"{blockDto.PenetrationSAUB}"); - sheet._Range(AddressWorkSaubData[1], AddressWorkSaubData[1] + (0, 2)) - ._SetValue("Спин Мастер (осцилляция),ч/м:"); - sheet.Cell(AddressWatchData[1]) - ._SetValue($"{blockDto.WorkTimeSpinMaster}"); - sheet.Cell(AddressMetreData[1]) - ._SetValue($"{blockDto.PenetrationSpinMaster}"); - sheet._Range(AddressWorkSaubData[2], AddressWorkSaubData[2] + (0, 2)) - ._SetValue("Торк Мастер (демпфирование), ч/:"); - sheet.Cell(AddressWatchData[2]) - ._SetValue($"{blockDto.WorkTimeTorkMaster}"); - sheet.Cell(AddressMetreData[2]) - ._SetValue($"{blockDto.PenetrationTorkMaster}"); - sheet._Range(AddressWorkSaubData[3], AddressWorkSaubData[3] + (0, 2)) - ._SetValue("МСЕ, колличество запусков, раз:"); - sheet._Range(AddressWatchData[3], AddressWatchData[3] + (0, 1)) - ._SetValue($"{blockDto.CountLaunchesMSE}"); - } - } - -} - - diff --git a/AsbCloudInfrastructure/Services/DailyReport/DailyReportBlocks/SaubBlock.cs b/AsbCloudInfrastructure/Services/DailyReport/DailyReportBlocks/SaubBlock.cs deleted file mode 100644 index f6f4791f..00000000 --- a/AsbCloudInfrastructure/Services/DailyReport/DailyReportBlocks/SaubBlock.cs +++ /dev/null @@ -1,230 +0,0 @@ -using AsbCloudApp.Data.DailyReport; -using ClosedXML.Excel; - -namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks -{ - - internal class SaubBlock : BlockAbstract - { - private readonly SaubDto blockDto; - private readonly HeadBlock headBlock; - public CellAddress AddressRotorDrilling { get; } - public CellAddress AddressSlideDrilling { get; } - public CellAddress AddressDrillingTableTitle { get; } - public CellAddress[] AddressDrillingTableHead { get; } - public CellAddress[] AddressDrillingTableData { get; } - public CellAddress AddressSlideTableTitle { get; } - public CellAddress[] AddressSlideTableHead { get; } - public CellAddress[] AddressSlideTableData { get; } - public CellAddress AddressTotalTableMechanicalSpeed { get; } - public CellAddress AddressTotalTableTitle { get; } - public CellAddress[] AddressTotalTableHead { get; } - public CellAddress[] AddressTotalTableData { get; } - public CellAddress IncreaseSpeedSection { get; } - public CellAddress IncreaseSpeedDay { get; } - public CellAddress ReductionTimeDrilling { get; } - public CellAddress RotorSlidePercent { get; } - public CellAddress MspSection { get; } - public CellAddress SectionDrillingTimeTotal { get; } - public CellAddress SectionPenetrationTotal { get; } - public CellAddress AddressExtensionsCount { get; } - public CellAddress DeviationFromTVD { get; } - public CellAddress DeclinesReasonsROP { get; } - public CellAddress IncreaseSpeedSectionValue { get; } - public CellAddress IncreaseSpeedDayValue { get; } - public CellAddress ReductionTimeDrillingValue { get; } - public CellAddress RotorSlidePercentValue { get; } - public CellAddress MspSectionValue { get; } - public CellAddress SectionDrillingTimeTotalValue { get; } - public CellAddress SectionPenetrationTotalValue { get; } - public CellAddress AddressExtensionsCountValue { get; } - public CellAddress DeviationFromTVDValue { get; } - public override CellAddress AddressBlockBegin { get; } - public override CellAddress AddressBlockEnd { get; } - - public SaubBlock(CellAddress addressBlockBegin, SaubDto blockDto, HeadBlock headBlock) - { - this.headBlock = headBlock; - AddressBlockBegin = addressBlockBegin.Copy(); - this.blockDto = blockDto; - AddressRotorDrilling = addressBlockBegin + (1, 0); - AddressSlideDrilling = addressBlockBegin + (2, 0); - AddressDrillingTableTitle = addressBlockBegin + (4, 0); - AddressDrillingTableHead = new CellAddress[4]; - AddressDrillingTableHead[0] = addressBlockBegin + (5, 0); - AddressDrillingTableHead[1] = addressBlockBegin + (5, 2); - AddressDrillingTableHead[2] = addressBlockBegin + (5, 4); - AddressDrillingTableHead[3] = addressBlockBegin + (5, 6); - AddressDrillingTableData = new CellAddress[4]; - AddressDrillingTableData[0] = addressBlockBegin + (6, 0); - AddressDrillingTableData[1] = addressBlockBegin + (6, 2); - AddressDrillingTableData[2] = addressBlockBegin + (6, 4); - AddressDrillingTableData[3] = addressBlockBegin + (6, 6); - AddressSlideTableTitle = addressBlockBegin + (8, 0); - AddressSlideTableHead = new CellAddress[4]; - AddressSlideTableHead[0] = addressBlockBegin + (9, 0); - AddressSlideTableHead[1] = addressBlockBegin + (9, 2); - AddressSlideTableHead[2] = addressBlockBegin + (9, 4); - AddressSlideTableHead[3] = addressBlockBegin + (9, 6); - AddressSlideTableData = new CellAddress[4]; - AddressSlideTableData[0] = addressBlockBegin + (10, 0); - AddressSlideTableData[1] = addressBlockBegin + (10, 2); - AddressSlideTableData[2] = addressBlockBegin + (10, 4); - AddressSlideTableData[3] = addressBlockBegin + (10, 6); - AddressTotalTableTitle = addressBlockBegin + (12, 0); - AddressTotalTableMechanicalSpeed = addressBlockBegin + (12, 6); - AddressTotalTableHead = new CellAddress[4]; - AddressTotalTableHead[0] = addressBlockBegin + (13, 0); - AddressTotalTableHead[1] = addressBlockBegin + (13, 2); - AddressTotalTableHead[2] = addressBlockBegin + (13, 4); - AddressTotalTableData = new CellAddress[4]; - AddressTotalTableData[0] = addressBlockBegin + (14, 0); - AddressTotalTableData[1] = addressBlockBegin + (14, 2); - AddressTotalTableData[2] = addressBlockBegin + (14, 4); - AddressTotalTableData[3] = addressBlockBegin + (14, 6); - IncreaseSpeedSection = addressBlockBegin + (16, 0); - IncreaseSpeedSectionValue = addressBlockBegin + (16, 4); - IncreaseSpeedDay = addressBlockBegin + (17, 0); - IncreaseSpeedDayValue = addressBlockBegin + (17, 4); - ReductionTimeDrilling = addressBlockBegin + (18, 0); - ReductionTimeDrillingValue = addressBlockBegin + (18, 4); - RotorSlidePercent = addressBlockBegin + (19, 0); - RotorSlidePercentValue = addressBlockBegin + (19, 4); - MspSection = addressBlockBegin + (20, 0); - MspSectionValue = addressBlockBegin + (20, 4); - SectionDrillingTimeTotal = addressBlockBegin + (21, 0); - SectionDrillingTimeTotalValue = addressBlockBegin + (21, 4); - SectionPenetrationTotal = addressBlockBegin + (22, 0); - SectionPenetrationTotalValue = addressBlockBegin + (22, 4); - AddressExtensionsCount = addressBlockBegin + (23, 0); - AddressExtensionsCountValue = addressBlockBegin + (23, 4); - DeviationFromTVD = addressBlockBegin + (24, 0); - DeviationFromTVDValue = addressBlockBegin + (24, 4); - DeclinesReasonsROP = addressBlockBegin + (25, 0); - AddressBlockEnd = DeclinesReasonsROP + (1,7) ; - } - - private string FormulaMechanicalSpeed(CellAddress cellSinking, CellAddress cellWatch ) - { - return string.Format("=IF({0}>0,{1}/{2},0)", cellWatch.ToString(), cellSinking.ToString(), cellWatch.ToString()); - } - - private string FormulaSinking(CellAddress sinkingDrilling, CellAddress sinkingSlide, CellAddress slaughterEnd, CellAddress slaughterBegin) - { - return string.Format("=IF(({0}+{1})<>({2}-{3}),\"ОШИБКА\",({0}+{1}))", sinkingSlide.ToString(), sinkingDrilling.ToString(), - slaughterEnd.ToString(), slaughterBegin.ToString()); - } - private string FormulaWatch(CellAddress cellSinkingDrill, CellAddress cellSinkingSlide) - { - return string.Format("={0}+{1}", - cellSinkingDrill.ToString(), cellSinkingSlide.ToString()); - } - - public override void Draw(IXLWorksheet sheet) - { - sheet._Range(AddressRotorDrilling, AddressRotorDrilling + (0, 7)) - ._SetValue($"Бурение в роторе : {blockDto.RotorDrillingModes}"); - sheet._Range(AddressSlideDrilling, AddressSlideDrilling + (0, 7)) - ._SetValue($"Бурение в слайде : {blockDto.SlideDrillingModes}"); - sheet._Range(AddressDrillingTableTitle, AddressDrillingTableTitle + (0, 7)) - ._SetValue("Бурение в роторе(за отчетный период) с использование САУБ - 1"); - sheet._Range(AddressDrillingTableHead[0], AddressDrillingTableHead[0] + (0, 1)) - ._SetValue("Проходка"); - sheet._Range(AddressDrillingTableHead[1], AddressDrillingTableHead[1] + (0, 1)) - ._SetValue("Часы бурения"); - sheet._Range(AddressDrillingTableHead[2], AddressDrillingTableHead[2] + (0, 1)) - ._SetValue("Мех. скорость"); - sheet._Range(AddressDrillingTableHead[3], AddressDrillingTableHead[3] + (0, 1)) - ._SetValue("Среднее диф. Давление"); - sheet._Range(AddressDrillingTableData[0], AddressDrillingTableData[0] + (0, 1)) - ._SetValue($"{blockDto.PenetrationInRotor}"); - sheet._Range(AddressDrillingTableData[1], AddressDrillingTableData[1] + (0, 1)) - ._SetValue($"{blockDto.NumberDrillingHours}"); - sheet._Range(AddressDrillingTableData[2], AddressDrillingTableData[2] + (0, 1))._SetValue(""); - sheet.Cell(AddressDrillingTableData[2]) - .SetFormulaA1(FormulaMechanicalSpeed(AddressDrillingTableData[0], AddressDrillingTableData[1])).Style.SetAllBorders(); - sheet._Range(AddressDrillingTableData[3], AddressDrillingTableData[3] + (0, 1)) - ._SetValue($"{blockDto.AVGDiffDropRotor}"); - sheet._Range(AddressSlideTableTitle, AddressSlideTableTitle + (0, 7)) - ._SetValue("Бурение в слайде (за отчетный период) с использование САУБ-1"); - sheet._Range(AddressSlideTableHead[0], AddressSlideTableHead[0] + (0, 1)) - ._SetValue("Проходка"); - sheet._Range(AddressSlideTableHead[1], AddressSlideTableHead[1] + (0, 1)) - ._SetValue("Часы бурения"); - sheet._Range(AddressSlideTableHead[2], AddressSlideTableHead[2] + (0, 1)) - ._SetValue("Мех. скорость"); - sheet._Range(AddressSlideTableHead[3], AddressSlideTableHead[3] + (0, 1)) - ._SetValue("Среднее диф. Давление"); - sheet._Range(AddressSlideTableData[0], AddressSlideTableData[0] + (0, 1)) - ._SetValue($"{blockDto.PenetrationInSlide}"); - sheet._Range(AddressSlideTableData[1], AddressSlideTableData[1] + (0, 1)) - ._SetValue($"{blockDto.DrillingTimeInRotor}"); - sheet._Range(AddressSlideTableData[2], AddressSlideTableData[2] + (0, 1))._SetValue(""); - sheet.Cell(AddressSlideTableData[2]) - .SetFormulaA1(FormulaMechanicalSpeed(AddressSlideTableData[0], AddressSlideTableData[1])).Style.SetAllBorders(); - sheet._Range(AddressSlideTableData[3], AddressSlideTableData[3] + (0, 1)) - ._SetValue($"{blockDto.AVGDiffPressureSlide}"); - sheet._Range(AddressTotalTableTitle, AddressTotalTableTitle + (0, 5)) - ._SetValue("Итого за отчетный период, использование САУБ-1"); - sheet._Range(AddressTotalTableMechanicalSpeed, AddressTotalTableMechanicalSpeed + (1, 1)) - ._SetValue("Плановая мех скорость"); - sheet._Range(AddressTotalTableHead[0], AddressTotalTableHead[0] + (0, 1)) - ._SetValue("Проходка"); - sheet._Range(AddressTotalTableHead[1], AddressTotalTableHead[1] + (0, 1)) - ._SetValue("Часы бурения"); - sheet._Range(AddressTotalTableHead[2], AddressTotalTableHead[2] + (0, 1)) - ._SetValue("Мех. скорость"); - - sheet._Range(AddressTotalTableData[0], AddressTotalTableData[0] + (0, 1))._SetValue(""); - sheet.Cell(AddressTotalTableData[0]) - .SetFormulaA1(FormulaSinking(AddressDrillingTableData[0], AddressSlideTableData[0], headBlock.AddressPeriodTableDataArray[3], headBlock.AddressPeriodTableDataArray[2])); - sheet._Range(AddressTotalTableData[1], AddressTotalTableData[1] + (0, 1))._SetValue(""); - sheet.Cell(AddressTotalTableData[1]) - .SetFormulaA1(FormulaWatch(AddressDrillingTableData[1], AddressSlideTableData[1])); - sheet._Range(AddressTotalTableData[2], AddressTotalTableData[2] + (0, 1)) - ._SetValue(""); - sheet._Range(AddressTotalTableData[3], AddressTotalTableData[3] + (0, 1)) - ._SetValue($"{blockDto.SectionROPPlan}"); - sheet._Range(IncreaseSpeedSection, IncreaseSpeedSection + (0, 3)) - ._SetValue("Увеличение мех скорости за секцию %"); - sheet._Range(IncreaseSpeedSectionValue, IncreaseSpeedSectionValue + (0, 3)) - ._SetValue($"{blockDto.IncreaseSpeedSection}"); - sheet._Range(IncreaseSpeedDay, IncreaseSpeedDay + (0, 3)) - ._SetValue("Увеличение мех скорости за сутки %"); - sheet._Range(IncreaseSpeedDayValue, IncreaseSpeedDayValue + (0, 3)) - ._SetValue($"{blockDto.IncreaseSpeedDay}"); - sheet._Range(ReductionTimeDrilling, ReductionTimeDrilling + (0, 3)) - ._SetValue("Сокращение времени бурения за секцию, ч"); - sheet._Range(ReductionTimeDrillingValue, ReductionTimeDrillingValue + (0, 3)) - ._SetValue($"{blockDto.ReductionTimeDrilling}"); - sheet._Range(RotorSlidePercent, RotorSlidePercent + (0, 3)) - ._SetValue("Ротор / слайд, %"); - sheet._Range(RotorSlidePercentValue, RotorSlidePercentValue + (0, 3)) - ._SetValue($"{blockDto.RotorSlidePercent}"); - sheet._Range(MspSection, MspSection + (0, 3)) - ._SetValue("МСП за секцию м/ч."); - sheet._Range(MspSectionValue, MspSectionValue + (0, 3)) - ._SetValue($"{blockDto.MspSection}"); - sheet._Range(SectionDrillingTimeTotal, SectionDrillingTimeTotal + (0, 3)) - ._SetValue("Время бурения за секцию"); - sheet._Range(SectionDrillingTimeTotalValue, SectionDrillingTimeTotalValue + (0, 3)) - ._SetValue($"{blockDto.SectionDrillingTimeTotal}"); - sheet._Range(SectionPenetrationTotal, SectionPenetrationTotal + (0, 3)) - ._SetValue("Проходка за секцию"); - sheet._Range(SectionPenetrationTotalValue, SectionPenetrationTotalValue + (0, 3)) - ._SetValue($"{blockDto.SectionPenetrationTotal}"); - sheet._Range(AddressExtensionsCount, AddressExtensionsCount + (0, 3)) - ._SetValue("Кол- во наращиваний"); - sheet._Range(AddressExtensionsCountValue, AddressExtensionsCountValue + (0, 3)) - ._SetValue($"{blockDto.ExtensionsCount}"); - sheet._Range(DeviationFromTVD, DeviationFromTVD + (0, 3)) - ._SetValue("Отклонение от ГГД +/-, сут"); - sheet._Range(DeviationFromTVDValue, DeviationFromTVDValue + (0, 3)) - ._SetValue($"{blockDto.DeviationFromTVD}"); - sheet._Range(DeclinesReasonsROP, DeclinesReasonsROP + (1, 7)) - ._SetValue($"Примечание: {blockDto.DeclinesReasonsROP}"); - } - } - -} - diff --git a/AsbCloudInfrastructure/Services/DailyReport/DailyReportBlocks/SignBlock.cs b/AsbCloudInfrastructure/Services/DailyReport/DailyReportBlocks/SignBlock.cs deleted file mode 100644 index b7e5eb60..00000000 --- a/AsbCloudInfrastructure/Services/DailyReport/DailyReportBlocks/SignBlock.cs +++ /dev/null @@ -1,51 +0,0 @@ -using AsbCloudApp.Data.DailyReport; -using ClosedXML.Excel; - -namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks -{ - - internal class SignBlock : BlockAbstract - { - private readonly SignDto blockDto; - public CellAddress AddressDrillMasterHead { get; } - public CellAddress AddressDrillMaster { get; } - public CellAddress AddressSupervisorHead { get; } - public CellAddress AddressSupervisor { get; } - public override CellAddress AddressBlockBegin { get; } - public override CellAddress AddressBlockEnd { get; } - - public SignBlock(CellAddress addressBlockBegin, SignDto blockDto) - { - AddressBlockBegin = addressBlockBegin.Copy(); - this.blockDto = blockDto; - AddressDrillMasterHead = addressBlockBegin + (3, 0); - AddressDrillMaster = AddressDrillMasterHead + (0, 5); - AddressSupervisorHead = AddressDrillMasterHead + (2, 0); - AddressSupervisor = AddressSupervisorHead + (0, 5); - AddressBlockEnd = AddressSupervisor + (0,1); - } - - public override void Draw(IXLWorksheet sheet) - { - sheet.Range(AddressDrillMasterHead.RowNumber, AddressDrillMasterHead.ColumnNumber - , AddressDrillMasterHead.RowNumber, AddressDrillMasterHead.ColumnNumber + 2) - .Merge() - .SetValue("Мастер буровой "); - sheet.Range(AddressDrillMaster.RowNumber, AddressDrillMaster.ColumnNumber - , AddressDrillMaster.RowNumber, AddressDrillMaster.ColumnNumber + 2) - .Merge() - .SetValue($"{blockDto.DrillingMaster}"); - sheet.Range(AddressSupervisorHead.RowNumber, AddressSupervisorHead.ColumnNumber - , AddressSupervisorHead.RowNumber, AddressSupervisorHead.ColumnNumber + 2) - .Merge() - .SetValue("Супервайзер "); - sheet.Range(AddressSupervisor.RowNumber, AddressSupervisor.ColumnNumber - , AddressSupervisor.RowNumber, AddressSupervisor.ColumnNumber + 2) - .Merge() - .SetValue($"{blockDto.Supervisor}"); - } - } - -} - - diff --git a/AsbCloudInfrastructure/Services/DailyReport/DailyReportBlocks/TimeBalanceBlock.cs b/AsbCloudInfrastructure/Services/DailyReport/DailyReportBlocks/TimeBalanceBlock.cs deleted file mode 100644 index 9fe13a72..00000000 --- a/AsbCloudInfrastructure/Services/DailyReport/DailyReportBlocks/TimeBalanceBlock.cs +++ /dev/null @@ -1,93 +0,0 @@ -using AsbCloudApp.Data; -using AsbCloudApp.Data.DailyReport; -using ClosedXML.Excel; -using System; -using System.Collections.Generic; -using System.Linq; - - -namespace AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks -{ - /// - /// Построение баланса времени - /// - class TimeBalanceBlock : BlockAbstract - { - /// - /// Начальная ячейка - /// - public override CellAddress AddressBlockBegin { get; } - - /// - /// Конечная ячейка - /// - public override CellAddress AddressBlockEnd { get; } - - /// - /// Ячейка с заголовком - /// - private CellAddress Title { get { return AddressBlockBegin + (1, 3); } } - - /// - /// Статистика по операциям - /// - private Dictionary OperationsStatistics { get; } - - /// - /// Категории операций - /// - private IEnumerable OperationCategories { get; } - - /// - /// количество столбцов в таблице - /// - private const int countColumns = 3; - - /// - /// количество категорий операций - /// - private int OperationCategoriesCount { get { return OperationCategories.Count(); } } - - - public TimeBalanceBlock(CellAddress addressBlockBegin, TimeBalanceDto blockDto, IEnumerable operationCategories) - { - AddressBlockBegin = addressBlockBegin.Copy(); - - OperationsStatistics = blockDto.OperationsStat; - OperationCategories = operationCategories; - - var rowsCount = (int)Math.Ceiling( 1d * OperationCategoriesCount / countColumns); - var colsCount = (1 + 1) * countColumns; - AddressBlockEnd = Title + (rowsCount, colsCount); - } - - public override void Draw(IXLWorksheet sheet) - { - sheet.Range(Title.RowNumber, Title.ColumnNumber, Title.RowNumber, Title.ColumnNumber + 1) - .Merge() - .SetValue("БАЛАНС ВРЕМЕНИ"); - - var i = 0; - - foreach (var operationCategory in OperationCategories) - { - var row = 2 + (int)Math.Floor(1d * i / countColumns); - var col = 1 + 2 *(i % countColumns); - i++; - - sheet.Cell(AddressBlockBegin + (row, col)) - ._SetValue(operationCategory.Name, true); - sheet.Cell(AddressBlockBegin + (row, col + 1)) - ._SetValue(GetValue(operationCategory.Id), true); - } - } - - private string GetValue(int categoryId) - { - if (OperationsStatistics.TryGetValue(categoryId, out double duration)) - return $"{duration}"; - return "0"; - } - } -} - diff --git a/AsbCloudInfrastructure/Services/DailyReport/DailyReportMakerExcel.cs b/AsbCloudInfrastructure/Services/DailyReport/DailyReportMakerExcel.cs deleted file mode 100644 index 56b68c30..00000000 --- a/AsbCloudInfrastructure/Services/DailyReport/DailyReportMakerExcel.cs +++ /dev/null @@ -1,61 +0,0 @@ -using AsbCloudApp.Data; -using AsbCloudApp.Data.DailyReport; -using AsbCloudInfrastructure.Services.DailyReport.DailyReportBlocks; -using ClosedXML.Excel; -using System.Collections.Generic; -using System.IO; -namespace AsbCloudInfrastructure.Services.DailyReport -{ - - public class DailyReportMakerExcel - { - private IEnumerable OperationCategories = null!; - - public Stream MakeReportFromBlocks(DailyReportDto dto, IEnumerable operationCategories) - { - OperationCategories = operationCategories; - - using var workbook = new XLWorkbook(); - FillExampleBlocks(workbook, dto); - MemoryStream memoryStream = new MemoryStream(); - workbook.SaveAs(memoryStream, new SaveOptions { }); - memoryStream.Seek(0, SeekOrigin.Begin); - return memoryStream; - } - - private void FillExampleBlocks(XLWorkbook workbook, DailyReportDto dto) - { - var sheet = workbook.Worksheets.Add(dto.Head.ReportDate.ToString("dd.MM.yyyy")); - var addressStart = new CellAddress(sheet, 2, 2); - var blockHeader = new HeadBlock(addressStart, dto.Head); - addressStart = blockHeader.AddressBlockEnd + (1, 0); - addressStart.ColumnNumber = 2; - var blockBha = new BhaBlock(addressStart, dto.Bha); - addressStart = blockBha.AddressBlockEnd + (1, 0); - addressStart.ColumnNumber = 2; - var timeBalance = new TimeBalanceBlock(addressStart, dto.TimeBalance, OperationCategories); - addressStart = timeBalance.AddressBlockEnd + (1, 0); - addressStart.ColumnNumber = 2; - var blockDimensionless = new DimensionlessBlock(addressStart, dto.NoDrilling); - addressStart = blockDimensionless.AddressBlockEnd + (1, 0); - addressStart.ColumnNumber = 2; - var blockSaub = new SaubBlock(addressStart, dto.Saub, blockHeader); - addressStart = blockSaub.AddressBlockEnd + (1, 0); - blockDimensionless.SaubBlock = blockSaub; - addressStart.ColumnNumber = 2; - var blockSign = new SignBlock(addressStart, dto.Sign); - addressStart = blockSign.AddressBlockEnd + (1, 0); - addressStart.ColumnNumber = 2; - blockHeader.Draw(sheet); - blockBha.Draw(sheet); - timeBalance.Draw(sheet); - blockDimensionless.Draw(sheet); - blockSaub.Draw(sheet); - blockSign.Draw(sheet); - //sheet.Columns().AdjustToContents(); // Adjust column width - sheet.Rows().AdjustToContents(); - } - } - -} - diff --git a/AsbCloudInfrastructure/Services/DailyReport/DailyReportTemplate.xlsx b/AsbCloudInfrastructure/Services/DailyReport/DailyReportTemplate.xlsx deleted file mode 100644 index 640f481b8e808f4cde0267039c257687365b36f2..0000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0mAk`1V0|1S! BqJ;ne diff --git a/AsbCloudWebApi/Controllers/AutoGeneratedDailyReportController.cs b/AsbCloudWebApi/Controllers/AutoGeneratedDailyReportController.cs deleted file mode 100644 index a392bf51..00000000 --- a/AsbCloudWebApi/Controllers/AutoGeneratedDailyReportController.cs +++ /dev/null @@ -1,105 +0,0 @@ -using System; -using System.ComponentModel.DataAnnotations; -using System.Net; -using System.Threading; -using System.Threading.Tasks; -using AsbCloudApp.Data; -using AsbCloudApp.Data.AutogeneratedDailyReport; -using AsbCloudApp.Requests; -using AsbCloudApp.Services; -using AsbCloudApp.Services.AutoGeneratedDailyReports; -using Microsoft.AspNetCore.Authorization; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; - -namespace AsbCloudWebApi.Controllers; - -/// -/// Контроллер для авто-генерируемых суточных отчётов -/// -[ApiController] -[Route("api/well/{idWell}/[controller]")] -[Authorize] -public class AutoGeneratedDailyReportController : ControllerBase -{ - private readonly IAutoGeneratedDailyReportService autoGeneratedDailyReportService; - private readonly IWellService wellService; - - public AutoGeneratedDailyReportController( - IAutoGeneratedDailyReportService autoGeneratedDailyReportService, - IWellService wellService) - { - this.autoGeneratedDailyReportService = autoGeneratedDailyReportService; - this.wellService = wellService; - } - - /// - /// Формирование отчёта - /// - /// Id скважины - /// Дата отчёта - /// - /// - [HttpGet] - [ProducesResponseType(typeof(PhysicalFileResult), (int)HttpStatusCode.OK, "application/octet-stream")] - [ProducesResponseType(StatusCodes.Status204NoContent)] - public async Task GenerateReportAsync([FromRoute] int idWell, - [Required] DateOnly reportDate, - CancellationToken cancellationToken) - { - if (!await CanUserAccessToWellAsync(idWell, cancellationToken)) - return Forbid(); - - var reportFile = await autoGeneratedDailyReportService.GenerateAsync(idWell, - reportDate, - cancellationToken); - - return File(reportFile.stream, "application/octet-stream", reportFile.fileName); - } - - /// - /// Список файлов суточных отчётов - /// - /// Id скважины - /// Параметры запроса - /// - /// - [HttpGet("all")] - [ProducesResponseType(typeof(PaginationContainer), (int)HttpStatusCode.OK)] - public async Task GetListAsync([FromRoute][Required] int idWell, - [FromQuery] FileReportRequest request, - CancellationToken cancellationToken) - { - if (!await CanUserAccessToWellAsync(idWell, cancellationToken)) - return Forbid(); - - var reports = await autoGeneratedDailyReportService.GetListAsync(idWell, - request, - cancellationToken); - - return Ok(reports); - } - - /// - /// Диапазон дат для формирования суточных отчётов - /// - /// - /// - /// - [HttpGet("datesRange")] - [ProducesResponseType(typeof(DatesRangeDto), (int)HttpStatusCode.OK)] - public async Task GetDatesRangeAsync(int idWell, CancellationToken cancellationToken) - { - if (!await CanUserAccessToWellAsync(idWell, cancellationToken)) - return Forbid(); - - return Ok(await autoGeneratedDailyReportService.GetDatesRangeAsync(idWell, cancellationToken)); - } - - private async Task CanUserAccessToWellAsync(int idWell, CancellationToken cancellationToken) - { - int? idCompany = User.GetCompanyId(); - return idCompany is not null && await wellService.IsCompanyInvolvedInWellAsync((int)idCompany, - idWell, cancellationToken).ConfigureAwait(false); - } -} \ No newline at end of file