From 1ab89ba15fd521d83e809f52d6e50133814c042a Mon Sep 17 00:00:00 2001
From: yl <ykxkd@outlook.com>
Date: 星期五, 15 三月 2024 15:25:41 +0800
Subject: [PATCH] 1.订单、工单增加字段(销售业务员) 2.优化生产进度报表查询语句
---
VueWebCoreApi/Controllers/ImportExcelController.cs | 44 +++++++++++++++++++++++++++++++++++++++-----
1 files changed, 39 insertions(+), 5 deletions(-)
diff --git a/VueWebCoreApi/Controllers/ImportExcelController.cs b/VueWebCoreApi/Controllers/ImportExcelController.cs
index dd36c4c..1617421 100644
--- a/VueWebCoreApi/Controllers/ImportExcelController.cs
+++ b/VueWebCoreApi/Controllers/ImportExcelController.cs
@@ -1,4 +1,5 @@
-锘縰sing Microsoft.AspNetCore.Mvc;
+锘縰sing Microsoft.AspNetCore.Hosting;
+using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Data;
@@ -15,9 +16,15 @@
[ApiExplorerSettings(GroupName = "Excel瀵煎叆")]
[ApiController]
[Route("api/[controller]")]
- [ChannelActionFilter]
+ //[ChannelActionFilter]
public class ImportExcelController : Controller
{
+ private readonly IWebHostEnvironment _hostingEnvironment;
+
+ public ImportExcelController(IWebHostEnvironment hostingEnvironment)
+ {
+ _hostingEnvironment = hostingEnvironment;
+ }
#region[Excel瀵煎叆妯℃澘鍒楄〃]
/// <summary>
@@ -55,6 +62,33 @@
mes.code = "200";
mes.data = msg;
return Json(mes);
+
+ //ToMessage mes = new ToMessage();
+ //List<ScoreReport> list = ExcelList.ExcelData();
+ //list = list.Where(s => s.FileCode == FileCode).ToList();
+ //var filename = list[0].FileName + ".xls";
+ //var wwwRootPath = _hostingEnvironment.WebRootPath;
+ //var fileDirectory = Path.Combine(wwwRootPath, "Excel"); // 鏇挎崲涓烘偍鐨凟xcel鏂囦欢鎵�鍦ㄧ洰褰�
+ //var filePath = Path.Combine(fileDirectory, $"{filename}.xlsx"); // 鍋囪鏂囦欢鍚嶇紪鐮佷负鏂囦欢鍚�
+
+ //if (System.IO.File.Exists(filePath))
+ //{
+ // var fileInfo = new FileInfo(filePath);
+ // var result = new
+ // {
+ // FileName = fileInfo.Name,
+ // FilePath = filePath,
+ // FileSize = fileInfo.Length
+ // };
+ // return Json(result);
+ //}
+ //else
+ //{
+ // mes.code = "300";
+ // mes.data = "";
+ // mes.message = "鏂囦欢涓嶅瓨鍦�";
+ //}
+ //return Json(mes);
}
#endregion
@@ -119,7 +153,7 @@
catch (Exception e)
{
mes.code = "300";
- mes.Message = e.Message;
+ mes.message = e.Message;
}
return mes;
}
@@ -145,7 +179,7 @@
List<DataTable> dataTable = myModel.TableData;
list = ExcelCheckBLL.ExcelCheckData(FileCode, dataTable, out StuCode, out message, out count);
mes.code = StuCode;
- mes.Message = message;
+ mes.message = message;
mes.count = count;
mes.data = list;
return mes;
@@ -179,7 +213,7 @@
catch (Exception e)
{
mes.code = "300";
- mes.Message = e.Message;
+ mes.message = e.Message;
}
return mes;
}
--
Gitblit v1.9.3