导入导出
This commit is contained in:
@@ -163,29 +163,9 @@ namespace DOAN.Admin.WebApi.Controllers.BZFM
|
||||
{
|
||||
var list = _MmMaterialService.SelectMaterialList(material, new PagerInfo(1, 10000));
|
||||
|
||||
var data = (list?.Result ?? new List<MmMaterial>());
|
||||
var data = (list?.Result ?? new List<MmMaterialExcelDto>());
|
||||
|
||||
// Build list of dictionaries to control column titles and format dates
|
||||
var exportList = data.Select(x => new Dictionary<string, object>
|
||||
{
|
||||
["id"] = x.Id,
|
||||
["物料标号"] = x.Type,
|
||||
["物料编码"] = x.MaterialCode,
|
||||
["物料名称"] = x.MaterialName,
|
||||
["规格"] = x.Specification,
|
||||
["物料分类编码"] = x.CategoryCode,
|
||||
["物料分类名称"] = x.CategoryName,
|
||||
["计量单位"] = x.Unit,
|
||||
["供应商编码"] = x.SupplierCode,
|
||||
["供应商名称"] = x.SupplierName,
|
||||
["安全库存"] = x.SafetyStock,
|
||||
["状态"] = x.Status,
|
||||
["创建时间"] = x.CreatedTime.HasValue ? x.CreatedTime.Value.ToString("yyyy-MM-dd HH:mm:ss") : string.Empty,
|
||||
["更新时间"] = x.UpdatedTime.HasValue ? x.UpdatedTime.Value.ToString("yyyy-MM-dd HH:mm:ss") : string.Empty,
|
||||
["描述"] = x.Description
|
||||
}).ToList();
|
||||
|
||||
var result = ExportExcelMini(exportList, "material", "物料清单");
|
||||
var result = ExportExcelMini(data, "material", "物料清单");
|
||||
return ExportExcel(result.Item2, result.Item1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user