From defabbe6e268ec177cecc70cf6132ccb74b590f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=82=A5=E7=BE=8A?= <1048382248@qq.com> Date: Wed, 27 Aug 2025 15:23:03 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20=E6=AD=A3=E5=BC=8F?= =?UTF-8?q?=E7=8E=AF=E5=A2=83=E7=9A=84=20=E5=BA=93=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Learn.Archives.API/Controllers/MenuRelationController.cs | 2 +- Learn.Archives.API/appsettings.Production.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Learn.Archives.API/Controllers/MenuRelationController.cs b/Learn.Archives.API/Controllers/MenuRelationController.cs index 7ac0d44..a58b9a3 100644 --- a/Learn.Archives.API/Controllers/MenuRelationController.cs +++ b/Learn.Archives.API/Controllers/MenuRelationController.cs @@ -38,7 +38,7 @@ namespace Learn.Archives.API.Controllers { if (roleId == 0) Oh.Error("无效的角色"); if (!userInfo.IsSa) Oh.Error("无权访问"); - var role = roleService.GetByIdAsync(roleId); + var role = await roleService.GetByIdAsync(roleId); if (role == null) Oh.Error("无效的角色"); return await mrService.AsQueryable() .Where(s=>s.RoleId==roleId) diff --git a/Learn.Archives.API/appsettings.Production.json b/Learn.Archives.API/appsettings.Production.json index 2deaa53..b36b938 100644 --- a/Learn.Archives.API/appsettings.Production.json +++ b/Learn.Archives.API/appsettings.Production.json @@ -20,7 +20,7 @@ "OtherDBArr": [ { "ConfigId": 1001, //用户中心 - "ConnectionString": "AllowLoadLocalInfile=true;Server=rm-2vc20nd3d11g0oh6g2o.rwlb.cn-chengdu.rds.aliyuncs.com;User ID=marking;Password=poiuytPOIUYT098765)(*&^%;Port=3306;Database=usercenter;CharSet=utf8mb4;pooling=true;SslMode=None", + "ConnectionString": "AllowLoadLocalInfile=true;Server=rm-2vc20nd3d11g0oh6g2o.rwlb.cn-chengdu.rds.aliyuncs.com;User ID=marking;Password=poiuytPOIUYT098765)(*&^%;Port=3306;Database=usercenter_v1;CharSet=utf8mb4;pooling=true;SslMode=None", "SqlType": "MySql" } ] From 6255e72300103bcece1f210512c8186baaf78291 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=82=A5=E7=BE=8A?= <1048382248@qq.com> Date: Wed, 27 Aug 2025 15:43:35 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20=E5=AF=BC=E5=85=A5?= =?UTF-8?q?=E8=80=81=E5=B8=88=E6=A0=A1=E9=AA=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/StudentController.cs | 21 ++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/Learn.Archives.API/Controllers/StudentController.cs b/Learn.Archives.API/Controllers/StudentController.cs index dd10085..c6a5b8c 100644 --- a/Learn.Archives.API/Controllers/StudentController.cs +++ b/Learn.Archives.API/Controllers/StudentController.cs @@ -153,6 +153,25 @@ namespace Learn.Archives.API.Controllers impError.Add(s); continue; } + //基础信息校验 + if (string.IsNullOrEmpty(s.UserType) || + string.IsNullOrEmpty(s.School)|| + string.IsNullOrEmpty(s.Class) || + string.IsNullOrEmpty(s.Phone)|| + string.IsNullOrEmpty(s.RealName) + ) + { + s.ErrorMsg = "基础信息未能检查通过/请检查 导入行中 是否缺少了[任职信息类型/学校/班级/年级/名称//手机号]"; + impError.Add(s); + continue; + } + //无效的任教学科 + if (!string.IsNullOrEmpty(s.Subject) && s.Subject.ToEnum()==null) + { + s.ErrorMsg = "无效的任教学科"; + impError.Add(s); + continue; + } userCenterImp.Add(new UserExcelExportData() { UserType = s.UserType, @@ -162,7 +181,7 @@ namespace Learn.Archives.API.Controllers School = s.School, Grade = gStr, Class = s.Class, - ClassType = s.ClassType, + ClassType = s.ClassType??ClassTypeEnum.云校班.ToString(), Phone = s.Phone, RealName = s.RealName, Stages = s.Grade.Contains("初") ? StudentStagesEnum.初中.ToString() : StudentStagesEnum.高中.ToString()