diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs index 3749ff438..f18f16354 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LogisticsManagement/Accommodation/AccommodationService.cs @@ -1963,40 +1963,50 @@ where ID='{ParentID}' if (string.IsNullOrEmpty(DeptNo)) { fnum++; - dr["导入错误"] = dr["系部"] + "导入错误"; + dr["导入错误"] = "系部导入错误"; failDt.Rows.Add(dr.ItemArray); continue; } if (string.IsNullOrEmpty(MajorNo)) { fnum++; - dr["导入错误"] = dr["专业"] + "导入错误"; + dr["导入错误"] = "专业导入错误"; failDt.Rows.Add(dr.ItemArray); continue; } if (string.IsNullOrEmpty(ClassNo)) { fnum++; - dr["导入错误"] = dr["班级"] + "导入错误"; + dr["导入错误"] = "班级导入错误"; failDt.Rows.Add(dr.ItemArray); continue; } - var leaderno = stuinfobasic.Where(x => x.StuNo == dr["舍长学号"].ToString() && x.ClassNo == ClassNo).FirstOrDefault()?.StuNo; - var stuno = stuinfobasic.Where(x => x.StuNo == dr["学生学号"].ToString() && x.ClassNo == ClassNo).FirstOrDefault()?.StuNo; - //if (string.IsNullOrEmpty(stuno)) - //{ - // fnum++; - // dr["导入错误"] = dr["学生学号"] + "导入错误"; - // failDt.Rows.Add(dr.ItemArray); - // continue; - //} - //if (string.IsNullOrEmpty(leaderno)) - //{ - // fnum++; - // dr["导入错误"] = dr["舍长学号"] + "导入错误"; - // failDt.Rows.Add(dr.ItemArray); - // continue; - //} + + var leaderno = ""; + if (!string.IsNullOrEmpty(dr["舍长学号"].ToString())) + { + leaderno = stuinfobasic.Where(x => x.StuNo == dr["舍长学号"].ToString() && x.ClassNo == ClassNo).FirstOrDefault()?.StuNo; + if (string.IsNullOrEmpty(leaderno)) + { + fnum++; + dr["导入错误"] = dr["舍长学号"] + "导入错误"; + failDt.Rows.Add(dr.ItemArray); + continue; + } + } + + var stuno = ""; + if (!string.IsNullOrEmpty(dr["舍长学号"].ToString())) + { + stuno = stuinfobasic.Where(x => x.StuNo == dr["学生学号"].ToString() && x.ClassNo == ClassNo).FirstOrDefault()?.StuNo; + if (string.IsNullOrEmpty(stuno)) + { + fnum++; + dr["导入错误"] = dr["学生学号"] + "导入错误"; + failDt.Rows.Add(dr.ItemArray); + continue; + } + } var parent = dormitoryBuildList.Where(x => x.Name == "数字化智慧校园").FirstOrDefault(); if (parent == null)