From 59c96aa9e945cd70d6cf56d2a4ae698445101598 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: Mon, 4 Sep 2023 14:04:59 +0500 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=B8=D0=BB=20DT?= =?UTF-8?q?O=20=D0=B8=20=D0=BA=D0=BE=D0=BD=D1=81=D1=82=D0=B0=D0=BD=D1=82?= =?UTF-8?q?=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Data/WellOperationImport/RowDto.cs | 54 +++++++++++++++++++ .../WellOperationImportOptionsDto.cs | 29 ++++++++++ .../Constants/DefaultTemplateInfo.cs | 17 ++++++ .../Constants/OperationAttributes.cs | 10 ++++ .../Constants/Templates.cs | 7 +++ 5 files changed, 117 insertions(+) create mode 100644 AsbCloudApp/Data/WellOperationImport/RowDto.cs create mode 100644 AsbCloudApp/Data/WellOperationImport/WellOperationImportOptionsDto.cs create mode 100644 AsbCloudInfrastructure/Services/WellOperationImport/Constants/DefaultTemplateInfo.cs create mode 100644 AsbCloudInfrastructure/Services/WellOperationImport/Constants/OperationAttributes.cs create mode 100644 AsbCloudInfrastructure/Services/WellOperationImport/Constants/Templates.cs diff --git a/AsbCloudApp/Data/WellOperationImport/RowDto.cs b/AsbCloudApp/Data/WellOperationImport/RowDto.cs new file mode 100644 index 00000000..5b6691f4 --- /dev/null +++ b/AsbCloudApp/Data/WellOperationImport/RowDto.cs @@ -0,0 +1,54 @@ +using System; + +namespace AsbCloudApp.Data.WellOperationImport; + +/// +/// Объект строки полученный из файла excel +/// +public class RowDto +{ + /// + /// Номер строки + /// + public int Number { get; set; } + + /// + /// Название секции + /// + public string? Section { get; set; } + + /// + /// Категория + /// + public string? Category { get; set; } + + /// + /// Описание категории + /// + public string CategoryInfo { get; set; } = null!; + + /// + /// Начальная глубина операции + /// + public double DepthStart { get; set; } + + /// + /// Конечная глубина операции + /// + public double DepthEnd { get; set; } + + /// + /// Дата начала операции + /// + public DateTime Date { get; set; } + + /// + /// Длительность операции + /// + public double Duration { get; set; } + + /// + /// Комментарий + /// + public string? Comment { get; set; } +} \ No newline at end of file diff --git a/AsbCloudApp/Data/WellOperationImport/WellOperationImportOptionsDto.cs b/AsbCloudApp/Data/WellOperationImport/WellOperationImportOptionsDto.cs new file mode 100644 index 00000000..5a1efc22 --- /dev/null +++ b/AsbCloudApp/Data/WellOperationImport/WellOperationImportOptionsDto.cs @@ -0,0 +1,29 @@ +namespace AsbCloudApp.Data.WellOperationImport; + +/// +/// Опции для настройки парсинга документа +/// +public class WellOperationParserOptionsDto +{ + /// + /// Название листа + /// + public string? SheetName { get; set; } + + /// + /// Id шаблона + /// 0 - Дефолтный шаблон + /// 1 - Газпром хантос + /// + public int IdTemplate { get; set; } + + /// + /// Начальная строка + /// + public int? StartRow { get; set; } + + /// + /// Конечная строка + /// + public int? EndRow { get; set; } +} \ No newline at end of file diff --git a/AsbCloudInfrastructure/Services/WellOperationImport/Constants/DefaultTemplateInfo.cs b/AsbCloudInfrastructure/Services/WellOperationImport/Constants/DefaultTemplateInfo.cs new file mode 100644 index 00000000..96f3272b --- /dev/null +++ b/AsbCloudInfrastructure/Services/WellOperationImport/Constants/DefaultTemplateInfo.cs @@ -0,0 +1,17 @@ +namespace AsbCloudInfrastructure.Services.WellOperationImport.Constants; + +public static class DefaultTemplateInfo +{ + public const string SheetNamePlan = "План"; + public const string SheetNameFact = "Факт"; + + public const int HeaderRowsCount = 1; + public const int ColumnSection = 1; + public const int ColumnCategory = 2; + public const int ColumnCategoryInfo = 3; + public const int ColumnDepthStart = 4; + public const int ColumnDepthEnd = 5; + public const int ColumnDate = 6; + public const int ColumnDuration = 7; + public const int ColumnComment = 8; +} \ No newline at end of file diff --git a/AsbCloudInfrastructure/Services/WellOperationImport/Constants/OperationAttributes.cs b/AsbCloudInfrastructure/Services/WellOperationImport/Constants/OperationAttributes.cs new file mode 100644 index 00000000..c4049d03 --- /dev/null +++ b/AsbCloudInfrastructure/Services/WellOperationImport/Constants/OperationAttributes.cs @@ -0,0 +1,10 @@ +namespace AsbCloudInfrastructure.Services.WellOperationImport.Constants; + +public static class OperationAttributes +{ + public const string CategoryInfo = "Описание"; + public const string SectionDiameter = "ОК"; + public const string Depth = "Забой"; + public const string Duration = "Время операции"; + public const string Date = "Дата окончания операции"; +} \ No newline at end of file diff --git a/AsbCloudInfrastructure/Services/WellOperationImport/Constants/Templates.cs b/AsbCloudInfrastructure/Services/WellOperationImport/Constants/Templates.cs new file mode 100644 index 00000000..631dc170 --- /dev/null +++ b/AsbCloudInfrastructure/Services/WellOperationImport/Constants/Templates.cs @@ -0,0 +1,7 @@ +namespace AsbCloudInfrastructure.Services.WellOperationImport.Constants; + +public static class Templates +{ + public const int IdDefaultTemplate = 0; + public const int IdGazpromKhantosTemplate = 1; +} \ No newline at end of file