From 129879f45b1b59f8e1b26c766a80d50f371be385 Mon Sep 17 00:00:00 2001
From: yl <ykxkd@outlook.com>
Date: 星期五, 08 九月 2023 18:21:56 +0800
Subject: [PATCH] 人员信息导入
---
VueWebCoreApi/Controllers/ImportExcelController.cs | 135 ++++++
VueWebCoreApi/DLL/DAL/ExcelCheckDAL.cs | 77 ++-
VueWebCoreApi/wwwroot/Excel/设备保养标准.xls | 0
VueWebCoreApi/Models/SystemSetting/ExceImport.cs | 17
VueWebCoreApi/wwwroot/Excel/物料清单.xls | 0
VueWebCoreApi/wwwroot/Excel/设备点检项目.xls | 0
VueWebCoreApi/wwwroot/Excel/往来单位.xls | 0
VueWebCoreApi/DLL/BLL/ExcelCheckBLL.cs | 13
VueWebCoreApi/Tools/ImportExcelData.cs | 827 ++++++++++++++++++++++++-----------------
VueWebCoreApi/wwwroot/Excel/仓库库位清单.xls | 0
VueWebCoreApi/wwwroot/Excel/用户清单.xls | 0
VueWebCoreApi/wwwroot/Excel/缺陷定义.xls | 0
VueWebCoreApi/wwwroot/Excel/节拍工价.xls | 0
VueWebCoreApi/wwwroot/Excel/设备清单.xls | 0
/dev/null | 0
VueWebCoreApi/Tools/ExcelList.cs | 13
VueWebCoreApi/VueWebCoreApi.csproj | 16
VueWebCoreApi/wwwroot/Excel/设备点检标准.xls | 0
VueWebCoreApi/Controllers/GeneralBasicDataController.cs | 12
VueWebCoreApi/wwwroot/Excel/设备保养项目.xls | 0
VueWebCoreApi/Tools/ImportExcel.cs | 47 ++
VueWebCoreApi/wwwroot/Excel/角色清单.xls | 0
22 files changed, 768 insertions(+), 389 deletions(-)
diff --git a/VueWebCoreApi/Controllers/GeneralBasicDataController.cs b/VueWebCoreApi/Controllers/GeneralBasicDataController.cs
index d253f6c..10157a1 100644
--- a/VueWebCoreApi/Controllers/GeneralBasicDataController.cs
+++ b/VueWebCoreApi/Controllers/GeneralBasicDataController.cs
@@ -32,6 +32,10 @@
#endregion
#region[宀椾綅鍩虹璧勬枡]
+ /// <summary>
+ /// 宀椾綅鍩虹璧勬枡
+ /// </summary>
+ /// <returns></returns>
[Route(template: "PostPermissions")]
[HttpGet]
public JsonResult PostPermissions()
@@ -42,6 +46,10 @@
#endregion
#region[瑙掕壊鍩虹璧勬枡]
+ /// <summary>
+ /// 瑙掕壊鍩虹璧勬枡
+ /// </summary>
+ /// <returns></returns>
[Route(template: "RolePermissions")]
[HttpGet]
public JsonResult RolePermissions()
@@ -52,6 +60,10 @@
#endregion
#region[鐝粍鍩虹璧勬枡]
+ /// <summary>
+ ///鐝粍鍩虹璧勬枡
+ /// </summary>
+ /// <returns></returns>
[Route(template: "GroupsPermissions")]
[HttpGet]
public JsonResult GroupsPermissions()
diff --git a/VueWebCoreApi/Controllers/ImportExcelController.cs b/VueWebCoreApi/Controllers/ImportExcelController.cs
index 2838ec1..3d67241 100644
--- a/VueWebCoreApi/Controllers/ImportExcelController.cs
+++ b/VueWebCoreApi/Controllers/ImportExcelController.cs
@@ -1,9 +1,13 @@
锘縰sing Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
+using System.Data;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
+using VueWebCoreApi.DLL.BLL;
+using VueWebCoreApi.Models;
+using VueWebCoreApi.Models.SystemSetting;
using VueWebCoreApi.Tools;
namespace VueWebCoreApi.Controllers
@@ -14,8 +18,6 @@
//[ChannelActionFilter]
public class ImportExcelController : Controller
{
- //瀹氫箟鍏ㄥ眬淇℃伅杩斿洖鍙橀噺
- ToMessage mes = new ToMessage();
#region[Excel瀵煎叆妯℃澘鍒楄〃]
/// <summary>
@@ -26,6 +28,7 @@
[HttpGet]
public JsonResult ExcelModelData()
{
+ ToMessage mes = new ToMessage();
List<ScoreReport> list = ExcelList.ExcelData();
mes.code = "200";
mes.data = list;
@@ -43,6 +46,7 @@
[HttpGet]
public JsonResult DownLoadExcel(string FileCode = null)
{
+ ToMessage mes = new ToMessage();
List<ScoreReport> list = ExcelList.ExcelData();
list = list.Where(s => s.FileCode == FileCode).ToList();
var filename = list[0].FileName + ".xls";
@@ -53,5 +57,132 @@
return Json(mes);
}
#endregion
+
+ #region [Excel瀵煎叆鏁版嵁鎻愪氦銆佹ā鏉块獙璇併�佹暟鎹鍏
+ /// <summary>
+ /// Excel瀵煎叆鏁版嵁鎻愪氦銆佹ā鏉块獙璇併�佹暟鎹鍏�
+ /// </summary>
+ /// <param name="myModel">鎻愪氦鏁版嵁</param>
+ /// <returns></returns>
+ [Route(template: "ExcelModelCheck")]
+ [HttpPost]
+ public JsonResult ExcelModelCheck([FromBody] ExceImport myModel)
+ {
+ string FileCode = myModel.FileCode;
+ List<DataTable> dataTable = myModel.TableData;
+
+ ExcelModelCheck list = new ExcelModelCheck();
+ list.json1 = ExcelCheck(dataTable, FileCode); //妯℃澘楠岃瘉
+ if (list.json1.code == "301")
+ {
+ list.json1 = list.json1;
+ return Json(list);
+ }
+ list.json2 = ExcelCheckData(myModel); //鏁版嵁楠岃瘉
+ if (list.json2.code == "301")
+ {
+ list.json2 = list.json2;
+ return Json(list);
+ }
+ //list.json3 = ExcelCheckData(myModel); //鏁版嵁楠岃瘉
+ //if (list.json3.code == "300")
+ //{
+ // list.json3 = list.json3;
+ // return Json(list);
+ //}
+ return Json(list);
+ }
+ #endregion
+
+ #region [Excel瀵煎叆妯℃澘楠岃瘉]
+ /// <summary>
+ /// Excel瀵煎叆妯℃澘楠岃瘉
+ /// </summary>
+ /// <param name="dataTable">鎻愪氦鏁版嵁</param>
+ /// <param name="FileCode">鏂囦欢缂栫爜</param>
+ /// <returns></returns>
+ [Route(template: "ExcelCheckUpload")]
+ [HttpGet]
+ [ApiExplorerSettings(IgnoreApi = true)]
+ public ToMessage ExcelCheck(List<DataTable> dataTable, string FileCode = null)
+ {
+ ToMessage mes = new ToMessage();
+ try
+ {
+ mes = ExcelCheckBLL.ExcelCheck(FileCode, dataTable);
+ if (mes.code == "301") //涓婁紶妯℃澘涓嶆槸鎸囧畾妯℃澘
+ {
+ return mes;
+ }
+ return mes;
+ }
+ catch (Exception e)
+ {
+ mes.code = "300";
+ mes.Message = e.Message;
+ }
+ return mes;
+ }
+ #endregion
+
+ #region [Excel瀵煎叆鏁版嵁楠岃瘉]
+ /// <summary>
+ /// Excel瀵煎叆鏁版嵁楠岃瘉
+ /// </summary>
+ /// <param name="myModel">鎻愪氦鏁版嵁</param>
+ /// <returns></returns>
+ [Route(template: "ExcelCheckData")]
+ [HttpPost]
+ [ApiExplorerSettings(IgnoreApi = true)]
+ public ToMessage ExcelCheckData([FromBody] ExceImport myModel)
+ {
+ ToMessage mes = new ToMessage();
+ string message = "";
+ string StuCode = "";
+ int count = 0;
+ List<ExcelErro> list = new List<ExcelErro>();
+ string FileCode = myModel.FileCode;
+ List<DataTable> dataTable = myModel.TableData;
+ list = ExcelCheckBLL.ExcelCheckData(FileCode, dataTable, out StuCode, out message, out count);
+ mes.code = StuCode;
+ mes.Message = message;
+ mes.count = count;
+ mes.data = list;
+ return mes;
+ }
+ #endregion
+
+ #region[Excel瀵煎叆鏁版嵁]
+ /// <summary>
+ /// Excel瀵煎叆鏁版嵁
+ /// </summary>
+ /// <param name="dataTable">鎻愪氦鏁版嵁</param>
+ /// <param name="FileCode">鏂囦欢缂栫爜</param>
+ /// <returns></returns>
+ [Route(template: "ExcelImportSubmit")]
+ [HttpPost]
+ [ApiExplorerSettings(IgnoreApi = true)]
+ public ToMessage ExcelImportSubmit(List<DataTable> dataTable, string FileCode = null)
+ {
+ ToMessage mes = new ToMessage();
+ try
+ {
+ var token = HttpContext.Request.Headers["Token"].ToString();
+ User us = JwtTools.Denocode(token.ToString());
+ mes = ExcelCheckBLL.ExcelImportSubmit(FileCode, dataTable, us);
+ if (mes.code == "300")
+ {
+ return mes;
+ }
+ return mes;
+ }
+ catch (Exception e)
+ {
+ mes.code = "300";
+ mes.Message = e.Message;
+ }
+ return mes;
+ }
+ #endregion
}
}
diff --git a/VueWebCoreApi/DLL/BLL/ExcelCheckBLL.cs b/VueWebCoreApi/DLL/BLL/ExcelCheckBLL.cs
index 668c121..a90435e 100644
--- a/VueWebCoreApi/DLL/BLL/ExcelCheckBLL.cs
+++ b/VueWebCoreApi/DLL/BLL/ExcelCheckBLL.cs
@@ -1,5 +1,6 @@
锘縰sing System;
using System.Collections.Generic;
+using System.Data;
using System.Linq;
using System.Threading.Tasks;
using VueWebCoreApi.DLL.DAL;
@@ -11,23 +12,23 @@
public class ExcelCheckBLL
{
#region銆怑xcel瀵煎叆妯℃澘楠岃瘉銆�
- public static ToMessage ExcelCheck(string fileCode, string savePath)
+ public static ToMessage ExcelCheck(string fileCode, List<DataTable> dataTable)
{
- return ExcelCheckDAL.ExcelCheck(fileCode, savePath);
+ return ExcelCheckDAL.ExcelCheck(fileCode, dataTable);
}
#endregion
#region[Excel瀵煎叆鏁版嵁楠岃瘉]
- public static List<ExcelErro> ExcelCheckData(string fileCode, string savePath, out string stuCode, out string message, out int count)
+ public static List<ExcelErro> ExcelCheckData(string fileCode, List<DataTable> dataTable, out string stuCode, out string message, out int count)
{
- return ExcelCheckDAL.ExcelCheckData(fileCode, savePath, out stuCode, out message, out count);
+ return ExcelCheckDAL.ExcelCheckData(fileCode, dataTable, out stuCode, out message, out count);
}
#endregion
#region[Excel瀵煎叆鏁版嵁]
- public static ToMessage ExcelImportSubmit(string fileCode, string savePath, string username)
+ public static ToMessage ExcelImportSubmit(string FileCode, List<DataTable> dataTable, User us)
{
- return ExcelCheckDAL.ExcelImportSubmit(fileCode, savePath, username);
+ return ExcelCheckDAL.ExcelImportSubmit(FileCode, dataTable, us);
}
#endregion
}
diff --git a/VueWebCoreApi/DLL/DAL/ExcelCheckDAL.cs b/VueWebCoreApi/DLL/DAL/ExcelCheckDAL.cs
index e6fbee6..aa9e0d2 100644
--- a/VueWebCoreApi/DLL/DAL/ExcelCheckDAL.cs
+++ b/VueWebCoreApi/DLL/DAL/ExcelCheckDAL.cs
@@ -1,5 +1,6 @@
锘縰sing System;
using System.Collections.Generic;
+using System.Data;
using System.Linq;
using System.Threading.Tasks;
using VueWebCoreApi.Models;
@@ -10,30 +11,37 @@
public class ExcelCheckDAL
{
public static ToMessage mes = new ToMessage(); //瀹氫箟鍏ㄥ眬杩斿洖淇℃伅瀵硅薄
+ public static string savePath = "";
#region銆怑xcel瀵煎叆妯℃澘楠岃瘉銆�
- public static ToMessage ExcelCheck(string fileCode, string savePath)
+ public static ToMessage ExcelCheck(string fileCode, List<DataTable> dataTable)
{
string StuCode = "";
string Message = "";
switch (fileCode)
{
- case "1": //瑙掕壊鏉冮檺
+ case "0": //缁勭粐鏋舵瀯
+ Message = ImportExcelData.Zerro(savePath, out StuCode);
+ break;
+ case "1"://宀椾綅绠$悊
Message = ImportExcelData.One(savePath, out StuCode);
break;
- case "2"://鐢ㄦ埛瑙掕壊
+ case "2"://鐝粍绠$悊
Message = ImportExcelData.Two(savePath, out StuCode);
break;
- case "3"://宸ヤ綅娓呭崟
- Message = ImportExcelData.Three(savePath, out StuCode);
+ case "3"://浜哄憳绠$悊
+ Message = ImportExcelData.Three(dataTable, out StuCode);
break;
- case "4"://寰�鏉ュ崟浣�
+ case "4"://瑙掕壊绠$悊
Message = ImportExcelData.Four(savePath, out StuCode);
break;
- case "6"://浠撳簱銆佸簱浣嶅畾涔�
- Message = ImportExcelData.SixOne(savePath, out StuCode);
+ case "5"://寰�鏉ュ崟浣�
+ Message = ImportExcelData.Five(savePath, out StuCode);
break;
- case "7"://瀹瑰櫒瀹氫箟
+ case "6"://浠撳簱璁剧疆
+ Message = ImportExcelData.Six(savePath, out StuCode);
+ break;
+ case "7"://搴撲綅璁剧疆
Message = ImportExcelData.Seven(savePath, out StuCode);
break;
case "8"://瀛樿揣妗f
@@ -102,7 +110,7 @@
#endregion
#region銆怑xcel瀵煎叆鏁版嵁楠岃瘉銆�
- public static List<ExcelErro> ExcelCheckData(string fileCode, string savePath, out string stuCode, out string message, out int count)
+ public static List<ExcelErro> ExcelCheckData(string fileCode, List<DataTable> dataTable, out string stuCode, out string message, out int count)
{
stuCode = "";
message = "";
@@ -110,22 +118,28 @@
List<ExcelErro> list = new List<ExcelErro>();
switch (fileCode)
{
- case "1": //瑙掕壊鏉冮檺
+ case "0": //缁勭粐鏋舵瀯
+ list = ImportExcelData.ZerroData(savePath, out stuCode, out message, out count);
+ break;
+ case "1": //宀椾綅绠$悊
list = ImportExcelData.OneData(savePath, out stuCode, out message, out count);
break;
- case "2"://鐢ㄦ埛瑙掕壊
+ case "2"://鐝粍绠$悊
list = ImportExcelData.TwoData(savePath, out stuCode, out message, out count);
break;
- case "3"://宸ヤ綅娓呭崟
- list = ImportExcelData.ThreeData(savePath, out stuCode, out message, out count);
+ case "3"://浜哄憳绠$悊
+ list = ImportExcelData.ThreeData(dataTable, out stuCode, out message, out count);
break;
- case "4"://寰�鏉ュ崟浣嶆竻鍗�
+ case "4"://瑙掕壊绠$悊
list = ImportExcelData.FourData(savePath, out stuCode, out message, out count);
break;
- case "6"://浠撳簱銆佸簱浣嶅畾涔�
- list = ImportExcelData.SixOneData(savePath, out stuCode, out message, out count);
+ case "5"://寰�鏉ュ崟浣�
+ list = ImportExcelData.FiveData(savePath, out stuCode, out message, out count);
break;
- case "7"://瀹瑰櫒瀹氫箟
+ case "6"://浠撳簱璁剧疆
+ list = ImportExcelData.SixData(savePath, out stuCode, out message, out count);
+ break;
+ case "7"://搴撲綅璁剧疆
list = ImportExcelData.SevenData(savePath, out stuCode, out message, out count);
break;
case "8"://瀛樿揣妗f
@@ -186,29 +200,36 @@
}
#endregion
- #region銆怑xcel瀵煎叆鏁版嵁楠岃瘉銆�
- public static ToMessage ExcelImportSubmit(string FileCode, string savePath, string User)
+ #region銆怑xcel瀵煎叆鏁版嵁銆�
+ public static ToMessage ExcelImportSubmit(string FileCode, List<DataTable> dataTable, User us)
{
string StuCode = "";
string Message = "";
+ string User = "";
switch (FileCode)
{
- case "1": //瑙掕壊鏉冮檺
+ case "0": //缁勭粐鏋舵瀯
+ Message = ImportExcelData.ZerroSubmit(savePath, User, out StuCode);
+ break;
+ case "1": //宀椾綅绠$悊
Message = ImportExcelData.OneSubmit(savePath, User, out StuCode);
break;
- case "2"://鐢ㄦ埛瑙掕壊
+ case "2"://鐝粍绠$悊
Message = ImportExcelData.TwoSubmit(savePath, User, out StuCode);
break;
- case "3"://宸ヤ綅娓呭崟
- Message = ImportExcelData.ThreeSubmit(savePath, User, out StuCode);
+ case "3"://浜哄憳绠$悊
+ Message = ImportExcelData.ThreeSubmit(dataTable, us, out StuCode);
break;
- case "4"://寰�鏉ュ崟浣嶆竻鍗�
+ case "4"://瑙掕壊绠$悊
Message = ImportExcelData.FourSubmit(savePath, User, out StuCode);
break;
- case "6"://浠撳簱銆佸簱浣嶅畾涔�
- Message = ImportExcelData.SixOneSubmit(savePath, User, out StuCode);
+ case "5"://寰�鏉ュ崟浣�
+ Message = ImportExcelData.FiveSubmit(savePath, User, out StuCode);
break;
- case "7"://瀹瑰櫒瀹氫箟
+ case "6"://浠撳簱璁剧疆
+ Message = ImportExcelData.SixSubmit(savePath, User, out StuCode);
+ break;
+ case "7"://搴撲綅璁剧疆
Message = ImportExcelData.SevenSubmit(savePath, User, out StuCode);
break;
case "8"://瀛樿揣妗f
diff --git "a/VueWebCoreApi/Excel/\347\224\250\346\210\267\346\270\205\345\215\225.xls" "b/VueWebCoreApi/Excel/\347\224\250\346\210\267\346\270\205\345\215\225.xls"
deleted file mode 100644
index e8d342f..0000000
--- "a/VueWebCoreApi/Excel/\347\224\250\346\210\267\346\270\205\345\215\225.xls"
+++ /dev/null
Binary files differ
diff --git a/VueWebCoreApi/Models/SystemSetting/ExceImport.cs b/VueWebCoreApi/Models/SystemSetting/ExceImport.cs
new file mode 100644
index 0000000..dbe9b8a
--- /dev/null
+++ b/VueWebCoreApi/Models/SystemSetting/ExceImport.cs
@@ -0,0 +1,17 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Data;
+using System.Linq;
+using System.Threading.Tasks;
+
+namespace VueWebCoreApi.Models.SystemSetting
+{
+ public class ExceImport
+ {
+ public string FileCode { get; set; }
+ //public List<string> SheetName { get; set; }
+ //public List<List<string>> TableHeader { get; set; }
+ //public List<List<Dictionary<string, object>>> TableData { get; set; }
+ public List<DataTable> TableData { get; set; }
+ }
+}
diff --git a/VueWebCoreApi/Tools/ExcelList.cs b/VueWebCoreApi/Tools/ExcelList.cs
index 376a937..6c55a67 100644
--- a/VueWebCoreApi/Tools/ExcelList.cs
+++ b/VueWebCoreApi/Tools/ExcelList.cs
@@ -13,12 +13,13 @@
List<ScoreReport> list = new List<ScoreReport>
{
new ScoreReport("0","缁勭粐鏋舵瀯"),
- new ScoreReport("1","瑙掕壊娓呭崟"),
- new ScoreReport("2","鐢ㄦ埛娓呭崟"),
- new ScoreReport("3","宸ヤ綅娓呭崟"),
- new ScoreReport("4","寰�鏉ュ崟浣�"),
- new ScoreReport("6","浠撳簱搴撲綅娓呭崟"),
- new ScoreReport("7","瀹瑰櫒瀹氫箟"),
+ new ScoreReport("1","宀椾綅绠$悊"),
+ new ScoreReport("2","鐝粍绠$悊"),
+ new ScoreReport("3","浜哄憳绠$悊"),
+ new ScoreReport("4","瑙掕壊绠$悊"),
+ new ScoreReport("5","寰�鏉ュ崟浣�"),
+ new ScoreReport("6","浠撳簱璁剧疆"),
+ new ScoreReport("7","搴撲綅璁剧疆"),
new ScoreReport("8","瀛樿揣妗f"),
new ScoreReport("9","璁惧娓呭崟"),
new ScoreReport("10","璁惧鐐规椤圭洰"),
diff --git a/VueWebCoreApi/Tools/ImportExcel.cs b/VueWebCoreApi/Tools/ImportExcel.cs
index a3c206b..c6f0b4f 100644
--- a/VueWebCoreApi/Tools/ImportExcel.cs
+++ b/VueWebCoreApi/Tools/ImportExcel.cs
@@ -1273,5 +1273,52 @@
return table.Rows.Count;
}
#endregion
+
+
+ #region
+ public static List<ExcelErro> InportExcelToTableListErro(List<DataTable> excelTable)
+ {
+ List<ExcelErro> list = new List<ExcelErro>();
+ for (int i = 0; i < excelTable.Count; i++)
+ {
+ var emptyColumn = excelTable[i].Columns.Cast<DataColumn>().FirstOrDefault(
+ column => column.ColumnName.Contains("*") && excelTable[i].AsEnumerable().Any(row => row.IsNull(column))
+ );
+
+ if (emptyColumn != null)
+ {
+ int columnIndex = excelTable[i].Columns.IndexOf(emptyColumn);
+ int rowIndex = excelTable[i].AsEnumerable().ToList().FindIndex(row => row.IsNull(emptyColumn));
+ ExcelErro erro = new ExcelErro();
+ erro.RoeNumber = (rowIndex + 1).ToString();
+ erro.ErrorField = emptyColumn.ColumnName;
+ erro.ErrorCont = "妯℃澘琛ㄥご甯�*鐨勫垪涓瓨鍦ㄧ┖鍊�,绗�" + (rowIndex + 1).ToString() + "琛�,蹇呭~瀛楁锛�"+ emptyColumn.ColumnName +"涓虹┖";
+ list.Add(erro);
+ }
+ var duplicateColumn = excelTable[i].Columns.Cast<DataColumn>().FirstOrDefault(
+ column => column.ColumnName.Contains("鍞竴") && excelTable[i].AsEnumerable().GroupBy(row => row[column]).Any(group => group.Count() > 1));
+ if (duplicateColumn != null)
+ {
+ int columnIndex = excelTable[i].Columns.IndexOf(duplicateColumn);
+ var duplicateRows = excelTable[i].AsEnumerable()
+ .Where(row => row[duplicateColumn] != DBNull.Value)
+ .GroupBy(row => row[duplicateColumn])
+ .Where(group => group.Count() > 1)
+ .SelectMany(group => group.ToList())
+ .ToList();
+ foreach (var row in duplicateRows)
+ {
+ ExcelErro erro = new ExcelErro();
+ erro.RoeNumber = excelTable[i].Rows.IndexOf(row).ToString();
+ erro.ErrorField = emptyColumn.ColumnName;
+ erro.ErrorCont = "妯℃澘琛ㄥご甯�(鍞竴)鐨勫垪涓瓨鍦ㄩ噸澶嶅��,绗�" + excelTable[i].Rows.IndexOf(row).ToString() + "琛�,蹇呭~瀛楁锛�" + duplicateColumn.ColumnName + "閲嶅";
+ list.Add(erro);
+
+ }
+ }
+ }
+ return list;
+ }
+ #endregion
}
}
diff --git a/VueWebCoreApi/Tools/ImportExcelData.cs b/VueWebCoreApi/Tools/ImportExcelData.cs
index 45efc88..ce6197a 100644
--- a/VueWebCoreApi/Tools/ImportExcelData.cs
+++ b/VueWebCoreApi/Tools/ImportExcelData.cs
@@ -13,132 +13,20 @@
public static ToMessage mes = new ToMessage(); //瀹氫箟鍏ㄥ眬杩斿洖淇℃伅瀵硅薄
#region銆怑xcel妯℃澘涓婁紶楠岃瘉銆�
- #region銆怑xcel妯℃澘涓婁紶楠岃瘉,鐢ㄦ埛娓呭崟妯℃澘銆�
- public static string Two(string FileCode, out string code)
+
+ #region銆怑xcel妯℃澘涓婁紶楠岃瘉,缁勭粐鏋舵瀯妯℃澘銆�
+ public static string Zerro(string FileCode, out string code)
{
string Message = "";
code = "";
List<DataTable> excelTable = new List<DataTable>();
excelTable = ImportExcel.ExcelToTableList(FileCode);
- if (excelTable.Count != 4)
- {
- code = "300";
- Message = "瀵煎叆妯℃澘涓嶇鍚堣鑼�,璇锋鏌heet鏁�";
- return Message;
-
- }
- else if (excelTable[0].Columns.Count != 5)
- {
- code = "300";
- Message = "鐢ㄦ埛鐝粍妯℃澘涓嶇鍚堣鑼�,璇锋鏌ュ垪鍚嶅瓧娈垫暟";
- return Message;
- }
- else if (excelTable[1].Columns.Count != 10)
- {
- code = "300";
- Message = "鐢ㄦ埛娓呭崟妯℃澘涓嶇鍚堣鑼�,璇锋鏌ュ垪鍚嶅瓧娈垫暟";
- return Message;
- }
- else if (excelTable[0].Columns[0].ColumnName != "搴忓彿")
- {
- code = "300";
- Message = "鐢ㄦ埛鐝粍妯℃澘锛氳〃澶翠俊鎭笉绗﹀悎瑙勮寖,绗�1鍒楀簲涓簕搴忓彿}";
- return Message;
- }
- else if (excelTable[0].Columns[1].ColumnName != "缁勭粐缂栫爜")
- {
- code = "300";
- Message = "鐢ㄦ埛鐝粍妯℃澘锛氳〃澶翠俊鎭笉绗﹀悎瑙勮寖,绗�2鍒楀簲涓簕缁勭粐缂栫爜}";
- return Message;
- }
- else if (excelTable[0].Columns[2].ColumnName != "鐝粍缂栧彿(鍞竴)")
- {
- code = "300";
- Message = "鐢ㄦ埛鐝粍妯℃澘锛氳〃澶翠俊鎭笉绗﹀悎瑙勮寖,绗�2鍒楀簲涓簕鐝粍缂栧彿(鍞竴)}";
- return Message;
- }
- else if (excelTable[0].Columns[3].ColumnName != "鐝粍鍚嶇О")
- {
- code = "300";
- Message = "鐢ㄦ埛鐝粍妯℃澘锛氳〃澶翠俊鎭笉绗﹀悎瑙勮寖,绗�3鍒楀簲涓簕鐝粍鍚嶇О}";
- return Message;
- }
- else if (excelTable[0].Columns[4].ColumnName != "鐝粍鎻忚堪")
- {
- code = "300";
- Message = "鐢ㄦ埛鐝粍妯℃澘锛氳〃澶翠俊鎭笉绗﹀悎瑙勮寖,绗�4鍒楀簲涓簕鐝粍鎻忚堪}";
- return Message;
- }
- else if (excelTable[1].Columns[0].ColumnName != "搴忓彿")
- {
- code = "300";
- Message = "鐢ㄦ埛娓呭崟妯℃澘锛氳〃澶翠俊鎭笉绗﹀悎瑙勮寖,绗�1鍒楀簲涓簕搴忓彿}";
- return Message;
- }
- else if (excelTable[1].Columns[1].ColumnName != "鐢ㄦ埛缂栧彿(鍞竴)")
- {
- code = "300";
- Message = "鐢ㄦ埛娓呭崟妯℃澘锛氳〃澶翠俊鎭笉绗﹀悎瑙勮寖,绗�2鍒楀簲涓簕鐢ㄦ埛缂栧彿(鍞竴)}";
- return Message;
- }
- else if (excelTable[1].Columns[2].ColumnName != "鐢ㄦ埛濮撳悕")
- {
- code = "300";
- Message = "鐢ㄦ埛娓呭崟妯℃澘锛氳〃澶翠俊鎭笉绗﹀悎瑙勮寖,绗�3鍒楀簲涓簕鐢ㄦ埛濮撳悕}";
- return Message;
- }
- else if (excelTable[1].Columns[3].ColumnName != "鍦ㄨ亴鐘舵��")
- {
- code = "300";
- Message = "鐢ㄦ埛娓呭崟妯℃澘锛氳〃澶翠俊鎭笉绗﹀悎瑙勮寖,绗�4鍒楀簲涓簕鍦ㄨ亴鐘舵�亇";
- return Message;
- }
- else if (excelTable[1].Columns[4].ColumnName != "瀵嗙爜")
- {
- code = "300";
- Message = "鐢ㄦ埛娓呭崟妯℃澘锛氳〃澶翠俊鎭笉绗﹀悎瑙勮寖,绗�5鍒楀簲涓簕瀵嗙爜}";
- return Message;
- }
- else if (excelTable[1].Columns[5].ColumnName != "鎵嬫満鍙�")
- {
- code = "300";
- Message = "鐢ㄦ埛娓呭崟妯℃澘锛氳〃澶翠俊鎭笉绗﹀悎瑙勮寖,绗�6鍒楀簲涓簕鎵嬫満鍙穧";
- return Message;
- }
- else if (excelTable[1].Columns[6].ColumnName != "閭")
- {
- code = "300";
- Message = "鐢ㄦ埛娓呭崟妯℃澘锛氳〃澶翠俊鎭笉绗﹀悎瑙勮寖,绗�7鍒楀簲涓簕閭}";
- return Message;
- }
- else if (excelTable[1].Columns[7].ColumnName != "缁勭粐缂栫爜")
- {
- code = "300";
- Message = "鐢ㄦ埛娓呭崟妯℃澘锛氳〃澶翠俊鎭笉绗﹀悎瑙勮寖,绗�8鍒楀簲涓簕缁勭粐缂栫爜}";
- return Message;
- }
- else if (excelTable[1].Columns[8].ColumnName != "宸ヨ祫绫诲瀷")
- {
- code = "300";
- Message = "鐢ㄦ埛娓呭崟妯℃澘锛氳〃澶翠俊鎭笉绗﹀悎瑙勮寖,绗�9鍒楀簲涓簕宸ヨ祫绫诲瀷}";
- return Message;
- }
- else if (excelTable[1].Columns[9].ColumnName != "鐢ㄦ埛缁勭紪鐮�")
- {
- code = "300";
- Message = "鐢ㄦ埛娓呭崟妯℃澘锛氳〃澶翠俊鎭笉绗﹀悎瑙勮寖,绗�10鍒楀簲涓簕鐢ㄦ埛缁勭紪鐮亇";
- return Message;
- }
- else
- {
- code = "200";
- Message = "妯℃澘妫�楠岄�氳繃";
- }
+
return Message;
}
#endregion
- #region銆怑xcel妯℃澘涓婁紶楠岃瘉,瑙掕壊鏉冮檺妯℃澘銆�
+ #region銆怑xcel妯℃澘涓婁紶楠岃瘉,宀椾綅绠$悊妯℃澘銆�
public static string One(string FileCode, out string code)
{
string Message = "";
@@ -233,62 +121,93 @@
}
#endregion
- #region銆怑xcel妯℃澘涓婁紶楠岃瘉,宸ヤ綅娓呭崟妯℃澘銆�
- public static string Three(string FileCode, out string code)
+ #region銆怑xcel妯℃澘涓婁紶楠岃瘉,鐝粍绠$悊妯℃澘銆�
+ public static string Two(string FileCode, out string code)
{
string Message = "";
code = "";
- DataTable excelTable = new DataTable();
- excelTable = ImportExcel.ExcelToTable(FileCode);
- if (excelTable.Columns.Count != 9)
+
+ return Message;
+ }
+ #endregion
+
+ #region銆怑xcel妯℃澘涓婁紶楠岃瘉,浜哄憳绠$悊妯℃澘銆�
+ public static string Three(List<DataTable> excelTable, out string code)
+ {
+ string Message = "";
+ code = "";
+ if (excelTable.Count != 1)
{
- code = "300";
- Message = "妯℃澘涓嶇鍚堣鑼�,璇锋鏌ュ垪鍚�";
+ code = "301";
+ Message = "瀵煎叆妯℃澘涓嶇鍚堣鑼�,璇锋鏌heet鏁�";
+ return Message;
+
}
- else if (excelTable.Columns[0].ColumnName != "搴忓彿")
+ else if (excelTable[0].Columns.Count != 10)
{
- code = "300";
- Message = "妯℃澘涓嶇鍚堣鑼�,璇锋鏌ュ垪鍚�";
+ code = "301";
+ Message = "鐢ㄦ埛娓呭崟妯℃澘涓嶇鍚堣鑼�,璇锋鏌ュ垪鍚嶅瓧娈垫暟";
+ return Message;
}
- else if (excelTable.Columns[1].ColumnName != "宸ヤ綅缂栧彿(鍞竴)")
+ else if (excelTable[0].Columns[0].ColumnName != "*鐢ㄦ埛缂栧彿(鍞竴)")
{
- code = "300";
- Message = "妯℃澘涓嶇鍚堣鑼�,璇锋鏌ュ垪鍚�";
+ code = "301";
+ Message = "鐢ㄦ埛娓呭崟妯℃澘锛氳〃澶翠俊鎭笉绗﹀悎瑙勮寖,绗�1鍒楀簲涓簕*鐢ㄦ埛缂栧彿(鍞竴)}";
+ return Message;
}
- else if (excelTable.Columns[2].ColumnName != "宸ヤ綅鍚嶇О锛堝敮涓�锛�")
+ else if (excelTable[0].Columns[1].ColumnName != "*鐢ㄦ埛濮撳悕")
{
- code = "300";
- Message = "妯℃澘涓嶇鍚堣鑼�,璇锋鏌ュ垪鍚�";
+ code = "301";
+ Message = "鐢ㄦ埛娓呭崟妯℃澘锛氳〃澶翠俊鎭笉绗﹀悎瑙勮寖,绗�2鍒楀簲涓簕*鐢ㄦ埛濮撳悕}";
+ return Message;
}
- else if (excelTable.Columns[3].ColumnName != "宸ヤ綅绫诲瀷")
+ else if (excelTable[0].Columns[2].ColumnName != "*瀵嗙爜")
{
- code = "300";
- Message = "妯℃澘涓嶇鍚堣鑼�,璇锋鏌ュ垪鍚�";
+ code = "301";
+ Message = "鐢ㄦ埛娓呭崟妯℃澘锛氳〃澶翠俊鎭笉绗﹀悎瑙勮寖,绗�3鍒楀簲涓簕*瀵嗙爜}";
+ return Message;
}
- else if (excelTable.Columns[4].ColumnName != "鎵�灞炶溅闂�")
+ else if (excelTable[0].Columns[3].ColumnName != "*鍦ㄨ亴鐘舵��")
{
- code = "300";
- Message = "妯℃澘涓嶇鍚堣鑼�,璇锋鏌ュ垪鍚�";
+ code = "301";
+ Message = "鐢ㄦ埛娓呭崟妯℃澘锛氳〃澶翠俊鎭笉绗﹀悎瑙勮寖,绗�4鍒楀簲涓簕*鍦ㄨ亴鐘舵�亇";
+ return Message;
}
- else if (excelTable.Columns[5].ColumnName != "鎵�灞炰骇绾�")
+ else if (excelTable[0].Columns[4].ColumnName != "鎵嬫満鍙�")
{
- code = "300";
- Message = "妯℃澘涓嶇鍚堣鑼�,璇锋鏌ュ垪鍚�";
+ code = "301";
+ Message = "鐢ㄦ埛娓呭崟妯℃澘锛氳〃澶翠俊鎭笉绗﹀悎瑙勮寖,绗�5鍒楀簲涓簕鎵嬫満鍙穧";
+ return Message;
}
- else if (excelTable.Columns[6].ColumnName != "浣跨敤鐘舵��")
+ else if (excelTable[0].Columns[5].ColumnName != "閭")
{
- code = "300";
- Message = "妯℃澘涓嶇鍚堣鑼�,璇锋鏌ュ垪鍚�";
+ code = "301";
+ Message = "鐢ㄦ埛娓呭崟妯℃澘锛氳〃澶翠俊鎭笉绗﹀悎瑙勮寖,绗�6鍒楀簲涓簕閭}";
+ return Message;
}
- else if (excelTable.Columns[7].ColumnName != "鏁伴噰鏍囪瘑1")
+ else if (excelTable[0].Columns[6].ColumnName != "*鎵�灞炵粍缁囩紪鐮�")
{
- code = "300";
- Message = "妯℃澘涓嶇鍚堣鑼�,璇锋鏌ュ垪鍚�";
+ code = "301";
+ Message = "鐢ㄦ埛娓呭崟妯℃澘锛氳〃澶翠俊鎭笉绗﹀悎瑙勮寖,绗�7鍒楀簲涓簕*鎵�灞炵粍缁囩紪鐮亇";
+ return Message;
}
- else if (excelTable.Columns[8].ColumnName != "鏁伴噰鏍囪瘑2")
+ else if (excelTable[0].Columns[7].ColumnName != "鎵�灞炲矖浣嶇紪鐮�")
{
- code = "300";
- Message = "妯℃澘涓嶇鍚堣鑼�,璇锋鏌ュ垪鍚�";
+ code = "301";
+ Message = "鐢ㄦ埛娓呭崟妯℃澘锛氳〃澶翠俊鎭笉绗﹀悎瑙勮寖,绗�8鍒楀簲涓簕鎵�灞炲矖浣嶇紪鐮亇";
+ return Message;
+ }
+ else if (excelTable[0].Columns[8].ColumnName != "鎵�灞炶鑹茬紪鐮�")
+ {
+ code = "301";
+ Message = "鐢ㄦ埛娓呭崟妯℃澘锛氳〃澶翠俊鎭笉绗﹀悎瑙勮寖,绗�9鍒楀簲涓簕鎵�灞炶鑹茬紪鐮亇";
+ return Message;
+ }
+ else if (excelTable[0].Columns[9].ColumnName != "鎵�灞炵彮缁勭紪鐮�")
+ {
+ code = "301";
+ Message = "鐢ㄦ埛娓呭崟妯℃澘锛氳〃澶翠俊鎭笉绗﹀悎瑙勮寖,绗�10鍒楀簲涓簕鎵�灞炵彮缁勭紪鐮亇";
+ return Message;
}
else
{
@@ -299,7 +218,7 @@
}
#endregion
- #region銆怑xcel妯℃澘涓婁紶楠岃瘉,寰�鏉ュ崟浣嶆竻鍗曟ā鏉裤��
+ #region銆怑xcel妯℃澘涓婁紶楠岃瘉,瑙掕壊绠″崟妯℃澘銆�
public static string Four(string FileCode, out string code)
{
string Message = "";
@@ -370,8 +289,18 @@
}
#endregion
- #region銆怑xcel妯℃澘涓婁紶楠岃瘉,浠撳簱銆佸簱浣嶅畾涔夋ā鏉裤��
- public static string SixOne(string FileCode, out string code)
+ #region銆怑xcel妯℃澘涓婁紶楠岃瘉,寰�鏉ュ崟浣嶆ā鏉裤��
+ public static string Five(string FileCode, out string code)
+ {
+ string Message = "";
+ code = "";
+
+ return Message;
+ }
+ #endregion
+
+ #region銆怑xcel妯℃澘涓婁紶楠岃瘉,浠撳簱璁剧疆妯℃澘銆�
+ public static string Six(string FileCode, out string code)
{
string Message = "";
code = "";
@@ -459,7 +388,7 @@
}
#endregion
- #region銆怑xcel妯℃澘涓婁紶楠岃瘉,瀹瑰櫒瀹氫箟妯℃澘銆�
+ #region銆怑xcel妯℃澘涓婁紶楠岃瘉,搴撲綅璁剧疆妯℃澘銆�
public static string Seven(string FileCode, out string code)
{
string Message = "";
@@ -1854,8 +1783,8 @@
#endregion
#region銆怑xcel涓婁紶鏁版嵁楠岃瘉銆�
- #region銆怑xcel涓婁紶鏁版嵁楠岃瘉,鐢ㄦ埛瑙掕壊銆�
- public static List<ExcelErro> TwoData(string FileCode, out string StuCode, out string message, out int count)
+ #region銆怑xcel涓婁紶鏁版嵁楠岃瘉,缁勭粐鏋舵瀯銆�
+ public static List<ExcelErro> ZerroData(string savePath, out string StuCode, out string message, out int count)
{
message = "";
StuCode = "";
@@ -1864,108 +1793,7 @@
var dynamicParams = new DynamicParameters();
DataTable dt;
List<ExcelErro> list = new List<ExcelErro>();
- List<DataTable> excelTable = new List<DataTable>();
- list = ImportExcel.ExcelToTableListErro(FileCode); //楠岃瘉Excel鏁版嵁蹇呭~瀛楁鏄惁涓虹┖銆佸敮涓�瀛楁鏄惁閲嶅
- excelTable = ImportExcel.ExcelToTableList(FileCode); //鑾峰彇Excel鏁版嵁
- //涓昏〃
- for (int j = 0; j < excelTable[0].Rows.Count; j++)
- {
- if (excelTable[0].Rows[j][2].ToString().Trim() != null && excelTable[0].Rows[j][2].ToString().Trim() != "")
- {
- sql = @"select * from TGroup where group_code=@group_code";
- dynamicParams.Add("@group_code", excelTable[0].Rows[j][2].ToString().Trim());
- dt = DapperHelper.selectdata(sql, dynamicParams);
- if (dt.Rows.Count > 0)
- {
- ExcelErro erro = new ExcelErro();
- erro.RoeNumber = "/";
- erro.ErrorField = "{鐝粍缂栫爜(鍞竴)}";
- erro.ErrorCont = "鐝粍琛�:{鐝粍缂栫爜(鍞竴)}瀛楁" + excelTable[0].Rows[j][2].ToString().Trim() + "宸插瓨鍦�";
- list.Add(erro);
- }
- }
- }
- //瀛愯〃
- for (int k = 0; k < excelTable[1].Rows.Count; k++)
- {
- if (excelTable[1].Rows[k][1].ToString().Trim() != null && excelTable[1].Rows[k][1].ToString().Trim() != "")
- {
- sql = @"select * from TUser where usercode=@usercode";
- dynamicParams.Add("@usercode", excelTable[1].Rows[k][1].ToString().Trim());
- dt = DapperHelper.selectdata(sql, dynamicParams);
- if (dt.Rows.Count > 0)
- {
- ExcelErro erro = new ExcelErro();
- erro.RoeNumber = "/";
- erro.ErrorField = "{鐢ㄦ埛缂栫爜(鍞竴)}";
- erro.ErrorCont = "鐢ㄦ埛琛�:{鐢ㄦ埛缂栫爜(鍞竴)}瀛楁" + excelTable[1].Rows[k][1].ToString().Trim() + "宸插瓨鍦�";
- list.Add(erro);
- }
- }
- if (excelTable[1].Rows[k][7].ToString().Trim() != null && excelTable[1].Rows[k][7].ToString().Trim() != "")
- {
- sql = @"select * from TOrganization where org_code=@org_code";
- dynamicParams.Add("@org_code", excelTable[1].Rows[k][7].ToString().Trim());
- dt = DapperHelper.selectdata(sql, dynamicParams);
- if (dt == null || dt.Rows.Count <= 0)
- {
- ExcelErro erro = new ExcelErro();
- erro.RoeNumber = "/";
- erro.ErrorField = "{缁勭粐缂栫爜}";
- erro.ErrorCont = "鐢ㄦ埛琛�:{缁勭粐缂栫爜}瀛楁" + excelTable[1].Rows[k][7].ToString().Trim() + "涓嶅瓨鍦�";
- list.Add(erro);
- }
- }
- if (excelTable[1].Rows[k][9].ToString().Trim() != null && excelTable[1].Rows[k][9].ToString().Trim() != "")
- {
- sql = @"select torg_code from TGroup where group_code=@group_code";
- dynamicParams.Add("@group_code", excelTable[1].Rows[k][9].ToString().Trim());
- dt = DapperHelper.selectdata(sql, dynamicParams);
- if (dt != null && dt.Rows.Count > 0)
- {
- if (dt.Rows[0]["torg_code"].ToString() != excelTable[1].Rows[k][7].ToString().Trim())
- {
- ExcelErro erro = new ExcelErro();
- erro.RoeNumber = "/";
- erro.ErrorField = "{鐢ㄦ埛缁勭紪鐮亇";
- erro.ErrorCont = "鐢ㄦ埛琛�:{鐢ㄦ埛缁勭紪鐮亇瀛楁" + excelTable[1].Rows[k][9].ToString().Trim() + " 涓嶆槸缁勭粐缂栫爜:" + excelTable[1].Rows[k][7].ToString().Trim() + "涓嬬殑鐢ㄦ埛缁�";
- list.Add(erro);
- }
- }
- }
- }
- //鍒ゆ柇瀛愯〃缁勭粐缂栫爜涓嶅瓨鍦ㄤ簬涓昏〃缁勭粐缂栫爜涓殑鏁版嵁
- var dt2 = from r in excelTable[1].AsEnumerable()
- where !(
- from rr in excelTable[0].AsEnumerable()
- select rr.Field<string>("缁勭粐缂栫爜")
- ).Contains(r.Field<string>("缁勭粐缂栫爜"))
- select r;
- List<DataRow> listRow2 = dt2.ToList();
- if (listRow2.Count > 0)
- {
- ExcelErro erro = new ExcelErro();
- erro.RoeNumber = "/";
- erro.ErrorField = "{缁勭粐缂栫爜}";
- erro.ErrorCont = "鐢ㄦ埛琛�:{缁勭粐缂栫爜}瀛楁涓湁鍊煎湪鐝粍琛�:{缁勭粐缂栫爜}涓笉瀛樺湪";
- list.Add(erro);
- }
- //鍒ゆ柇瀛愯〃澶栭敭涓嶅瓨鍦ㄤ簬涓昏〃涓婚敭涓殑鏁版嵁
- var dt3 = from r in excelTable[1].AsEnumerable()
- where !(
- from rr in excelTable[0].AsEnumerable()
- select rr.Field<string>("鐝粍缂栧彿(鍞竴)")
- ).Contains(r.Field<string>("鐢ㄦ埛缁勭紪鐮�"))
- select r;
- List<DataRow> listRow = dt3.ToList();
- if (listRow.Count > 0)
- {
- ExcelErro erro = new ExcelErro();
- erro.RoeNumber = "/";
- erro.ErrorField = "{鐢ㄦ埛缁勭紪鐮亇";
- erro.ErrorCont = "鐢ㄦ埛琛�:{鐢ㄦ埛缁勭紪鐮亇瀛楁涓湁鍊煎湪鐝粍琛�:{鐝粍缂栧彿(鍞竴)}涓笉瀛樺湪";
- list.Add(erro);
- }
+
if (list.Count > 0)
{
int index = 0;
@@ -1981,13 +1809,12 @@
{
StuCode = "200";
message = "鏁版嵁楠岃瘉鎴愬姛";
- count = excelTable[0].Rows.Count + excelTable[1].Rows.Count;
}
return list;
}
#endregion
- #region銆怑xcel涓婁紶鏁版嵁楠岃瘉,瑙掕壊鏉冮檺銆�
+ #region銆怑xcel涓婁紶鏁版嵁楠岃瘉,宀椾綅绠$悊銆�
public static List<ExcelErro> OneData(string FileCode, out string StuCode, out string message, out int count)
{
message = "";
@@ -2128,14 +1955,14 @@
{
StuCode = "200";
message = "鏁版嵁楠岃瘉鎴愬姛";
- count = excelTable[0].Rows.Count + excelTable[1].Rows.Count;
+ count = excelTable[0].Rows.Count;
}
return list;
}
#endregion
- #region銆怑xcel涓婁紶鏁版嵁楠岃瘉,宸ヤ綅娓呭崟銆�
- public static List<ExcelErro> ThreeData(string FileCode, out string StuCode, out string message, out int count)
+ #region銆怑xcel涓婁紶鏁版嵁楠岃瘉,鐝粍绠$悊銆�
+ public static List<ExcelErro> TwoData(string FileCode, out string StuCode, out string message, out int count)
{
message = "";
StuCode = "";
@@ -2148,7 +1975,169 @@
}
#endregion
- #region銆怑xcel涓婁紶鏁版嵁楠岃瘉,寰�鏉ュ崟浣嶆竻鍗曘��
+ #region銆怑xcel涓婁紶鏁版嵁楠岃瘉,浜哄憳绠$悊銆�
+ public static List<ExcelErro> ThreeData(List<DataTable> excelTable, out string StuCode, out string message, out int count)
+ {
+ message = "";
+ StuCode = "";
+ count = 0;
+ string sql = "";
+ var dynamicParams = new DynamicParameters();
+ DataTable dt;
+ List<ExcelErro> list = new List<ExcelErro>();
+ list = ImportExcel.InportExcelToTableListErro(excelTable); //楠岃瘉Excel鏁版嵁蹇呭~瀛楁鏄惁涓虹┖銆佸敮涓�瀛楁鏄惁閲嶅
+ //鐢ㄦ埛琛�
+ for (int k = 0; k < excelTable[0].Rows.Count; k++)
+ {
+ if (excelTable[0].Rows[k][0].ToString().Trim() != null && excelTable[0].Rows[k][0].ToString().Trim() != "")
+ {
+ sql = @"select * from TUser where usercode=@usercode";
+ dynamicParams.Add("@usercode", excelTable[0].Rows[k][0].ToString().Trim());
+ dt = DapperHelper.selectdata(sql, dynamicParams);
+ if (dt.Rows.Count > 0)
+ {
+ ExcelErro erro = new ExcelErro();
+ erro.RoeNumber = (k + 1).ToString();
+ erro.ErrorField = "*鐢ㄦ埛缂栫爜(鍞竴)";
+ erro.ErrorCont = "鐢ㄦ埛琛�:*鐢ㄦ埛缂栫爜(鍞竴)瀛楁" + excelTable[0].Rows[k][0].ToString().Trim() + "宸插瓨鍦�";
+ list.Add(erro);
+ }
+ }
+ if (excelTable[0].Rows[k][1].ToString().Trim() != null && excelTable[0].Rows[k][1].ToString().Trim() != "")
+ {
+ sql = @"select * from TUser where username=@username";
+ dynamicParams.Add("@username", excelTable[0].Rows[k][1].ToString().Trim());
+ dt = DapperHelper.selectdata(sql, dynamicParams);
+ if (dt.Rows.Count > 0)
+ {
+ ExcelErro erro = new ExcelErro();
+ erro.RoeNumber = (k + 1).ToString();
+ erro.ErrorField = "*鐢ㄦ埛鍚嶇О";
+ erro.ErrorCont = "鐢ㄦ埛琛�:*鐢ㄦ埛鍚嶇О瀛楁" + excelTable[0].Rows[k][1].ToString().Trim() + "宸插瓨鍦�";
+ list.Add(erro);
+ }
+ }
+ if (excelTable[0].Rows[k][6].ToString().Trim() != null && excelTable[0].Rows[k][6].ToString().Trim() != "")
+ {
+ sql = @"select * from TOrganization where torg_code=@torg_code";
+ dynamicParams.Add("@torg_code", excelTable[0].Rows[k][6].ToString().Trim());
+ dt = DapperHelper.selectdata(sql, dynamicParams);
+ if (dt == null || dt.Rows.Count <= 0)
+ {
+ ExcelErro erro = new ExcelErro();
+ erro.RoeNumber = (k + 1).ToString();
+ erro.ErrorField = "*缁勭粐缂栫爜";
+ erro.ErrorCont = "鐢ㄦ埛琛�:*缁勭粐缂栫爜瀛楁" + excelTable[0].Rows[k][6].ToString().Trim() + "涓嶅瓨鍦�";
+ list.Add(erro);
+ }
+ }
+ if (excelTable[0].Rows[k][7].ToString().Trim() != null && excelTable[0].Rows[k][7].ToString().Trim() != "")
+ {
+ string[] postcode = Array.ConvertAll<string, string>(excelTable[0].Rows[k][7].ToString().Trim().Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries), s => s.ToString()); //string鍒嗗壊杞瑂tring[]
+ sql = @"select postcode from TPost where postcode in @postcode";
+ dynamicParams.Add("@postcode", postcode);
+ dt = DapperHelper.selectdata(sql, dynamicParams);
+ if (dt != null && dt.Rows.Count > 0)
+ {
+ string[] values = excelTable[0].Rows[k][7].ToString().Trim().Split(',');
+ var unmatchedValues = values.Except(dt.AsEnumerable().Select(row => row.Field<string>("postcode")));
+ foreach (var value in unmatchedValues)
+ {
+ ExcelErro erro = new ExcelErro();
+ erro.RoeNumber = (k + 1).ToString();
+ erro.ErrorField = "{鎵�灞炲矖浣嶇紪鐮亇";
+ erro.ErrorCont = "鐢ㄦ埛琛�:{鎵�灞炲矖浣嶇紪鐮亇瀛楁" + value + " 涓嶆槸鏈夋晥鐨勫矖浣嶇紪鐮�";
+ list.Add(erro);
+ }
+ }
+ else
+ {
+ ExcelErro erro = new ExcelErro();
+ erro.RoeNumber = (k + 1).ToString();
+ erro.ErrorField = "{鎵�灞炲矖浣嶇紪鐮亇";
+ erro.ErrorCont = "鐢ㄦ埛琛�:{鎵�灞炲矖浣嶇紪鐮亇瀛楁" + excelTable[0].Rows[k][7].ToString().Trim() + " 涓嶆槸鏈夋晥鐨勫矖浣嶇紪鐮�";
+ list.Add(erro);
+ }
+ }
+ if (excelTable[0].Rows[k][8].ToString().Trim() != null && excelTable[0].Rows[k][8].ToString().Trim() != "")
+ {
+ string[] rolecode = Array.ConvertAll<string, string>(excelTable[0].Rows[k][8].ToString().Trim().Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries), s => s.ToString()); //string鍒嗗壊杞瑂tring[]
+ sql = @"select rolecode from TRole where rolecode in @rolecode";
+ dynamicParams.Add("@rolecode", rolecode);
+ dt = DapperHelper.selectdata(sql, dynamicParams);
+ if (dt != null && dt.Rows.Count > 0)
+ {
+ string[] values = excelTable[0].Rows[k][8].ToString().Trim().Split(',');
+ var unmatchedValues = values.Except(dt.AsEnumerable().Select(row => row.Field<string>("rolecode")));
+ foreach (var value in unmatchedValues)
+ {
+ ExcelErro erro = new ExcelErro();
+ erro.RoeNumber = (k + 1).ToString();
+ erro.ErrorField = "{鎵�灞炶鑹茬紪鐮亇";
+ erro.ErrorCont = "鐢ㄦ埛琛�:{鎵�灞炶鑹茬紪鐮亇瀛楁" + value + " 涓嶆槸鏈夋晥鐨勮鑹茬紪鐮�";
+ list.Add(erro);
+ }
+ }
+ else
+ {
+ ExcelErro erro = new ExcelErro();
+ erro.RoeNumber = (k + 1).ToString();
+ erro.ErrorField = "{鎵�灞炶鑹茬紪鐮亇";
+ erro.ErrorCont = "鐢ㄦ埛琛�:{鎵�灞炶鑹茬紪鐮亇瀛楁" + excelTable[0].Rows[k][8].ToString().Trim() + " 涓嶆槸鏈夋晥鐨勮鑹茬紪鐮�";
+ list.Add(erro);
+ }
+ }
+ if (excelTable[0].Rows[k][9].ToString().Trim() != null && excelTable[0].Rows[k][9].ToString().Trim() != "")
+ {
+ string[] usergroupcode = Array.ConvertAll<string, string>(excelTable[0].Rows[k][9].ToString().Trim().Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries), s => s.ToString()); //string鍒嗗壊杞瑂tring[]
+ sql = @"select usergroupcode from TGroup where usergroupcode in @usergroupcode";
+ dynamicParams.Add("@usergroupcode", usergroupcode);
+ dt = DapperHelper.selectdata(sql, dynamicParams);
+ if (dt != null && dt.Rows.Count > 0)
+ {
+ string[] values = excelTable[0].Rows[k][9].ToString().Trim().Split(',');
+ var unmatchedValues = values.Except(dt.AsEnumerable().Select(row => row.Field<string>("usergroupcode")));
+ foreach (var value in unmatchedValues)
+ {
+ ExcelErro erro = new ExcelErro();
+ erro.RoeNumber = (k + 1).ToString();
+ erro.ErrorField = "{鎵�灞炵彮缁勭紪鐮亇";
+ erro.ErrorCont = "鐢ㄦ埛琛�:{鎵�灞炵彮缁勭紪鐮亇瀛楁" + value + " 涓嶆槸鏈夋晥鐨勭彮缁勭紪鐮�";
+ list.Add(erro);
+ }
+ }
+ else
+ {
+ ExcelErro erro = new ExcelErro();
+ erro.RoeNumber = (k + 1).ToString();
+ erro.ErrorField = "{鎵�灞炵彮缁勭紪鐮亇";
+ erro.ErrorCont = "鐢ㄦ埛琛�:{鎵�灞炵彮缁勭紪鐮亇瀛楁" + excelTable[0].Rows[k][9].ToString().Trim() + " 涓嶆槸鏈夋晥鐨勭彮缁勭紪鐮�";
+ list.Add(erro);
+ }
+ }
+ }
+ if (list.Count > 0)
+ {
+ int index = 0;
+ foreach (ExcelErro item in list)
+ {
+ index++;
+ item.Seq = index.ToString();
+ }
+ StuCode = "301";
+ message = "鏁版嵁楠岃瘉澶辫触";
+ }
+ else
+ {
+ StuCode = "200";
+ message = "鏁版嵁楠岃瘉鎴愬姛";
+ count = excelTable[0].Rows.Count;
+ }
+ return list;
+ }
+ #endregion
+
+ #region銆怑xcel涓婁紶鏁版嵁楠岃瘉,瑙掕壊绠$悊銆�
public static List<ExcelErro> FourData(string FileCode, out string StuCode, out string message, out int count)
{
message = "";
@@ -2200,8 +2189,60 @@
}
#endregion
- #region銆怑xcel涓婁紶鏁版嵁楠岃瘉,浠撳簱銆佸簱浣嶅畾涔夈��
- public static List<ExcelErro> SixOneData(string FileCode, out string StuCode, out string message, out int count)
+ #region銆怑xcel涓婁紶鏁版嵁楠岃瘉,寰�鏉ュ崟浣嶃��
+ public static List<ExcelErro> FiveData(string FileCode, out string StuCode, out string message, out int count)
+ {
+ message = "";
+ StuCode = "";
+ count = 0;
+ string sql = "";
+ DataTable dt;
+ var dynamicParams = new DynamicParameters();
+ List<ExcelErro> list = new List<ExcelErro>();
+ DataTable excelTable = new DataTable();
+ list = ImportExcel.ExcelToTableErro(FileCode); //楠岃瘉Excel鏁版嵁蹇呭~瀛楁鏄惁涓虹┖銆佸敮涓�瀛楁鏄惁閲嶅
+ excelTable = ImportExcel.ExcelToTable(FileCode); //鑾峰彇Excel鏁版嵁
+ for (int i = 0; i < excelTable.Rows.Count; i++)
+ {
+ if (excelTable.Rows[i][1].ToString().Trim() != null && excelTable.Rows[i][1].ToString().Trim() != "")
+ {
+ sql = @"select code from TCustomer where code=@code";
+
+ dynamicParams.Add("@code", excelTable.Rows[i][1].ToString().Trim());
+ dt = DapperHelper.selectdata(sql, dynamicParams);
+ if (dt.Rows.Count > 0)
+ {
+ ExcelErro erro = new ExcelErro();
+ erro.RoeNumber = "/";
+ erro.ErrorField = "{寰�鏉ュ崟浣嶇紪鐮�(鍞竴)}";
+ erro.ErrorCont = "寰�鏉ュ崟浣嶈〃:{寰�鏉ュ崟浣嶇紪鐮�(鍞竴)}瀛楁" + excelTable.Rows[i][1].ToString().Trim() + "宸插瓨鍦�";
+ list.Add(erro);
+ }
+ }
+ }
+ if (list.Count > 0)
+ {
+ int index = 0;
+ foreach (ExcelErro item in list)
+ {
+ index++;
+ item.Seq = index.ToString();
+ }
+ StuCode = "301";
+ message = "鏁版嵁楠岃瘉澶辫触";
+ }
+ else
+ {
+ StuCode = "200";
+ message = "鏁版嵁楠岃瘉鎴愬姛";
+ count = excelTable.Rows.Count;
+ }
+ return list;
+ }
+ #endregion
+
+ #region銆怑xcel涓婁紶鏁版嵁楠岃瘉,浠撳簱璁剧疆銆�
+ public static List<ExcelErro> SixData(string FileCode, out string StuCode, out string message, out int count)
{
message = "";
StuCode = "";
@@ -2286,7 +2327,7 @@
}
#endregion
- #region銆怑xcel涓婁紶鏁版嵁楠岃瘉,瀹瑰櫒瀹氫箟銆�
+ #region銆怑xcel涓婁紶鏁版嵁楠岃瘉,搴撲綅璁剧疆銆�
public static List<ExcelErro> SevenData(string FileCode, out string StuCode, out string message, out int count)
{
message = "";
@@ -3221,8 +3262,8 @@
#endregion
#region[Excel涓婁紶鏁版嵁鎻愪氦]
- #region銆怑xcel鏁版嵁涓婁紶,鐢ㄦ埛瑙掕壊銆�
- public static string TwoSubmit(string FileCode, string User, out string StuCode)
+ #region銆怑xcel鏁版嵁涓婁紶,缁勭粐鏋舵瀯銆�
+ public static string ZerroSubmit(string FileCode, string User, out string StuCode)
{
string message = "";
StuCode = "";
@@ -3236,83 +3277,39 @@
list.Clear();
List<DataTable> excelTable = new List<DataTable>();
excelTable = ImportExcel.ExcelToTableList(FileCode);
- //瀵煎叆鐝粍
+ //瀵煎叆瑙掕壊绫诲瀷
for (int k = 0; k < excelTable[0].Rows.Count; k++)
{
- sql = @"select * from TGroup where group_code=@group_code";
- dynamicParams.Add("@group_code", excelTable[0].Rows[k][2].ToString().Trim());
- dt = DapperHelper.selectdata(sql, dynamicParams);
- if (dt.Rows.Count > 0)
- {
- continue;
- }
- else
- {
- sql = @"insert into TGroup(group_code,group_name,description,lm_user,lm_date,torg_code)
- values(@group_code,@group_name,@description,@Operator,@CreateDate,@torg_code)";
- list.Add(new
- {
- str = sql,
- parm = new
- {
- group_code = excelTable[0].Rows[k][2].ToString().Trim(),
- group_name = excelTable[0].Rows[k][3].ToString().Trim(),
- description = excelTable[0].Rows[k][4].ToString().Trim(),
- CreateDate = DateTime.Now.ToString(),
- Operator = User,
- torg_code = excelTable[0].Rows[k][1].ToString().Trim()
- }
- });
- }
- }
- //瀵煎叆鐢ㄦ埛
- for (int i = 0; i < excelTable[1].Rows.Count; i++)
- {
- if (excelTable[1].Rows[i][3].ToString().Trim() == "鍦ㄨ亴")
- {
- Enable = "Y";
- }
- else
- {
- Enable = "N";
- }
- //宸ヨ祫绫诲瀷
- switch (excelTable[1].Rows[i][8].ToString().Trim())
- {
- case "璁′欢鍒�":
- WageType = "2";
- break;
- case "璁℃椂鍒�":
- WageType = "1";
- break;
- default:
- break;
- }
- sql = @"select * from TUser where usercode=@usercode";
- dynamicParams.Add("@usercode", excelTable[1].Rows[i][1].ToString().Trim());
- dt = DapperHelper.selectdata(sql, dynamicParams);
- if (dt.Rows.Count > 0)
- {
- continue;
- }
- sql = @"insert into TUser(usercode,username,password,enable,mobile,lm_date,email,lm_user,stu_torgcode,wagetype,usergroup_code)
- values(@UserCode,@UserName,@password,@Enable,@Mobile,@CreateDate,@Email,@Operator,@StuOrg,@wagetype,@usergroup_code)";
+ sql = @"insert into TRoleType(roletype_code,roletype_name,torg_code)
+ values(@roletype_code,@roletype_name,@torg_code)";
list.Add(new
{
str = sql,
parm = new
{
- UserCode = excelTable[1].Rows[i][1].ToString().Trim(),
- UserName = excelTable[1].Rows[i][2].ToString().Trim(),
- password = excelTable[1].Rows[i][4].ToString().Trim(),
- Enable = Enable,
- Mobile = excelTable[1].Rows[i][5].ToString().Trim(),
- CreateDate = DateTime.Now.ToString(),
- Email = excelTable[1].Rows[i][6].ToString().Trim(),
+ roletype_code = excelTable[0].Rows[k][2].ToString().Trim(),
+ roletype_name = excelTable[0].Rows[k][3].ToString().Trim(),
+ torg_code = excelTable[0].Rows[k][1].ToString().Trim()
+ }
+ });
+ }
+ //瀵煎叆瑙掕壊
+ for (int i = 0; i < excelTable[1].Rows.Count; i++)
+ {
+ sql = @"insert into TRole(role_code,role_name,roletype_code,description,lm_user,lm_date,torg_code)
+ values(@role_code,@role_name,@roletype_code,@description,@Operator,@CreateDate,@torg_code)";
+ list.Add(new
+ {
+ str = sql,
+ parm = new
+ {
+ role_code = excelTable[1].Rows[i][2].ToString().Trim(),
+ role_name = excelTable[1].Rows[i][3].ToString().Trim(),
+ roletype_code = excelTable[1].Rows[i][4].ToString().Trim(),
+ description = excelTable[1].Rows[i][5].ToString().Trim(),
Operator = User,
- StuOrg = excelTable[1].Rows[i][7].ToString().Trim(),
- wagetype = WageType,
- usergroup_code = excelTable[1].Rows[i][9].ToString().Trim()
+ CreateDate = DateTime.Now.ToString(),
+ torg_code = excelTable[1].Rows[i][1].ToString().Trim()
}
});
}
@@ -3337,7 +3334,7 @@
}
#endregion
- #region銆怑xcel鏁版嵁涓婁紶,瑙掕壊鏉冮檺銆�
+ #region銆怑xcel鏁版嵁涓婁紶,宀椾綅绠$悊銆�
public static string OneSubmit(string FileCode, string User, out string StuCode)
{
string message = "";
@@ -3409,8 +3406,8 @@
}
#endregion
- #region銆怑xcel鏁版嵁涓婁紶,宸ヤ綅娓呭崟銆�
- public static string ThreeSubmit(string FileCode, string User, out string StuCode)
+ #region銆怑xcel鏁版嵁涓婁紶,鍒嗙粍绠$悊銆�
+ public static string TwoSubmit(string FileCode, string User, out string StuCode)
{
string message = "";
StuCode = "";
@@ -3427,7 +3424,73 @@
}
#endregion
- #region銆怑xcel鏁版嵁涓婁紶,寰�鏉ュ崟浣嶆竻鍗曘��
+ #region銆怑xcel鏁版嵁涓婁紶,浜哄憳绠$悊銆�
+ public static string ThreeSubmit(List<DataTable> excelTable, User us, out string StuCode)
+ {
+ string message = "";
+ StuCode = "";
+ string sql = "";
+ DataTable dt;
+ List<object> list = new List<object>();
+ var dynamicParams = new DynamicParameters();
+ try
+ {
+ list.Clear();
+ //瀵煎叆鐢ㄦ埛
+ for (int i = 0; i < excelTable[0].Rows.Count; i++)
+ {
+ //sql = @"select * from TUser where usercode=@usercode";
+ //dynamicParams.Add("@usercode", excelTable[1].Rows[i][1].ToString().Trim());
+ //dt = DapperHelper.selectdata(sql, dynamicParams);
+ //if (dt.Rows.Count > 0)
+ //{
+ // continue;
+ //}
+ sql = @"insert into TUser(usercode,username,password,status,mobile,email,storg_code,post_code,role_code,group_code,is_system_admin,lm_user,lm_date)
+ values(@usercode,@username,@password,@status,@mobile,@email,@storg_code,@post_code,@role_code,@group_code,@is_system_admin,@lm_user,@lm_date)";
+ list.Add(new
+ {
+ str = sql,
+ parm = new
+ {
+ usercode = excelTable[0].Rows[i][0].ToString().Trim(),
+ username = excelTable[0].Rows[i][1].ToString().Trim(),
+ password = excelTable[0].Rows[i][2].ToString().Trim(),
+ status = excelTable[0].Rows[i][3].ToString().Trim(),
+ mobile = excelTable[0].Rows[i][4].ToString().Trim(),
+ email = excelTable[0].Rows[i][5].ToString().Trim(),
+ storg_code = excelTable[0].Rows[i][6].ToString().Trim(),
+ post_code = excelTable[0].Rows[i][7].ToString().Trim(),
+ role_code = excelTable[0].Rows[i][8].ToString().Trim(),
+ group_code = excelTable[0].Rows[i][9].ToString().Trim(),
+ is_system_admin = "N",
+ lm_user = us.usercode,
+ lm_date = DateTime.Now.ToString()
+ }
+ });
+ }
+ bool aa = DapperHelper.DoTransaction(list);
+ if (aa)
+ {
+ StuCode = "200";
+ message = "瀵煎叆鎴愬姛锛�";
+ }
+ else
+ {
+ StuCode = "300";
+ message = "瀵煎叆澶辫触锛�";
+ }
+ }
+ catch (Exception e)
+ {
+ StuCode = "300";
+ message = e.Message;
+ }
+ return message;
+ }
+ #endregion
+
+ #region銆怑xcel鏁版嵁涓婁紶,瑙掕壊绠$悊銆�
public static string FourSubmit(string FileCode, string User, out string StuCode)
{
string message = "";
@@ -3499,8 +3562,80 @@
}
#endregion
- #region銆怑xcel鏁版嵁涓婁紶,浠撳簱銆佸簱浣嶅畾涔夈��
- public static string SixOneSubmit(string FileCode, string User, out string StuCode)
+ #region銆怑xcel鏁版嵁涓婁紶,寰�鏉ュ崟浣嶃��
+ public static string FiveSubmit(string FileCode, string User, out string StuCode)
+ {
+ string message = "";
+ StuCode = "";
+ string sql = "";
+ DataTable dt;
+ List<object> list = new List<object>();
+ var dynamicParams = new DynamicParameters();
+ try
+ {
+ list.Clear();
+ DataTable excelTable = new DataTable();
+ excelTable = ImportExcel.ExcelToTable(FileCode);
+ //瀵煎叆寰�鏉ュ崟浣嶈〃
+ for (int i = 0; i < excelTable.Rows.Count; i++)
+ {
+ string Type = "";
+ switch (excelTable.Rows[i][3].ToString().Trim())
+ {
+ case "渚涘簲鍟�":
+ Type = "226";
+ break;
+ case "瀹㈡埛":
+ Type = "211";
+ break;
+ case "瀹㈡埛/渚涘簲鍟�":
+ Type = "228";
+ break;
+ default:
+ break;
+ }
+
+ sql = @"insert into TCustomer(code,name,type,conttacts,conttphone,addr,lm_user,lm_date)
+ values(@code,@name,@type,@conttacts,@conttphone,@addr,@Operator,@CreateDate)";
+ list.Add(new
+ {
+ str = sql,
+ parm = new
+ {
+ code = excelTable.Rows[i][1].ToString().Trim(),
+ name = excelTable.Rows[i][2].ToString().Trim(),
+ type = Type,
+ conttacts = excelTable.Rows[i][4].ToString().Trim(),
+ conttphone = excelTable.Rows[i][5].ToString().Trim(),
+ addr = excelTable.Rows[i][6].ToString().Trim(),
+ Operator = User,
+ CreateDate = DateTime.Now.ToString()
+ }
+ });
+ }
+ bool aa = DapperHelper.DoTransaction(list);
+ if (aa)
+ {
+ StuCode = "200";
+ message = "瀵煎叆鎴愬姛锛�";
+ }
+ else
+ {
+ StuCode = "300";
+ message = "瀵煎叆澶辫触锛�";
+ }
+ }
+ catch (Exception e)
+ {
+ StuCode = "300";
+ message = e.Message;
+ }
+ return message;
+ }
+ #endregion
+
+ #region銆怑xcel鏁版嵁涓婁紶,浠撳簱璁剧疆銆�
+ public static string SixSubmit(string FileCode, string User, out string StuCode)
{
string message = "";
StuCode = "";
@@ -3570,7 +3705,7 @@
}
#endregion
- #region銆怑xcel鏁版嵁涓婁紶,瀹瑰櫒瀹氫箟銆�
+ #region銆怑xcel鏁版嵁涓婁紶,搴撲綅璁剧疆銆�
public static string SevenSubmit(string FileCode, string User, out string StuCode)
{
string message = "";
diff --git a/VueWebCoreApi/VueWebCoreApi.csproj b/VueWebCoreApi/VueWebCoreApi.csproj
index 3527691..6e05c24 100644
--- a/VueWebCoreApi/VueWebCoreApi.csproj
+++ b/VueWebCoreApi/VueWebCoreApi.csproj
@@ -47,7 +47,21 @@
<ItemGroup>
<Folder Include="InExcel\" />
- <Folder Include="Models\SystemSetting\" />
+ </ItemGroup>
+
+ <ItemGroup>
+ <None Include="wwwroot\Excel\浠撳簱搴撲綅娓呭崟.xls" />
+ <None Include="wwwroot\Excel\寰�鏉ュ崟浣�.xls" />
+ <None Include="wwwroot\Excel\鐗╂枡娓呭崟.xls" />
+ <None Include="wwwroot\Excel\鐢ㄦ埛娓呭崟.xls" />
+ <None Include="wwwroot\Excel\缂洪櫡瀹氫箟.xls" />
+ <None Include="wwwroot\Excel\鑺傛媿宸ヤ环.xls" />
+ <None Include="wwwroot\Excel\瑙掕壊娓呭崟.xls" />
+ <None Include="wwwroot\Excel\璁惧淇濆吇鏍囧噯.xls" />
+ <None Include="wwwroot\Excel\璁惧淇濆吇椤圭洰.xls" />
+ <None Include="wwwroot\Excel\璁惧娓呭崟.xls" />
+ <None Include="wwwroot\Excel\璁惧鐐规鏍囧噯.xls" />
+ <None Include="wwwroot\Excel\璁惧鐐规椤圭洰.xls" />
</ItemGroup>
<ItemGroup>
diff --git "a/VueWebCoreApi/Excel/\344\273\223\345\272\223\345\272\223\344\275\215\346\270\205\345\215\225.xls" "b/VueWebCoreApi/wwwroot/Excel/\344\273\223\345\272\223\345\272\223\344\275\215\346\270\205\345\215\225.xls"
similarity index 100%
rename from "VueWebCoreApi/Excel/\344\273\223\345\272\223\345\272\223\344\275\215\346\270\205\345\215\225.xls"
rename to "VueWebCoreApi/wwwroot/Excel/\344\273\223\345\272\223\345\272\223\344\275\215\346\270\205\345\215\225.xls"
Binary files differ
diff --git "a/VueWebCoreApi/Excel/\345\276\200\346\235\245\345\215\225\344\275\215.xls" "b/VueWebCoreApi/wwwroot/Excel/\345\276\200\346\235\245\345\215\225\344\275\215.xls"
similarity index 100%
rename from "VueWebCoreApi/Excel/\345\276\200\346\235\245\345\215\225\344\275\215.xls"
rename to "VueWebCoreApi/wwwroot/Excel/\345\276\200\346\235\245\345\215\225\344\275\215.xls"
Binary files differ
diff --git "a/VueWebCoreApi/Excel/\347\211\251\346\226\231\346\270\205\345\215\225.xls" "b/VueWebCoreApi/wwwroot/Excel/\347\211\251\346\226\231\346\270\205\345\215\225.xls"
similarity index 100%
rename from "VueWebCoreApi/Excel/\347\211\251\346\226\231\346\270\205\345\215\225.xls"
rename to "VueWebCoreApi/wwwroot/Excel/\347\211\251\346\226\231\346\270\205\345\215\225.xls"
Binary files differ
diff --git "a/VueWebCoreApi/wwwroot/Excel/\347\224\250\346\210\267\346\270\205\345\215\225.xls" "b/VueWebCoreApi/wwwroot/Excel/\347\224\250\346\210\267\346\270\205\345\215\225.xls"
new file mode 100644
index 0000000..655ba9a
--- /dev/null
+++ "b/VueWebCoreApi/wwwroot/Excel/\347\224\250\346\210\267\346\270\205\345\215\225.xls"
Binary files differ
diff --git "a/VueWebCoreApi/Excel/\347\274\272\351\231\267\345\256\232\344\271\211.xls" "b/VueWebCoreApi/wwwroot/Excel/\347\274\272\351\231\267\345\256\232\344\271\211.xls"
similarity index 100%
rename from "VueWebCoreApi/Excel/\347\274\272\351\231\267\345\256\232\344\271\211.xls"
rename to "VueWebCoreApi/wwwroot/Excel/\347\274\272\351\231\267\345\256\232\344\271\211.xls"
Binary files differ
diff --git "a/VueWebCoreApi/Excel/\350\212\202\346\213\215\345\267\245\344\273\267.xls" "b/VueWebCoreApi/wwwroot/Excel/\350\212\202\346\213\215\345\267\245\344\273\267.xls"
similarity index 100%
rename from "VueWebCoreApi/Excel/\350\212\202\346\213\215\345\267\245\344\273\267.xls"
rename to "VueWebCoreApi/wwwroot/Excel/\350\212\202\346\213\215\345\267\245\344\273\267.xls"
Binary files differ
diff --git "a/VueWebCoreApi/Excel/\350\247\222\350\211\262\346\270\205\345\215\225.xls" "b/VueWebCoreApi/wwwroot/Excel/\350\247\222\350\211\262\346\270\205\345\215\225.xls"
similarity index 100%
rename from "VueWebCoreApi/Excel/\350\247\222\350\211\262\346\270\205\345\215\225.xls"
rename to "VueWebCoreApi/wwwroot/Excel/\350\247\222\350\211\262\346\270\205\345\215\225.xls"
Binary files differ
diff --git "a/VueWebCoreApi/Excel/\350\256\276\345\244\207\344\277\235\345\205\273\346\240\207\345\207\206.xls" "b/VueWebCoreApi/wwwroot/Excel/\350\256\276\345\244\207\344\277\235\345\205\273\346\240\207\345\207\206.xls"
similarity index 100%
rename from "VueWebCoreApi/Excel/\350\256\276\345\244\207\344\277\235\345\205\273\346\240\207\345\207\206.xls"
rename to "VueWebCoreApi/wwwroot/Excel/\350\256\276\345\244\207\344\277\235\345\205\273\346\240\207\345\207\206.xls"
Binary files differ
diff --git "a/VueWebCoreApi/Excel/\350\256\276\345\244\207\344\277\235\345\205\273\351\241\271\347\233\256.xls" "b/VueWebCoreApi/wwwroot/Excel/\350\256\276\345\244\207\344\277\235\345\205\273\351\241\271\347\233\256.xls"
similarity index 100%
rename from "VueWebCoreApi/Excel/\350\256\276\345\244\207\344\277\235\345\205\273\351\241\271\347\233\256.xls"
rename to "VueWebCoreApi/wwwroot/Excel/\350\256\276\345\244\207\344\277\235\345\205\273\351\241\271\347\233\256.xls"
Binary files differ
diff --git "a/VueWebCoreApi/Excel/\350\256\276\345\244\207\346\270\205\345\215\225.xls" "b/VueWebCoreApi/wwwroot/Excel/\350\256\276\345\244\207\346\270\205\345\215\225.xls"
similarity index 100%
rename from "VueWebCoreApi/Excel/\350\256\276\345\244\207\346\270\205\345\215\225.xls"
rename to "VueWebCoreApi/wwwroot/Excel/\350\256\276\345\244\207\346\270\205\345\215\225.xls"
Binary files differ
diff --git "a/VueWebCoreApi/Excel/\350\256\276\345\244\207\347\202\271\346\243\200\346\240\207\345\207\206.xls" "b/VueWebCoreApi/wwwroot/Excel/\350\256\276\345\244\207\347\202\271\346\243\200\346\240\207\345\207\206.xls"
similarity index 100%
rename from "VueWebCoreApi/Excel/\350\256\276\345\244\207\347\202\271\346\243\200\346\240\207\345\207\206.xls"
rename to "VueWebCoreApi/wwwroot/Excel/\350\256\276\345\244\207\347\202\271\346\243\200\346\240\207\345\207\206.xls"
Binary files differ
diff --git "a/VueWebCoreApi/Excel/\350\256\276\345\244\207\347\202\271\346\243\200\351\241\271\347\233\256.xls" "b/VueWebCoreApi/wwwroot/Excel/\350\256\276\345\244\207\347\202\271\346\243\200\351\241\271\347\233\256.xls"
similarity index 100%
rename from "VueWebCoreApi/Excel/\350\256\276\345\244\207\347\202\271\346\243\200\351\241\271\347\233\256.xls"
rename to "VueWebCoreApi/wwwroot/Excel/\350\256\276\345\244\207\347\202\271\346\243\200\351\241\271\347\233\256.xls"
Binary files differ
--
Gitblit v1.9.3