工单导入模板下载
This commit is contained in:
@@ -54,21 +54,21 @@ namespace ZR.Admin.WebApi.Controllers
|
|||||||
/// <param name="path">完整文件路径</param>
|
/// <param name="path">完整文件路径</param>
|
||||||
/// <param name="fileName">带扩展文件名</param>
|
/// <param name="fileName">带扩展文件名</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
|
//protected IActionResult ExportExcel(string path, string fileName)
|
||||||
|
//{
|
||||||
|
// //var webHostEnvironment = App.WebHostEnvironment;
|
||||||
|
// if (!Path.Exists(path))
|
||||||
|
// {
|
||||||
|
// throw new CustomException(fileName + "文件不存在");
|
||||||
|
// }
|
||||||
|
// var stream = Io.File.OpenRead(path); //创建文件流
|
||||||
|
|
||||||
|
// Response.Headers.Add("Access-Control-Expose-Headers", "Content-Disposition");
|
||||||
|
// return File(stream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", HttpUtility.UrlEncode(fileName));
|
||||||
|
// // return File(stream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",fileName);
|
||||||
|
//}
|
||||||
|
|
||||||
protected IActionResult ExportExcel(string path, string fileName)
|
protected IActionResult ExportExcel(string path, string fileName)
|
||||||
{
|
|
||||||
//var webHostEnvironment = App.WebHostEnvironment;
|
|
||||||
if (!Path.Exists(path))
|
|
||||||
{
|
|
||||||
throw new CustomException(fileName + "文件不存在");
|
|
||||||
}
|
|
||||||
var stream = Io.File.OpenRead(path); //创建文件流
|
|
||||||
|
|
||||||
Response.Headers.Add("Access-Control-Expose-Headers", "Content-Disposition");
|
|
||||||
return File(stream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet", HttpUtility.UrlEncode(fileName));
|
|
||||||
// return File(stream, "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",fileName);
|
|
||||||
}
|
|
||||||
|
|
||||||
protected IActionResult ExportExcel2(string path, string fileName)
|
|
||||||
{
|
{
|
||||||
if (!Path.Exists(path))
|
if (!Path.Exists(path))
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ namespace ZR.Admin.WebApi.Controllers.mes.pro
|
|||||||
public IActionResult ImportTemplateExcel()
|
public IActionResult ImportTemplateExcel()
|
||||||
{
|
{
|
||||||
(string, string) result = DownloadImportTemplate("日生产计划模板");//返回文件名和路径
|
(string, string) result = DownloadImportTemplate("日生产计划模板");//返回文件名和路径
|
||||||
return ExportExcel2(result.Item2, result.Item1);
|
return ExportExcel(result.Item2, result.Item1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
BIN
ZR.Admin.WebApi/wwwroot/workorder/20251218152757日生产计划模板.xlsx
Normal file
BIN
ZR.Admin.WebApi/wwwroot/workorder/20251218152757日生产计划模板.xlsx
Normal file
Binary file not shown.
BIN
ZR.Admin.WebApi/wwwroot/workorder/20251218153054日生产计划模板.xlsx
Normal file
BIN
ZR.Admin.WebApi/wwwroot/workorder/20251218153054日生产计划模板.xlsx
Normal file
Binary file not shown.
Reference in New Issue
Block a user