diff --git a/AsbCloudApp/Requests/ParserOptions/WellRelatedParserRequest.cs b/AsbCloudApp/Requests/ParserOptions/WellRelatedParserRequest.cs
new file mode 100644
index 00000000..3ffbf4d5
--- /dev/null
+++ b/AsbCloudApp/Requests/ParserOptions/WellRelatedParserRequest.cs
@@ -0,0 +1,21 @@
+namespace AsbCloudApp.Requests.ParserOptions;
+
+///
+/// Параметры парсинга
+///
+public class WellRelatedParserRequest : IParserOptionsRequest
+{
+ ///
+ /// Конструктор
+ ///
+ /// Id скважины
+ public WellRelatedParserRequest(int idWell)
+ {
+ IdWell = idWell;
+ }
+
+ ///
+ /// Id скважины
+ ///
+ public int IdWell { get; }
+}
\ No newline at end of file
diff --git a/AsbCloudApp/Services/IParserService.cs b/AsbCloudApp/Services/IParserService.cs
index 8c01af5a..6fa095cd 100644
--- a/AsbCloudApp/Services/IParserService.cs
+++ b/AsbCloudApp/Services/IParserService.cs
@@ -8,8 +8,10 @@ namespace AsbCloudApp.Services;
/// Сервис парсинга
///
///
-public interface IParserService : IParserService
+///
+public interface IParserService : IParserService
where TDto : class, IId
+ where TOptions : IParserOptionsRequest
{
///
/// Распарсить файл
@@ -17,8 +19,7 @@ public interface IParserService : IParserService
///
///
///
- ParserResultDto Parse(Stream file, TOptions options)
- where TOptions : IParserOptionsRequest;
+ ParserResultDto Parse(Stream file, TOptions options);
///
/// Получение шаблона для заполнения
diff --git a/AsbCloudInfrastructure/Services/Parser/ParserExcelService.cs b/AsbCloudInfrastructure/Services/Parser/ParserExcelService.cs
index 661c729f..13c621af 100644
--- a/AsbCloudInfrastructure/Services/Parser/ParserExcelService.cs
+++ b/AsbCloudInfrastructure/Services/Parser/ParserExcelService.cs
@@ -12,8 +12,9 @@ using Mapster;
namespace AsbCloudInfrastructure.Services.Parser;
-public abstract class ParserExcelService : IParserService
+public abstract class ParserExcelService : IParserService
where TDto : class, IValidatableObject, IId
+ where TOptions : IParserOptionsRequest
{
protected abstract string SheetName { get; }
@@ -22,9 +23,8 @@ public abstract class ParserExcelService : IParserService
protected abstract string TemplateFileName { get; }
protected abstract IDictionary Cells { get; }
-
- public virtual ParserResultDto Parse(Stream file, TOptions options)
- where TOptions : IParserOptionsRequest
+
+ public virtual ParserResultDto Parse(Stream file, TOptions options)
{
using var workbook = new XLWorkbook(file);
var sheet = workbook.GetWorksheet(SheetName);
diff --git a/AsbCloudInfrastructure/Services/ProcessMapPlan/Parser/ProcessMapPlanDrillingParser.cs b/AsbCloudInfrastructure/Services/ProcessMapPlan/Parser/ProcessMapPlanDrillingParser.cs
index c1717db1..f4e829fc 100644
--- a/AsbCloudInfrastructure/Services/ProcessMapPlan/Parser/ProcessMapPlanDrillingParser.cs
+++ b/AsbCloudInfrastructure/Services/ProcessMapPlan/Parser/ProcessMapPlanDrillingParser.cs
@@ -6,7 +6,6 @@ using AsbCloudApp.Data;
using AsbCloudApp.Data.ProcessMaps;
using AsbCloudApp.Repositories;
using AsbCloudInfrastructure.Services.Parser;
-using Microsoft.Extensions.DependencyInjection;
namespace AsbCloudInfrastructure.Services.ProcessMapPlan.Parser;
diff --git a/AsbCloudInfrastructure/Services/ProcessMapPlan/Parser/ProcessMapPlanParser.cs b/AsbCloudInfrastructure/Services/ProcessMapPlan/Parser/ProcessMapPlanParser.cs
index 1686779b..effe7ef6 100644
--- a/AsbCloudInfrastructure/Services/ProcessMapPlan/Parser/ProcessMapPlanParser.cs
+++ b/AsbCloudInfrastructure/Services/ProcessMapPlan/Parser/ProcessMapPlanParser.cs
@@ -1,14 +1,26 @@
-using System;
+using System.IO;
+using AsbCloudApp.Data;
using AsbCloudApp.Data.ProcessMaps;
+using AsbCloudApp.Requests.ParserOptions;
using AsbCloudInfrastructure.Services.Parser;
namespace AsbCloudInfrastructure.Services.ProcessMapPlan.Parser;
-public abstract class ProcessMapPlanParser : ParserExcelService
+public abstract class ProcessMapPlanParser : ParserExcelService
where TDto : ProcessMapPlanBaseDto
{
protected override int HeaderRowsCount => 2;
+ public override ParserResultDto Parse(Stream file, WellRelatedParserRequest options)
+ {
+ var result = base.Parse(file, options);
+
+ foreach (var item in result.Item)
+ item.Item.IdWell = options.IdWell;
+
+ return result;
+ }
+
protected static int? GetIdMode(string? modeName) =>
modeName?.Trim().ToLower() switch
{
diff --git a/AsbCloudInfrastructure/Services/ProcessMapPlan/Parser/ProcessMapPlanReamParser.cs b/AsbCloudInfrastructure/Services/ProcessMapPlan/Parser/ProcessMapPlanReamParser.cs
index 20aca5ed..6ca31714 100644
--- a/AsbCloudInfrastructure/Services/ProcessMapPlan/Parser/ProcessMapPlanReamParser.cs
+++ b/AsbCloudInfrastructure/Services/ProcessMapPlan/Parser/ProcessMapPlanReamParser.cs
@@ -22,14 +22,12 @@ public class ProcessMapPlanReamParser : ProcessMapPlanParser "ProcessMapPlanReamTemplate.xlsx";
private const int ColumnSection = 1;
- private const int ColumnMode = 2;
-
+
protected override IDictionary Cells => new Dictionary
{
{ nameof(ProcessMapPlanReamDto.Section), new Cell(ColumnSection, typeof(string)) },
{ nameof(ProcessMapPlanReamDto.DepthStart), new Cell(2, typeof(double)) },
{ nameof(ProcessMapPlanReamDto.DepthEnd), new Cell(3, typeof(double)) },
-
{ nameof(ProcessMapPlanReamDto.Repeats), new Cell(4, typeof(double)) },
{ nameof(ProcessMapPlanReamDto.SpinUpward), new Cell(5, typeof(double)) },
{ nameof(ProcessMapPlanReamDto.SpinUpward), new Cell(6, typeof(double)) },
diff --git a/AsbCloudInfrastructure/Services/Trajectory/Parser/TrajectoryFactManualParser.cs b/AsbCloudInfrastructure/Services/Trajectory/Parser/TrajectoryFactManualParser.cs
index 5de4e2c5..cf4b7118 100644
--- a/AsbCloudInfrastructure/Services/Trajectory/Parser/TrajectoryFactManualParser.cs
+++ b/AsbCloudInfrastructure/Services/Trajectory/Parser/TrajectoryFactManualParser.cs
@@ -4,12 +4,10 @@ using AsbCloudInfrastructure.Services.Parser;
namespace AsbCloudInfrastructure.Services.Trajectory.Parser;
-public class TrajectoryFactManualParser : ParserExcelService
+public class TrajectoryFactManualParser : TrajectoryParser
{
protected override string SheetName => "Фактическая траектория";
-
- protected override int HeaderRowsCount => 2;
-
+
protected override string TemplateFileName => "TrajectoryFactManualTemplate.xlsx";
protected override IDictionary Cells => new Dictionary
diff --git a/AsbCloudInfrastructure/Services/Trajectory/Parser/TrajectoryParser.cs b/AsbCloudInfrastructure/Services/Trajectory/Parser/TrajectoryParser.cs
new file mode 100644
index 00000000..ce579fa6
--- /dev/null
+++ b/AsbCloudInfrastructure/Services/Trajectory/Parser/TrajectoryParser.cs
@@ -0,0 +1,23 @@
+using System.IO;
+using AsbCloudApp.Data;
+using AsbCloudApp.Data.Trajectory;
+using AsbCloudApp.Requests.ParserOptions;
+using AsbCloudInfrastructure.Services.Parser;
+
+namespace AsbCloudInfrastructure.Services.Trajectory.Parser;
+
+public abstract class TrajectoryParser : ParserExcelService
+ where TDto : TrajectoryGeoDto
+{
+ protected override int HeaderRowsCount => 2;
+
+ public override ParserResultDto Parse(Stream file, WellRelatedParserRequest options)
+ {
+ var result = base.Parse(file, options);
+
+ foreach (var item in result.Item)
+ item.Item.IdWell = options.IdWell;
+
+ return result;
+ }
+}
\ No newline at end of file
diff --git a/AsbCloudInfrastructure/Services/Trajectory/Parser/TrajectoryPlanParser.cs b/AsbCloudInfrastructure/Services/Trajectory/Parser/TrajectoryPlanParser.cs
index 4c100766..568bfa35 100644
--- a/AsbCloudInfrastructure/Services/Trajectory/Parser/TrajectoryPlanParser.cs
+++ b/AsbCloudInfrastructure/Services/Trajectory/Parser/TrajectoryPlanParser.cs
@@ -4,12 +4,10 @@ using AsbCloudInfrastructure.Services.Parser;
namespace AsbCloudInfrastructure.Services.Trajectory.Parser;
-public class TrajectoryPlanParser : ParserExcelService
+public class TrajectoryPlanParser : TrajectoryParser
{
protected override string SheetName => "Плановая траектория";
-
- protected override int HeaderRowsCount => 2;
-
+
protected override string TemplateFileName => "TrajectoryPlanTemplate.xlsx";
protected override IDictionary Cells => new Dictionary