|
|
@@ -868,5 +868,57 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
public void SyncDept() |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
var data = this.BaseRepository("CollegeMIS").FindList<StuInfoBasicEntity>().ToList(); |
|
|
|
var majorList = this.BaseRepository("CollegeMIS").FindList<CdMajorEntity>().ToList(); |
|
|
|
foreach (var item in data) |
|
|
|
{ |
|
|
|
var deptNo = majorList.FirstOrDefault(a => a.MajorNo == item.MajorNo)?.DeptNo; |
|
|
|
item.DeptNo = deptNo; |
|
|
|
this.BaseRepository("CollegeMIS").Update(item); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
|
if (ex is ExceptionEx) |
|
|
|
{ |
|
|
|
throw; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
throw ExceptionEx.ThrowServiceException(ex); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
public void SyncMajor() |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
var data = this.BaseRepository("CollegeMIS").FindList<StuInfoBasicEntity>().ToList(); |
|
|
|
var classList = this.BaseRepository("CollegeMIS").FindList<ClassInfoEntity>().ToList(); |
|
|
|
foreach (var item in data) |
|
|
|
{ |
|
|
|
var majorNo = classList.FirstOrDefault(a => a.ClassNo == item.ClassNo)?.MajorNo; |
|
|
|
item.MajorNo = majorNo; |
|
|
|
this.BaseRepository("CollegeMIS").Update(item); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
|
if (ex is ExceptionEx) |
|
|
|
{ |
|
|
|
throw; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
throw ExceptionEx.ThrowServiceException(ex); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |