@@ -176,6 +176,9 @@ namespace Learun.Application.Organization | |||||
case "1": | case "1": | ||||
strSql.Append(" AND t.F_Description='学生' "); | strSql.Append(" AND t.F_Description='学生' "); | ||||
break; | break; | ||||
case "2": | |||||
strSql.Append(" AND t.F_Description='家长' "); | |||||
break; | |||||
} | } | ||||
} | } | ||||
if (!string.IsNullOrEmpty(keyword)) | if (!string.IsNullOrEmpty(keyword)) | ||||
@@ -46,7 +46,7 @@ var bootstrap = function ($, learun) { | |||||
label: '手机号码', name: 'Mobile', width: 100, align: 'left' | label: '手机号码', name: 'Mobile', width: 100, align: 'left' | ||||
, edit: { | , edit: { | ||||
type: 'input', | type: 'input', | ||||
} | } | ||||
}, | }, | ||||
{ | { | ||||
@@ -154,37 +154,46 @@ var bootstrap = function ($, learun) { | |||||
if (!$('body').lrValidform()) { | if (!$('body').lrValidform()) { | ||||
return false; | return false; | ||||
} | } | ||||
var flag = true; | |||||
//家庭成员: | //家庭成员: | ||||
var familyList = $('#StuInfoFreshFamily').jfGridGet('rowdatas'); | var familyList = $('#StuInfoFreshFamily').jfGridGet('rowdatas'); | ||||
$.each(familyList, function (i, item) { | $.each(familyList, function (i, item) { | ||||
//身份证号的验证 | |||||
if (!IsUserCard(item.IdCard)) {//身份证错误 | |||||
learun.alert.warning("家庭成员:" + item.Name + "的身份证号有误!"); | |||||
if (!item.Name) { | |||||
flag = false; | |||||
learun.alert.warning("家庭成员的姓名不可空!"); | |||||
return false; | return false; | ||||
} | } | ||||
//手机号验证 | //手机号验证 | ||||
if (!item.Mobile) { | if (!item.Mobile) { | ||||
flag = false; | |||||
learun.alert.warning("家庭成员:" + item.Name + "的手机号不可空!"); | learun.alert.warning("家庭成员:" + item.Name + "的手机号不可空!"); | ||||
return false; | return false; | ||||
} | } | ||||
else if(!IsMobile){ | |||||
else if (!IsMobile(item.Mobile)) { | |||||
flag = false; | |||||
learun.alert.warning("家庭成员:" + item.Name + "的手机号格式有误!"); | learun.alert.warning("家庭成员:" + item.Name + "的手机号格式有误!"); | ||||
return false; | return false; | ||||
} | } | ||||
}); | |||||
var postData = {}; | |||||
postData.strEntity = JSON.stringify($('[data-table="StuInfoFresh"]').lrGetFormData()); | |||||
postData.strstuInfoFreshEmergePeopleList = JSON.stringify($('#StuInfoFreshEmergePeople').jfGridGet('rowdatas')); | |||||
postData.strstuInfoFreshFamilyList = JSON.stringify($('#StuInfoFreshFamily').jfGridGet('rowdatas')); | |||||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||||
// 保存成功后才回调 | |||||
if (!!callBack) { | |||||
callBack(); | |||||
//身份证号的验证 | |||||
if (!item.IdCard || !IsUserCard(item.IdCard)) {//身份证错误 | |||||
flag = false; | |||||
learun.alert.warning("家庭成员:" + item.Name + "的身份证号有误!"); | |||||
return false; | |||||
} | } | ||||
}); | }); | ||||
if (flag) { | |||||
var postData = {}; | |||||
postData.strEntity = JSON.stringify($('[data-table="StuInfoFresh"]').lrGetFormData()); | |||||
postData.strstuInfoFreshEmergePeopleList = JSON.stringify($('#StuInfoFreshEmergePeople').jfGridGet('rowdatas')); | |||||
postData.strstuInfoFreshFamilyList = JSON.stringify($('#StuInfoFreshFamily').jfGridGet('rowdatas')); | |||||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/SaveForm?keyValue=' + keyValue, postData, function (res) { | |||||
// 保存成功后才回调 | |||||
if (!!callBack) { | |||||
callBack(); | |||||
} | |||||
}); | |||||
} | |||||
}; | }; | ||||
page.init(); | page.init(); | ||||
} | } | ||||
@@ -29,7 +29,15 @@ namespace Learun.Application.Web.Areas.LR_OrganizationModule.Controllers | |||||
#region 获取视图 | #region 获取视图 | ||||
/// <summary> | |||||
/// 家长用户管理 | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[HttpGet] | |||||
public ActionResult FamilyIndex() | |||||
{ | |||||
return View(); | |||||
} | |||||
[HttpGet] | [HttpGet] | ||||
public ActionResult StudentIndex() | public ActionResult StudentIndex() | ||||
{ | { | ||||
@@ -90,7 +98,7 @@ namespace Learun.Application.Web.Areas.LR_OrganizationModule.Controllers | |||||
/// <param name="keyword">关键字</param> | /// <param name="keyword">关键字</param> | ||||
/// <param name="companyId">公司主键</param> | /// <param name="companyId">公司主键</param> | ||||
/// <param name="departmentId">部门主键</param> | /// <param name="departmentId">部门主键</param> | ||||
/// <param name="tp">0 教师 1学生</param> | |||||
/// <param name="tp">0 教师 1学生 2家长</param> | |||||
/// <returns></returns> | /// <returns></returns> | ||||
[HttpGet] | [HttpGet] | ||||
[AjaxOnly] | [AjaxOnly] | ||||
@@ -319,7 +319,7 @@ var bootstrap = function ($, learun) { | |||||
param = param || {}; | param = param || {}; | ||||
param.companyId = companyId; | param.companyId = companyId; | ||||
param.departmentId = departmentId; | param.departmentId = departmentId; | ||||
param.tp = "1"; | |||||
param.tp = "2"; | |||||
$('#gridtable').jfGridSet('reload', param); | $('#gridtable').jfGridSet('reload', param); | ||||
} | } | ||||
}; | }; | ||||
@@ -199,6 +199,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
public string GetSchoolIdByDeptNo(string deptno) | |||||
{ | |||||
try | |||||
{ | |||||
return cdDeptService.GetSchoolIdByDeptNo(deptno); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | #endregion | ||||
} | } | ||||
@@ -55,5 +55,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
IEnumerable<CdDeptEntity> GetListBySchoolId(string schoolId); | IEnumerable<CdDeptEntity> GetListBySchoolId(string schoolId); | ||||
IEnumerable<CdDeptEntity> GetAllList(); | IEnumerable<CdDeptEntity> GetAllList(); | ||||
string GetSchoolIdByDeptNo(string deptno); | |||||
} | } | ||||
} | } |
@@ -250,5 +250,35 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
} | } | ||||
/// <summary> | |||||
/// 获取ClassInfo表实体数据 | |||||
/// <param name="className">班级名称</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
public string GetSchoolIdByDeptNo(string deptno) | |||||
{ | |||||
try | |||||
{ | |||||
string sql = $@"select F_SchoolId from [dbo].[CdDept] where deptno='{deptno}'"; | |||||
var obj = this.BaseRepository("CollegeMIS").FindObject(sql); | |||||
if (obj == null) | |||||
return ""; | |||||
else | |||||
return obj.ToString(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
} | } | ||||
} | } |
@@ -900,6 +900,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
db.Commit(); | db.Commit(); | ||||
//家长生成账号 | |||||
GenerateAccoutForStuFamily(entity, stuInfoFreshFamilyList); | |||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||
{ | { | ||||
@@ -924,7 +927,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
{ | { | ||||
UserRelationIBLL userRelationIBLL = new UserRelationBLL(); | UserRelationIBLL userRelationIBLL = new UserRelationBLL(); | ||||
UserIBLL userIBLL = new UserBLL(); | UserIBLL userIBLL = new UserBLL(); | ||||
ClassInfoIBLL classInfoIBLL = new ClassInfoBLL(); | |||||
CdDeptIBLL cdDeptIBLL = new CdDeptBLL(); | |||||
try | try | ||||
{ | { | ||||
var stuInfoBasicEntities = BaseRepository("CollegeMIS").FindList<StuInfoBasicEntity>(m => m.CheckMark != "0"); | var stuInfoBasicEntities = BaseRepository("CollegeMIS").FindList<StuInfoBasicEntity>(m => m.CheckMark != "0"); | ||||
@@ -940,13 +943,13 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
var studentList = new List<UserEntity>(); | var studentList = new List<UserEntity>(); | ||||
foreach (var fEntity in stuInfoFreshFamilyList) | foreach (var fEntity in stuInfoFreshFamilyList) | ||||
{ | { | ||||
if (string.IsNullOrEmpty(fEntity.Mobile) && alluserlist.Count(m => m.F_Account == fEntity.Mobile) > 0) | |||||
if (string.IsNullOrEmpty(fEntity.Mobile) || alluserlist.Count(m => m.F_Account == fEntity.Mobile)>0) | |||||
{ | { | ||||
continue; | continue; | ||||
} | } | ||||
//获取schoolid ClassNo | |||||
var schoolid= classInfoIBLL.GetSchoolIdByClassNo(entity.ClassNo); | |||||
if(string.IsNullOrEmpty((schoolid))) | |||||
//获取schoolid DeptNo | |||||
var schoolid = cdDeptIBLL.GetSchoolIdByDeptNo(entity.DeptNo); | |||||
if (string.IsNullOrEmpty((schoolid))) | |||||
continue; | continue; | ||||
UserEntity userbase = new UserEntity(); | UserEntity userbase = new UserEntity(); | ||||