From 7ff74f599084561338eef1230db5aa45f74565f8 Mon Sep 17 00:00:00 2001
From: yl <ykxkd@outlook.com>
Date: 星期一, 15 四月 2024 18:03:33 +0800
Subject: [PATCH] 1.ERP订单关闭增加单据id 2.MES工单关闭增加源单id关联

---
 VueWebCoreApi/Controllers/ImportExcelController.cs |   42 ++++++++++++++++++++++++++++++++++++++----
 1 files changed, 38 insertions(+), 4 deletions(-)

diff --git a/VueWebCoreApi/Controllers/ImportExcelController.cs b/VueWebCoreApi/Controllers/ImportExcelController.cs
index b069aa8..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;
@@ -18,6 +19,12 @@
     //[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