DD.WellWorkover.Cloud/AsbCloudInfrastructure/Services/Trajectory/Import/TrajectoryPlanParserService.cs

34 lines
1.3 KiB
C#
Raw Normal View History

2023-11-30 09:40:51 +05:00
using AsbCloudApp.Data.Trajectory;
using ClosedXML.Excel;
namespace AsbCloudInfrastructure.Services.Trajectory.Import
{
2023-11-30 15:08:58 +05:00
public class TrajectoryPlanParserService : TrajectoryParserService<TrajectoryGeoPlanDto>
2023-11-30 09:40:51 +05:00
{
2023-11-30 15:08:58 +05:00
public override string templateFileName { get; } = "TrajectoryPlanTemplate.xlsx";
2023-11-30 09:40:51 +05:00
public override string usingTemplateFile { get; } = "AsbCloudInfrastructure.Services.Trajectory.Templates";
2023-11-30 15:08:58 +05:00
public override string sheetName { get; } = "Плановая траектория";
2023-11-30 09:40:51 +05:00
public override int headerRowsCount { get; } = 2;
protected override TrajectoryGeoPlanDto ParseRow(IXLRow row)
{
var trajectoryRow = new TrajectoryGeoPlanDto
{
WellboreDepth = row.Cell(1).GetCellValue<double>(),
ZenithAngle = row.Cell(2).GetCellValue<double>(),
AzimuthGeo = row.Cell(3).GetCellValue<double>(),
AzimuthMagnetic = row.Cell(4).GetCellValue<double>(),
VerticalDepth = row.Cell(5).GetCellValue<double>(),
Radius = row.Cell(6).GetCellValue<double>(),
Comment = row.Cell(7).GetCellValue<string?>()
};
//TODO: Добавить валидацию модели IValidatableObject
return trajectoryRow;
}
}
}