|
|
@@ -172,6 +172,31 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public string GetPhotoByStuNo(string enCode) |
|
|
|
{ |
|
|
|
try |
|
|
|
{ |
|
|
|
var data = this.BaseRepository("CollegeMIS").FindEntity<StuInfoBasicEntity>(a => a.StuNo == enCode); |
|
|
|
if (data != null) |
|
|
|
{ |
|
|
|
return data.Photo; |
|
|
|
} |
|
|
|
|
|
|
|
return ""; |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
|
if (ex is ExceptionEx) |
|
|
|
{ |
|
|
|
throw; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
throw ExceptionEx.ThrowServiceException(ex); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public StuInfoBasicEntity GetStuInfoBasicEntityByStuName(string name) |
|
|
|
{ |
|
|
|
try |
|
|
@@ -396,13 +421,13 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration |
|
|
|
} |
|
|
|
public void SynPhoto() |
|
|
|
{ |
|
|
|
var logpath = @"D:\新版数字化校园\Publish\log"; |
|
|
|
//var logpath = @"D:\新版数字化校园\Publish\log\0913.txt"; |
|
|
|
try |
|
|
|
{ |
|
|
|
var stuList = this.BaseRepository("CollegeMIS").FindList<StuInfoBasicEntity>(x => x.Grade == "21") |
|
|
|
.ToList(); |
|
|
|
var url = AppDomain.CurrentDomain.BaseDirectory; |
|
|
|
System.IO.File.AppendAllText(logpath, "同步照片\r\n"); |
|
|
|
//System.IO.File.AppendAllText(logpath, "同步照片\r\n"); |
|
|
|
var num = 0; |
|
|
|
foreach (var stuInfo in stuList) |
|
|
|
{ |
|
|
@@ -451,19 +476,18 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration |
|
|
|
this.BaseRepository().Insert(annexEntity); |
|
|
|
} |
|
|
|
|
|
|
|
num++; |
|
|
|
//num++; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
|
|
|
|
System.IO.File.AppendAllText(logpath, F_FilePath + "学生:" + stuInfo.StuName + "文件不存在" + "\r\n"); |
|
|
|
//System.IO.File.AppendAllText(logpath, F_FilePath + "学生:" + stuInfo.StuName + "文件不存在" + "\r\n"); |
|
|
|
} |
|
|
|
} |
|
|
|
System.IO.File.AppendAllText(logpath, "同步照片:" + num + "个学生\r\n"); |
|
|
|
//System.IO.File.AppendAllText(logpath, "同步照片:" + num + "个学生\r\n"); |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
|
System.IO.File.AppendAllText(logpath, "同步照片异常:" + ex.Message + "\r\n"); |
|
|
|
if (ex is ExceptionEx) |
|
|
|
{ |
|
|
|
throw; |
|
|
|