forked from ddrilling/AsbCloudServer
Исправление импорта РТК план.
1. Фикс шаблона 2. Фикс получения значения из ячейки
This commit is contained in:
parent
e5a563f6e6
commit
54b789db70
@ -343,14 +343,15 @@ public class ProcessMapPlanImportService : IProcessMapPlanImportService
|
|||||||
|
|
||||||
private static T GetCellValue<T>(IXLRow row, int columnNumber)
|
private static T GetCellValue<T>(IXLRow row, int columnNumber)
|
||||||
{
|
{
|
||||||
var cell = row.Cell(columnNumber);
|
try
|
||||||
|
|
||||||
if (cell.Value is T cellValue)
|
|
||||||
{
|
{
|
||||||
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()} содержит некорректное значение");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
Binary file not shown.
Loading…
Reference in New Issue
Block a user