From ce9729c176d304452763603bf8a18b61840c93ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=95=E7=BE=8E=E8=8D=A3?= <10755671+mei-rong-he@user.noreply.gitee.com> Date: Sun, 23 Nov 2025 22:02:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A3=80=E6=9F=A5=E6=B8=85=E5=8D=95=E5=AF=BC?= =?UTF-8?q?=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/Api/CheckSetController.cs | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/APT.MicroApi/APT.SK.WebApi/Controllers/Api/CheckSetController.cs b/APT.MicroApi/APT.SK.WebApi/Controllers/Api/CheckSetController.cs index 51949c2..3cc0990 100644 --- a/APT.MicroApi/APT.SK.WebApi/Controllers/Api/CheckSetController.cs +++ b/APT.MicroApi/APT.SK.WebApi/Controllers/Api/CheckSetController.cs @@ -499,7 +499,7 @@ namespace APT.SK.WebApi.Controllers.Api var dataTables = FileUtils.ReadExcelByOledb(filePath, startRowIndexs); string Msg = string.Empty; - bool isOK = InsertModel2(dataTables.Tables[0], orgId, ref Msg); + bool isOK = InsertModel5(dataTables.Tables[0], orgId, ref Msg); 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()) - BantchAddEntityNoCommit(setLists); - if (setContentLists != null && setContentLists.Any()) - BantchAddEntityNoCommit(setContentLists); - if (setUserLists != null && setUserLists.Any()) - BantchAddEntityNoCommit(setUserLists); - }); - Msg = "导入成功!"; + UnifiedCommit(() => + { + if (setLists != null && setLists.Any()) + BantchAddEntityNoCommit(setLists); + if (setContentLists != null && setContentLists.Any()) + BantchAddEntityNoCommit(setContentLists); + if (setUserLists != null && setUserLists.Any()) + BantchAddEntityNoCommit(setUserLists); + }); + Msg = "导入成功!"; + } return true; } }