导入导出
This commit is contained in:
@@ -132,7 +132,7 @@ namespace DOAN.Admin.WebApi.Controllers.BZFM
|
|||||||
[ActionPermissionFilter(Permission = "mmmaterial:import")]
|
[ActionPermissionFilter(Permission = "mmmaterial:import")]
|
||||||
public IActionResult ImportData([FromForm(Name = "file")] IFormFile formFile)
|
public IActionResult ImportData([FromForm(Name = "file")] IFormFile formFile)
|
||||||
{
|
{
|
||||||
//List<MmMaterialExcelDto> material = new();
|
List<MmMaterialExcelDto> materialList = new();
|
||||||
DateTime dateValue = DateTime.MinValue;
|
DateTime dateValue = DateTime.MinValue;
|
||||||
using (var stream = formFile.OpenReadStream())
|
using (var stream = formFile.OpenReadStream())
|
||||||
{
|
{
|
||||||
@@ -266,16 +266,6 @@ namespace DOAN.Admin.WebApi.Controllers.BZFM
|
|||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
//10指示日期
|
|
||||||
NPOI.SS.UserModel.ICell cell17 = currentRow.GetCell(10);
|
|
||||||
|
|
||||||
// 将单元格的数字值转换为DateTime
|
|
||||||
material.CreatedTime = cell17.DateCellValue.Value;
|
|
||||||
|
|
||||||
//装箱容积
|
|
||||||
/*NPOI.SS.UserModel.ICell currentCell_0811 = currentRow.GetCell(6);
|
|
||||||
workorder.PackageCapacity = (int)currentCell_0811?.NumericCellValue;*/
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -283,9 +273,10 @@ namespace DOAN.Admin.WebApi.Controllers.BZFM
|
|||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
return -1;
|
//return -1;
|
||||||
}
|
}
|
||||||
//material = stream.Query<MmMaterialExcelDto>(startCell: "A2").ToList();
|
material = stream.Query<MmMaterialExcelDto>(startCell: "A2").ToList();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return SUCCESS(_MmMaterialService.Importmaterial(material));
|
return SUCCESS(_MmMaterialService.Importmaterial(material));
|
||||||
|
|||||||
Reference in New Issue
Block a user