Explorar el Código

Merge branch '西昌分支' of http://123.57.209.16:3000/bjquanjiang/DigitalScholl into 西昌分支

西昌缴费二期
edy hace 3 años
padre
commit
948340b248
Se han modificado 2 ficheros con 46 adiciones y 29 borrados
  1. +2
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/EmpInfo/Index.cshtml
  2. +44
    -27
      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/EmpInfo/Index.cshtml Ver fichero

@@ -93,9 +93,9 @@
<a id="lr_editDept" class="btn btn-default"><i class="fa fa-pencil-square-o"></i>&nbsp;修改部门、系部</a>
<a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i>&nbsp;打印</a>
</div>
<div class=" btn-group btn-group-sm" learun-authorize="no">
@*<div class=" btn-group btn-group-sm" learun-authorize="no">
<a id="lr_import" class="btn btn-default"><i class="fa fa-print"></i>&nbsp;导入</a>
</div>
</div>*@
</div>
</div>
<div class="lr-layout-body" id="gridtable"></div>


+ 44
- 27
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicService.cs Ver fichero

@@ -396,57 +396,74 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
public void SynPhoto()
{
var logpath = @"D:\新版数字化校园\Publish\log";
try
{
var stuList = this.BaseRepository("CollegeMIS").FindList<StuInfoBasicEntity>()
var stuList = this.BaseRepository("CollegeMIS").FindList<StuInfoBasicEntity>(x => x.Grade == "21")
.ToList();
var url = AppDomain.CurrentDomain.BaseDirectory;
System.IO.File.AppendAllText(logpath, "同步照片\r\n");
var num = 0;
foreach (var stuInfo in stuList)
{
//照片不为空
if (!string.IsNullOrEmpty(stuInfo.Photo))
var F_FileName = stuInfo.ksh + ".jpg";
var F_FilePath = $"{url}/Resource/UserPhoto/KSZP/{F_FileName}";
//判断文件是否存在
if (System.IO.File.Exists(F_FilePath))
{
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 = F_FileName,
F_FilePath = F_FilePath,
F_FolderId = stuInfo.Photo
};
this.BaseRepository().Insert(annexEntity);

}
else
{
annex.F_FileName = F_FileName;
annex.F_FilePath = F_FilePath;
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_FileName = F_FileName,
F_FilePath = F_FilePath,
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);
}

num++;
}
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);
System.IO.File.AppendAllText(logpath, F_FilePath + "学生:" + stuInfo.StuName + "文件不存在" + "\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;


Cargando…
Cancelar
Guardar