|
|
@@ -128,7 +128,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration |
|
|
|
} |
|
|
|
if (!queryParam["Admissions"].IsEmpty()) |
|
|
|
{ |
|
|
|
dp.Add("Admissions", queryParam["Admissions"].ToString() , DbType.String); |
|
|
|
dp.Add("Admissions", queryParam["Admissions"].ToString(), DbType.String); |
|
|
|
strSql.Append(" AND t.Admissions = @Admissions "); |
|
|
|
} |
|
|
|
if (!queryParam["DeptNo"].IsEmpty()) |
|
|
@@ -2048,8 +2048,82 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary> |
|
|
|
/// 生成账号 |
|
|
|
/// </summary> |
|
|
|
public void GenerateAccout() |
|
|
|
{ |
|
|
|
Base.AuthorizeModule.UserRelationIBLL userRelationIBLL = new Base.AuthorizeModule.UserRelationBLL(); |
|
|
|
UserIBLL userIBLL = new UserBLL(); |
|
|
|
ClassInfoIBLL classInfoIBLL = new ClassInfoBLL(); |
|
|
|
try |
|
|
|
{ |
|
|
|
var alluserlist = userIBLL.GetAllList().Where(m => m.F_Description == "学生"); |
|
|
|
//新生报到管理 |
|
|
|
var stuEnrolllist = BaseRepository("CollegeMIS").FindList<StuEnrollEntity>(m => m.Grade == "20" && m.IsReport == true); |
|
|
|
var roleId = Config.GetValue("GenerateStudentsRoleId"); |
|
|
|
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 tEntity in stuEnrolllist) |
|
|
|
{ |
|
|
|
if (alluserlist.Count(m => m.F_Account == tEntity.IDCard) > 0 || string.IsNullOrEmpty(tEntity.IDCard) || string.IsNullOrEmpty(tEntity.ClassNo)) |
|
|
|
{ |
|
|
|
continue; |
|
|
|
} |
|
|
|
//查询班级Id |
|
|
|
var schoolId = classInfoIBLL.GetSchoolIdByClassNo(tEntity.ClassNo); |
|
|
|
if (string.IsNullOrEmpty(schoolId)) |
|
|
|
continue; |
|
|
|
|
|
|
|
var annexesFileEntity = this.BaseRepository().FindEntity<AnnexesFileEntity>(a => a.F_FolderId == tEntity.Photo); |
|
|
|
var url = ""; |
|
|
|
if (annexesFileEntity != null) |
|
|
|
{ |
|
|
|
url = annexesFileEntity.F_FilePath; |
|
|
|
url = "/" + url.Substring(url.IndexOf("Resource")); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
UserEntity userbase = new UserEntity(); |
|
|
|
userbase.F_Account = tEntity.IDCard; |
|
|
|
userbase.F_RealName = tEntity.StuName; |
|
|
|
userbase.F_EnCode = tEntity.IDCard; |
|
|
|
userbase.F_Password = Md5Helper.Encrypt(defaultpwd, 32).ToLower(); |
|
|
|
userbase.F_HeadIcon = string.IsNullOrEmpty(url) ? Config.GetValue("defaultheadimg") : url; |
|
|
|
userbase.F_Gender = tEntity.Gender.HasValue ? Convert.ToInt32(tEntity.Gender.Value) : 1; |
|
|
|
userbase.F_DeleteMark = 0; |
|
|
|
userbase.F_EnabledMark = 1; |
|
|
|
userbase.F_Mobile = tEntity.FirstMobile; |
|
|
|
userbase.F_Description = "学生"; |
|
|
|
userbase.F_CompanyId = schoolId; |
|
|
|
userbase.F_DepartmentId = tEntity.DeptNo; |
|
|
|
userbase.F_IdentityCardNo = tEntity.IDCard; |
|
|
|
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); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
public void SyncDept() |
|
|
|
{ |
|
|
|