From 96b481ef9b0fc9ff489773e008f0ab09d639bf0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=82=A5=E7=BE=8A?= <1048382248@qq.com> Date: Mon, 25 Aug 2025 17:23:22 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E5=AD=A6=E7=94=9F?= =?UTF-8?q?=E8=A1=A5=E8=B4=B4=E7=B1=BB=E5=9E=8B=E4=B8=BA=20String?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/StudentController.cs | 2 +- .../Model/Enum/ReliefSubTimeEnum.cs | 23 ------------------- Learn.Archives.Core/Model/Student.cs | 4 ++-- 3 files changed, 3 insertions(+), 26 deletions(-) delete mode 100644 Learn.Archives.Core/Model/Enum/ReliefSubTimeEnum.cs diff --git a/Learn.Archives.API/Controllers/StudentController.cs b/Learn.Archives.API/Controllers/StudentController.cs index c3ab5dc..d0c9a20 100644 --- a/Learn.Archives.API/Controllers/StudentController.cs +++ b/Learn.Archives.API/Controllers/StudentController.cs @@ -209,7 +209,7 @@ namespace Learn.Archives.API.Controllers UserCenterId = s.Id, ReliefApplication=s.ReliefApplication?.Contains("已申请")??false, ReliefSubTime = s.ReliefSubTime, - ReliefType =s.ReliefType?.ToEnum() + ReliefType =s.ReliefType, }); userCenterImp.Add(new UserExcelExportData() { diff --git a/Learn.Archives.Core/Model/Enum/ReliefSubTimeEnum.cs b/Learn.Archives.Core/Model/Enum/ReliefSubTimeEnum.cs deleted file mode 100644 index 4f7815a..0000000 --- a/Learn.Archives.Core/Model/Enum/ReliefSubTimeEnum.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Learn.Archives.Core.Model.Enum -{ - /// - /// 学生减免类型 - /// - public enum ReliefSubTimeEnum - { - 低保户 = 10, - 教师子女 = 20, - 孤儿 = 30, - 艺体生 = 40, - 残疾学生 = 50, - 领导特殊承诺减免 = 60, - 领导同意的特殊贫困减免 = 70, - 建卡贫困户 = 80, - } -} diff --git a/Learn.Archives.Core/Model/Student.cs b/Learn.Archives.Core/Model/Student.cs index 5791ec4..81c5618 100644 --- a/Learn.Archives.Core/Model/Student.cs +++ b/Learn.Archives.Core/Model/Student.cs @@ -34,8 +34,8 @@ namespace Learn.Archives.Core.Model /// /// 减免申请类型 /// - [SugarColumn(IsNullable = true)] - public ReliefSubTimeEnum? ReliefType { get; set; } + [SugarColumn(IsNullable = true, Length = 20)] + public string? ReliefType { get; set; } /// /// 减免申请时间 /// 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 2/2] =?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; }