From c51d219e172f71c764aad3cc1a5b0bf533f6a2e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=82=A5=E7=BE=8A?= <1048382248@qq.com> Date: Fri, 28 Nov 2025 10:15:15 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=20=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E8=80=83=E8=AF=95=E4=BF=A1=E6=81=AF=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Learn.Archives.API/Controllers/ExamClassInfoController.cs | 1 + Learn.Archives.API/Controllers/StudentController.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Learn.Archives.API/Controllers/ExamClassInfoController.cs b/Learn.Archives.API/Controllers/ExamClassInfoController.cs index 4c488aa..d87d527 100644 --- a/Learn.Archives.API/Controllers/ExamClassInfoController.cs +++ b/Learn.Archives.API/Controllers/ExamClassInfoController.cs @@ -59,6 +59,7 @@ namespace Learn.Archives.API.Controllers var exam = await examService.GetByIdAsync(dto.eId); if (exam == null ) Oh.ModelError("为传入有效的数据"); var dataList = await accessor.ParsingExcelAsync(); + dataList= dataList.Where(s=>!string.IsNullOrEmpty(s.School)).ToArray(); if (dataList == null || dataList.Count() == 0) Oh.ModelError("导入失败:无有效数据"); diff --git a/Learn.Archives.API/Controllers/StudentController.cs b/Learn.Archives.API/Controllers/StudentController.cs index cf57187..0ed1d5a 100644 --- a/Learn.Archives.API/Controllers/StudentController.cs +++ b/Learn.Archives.API/Controllers/StudentController.cs @@ -360,6 +360,7 @@ namespace Learn.Archives.API.Controllers public async Task ImportUpdateStudent(IFormFile? file) { var dataList = await _httpContextAccessor.ParsingExcelAsync(); + dataList = dataList.Where(s => !string.IsNullOrEmpty(s.School)).ToArray(); if (dataList == null || dataList.Length == 0) Oh.ModelError("导入失败:无有效数据"); @@ -494,7 +495,6 @@ namespace Learn.Archives.API.Controllers .IgnoreColumns(ignoreAllNullColumns: true, ignoreAllDefaultValue: true) .WhereColumns(it => new { it.Id }) .ExecuteCommandAsync(); - Oh.Error("需要测试"); return Ok(); } -- 2.40.1