diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserService.cs b/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserService.cs index 3ed0a7ba5..d5081d8ce 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Organization/User/UserService.cs @@ -176,6 +176,9 @@ namespace Learun.Application.Organization case "1": strSql.Append(" AND t.F_Description='学生' "); break; + case "2": + strSql.Append(" AND t.F_Description='家长' "); + break; } } if (!string.IsNullOrEmpty(keyword)) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoFresh/FormOfStudent.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoFresh/FormOfStudent.js index 0ba9c458a..f2cb40724 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoFresh/FormOfStudent.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuInfoFresh/FormOfStudent.js @@ -46,7 +46,7 @@ var bootstrap = function ($, learun) { label: '手机号码', name: 'Mobile', width: 100, align: 'left' , edit: { type: 'input', - + } }, { @@ -154,37 +154,46 @@ var bootstrap = function ($, learun) { if (!$('body').lrValidform()) { return false; } - + var flag = true; //家庭成员: var familyList = $('#StuInfoFreshFamily').jfGridGet('rowdatas'); $.each(familyList, function (i, item) { - //身份证号的验证 - if (!IsUserCard(item.IdCard)) {//身份证错误 - learun.alert.warning("家庭成员:" + item.Name + "的身份证号有误!"); + if (!item.Name) { + flag = false; + learun.alert.warning("家庭成员的姓名不可空!"); return false; } //手机号验证 if (!item.Mobile) { + flag = false; learun.alert.warning("家庭成员:" + item.Name + "的手机号不可空!"); return false; } - else if(!IsMobile){ + else if (!IsMobile(item.Mobile)) { + flag = false; learun.alert.warning("家庭成员:" + item.Name + "的手机号格式有误!"); 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(); } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/UserController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/UserController.cs index e56939f12..7d622a269 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/UserController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Controllers/UserController.cs @@ -29,7 +29,15 @@ namespace Learun.Application.Web.Areas.LR_OrganizationModule.Controllers #region 获取视图 - + /// + /// 家长用户管理 + /// + /// + [HttpGet] + public ActionResult FamilyIndex() + { + return View(); + } [HttpGet] public ActionResult StudentIndex() { @@ -90,7 +98,7 @@ namespace Learun.Application.Web.Areas.LR_OrganizationModule.Controllers /// 关键字 /// 公司主键 /// 部门主键 - /// 0 教师 1学生 + /// 0 教师 1学生 2家长 /// [HttpGet] [AjaxOnly] diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Views/User/FamilyIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Views/User/FamilyIndex.js index 2c0c93828..074876fd1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Views/User/FamilyIndex.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_OrganizationModule/Views/User/FamilyIndex.js @@ -319,7 +319,7 @@ var bootstrap = function ($, learun) { param = param || {}; param.companyId = companyId; param.departmentId = departmentId; - param.tp = "1"; + param.tp = "2"; $('#gridtable').jfGridSet('reload', param); } }; diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptBLL.cs index c31f74746..049eb7379 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptBLL.cs @@ -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 } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptIBLL.cs index 979da4bec..898a955ee 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptIBLL.cs @@ -55,5 +55,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration IEnumerable GetListBySchoolId(string schoolId); IEnumerable GetAllList(); + string GetSchoolIdByDeptNo(string deptno); } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptService.cs index 507cdd93a..ea57ec12f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/CdDept/CdDeptService.cs @@ -250,5 +250,35 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + + + /// + /// 获取ClassInfo表实体数据 + /// 班级名称 + /// + /// + 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); + } + } + } } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoFresh/StuInfoFreshService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoFresh/StuInfoFreshService.cs index 91d695149..563b85c12 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoFresh/StuInfoFreshService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoFresh/StuInfoFreshService.cs @@ -900,6 +900,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } db.Commit(); + + //家长生成账号 + GenerateAccoutForStuFamily(entity, stuInfoFreshFamilyList); } catch (Exception ex) { @@ -924,7 +927,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { UserRelationIBLL userRelationIBLL = new UserRelationBLL(); UserIBLL userIBLL = new UserBLL(); - ClassInfoIBLL classInfoIBLL = new ClassInfoBLL(); + CdDeptIBLL cdDeptIBLL = new CdDeptBLL(); try { var stuInfoBasicEntities = BaseRepository("CollegeMIS").FindList(m => m.CheckMark != "0"); @@ -940,13 +943,13 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration var studentList = new List(); 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; } - //获取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; UserEntity userbase = new UserEntity();