@@ -25,7 +25,7 @@ var bootstrap = function ($, learun) { | |||||
$("#HighTestSortNo").lrDataItemSelect({ code: 'GraduateCategory' }); | $("#HighTestSortNo").lrDataItemSelect({ code: 'GraduateCategory' }); | ||||
$("#MatriculateSort").lrDataItemSelect({ code: 'EnrollStyle' }); | $("#MatriculateSort").lrDataItemSelect({ code: 'EnrollStyle' }); | ||||
$('#ResidenceNo').lrDataItemSelect({ code: 'ResidenceNo' }); | $('#ResidenceNo').lrDataItemSelect({ code: 'ResidenceNo' }); | ||||
//家庭成员(直系亲属) | |||||
$('#StuInfoFreshFamily').jfGrid({ | $('#StuInfoFreshFamily').jfGrid({ | ||||
headData: [ | headData: [ | ||||
{ | { | ||||
@@ -42,6 +42,13 @@ var bootstrap = function ($, learun) { | |||||
code: 'FamilyRelation' | code: 'FamilyRelation' | ||||
} | } | ||||
}, | }, | ||||
{ | |||||
label: '手机号码', name: 'Mobile', width: 100, align: 'left' | |||||
, edit: { | |||||
type: 'input', | |||||
} | |||||
}, | |||||
{ | { | ||||
label: '性别', name: 'Sex', width: 100, align: 'left' | label: '性别', name: 'Sex', width: 100, align: 'left' | ||||
, edit: { | , edit: { | ||||
@@ -53,7 +60,8 @@ var bootstrap = function ($, learun) { | |||||
{ | { | ||||
label: '年龄', name: 'Age', width: 100, align: 'left' | label: '年龄', name: 'Age', width: 100, align: 'left' | ||||
, edit: { | , edit: { | ||||
type: 'input' | |||||
type: 'input', | |||||
inputType: 'number', | |||||
} | } | ||||
}, | }, | ||||
{ | { | ||||
@@ -75,7 +83,7 @@ var bootstrap = function ($, learun) { | |||||
isEditWithTip: true, | isEditWithTip: true, | ||||
height: 200 | height: 200 | ||||
}); | }); | ||||
//紧急联系人 | |||||
$('#StuInfoFreshEmergePeople').jfGrid({ | $('#StuInfoFreshEmergePeople').jfGrid({ | ||||
headData: [ | headData: [ | ||||
{ | { | ||||
@@ -147,13 +155,23 @@ var bootstrap = function ($, learun) { | |||||
return false; | return false; | ||||
} | } | ||||
//家庭成员:身份证号的验证 | |||||
//家庭成员: | |||||
var familyList = $('#StuInfoFreshFamily').jfGridGet('rowdatas'); | var familyList = $('#StuInfoFreshFamily').jfGridGet('rowdatas'); | ||||
$.each(familyList, function (i, item) { | $.each(familyList, function (i, item) { | ||||
//身份证号的验证 | |||||
if (!IsUserCard(item.IdCard)) {//身份证错误 | if (!IsUserCard(item.IdCard)) {//身份证错误 | ||||
learun.alert.warning("家庭成员:" + item.Name + "的身份证号有误!"); | learun.alert.warning("家庭成员:" + item.Name + "的身份证号有误!"); | ||||
return false; | return false; | ||||
} | } | ||||
//手机号验证 | |||||
if (!item.Mobile) { | |||||
learun.alert.warning("家庭成员:" + item.Name + "的手机号不可空!"); | |||||
return false; | |||||
} | |||||
else if(!IsMobile){ | |||||
learun.alert.warning("家庭成员:" + item.Name + "的手机号格式有误!"); | |||||
return false; | |||||
} | |||||
}); | }); | ||||
var postData = {}; | var postData = {}; | ||||
@@ -171,8 +189,14 @@ var bootstrap = function ($, learun) { | |||||
page.init(); | page.init(); | ||||
} | } | ||||
//验证手机号 | |||||
function IsMobile(mobile) { | |||||
var reg = /^((\(\d{2,3}\))|(\d{3}\-))?1\d{10}$/; | |||||
if (!reg.test(mobile)) { | |||||
return false; | |||||
} | |||||
return true; | |||||
} | |||||
// 验证身份证 | // 验证身份证 | ||||
function IsUserCard(idNo) { | function IsUserCard(idNo) { | ||||
@@ -133,6 +133,8 @@ | |||||
<add key="kaoshisystemurl" value="http://ks.bjquanjiang.com/RereClientConnector" /> | <add key="kaoshisystemurl" value="http://ks.bjquanjiang.com/RereClientConnector" /> | ||||
<!--批量生成学生帐号时默认的角色Id--> | <!--批量生成学生帐号时默认的角色Id--> | ||||
<add key="GenerateStudentsRoleId" value="0cfc388c-80e6-4cf0-b53b-02201827490a" /> | <add key="GenerateStudentsRoleId" value="0cfc388c-80e6-4cf0-b53b-02201827490a" /> | ||||
<!--批量生成家长帐号时默认的角色Id--> | |||||
<add key="GenerateParentsRoleId" value="" /> | |||||
<!--批量生成教师帐号时默认的角色Id--> | <!--批量生成教师帐号时默认的角色Id--> | ||||
<add key="GenerateTeachersRoleId" value="e1702746-185a-4480-8f19-3892066555cf" /> | <add key="GenerateTeachersRoleId" value="e1702746-185a-4480-8f19-3892066555cf" /> | ||||
<add key="QingJuurl" value="http://xy.bjquanjiang.com/Student/LoginForSSOHandler.ashx" /> | <add key="QingJuurl" value="http://xy.bjquanjiang.com/Student/LoginForSSOHandler.ashx" /> | ||||
@@ -849,6 +849,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
/// </summary> | /// </summary> | ||||
[Column("IDCARD")] | [Column("IDCARD")] | ||||
public string IdCard { get; set; } | public string IdCard { get; set; } | ||||
/// <summary> | |||||
/// 手机号 | |||||
/// </summary> | |||||
[Column("MOBILE")] | |||||
public string Mobile { get; set; } | |||||
#endregion | #endregion | ||||
#region 扩展操作 | #region 扩展操作 | ||||
@@ -160,7 +160,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
var data = this.BaseRepository("CollegeMIS").FindList<StuInfoFreshEntity>(strSql.ToString(), dp); | var data = this.BaseRepository("CollegeMIS").FindList<StuInfoFreshEntity>(strSql.ToString(), dp); | ||||
return data; | return data; | ||||
} | } | ||||
catch (Exception ex) | 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> | /// <summary> | ||||
/// 保存实体数据(新增、修改) | /// 保存实体数据(新增、修改) | ||||
/// <param name="keyValue">主键</param> | /// <param name="keyValue">主键</param> | ||||