From 7a27a696dad3aeb83f0b35f2a561eb42193f3804 Mon Sep 17 00:00:00 2001 From: tiananlin Date: Mon, 25 Aug 2025 14:12:45 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20Learn.Archives.API/Doc?= =?UTF-8?q?kerfiles/Dockerfile-staging?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Learn.Archives.API/Dockerfiles/Dockerfile-staging | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 Learn.Archives.API/Dockerfiles/Dockerfile-staging diff --git a/Learn.Archives.API/Dockerfiles/Dockerfile-staging b/Learn.Archives.API/Dockerfiles/Dockerfile-staging new file mode 100644 index 0000000..d5160ee --- /dev/null +++ b/Learn.Archives.API/Dockerfiles/Dockerfile-staging @@ -0,0 +1,15 @@ +FROM mcr.microsoft.com/dotnet/sdk:8.0 AS publish +WORKDIR /src +COPY . . +WORKDIR "/src/Learn.Archives.API" +ENV NUGET_XMLDOC_MODE none +RUN dotnet nuget add source --name marking https://gitea.23544.com/api/packages/marking/nuget/index.json +RUN dotnet publish "Learn.Archives.API.csproj" -c Release -o /app + +FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS final +WORKDIR /app +COPY --from=publish /app . +ENV ASPNETCORE_ENVIRONMENT=Staging +ENV TZ=Asia/Shanghai +EXPOSE 8080 +ENTRYPOINT ["dotnet", "Learn.Archives.API.dll"] \ No newline at end of file From aa9dd2cd167551488525683d1e0217071dc07c7b 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 16:47:59 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E5=AE=8C=E5=96=84=20=E5=AD=A6=E7=94=9F?= =?UTF-8?q?=E5=AF=BC=E5=85=A5=E6=96=B0=E5=A2=9E=E7=9A=84=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/ExamClassInfoController.cs | 2 +- .../Controllers/SchoolBusinessController.cs | 24 ++++++++---- .../Controllers/StudentController.cs | 16 ++++++-- Learn.Archives.API/Expand/HttpFilter.cs | 2 +- Learn.Archives.Core/Model/Admin.cs | 2 +- .../Model/Dto/UserCenterServiceDto.cs | 39 +++++++++++++++++-- .../Model/Enum/ReliefSubTimeEnum.cs | 23 +++++++++++ Learn.Archives.Core/Model/Student.cs | 14 +++++++ 8 files changed, 105 insertions(+), 17 deletions(-) create mode 100644 Learn.Archives.Core/Model/Enum/ReliefSubTimeEnum.cs diff --git a/Learn.Archives.API/Controllers/ExamClassInfoController.cs b/Learn.Archives.API/Controllers/ExamClassInfoController.cs index e8a7863..9eb9741 100644 --- a/Learn.Archives.API/Controllers/ExamClassInfoController.cs +++ b/Learn.Archives.API/Controllers/ExamClassInfoController.cs @@ -254,7 +254,7 @@ namespace Learn.Archives.API.Controllers { List resultList = new List() { new ImportExamInfo() { - School="例子学校", + School="例子学校[导入时候请删除]", Class="测试班级", ClassType="普通班级", Grade="高2028", diff --git a/Learn.Archives.API/Controllers/SchoolBusinessController.cs b/Learn.Archives.API/Controllers/SchoolBusinessController.cs index 2b2132e..d043afb 100644 --- a/Learn.Archives.API/Controllers/SchoolBusinessController.cs +++ b/Learn.Archives.API/Controllers/SchoolBusinessController.cs @@ -211,19 +211,27 @@ namespace Learn.Archives.API.Controllers } } } - var feedbackQuestions = resultQuestion.ToArray(); + var feedbackQuestions = resultQuestion.ToArray(); + if(feedbackQuestions.Length==0) + { + imp.Error = $"未能识别到有效的赴校问题信息"; + errorExcelInfo.Add(imp); + continue; + } //沟通时间/执行记录 var regex1 = new Regex(@"(.*?):(.*?)(?=;|$)", RegexOptions.Singleline); var record = new List(); - foreach (Match match in regex1.Matches(imp.Record)) - { - record.Add(new RecordDto() + + if (!string.IsNullOrEmpty(imp.Record)) + foreach (Match match in regex1.Matches(imp.Record)) { - ExecutionTime = match.Groups[1].Value.ExtractDateTime(), - ExecutionRecords = match.Groups[2].Value, - }); - } + record.Add(new RecordDto() + { + ExecutionTime = match.Groups[1].Value.ExtractDateTime(), + ExecutionRecords = match.Groups[2].Value, + }); + } var business = new SchoolBusiness() { diff --git a/Learn.Archives.API/Controllers/StudentController.cs b/Learn.Archives.API/Controllers/StudentController.cs index e05ae58..c3ab5dc 100644 --- a/Learn.Archives.API/Controllers/StudentController.cs +++ b/Learn.Archives.API/Controllers/StudentController.cs @@ -96,11 +96,16 @@ namespace Learn.Archives.API.Controllers res.Data.Add(item); if (!exDataDic.ContainsKey(item.Id)) continue; var ex = exDataDic[item.Id].First(); - item.AmountRelief = ex.AmountRelief; item.Status = ex.Status; item.ExitTime = ex.ExitTime?.ToString("yyyy-MM-dd")??string.Empty; item.JoinTime = ex.JoinTime?.ToString("yyyy-MM-dd") ?? string.Empty; + + item.AmountRelief = ex.AmountRelief; + item.ReliefApplication = ex.ReliefApplication; item.Remark = ex.Remark; + item.ReliefType = ex.ReliefType.ToString(); + item.ReliefSubTime = ex.ReliefSubTime?.ToString("yyyy-MM-dd") ?? string.Empty; + } return res; } @@ -202,6 +207,9 @@ namespace Learn.Archives.API.Controllers JoinTime = s.JoinTime, Status = s.Status.ToEnum()??default, UserCenterId = s.Id, + ReliefApplication=s.ReliefApplication?.Contains("已申请")??false, + ReliefSubTime = s.ReliefSubTime, + ReliefType =s.ReliefType?.ToEnum() }); userCenterImp.Add(new UserExcelExportData() { @@ -210,7 +218,7 @@ namespace Learn.Archives.API.Controllers School = s.School, Grade = s.Grade, Class = s.Class, - ClassType = s.ClassType, + ClassType = s.ClassType??ClassTypeEnum.云校班.ToString(), ExamNo = s.Id.ToString(), Phone = s.Phone, RealName = s.RealName, @@ -252,7 +260,7 @@ namespace Learn.Archives.API.Controllers [HttpGet, ResultIgnore, AllowAnonymous] public IActionResult DwImportTemplate() { - var resultList = new List() { new StudentInfoImport() + var resultList = new List() { new StudentInfoImport() { RealName = "导入规范[导入时请删除本列]", School = "必填:与系统匹配", @@ -261,6 +269,8 @@ namespace Learn.Archives.API.Controllers ClassType = "必填:可选值\r\n[云校班 海豚智学班 蓝鲸智库班 中职班 其他 雅思班 点阵笔班级 移动校园班级 智学班 ...]", Status = "选填 可选值\r\n[就读,退出]", AmountRelief ="选填: 为0则视为 '未申请减免'", + ReliefType ="选填: 1.建卡贫困户\r\n2.低保户\r\n3.教师子女 \r\n4.孤儿\r\n5.艺体生\r\n6.残疾学生\r\n7.领导特殊承诺减免\r\n8.领导同意的特殊贫困减免", + ReliefApplication ="选填: [已申请, 未申请]", Phone="选填", Remark="选填", } }; diff --git a/Learn.Archives.API/Expand/HttpFilter.cs b/Learn.Archives.API/Expand/HttpFilter.cs index f45bb28..6353a10 100644 --- a/Learn.Archives.API/Expand/HttpFilter.cs +++ b/Learn.Archives.API/Expand/HttpFilter.cs @@ -239,7 +239,7 @@ namespace Learn.Archives.API.Expand code = exception.Code; var result = new BaseReturn() { - Code = -1, + Code = code, Message = context.Exception.Message }; context.Result = new JsonResult(result); diff --git a/Learn.Archives.Core/Model/Admin.cs b/Learn.Archives.Core/Model/Admin.cs index 442e21f..0df080c 100644 --- a/Learn.Archives.Core/Model/Admin.cs +++ b/Learn.Archives.Core/Model/Admin.cs @@ -28,7 +28,7 @@ namespace Learn.Archives.Core.Model /// /// 账号 /// - [SugarColumn(Length = 12)] + [SugarColumn(Length = 20)] public string Account { get; set; } /// /// 密码 diff --git a/Learn.Archives.Core/Model/Dto/UserCenterServiceDto.cs b/Learn.Archives.Core/Model/Dto/UserCenterServiceDto.cs index 0cce1e1..9f85394 100644 --- a/Learn.Archives.Core/Model/Dto/UserCenterServiceDto.cs +++ b/Learn.Archives.Core/Model/Dto/UserCenterServiceDto.cs @@ -107,7 +107,7 @@ namespace Learn.Archives.Core.Model.Dto /// /// 姓名 /// - [ExcelColumn(Name="姓名", Width = 20)] + [ExcelColumn(Name="姓名", Width = 28)] public string RealName { get; set; } /// /// 家长电话 @@ -141,6 +141,27 @@ namespace Learn.Archives.Core.Model.Dto [ExcelColumn(Name = "减免金额")] public string AmountRelief { get; set; } + + /// + /// 减免是否申请 + /// + [ExcelColumn(Name = "减免是否申请", Width = 15)] + public string ReliefApplication { get; set; } + /// + /// 减免申请类型 + /// + [ExcelColumn(Name = "减免申请类型", Width = 10)] + public string? ReliefType { get; set; } + /// + /// 减免申请时间 + /// + [ExcelColumn(Name = "减免申请时间", Width = 10)] + public DateTime? ReliefSubTime { get; set; } + + + + + /// /// 学生状态[就读/退出] /// @@ -299,6 +320,19 @@ namespace Learn.Archives.Core.Model.Dto /// 退出时间 /// public string? JoinTime { get; set; } + + /// + /// 减免是否申请 + /// + public bool ReliefApplication { get; set; } + /// + /// 减免申请类型 + /// + public string? ReliefType { get; set; } + /// + /// 减免申请时间 + /// + public string ReliefSubTime { get; set; } } /// @@ -470,7 +504,7 @@ namespace Learn.Archives.Core.Model.Dto /// public long SchoolId { get; set; } public bool Enable { get; set; } - public DateTime? EndTime { get; set; } + //public DateTime? EndTime { get; set; } /// /// 学校名称 @@ -479,7 +513,6 @@ namespace Learn.Archives.Core.Model.Dto /// /// 级别(初/高) /// - [Newtonsoft.Json.JsonIgnore] public string GradeLevel { get; set; } /// /// 所属届 diff --git a/Learn.Archives.Core/Model/Enum/ReliefSubTimeEnum.cs b/Learn.Archives.Core/Model/Enum/ReliefSubTimeEnum.cs new file mode 100644 index 0000000..4f7815a --- /dev/null +++ b/Learn.Archives.Core/Model/Enum/ReliefSubTimeEnum.cs @@ -0,0 +1,23 @@ +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 c0b1459..5791ec4 100644 --- a/Learn.Archives.Core/Model/Student.cs +++ b/Learn.Archives.Core/Model/Student.cs @@ -27,6 +27,20 @@ namespace Learn.Archives.Core.Model /// [SugarColumn(DecimalDigits =2)] public decimal AmountRelief { get; set; } + /// + /// 减免是否申请 + /// + public bool ReliefApplication { get; set; } + /// + /// 减免申请类型 + /// + [SugarColumn(IsNullable = true)] + public ReliefSubTimeEnum? ReliefType { get; set; } + /// + /// 减免申请时间 + /// + [SugarColumn(IsNullable = true)] + public DateTime? ReliefSubTime { get; set; } /// /// 学生状态 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 3/4] =?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 4/4] =?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; }