2024-02-01 16:35:29 +05:00
|
|
|
|
using System;
|
|
|
|
|
using AsbCloudApp.Data;
|
2024-01-29 15:03:53 +05:00
|
|
|
|
using AsbCloudApp.Data.Trajectory;
|
|
|
|
|
using ClosedXML.Excel;
|
|
|
|
|
|
|
|
|
|
namespace AsbCloudInfrastructure.Services.Trajectory.Parser;
|
|
|
|
|
|
2024-02-08 14:50:14 +05:00
|
|
|
|
public class TrajectoryFactManualParser : TrajectoryParser<TrajectoryGeoFactDto>
|
2024-01-29 15:03:53 +05:00
|
|
|
|
{
|
2024-01-31 17:20:54 +05:00
|
|
|
|
protected override string SheetName => "Фактическая траектория";
|
2024-02-01 16:35:29 +05:00
|
|
|
|
protected override string TemplateFileName => "TrajectoryFactManualTemplate.xlsx";
|
2024-01-31 17:20:54 +05:00
|
|
|
|
|
2024-02-08 14:50:14 +05:00
|
|
|
|
public TrajectoryFactManualParser(IServiceProvider serviceProvider)
|
2024-02-01 16:35:29 +05:00
|
|
|
|
: base(serviceProvider)
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
2024-01-29 15:03:53 +05:00
|
|
|
|
protected override ValidationResultDto<TrajectoryGeoFactDto> ParseRow(IXLRow row)
|
|
|
|
|
{
|
|
|
|
|
var trajectoryRow = new TrajectoryGeoFactDto
|
|
|
|
|
{
|
|
|
|
|
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>(),
|
|
|
|
|
Comment = row.Cell(6).GetCellValue<string?>()
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//TODO: Добавить валидацию модели
|
|
|
|
|
|
2024-02-01 16:35:29 +05:00
|
|
|
|
var validationResult = new ValidationResultDto<TrajectoryGeoFactDto>
|
2024-01-29 15:03:53 +05:00
|
|
|
|
{
|
|
|
|
|
Item = trajectoryRow
|
|
|
|
|
};
|
2024-02-01 16:35:29 +05:00
|
|
|
|
|
|
|
|
|
return validationResult;
|
2024-01-29 15:03:53 +05:00
|
|
|
|
}
|
|
|
|
|
}
|