人员导入 提示列 0 1 2 改为 列 A B C。。。

This commit is contained in:
wyw 2026-04-09 15:29:22 +08:00
parent 12e6fa30d1
commit 2e35b69172

View File

@ -801,7 +801,7 @@ namespace APT.BS.WebApi.Controllers.Api
bool isAddUser = false;//是否新增人员 是角色信息得新增 否 查询后处理
bool isAdddep5 = false;//是否新增 公司
DateTime dtNow = DateTime.Now;
Dictionary<int, List<int>> dicIndexEmpty = new Dictionary<int, List<int>>();
Dictionary<int, List<string>> dicIndexEmpty = new Dictionary<int, List<string>>();
List<T_FM_DEPARTMENT> listDepAll = GetEntities<T_FM_DEPARTMENT>(e => e.ENABLE_STATUS == 0, null).ToList();
List<T_FM_USER> listUSER = GetEntities<T_FM_USER>(e => e.ENABLE_STATUS == 0, null).ToList();
List<T_FM_PERSON> listPerson = GetEntities<T_FM_PERSON>(null, null).ToList();
@ -987,7 +987,7 @@ namespace APT.BS.WebApi.Controllers.Api
{
#region
List<int> listi = null;
List<string> listi = null;
for (int j = 0; j < 17; j++)
{
if (!listNotEmpty.Contains(j))
@ -997,9 +997,9 @@ namespace APT.BS.WebApi.Controllers.Api
{
if (listi == null)
{
listi = new List<int>();
listi = new List<string>();
}
listi.Add(j);
listi.Add(GetCol(j));
}
}
if (listi != null)
@ -1677,6 +1677,60 @@ namespace APT.BS.WebApi.Controllers.Api
return true;
}
/// <summary>
/// 根据列信息 获取Excel列头
/// </summary>
/// <param name="colIndex"></param>
/// <returns></returns>
private string GetCol(int colIndex)
{
switch (colIndex)
{
case 0:
return "A";
case 1:
return "B";
case 2:
return "C";
case 3:
return "D";
case 4:
return "E";
case 5:
return "F";
case 6:
return "G";
case 7:
return "H";
case 8:
return "I";
case 9:
return "J";
case 10:
return "K";
case 11:
return "L";
case 12:
return "M";
case 13:
return "N";
case 14:
return "O";
case 15:
return "P";
case 16:
return "Q";
case 17:
return "R";
case 18:
return "S";
case 19:
return "T";
default:
break;
}
return "";
}
public bool InsertModel2(DataTable dtSource, Guid? orgId, string telnetCode, ref string Msg, int rowIndex = 1)
{
var userId = APT.Infrastructure.Api.AppContext.CurrentSession.UserID;