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] =?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; } /// /// 学生状态