using System; using System.Collections.Generic; using AsbCloudApp.Data.Trajectory; using ClosedXML.Excel; namespace AsbCloudInfrastructure.Services.Trajectory.Parser; public class TrajectoryFactManualParser : TrajectoryParser { #region Columns private const int columnWellboreDepth = 1; private const int columnZenithAngle = 2; private const int columnAzimuthGeo = 3; private const int columnAzimuthMagnetic = 4; private const int columnVerticalDepth = 5; private const int columnComment = 6; #endregion public TrajectoryFactManualParser(IServiceProvider serviceProvider) : base(serviceProvider) { } protected override string SheetName => "Фактическая траектория"; protected override string TemplateFileName => "TrajectoryFactManualTemplate.xlsx"; protected override IDictionary PropertyColumnNumbers => new Dictionary { { nameof(TrajectoryGeoFactDto.WellboreDepth), columnWellboreDepth }, { nameof(TrajectoryGeoFactDto.ZenithAngle), columnZenithAngle }, { nameof(TrajectoryGeoFactDto.AzimuthGeo), columnAzimuthGeo }, { nameof(TrajectoryGeoFactDto.AzimuthMagnetic), columnAzimuthMagnetic }, { nameof(TrajectoryGeoFactDto.VerticalDepth), columnVerticalDepth }, { nameof(TrajectoryGeoFactDto.Comment), columnComment } }; protected override TrajectoryGeoFactDto ParseRow(IXLRow row) { var dto = new TrajectoryGeoFactDto { WellboreDepth = row.Cell(columnWellboreDepth).GetCellValue(), ZenithAngle = row.Cell(columnZenithAngle).GetCellValue(), AzimuthGeo = row.Cell(columnAzimuthGeo).GetCellValue(), AzimuthMagnetic = row.Cell(columnAzimuthMagnetic).GetCellValue(), VerticalDepth = row.Cell(columnVerticalDepth).GetCellValue(), Comment = row.Cell(columnComment).GetCellValue() }; return dto; } }