using AsbCloudApp.Data; using AsbCloudApp.Repositories; using AsbCloudApp.Services; using ClosedXML.Excel; namespace AsbCloudInfrastructure.Services.Trajectory { public class NnbTrajectoryImportService : TrajectoryImportService { public override string templateFileName { get; set; } = "NnbTrajectoryTemplate.xlsx"; public override string usingTemplateFile { get; set; } = "AsbCloudInfrastructure.Services.Trajectory.Templates"; public override string sheetNamePlannedTrajectory { get; set; } = "Фактическая ннб-траектория"; public override int headerRowsCount { get; set; } = 2; public override int ColumnWellboreDepth { get; set; } = 1; public override int ColumnZenithAngle { get; set; } = 2; public override int ColumnAzimuthGeo { get; set; } = 3; public override int ColumnAzimuthMagnetic { get; set; } = 4; public override int ColumnVerticalDepth { get; set; } = 5; public override int ColumnRadius { get; set; } = 6; public override int ColumnComment { get; set; } = 7; public NnbTrajectoryImportService( IWellService wellService, ITrajectoryNnbRepository nnbTrajectoryService) : base(nnbTrajectoryService, wellService) { } protected override void AddCoordinatesToRow(IXLRow row, TrajectoryGeoFactDto trajectory) { row.Cell(ColumnWellboreDepth).Value = trajectory.WellboreDepth; row.Cell(ColumnZenithAngle).Value = trajectory.ZenithAngle; row.Cell(ColumnAzimuthGeo).Value = trajectory.AzimuthGeo; row.Cell(ColumnAzimuthMagnetic).Value = trajectory.AzimuthMagnetic; row.Cell(ColumnVerticalDepth).Value = trajectory.VerticalDepth; row.Cell(ColumnRadius).Value = trajectory.Radius; row.Cell(ColumnComment).Value = trajectory.Comment; } protected override TrajectoryGeoFactDto ParseRow(IXLRow row) { var trajectoryRow = 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(), Radius = row.Cell(ColumnRadius).GetCellValue(), Comment = row.Cell(ColumnComment).GetCellValue() }; return trajectoryRow; } } }