新增 导入老师校验

This commit is contained in:
小肥羊 2025-08-27 15:43:35 +08:00
parent defabbe6e2
commit 6255e72300
1 changed files with 20 additions and 1 deletions

View File

@ -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<SubjectEnum>()==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()