Ver a proveniência

【修改】学籍:同步照片修改;

临城职教中职
dyy há 2 anos
ascendente
cometimento
e4c6bc529a
2 ficheiros alterados com 35 adições e 30 eliminações
  1. +2
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/Index.cshtml
  2. +33
    -28
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicService.cs

+ 2
- 2
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoBasic/Index.cshtml Ver ficheiro

@@ -71,7 +71,7 @@
<div id="StudyModality"></div>
</div>
<div class="col-xs-6 lr-form-item">
<div class="lr-form-item-title">上传照片</div>
<div class="lr-form-item-title">是否有照片</div>
<div id="Photo"></div>
</div>

@@ -95,7 +95,7 @@
<a id="checkall" class="btn btn-default"><i class="fa fa-print"></i>&nbsp;审核全部</a>
<a id="lr_generate" class="btn btn-default"><i class="fa fa-linode"></i>&nbsp;生成帐号</a>
<a id="lr_update" class="btn btn-default"><i class="fa fa-braille"></i>&nbsp;更新帐号</a>
@*<a id="lr_synPhoto" class="btn btn-default"><i class="fa fa-braille"></i>&nbsp;同步照片</a>*@
<a id="lr_synPhoto" class="btn btn-default"><i class="fa fa-braille"></i>&nbsp;同步照片</a>
<a id="lr_searchChange" class="btn btn-default"><i class="fa fa-search"></i>&nbsp;查看异动</a>
<a id="lr_photo" class="btn btn-default"><i class="fa fa-search"></i>&nbsp;拍照</a>
<a id="lr_printInfo" class="btn btn-default"><i class="fa fa-print"></i>&nbsp;学生简历表</a>


+ 33
- 28
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicService.cs Ver ficheiro

@@ -498,13 +498,38 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
var url = AppDomain.CurrentDomain.BaseDirectory;
foreach (var stuInfo in stuList)
{
//照片不为空
if (!string.IsNullOrEmpty(stuInfo.Photo))
//判断要上传的照片在本地服务器中是否存在
var photoPath = $"{url}/Resource/UserPhoto/{stuInfo.IdentityCardNo}.jpg";
if (System.IO.File.Exists(photoPath))
{
var annex = this.BaseRepository()
.FindEntity<AnnexesFileEntity>(a => a.F_FolderId == stuInfo.Photo);
if (annex == null)
//学籍表中照片字段不为空
if (!string.IsNullOrEmpty(stuInfo.Photo))
{
var annex = this.BaseRepository()
.FindEntity<AnnexesFileEntity>(a => a.F_FolderId == stuInfo.Photo);
if (annex == null)
{
var annexEntity = new AnnexesFileEntity()
{
F_Id = Guid.NewGuid().ToString(),
F_FileName = stuInfo.IdentityCardNo + ".jpg",
F_FilePath = $"{url}/Resource/UserPhoto/{stuInfo.IdentityCardNo}.jpg",
F_FolderId = stuInfo.Photo
};
this.BaseRepository().Insert(annexEntity);

}
else
{
annex.F_FileName = stuInfo.IdentityCardNo + ".jpg";
annex.F_FilePath = $"{url}/Resource/UserPhoto/{stuInfo.IdentityCardNo}.jpg";
this.BaseRepository().Update(annex);
}
}
else
{
stuInfo.Photo = Guid.NewGuid().ToString();

var annexEntity = new AnnexesFileEntity()
{
F_Id = Guid.NewGuid().ToString(),
@@ -512,32 +537,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
F_FilePath = $"{url}/Resource/UserPhoto/{stuInfo.IdentityCardNo}.jpg",
F_FolderId = stuInfo.Photo
};
annexEntity.Create();
this.BaseRepository("CollegeMIS").Update(stuInfo);
this.BaseRepository().Insert(annexEntity);

}
else
{
annex.F_FileName = stuInfo.IdentityCardNo + ".jpg";
annex.F_FilePath = $"{url}/Resource/UserPhoto/{stuInfo.IdentityCardNo}.jpg";
this.BaseRepository().Update(annex);
}
}
else
{
stuInfo.Photo = Guid.NewGuid().ToString();

var annexEntity = new AnnexesFileEntity()
{
F_Id = Guid.NewGuid().ToString(),
F_FileName = stuInfo.IdentityCardNo + ".jpg",
F_FilePath = $"{url}/Resource/UserPhoto/{stuInfo.IdentityCardNo}.jpg",
F_FolderId = stuInfo.Photo
};
annexEntity.Create();
this.BaseRepository("CollegeMIS").Update(stuInfo);
this.BaseRepository().Insert(annexEntity);
}

}
}
catch (Exception ex)


Carregando…
Cancelar
Guardar