|
|
@@ -1377,11 +1377,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration |
|
|
|
try |
|
|
|
{ |
|
|
|
//检测是否有空值 |
|
|
|
if (dr[0].ToString() == "" || dr[1].ToString() == "" || dr[2].ToString() == "" || dr[3].ToString() == "") |
|
|
|
if (dr[0].ToString() == "") |
|
|
|
{ |
|
|
|
throw (new Exception("行内数据有空值,不能为空!")); |
|
|
|
throw (new Exception("身份证号不能为空!")); |
|
|
|
} |
|
|
|
if (stuInfoBasicEntities.Count(m => m.IdentityCardNo.ToUpper() == dr[0].ToString().ToUpper()) == 0) |
|
|
|
if (!stuInfoBasicEntities.Any(m => m.IdentityCardNo.ToUpper() == dr[0].ToString().ToUpper())) |
|
|
|
{ |
|
|
|
throw (new Exception("【身份证号】不存在,请核对!")); |
|
|
|
} |
|
|
@@ -1390,30 +1390,52 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration |
|
|
|
WHERE t.F_DeleteMark = 0"); |
|
|
|
//写入要导入的数据 |
|
|
|
StuInfoBasicEntity stuUpdateList = new StuInfoBasicEntity(); |
|
|
|
stuUpdateList.StuId = stuInfoBasicEntities.FirstOrDefault(s => s.IdentityCardNo.ToUpper() == dr[0].ToString().ToUpper())?.StuId.ToString(); |
|
|
|
stuUpdateList.StuCode = dr[1].ToString(); |
|
|
|
stuUpdateList.MailAddress = dr[2].ToString(); |
|
|
|
stuUpdateList.mobile = dr[3].ToString(); |
|
|
|
|
|
|
|
var PolityStatus = dr["政治面貌"].ToString().Trim(); |
|
|
|
var PolityStatuslity = detailList.FirstOrDefault(x => x.F_ItemCode == "PolityStatus" && x.F_ItemName == PolityStatus); |
|
|
|
if (!string.IsNullOrEmpty(PolityStatus) && PolityStatuslity == null) |
|
|
|
var oriData = stuInfoBasicEntities.FirstOrDefault(s => s.IdentityCardNo.ToUpper() == dr[0].ToString().ToUpper()); |
|
|
|
stuUpdateList.StuId = oriData?.StuId; |
|
|
|
if(!string.IsNullOrWhiteSpace(dr[1].ToString())) |
|
|
|
{ |
|
|
|
throw (new Exception("【政治面貌】数据字典找不到对应的数据")); |
|
|
|
stuUpdateList.StuCode = dr[1].ToString(); |
|
|
|
} |
|
|
|
else |
|
|
|
|
|
|
|
if (!string.IsNullOrWhiteSpace(dr[2].ToString())) |
|
|
|
{ |
|
|
|
stuUpdateList.PartyFaceNo = PolityStatuslity?.F_ItemValue; |
|
|
|
stuUpdateList.StuNo = dr[2].ToString(); |
|
|
|
} |
|
|
|
var PieceCultivateWay = dr["五年一贯制"].ToString().Trim(); |
|
|
|
var PieceCultivateWaylity = detailList.FirstOrDefault(x => x.F_ItemCode == "PieceCultivateWay" && x.F_ItemName == PieceCultivateWay); |
|
|
|
if (!string.IsNullOrEmpty(PieceCultivateWay) && PieceCultivateWaylity == null) |
|
|
|
if (!string.IsNullOrWhiteSpace(dr[3].ToString())) |
|
|
|
{ |
|
|
|
throw (new Exception("【五年一贯制】数据字典找不到对应的数据!")); |
|
|
|
stuUpdateList.MailAddress = dr[3].ToString(); |
|
|
|
} |
|
|
|
else |
|
|
|
if (!string.IsNullOrWhiteSpace(dr[4].ToString())) |
|
|
|
{ |
|
|
|
stuUpdateList.FiveYear = dr["五年一贯制"].ToString(); |
|
|
|
stuUpdateList.mobile = dr[4].ToString(); |
|
|
|
} |
|
|
|
|
|
|
|
var PolityStatus = dr["政治面貌"].ToString().Trim(); |
|
|
|
if(!string.IsNullOrWhiteSpace(PolityStatus)) |
|
|
|
{ |
|
|
|
var PolityStatuslity = detailList.FirstOrDefault(x => x.F_ItemCode == "PolityStatus" && x.F_ItemName == PolityStatus); |
|
|
|
if (!string.IsNullOrEmpty(PolityStatus) && PolityStatuslity == null) |
|
|
|
{ |
|
|
|
throw (new Exception("【政治面貌】数据字典找不到对应的数据")); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
stuUpdateList.PartyFaceNo = PolityStatuslity?.F_ItemValue; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
var PieceCultivateWay = dr["五年一贯制"].ToString().Trim(); |
|
|
|
if (!string.IsNullOrWhiteSpace(PieceCultivateWay)) |
|
|
|
{ |
|
|
|
var PieceCultivateWaylity = detailList.FirstOrDefault(x => x.F_ItemCode == "PieceCultivateWay" && x.F_ItemName == PieceCultivateWay); |
|
|
|
if (!string.IsNullOrEmpty(PieceCultivateWay) && PieceCultivateWaylity == null) |
|
|
|
{ |
|
|
|
throw (new Exception("【五年一贯制】数据字典找不到对应的数据!")); |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
stuUpdateList.FiveYear = dr["五年一贯制"].ToString(); |
|
|
|
} |
|
|
|
} |
|
|
|
insertedorderlist.Add(stuUpdateList); |
|
|
|
snum++; |
|
|
|