|
|
@@ -160,7 +160,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration |
|
|
|
} |
|
|
|
|
|
|
|
var data = this.BaseRepository("CollegeMIS").FindList<StuInfoFreshEntity>(strSql.ToString(), dp); |
|
|
|
|
|
|
|
|
|
|
|
return data; |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
@@ -915,6 +915,74 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private void GenerateAccoutForStuFamily(StuInfoFreshEntity entity, List<StuInfoFreshFamilyEntity> stuInfoFreshFamilyList) |
|
|
|
{ |
|
|
|
UserRelationIBLL userRelationIBLL = new UserRelationBLL(); |
|
|
|
UserIBLL userIBLL = new UserBLL(); |
|
|
|
try |
|
|
|
{ |
|
|
|
var stuInfoBasicEntities = BaseRepository("CollegeMIS").FindList<StuInfoBasicEntity>(m => m.CheckMark != "0"); |
|
|
|
var alluserlist = userIBLL.GetAllList().Where(m => m.F_Description == "家长"); |
|
|
|
var roleId = Config.GetValue("GenerateParentsRoleId"); |
|
|
|
var defaultpwd = Config.GetValue("defaultpwd"); |
|
|
|
//读取默认密码配置中已启用的密码 |
|
|
|
var Sys_DefaultPwdConfigEntity = this.BaseRepository().FindEntity<Sys_DefaultPwdConfigEntity>(x => x.IsEnabled == true); |
|
|
|
if (Sys_DefaultPwdConfigEntity != null) |
|
|
|
{ |
|
|
|
defaultpwd = Sys_DefaultPwdConfigEntity.Pwd; |
|
|
|
} |
|
|
|
var studentList = new List<UserEntity>(); |
|
|
|
foreach (var fEntity in stuInfoFreshFamilyList) |
|
|
|
{ |
|
|
|
if (string.IsNullOrEmpty(fEntity.Mobile) && alluserlist.Count(m => m.F_Account == fEntity.Mobile) > 0) |
|
|
|
{ |
|
|
|
continue; |
|
|
|
} |
|
|
|
//获取schoolid ClassNo |
|
|
|
//var annexesFileEntity = this.BaseRepository().FindEntity<AnnexesFileEntity>(a => a.F_FolderId == fEntity.Photo); |
|
|
|
//var url = ""; |
|
|
|
//if (annexesFileEntity != null) |
|
|
|
//{ |
|
|
|
// url = annexesFileEntity.F_FilePath; |
|
|
|
// url = "/" + url.Substring(url.IndexOf("Resource")); |
|
|
|
//} |
|
|
|
|
|
|
|
//UserEntity userbase = new UserEntity(); |
|
|
|
//userbase.F_Account = fEntity.Mobile; |
|
|
|
//userbase.F_RealName = fEntity.Name; |
|
|
|
//userbase.F_EnCode = fEntity.Mobile; |
|
|
|
//userbase.F_Password = Md5Helper.Encrypt(defaultpwd, 32).ToLower(); |
|
|
|
//userbase.F_HeadIcon = string.IsNullOrEmpty(url) ? Config.GetValue("defaultheadimg") : url; |
|
|
|
//userbase.F_Gender = !string.IsNullOrEmpty(fEntity.Sex) ? Convert.ToInt32(fEntity.Sex) : 1; |
|
|
|
//userbase.F_DeleteMark = 0; |
|
|
|
//userbase.F_EnabledMark = 1; |
|
|
|
//userbase.F_Mobile = fEntity.Mobile; |
|
|
|
//userbase.F_Description = "家长"; |
|
|
|
//userbase.F_CompanyId = entity.com; |
|
|
|
//userbase.F_DepartmentId = entity.DeptNo; |
|
|
|
//userbase.F_IdentityCardNo = fEntity.IdentityCardNo; |
|
|
|
//userIBLL.SaveEntity(null, userbase); |
|
|
|
//studentList.Add(userbase); |
|
|
|
} |
|
|
|
if (studentList.Any()) |
|
|
|
{ |
|
|
|
string s = studentList.Select(m => m.F_UserId).Aggregate((current, userEntity) => current + "," + userEntity); |
|
|
|
userRelationIBLL.SaveEntityList2(roleId, 1, s); |
|
|
|
} |
|
|
|
} |
|
|
|
catch (Exception ex) |
|
|
|
{ |
|
|
|
if (ex is ExceptionEx) |
|
|
|
{ |
|
|
|
throw; |
|
|
|
} |
|
|
|
else |
|
|
|
{ |
|
|
|
throw ExceptionEx.ThrowServiceException(ex); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// 保存实体数据(新增、修改) |
|
|
|
/// <param name="keyValue">主键</param> |
|
|
|