From bbfb9c9f85f7b48067dec49229cdb4d56147426b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=82=A5=E7=BE=8A?= <1048382248@qq.com> Date: Tue, 26 Aug 2025 10:03:26 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E5=AD=A6=E7=94=9F=E6=97=B6=E7=9A=84=E6=97=A0=E6=95=88=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E8=A2=AB=E6=94=B6=E9=9B=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Learn.Archives.API/Controllers/ExamClassInfoController.cs | 4 ++++ Learn.Archives.API/Controllers/StudentController.cs | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Learn.Archives.API/Controllers/ExamClassInfoController.cs b/Learn.Archives.API/Controllers/ExamClassInfoController.cs index 9eb9741..ed75abf 100644 --- a/Learn.Archives.API/Controllers/ExamClassInfoController.cs +++ b/Learn.Archives.API/Controllers/ExamClassInfoController.cs @@ -1,6 +1,7 @@ using Learn.Archives.API.Controllers.Dto; using Learn.Archives.API.Expand; using Learn.Archives.Core.Common; +using Learn.Archives.Core.Common.Expand; using Learn.Archives.Core.Model; using Learn.Archives.Core.Model.Dto; using Microsoft.AspNetCore.Authorization; @@ -84,6 +85,7 @@ namespace Learn.Archives.API.Controllers var insertUserInfo = new List(); var insertClassInfo = new List(); var db = schoolService.Context; + SqlSugarExpand.SetDbAop(db); foreach (var schoolArr in dataList.GroupBy(s => s.School)) { var school = await schoolService.GetFirstAsync(s => s.Name == schoolArr.Key); @@ -94,6 +96,7 @@ namespace Learn.Archives.API.Controllers var classArr = await db.Queryable().Where(c => c.SchoolId == school.Id && c.GradeLevel == gradeInfo.GradeLevel && c.GraduationYear == gradeInfo.GradeYear && !c.DeleteState).ToArrayAsync(); + var userDic = await db.Queryable() .LeftJoin((s, c) => c.SchoolId == s.Id) .LeftJoin((s, c, p) => p.ClassId == c.Id) @@ -103,6 +106,7 @@ namespace Learn.Archives.API.Controllers s.Id == school.Id && c.GradeLevel == gradeInfo.GradeLevel && c.GraduationYear == gradeInfo.GradeYear && + u.UserType == UserTypeEnum.学生.GetHashCode() && s.Enable && p.Enable && pr.Enable && !p.DeleteState && !c.DeleteState && !u.DeleteState && !s.DeleteState) .Select((s, c, p, pr, u) => new diff --git a/Learn.Archives.API/Controllers/StudentController.cs b/Learn.Archives.API/Controllers/StudentController.cs index d0c9a20..60a9b1f 100644 --- a/Learn.Archives.API/Controllers/StudentController.cs +++ b/Learn.Archives.API/Controllers/StudentController.cs @@ -103,7 +103,7 @@ namespace Learn.Archives.API.Controllers item.AmountRelief = ex.AmountRelief; item.ReliefApplication = ex.ReliefApplication; item.Remark = ex.Remark; - item.ReliefType = ex.ReliefType.ToString(); + item.ReliefType = ex?.ReliefType?.ToString(); item.ReliefSubTime = ex.ReliefSubTime?.ToString("yyyy-MM-dd") ?? string.Empty; }