Merge pull request '#11586758 Исправление импорта РТК план.' (#89) from fix/processmap_import into dev

Reviewed-on: http://test.digitaldrilling.ru:8080/DDrilling/AsbCloudServer/pulls/89
This commit is contained in:
Никита Фролов 2023-07-28 10:49:01 +05:00
commit 2ec88c49bc
2 changed files with 8 additions and 7 deletions

View File

@ -343,14 +343,15 @@ public class ProcessMapPlanImportService : IProcessMapPlanImportService
private static T GetCellValue<T>(IXLRow row, int columnNumber)
{
var cell = row.Cell(columnNumber);
if (cell.Value is T cellValue)
try
{
return cellValue;
var cell = row.Cell(columnNumber);
return (T)Convert.ChangeType(cell.Value, typeof(T));
}
catch
{
throw new FileFormatException(
$"Лист {row.Worksheet.Name}. Ячейка: ({row.RowNumber()},{columnNumber}) содержит некорректное значение");
}
throw new FileFormatException(
$"Лист {row.Worksheet.Name}. Ячейка:{columnNumber},{row.RowNumber()} содержит некорректное значение");
}
}