Commit 43bb3899 authored by 吴春's avatar 吴春
parents 4dc1d1db a397d3b4
This diff is collapsed.
This diff is collapsed.
......@@ -23,14 +23,16 @@ namespace Mall.DataHelper.Import
{
//图片所在的列
List<int> imgColList = new List<int>();
imgColList.Add(1);
imgColList.Add(2);
imgColList.Add(3);
List<RB_Brand_Enterprise_Extend> list = new List<RB_Brand_Enterprise_Extend>();
DataTable dt = Mall.Common.Plugin.NPOIHelper.ImportYBExceltoDt(fileName, 0, 1, true, imgColList: imgColList, tempFilePath: tempFilePath);
Mall.Common.Plugin.ImportExcelNPOIHelper importExcelNPOIHelper = new Common.Plugin.ImportExcelNPOIHelper(tempFilePath);
DataTable dt = importExcelNPOIHelper.ExcelToDataTable(fileName, 0, 0, true, imgColList: imgColList);
if (dt != null && dt.Rows.Count > 0)
{
foreach (DataRow dr in dt.Rows)
{
list.Add(DataRowToModel(dr));
list.Add(DataRowToModel(dr));
}
}
return list;
......
......@@ -2230,7 +2230,7 @@ namespace Mall.WebApi.Controllers.User
{
string rootPath = Path.Combine(Directory.GetCurrentDirectory(), "upfile");
string filePath = rootPath + @"\消费品牌.xlsx";
string tempPath = rootPath + @"\TempImg";
string tempPath = rootPath + @"\TempImport\TempFile";
var list = BrandHelper.ImportYBBrandData(filePath, tempPath);
return ApiResult.Success(data: Common.Plugin.JsonHelper.Serialize(list));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment