检查清单导入

This commit is contained in:
何美荣 2025-11-23 22:02:43 +08:00
parent 7a71c59630
commit ce9729c176

View File

@ -499,7 +499,7 @@ namespace APT.SK.WebApi.Controllers.Api
var dataTables = FileUtils.ReadExcelByOledb(filePath, startRowIndexs); var dataTables = FileUtils.ReadExcelByOledb(filePath, startRowIndexs);
string Msg = string.Empty; string Msg = string.Empty;
bool isOK = InsertModel2(dataTables.Tables[0], orgId, ref Msg); bool isOK = InsertModel5(dataTables.Tables[0], orgId, ref Msg);
try try
{ {
@ -1872,16 +1872,23 @@ namespace APT.SK.WebApi.Controllers.Api
} }
} }
} }
UnifiedCommit(() => if (!string.IsNullOrEmpty(Msg))
{
throw new Exception(Msg);
}
else
{ {
if (setLists != null && setLists.Any()) UnifiedCommit(() =>
BantchAddEntityNoCommit(setLists); {
if (setContentLists != null && setContentLists.Any()) if (setLists != null && setLists.Any())
BantchAddEntityNoCommit(setContentLists); BantchAddEntityNoCommit(setLists);
if (setUserLists != null && setUserLists.Any()) if (setContentLists != null && setContentLists.Any())
BantchAddEntityNoCommit(setUserLists); BantchAddEntityNoCommit(setContentLists);
}); if (setUserLists != null && setUserLists.Any())
Msg = "导入成功!"; BantchAddEntityNoCommit(setUserLists);
});
Msg = "导入成功!";
}
return true; return true;
} }
} }