From 9aeccc474be8c2fa98d7024108aaac23ceb205ce Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Fri, 7 May 2021 16:28:47 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=B6=E9=95=BF=E8=B4=A6=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Views/StuInfoFresh/FormOfStudent.js | 36 ++++++++-- .../XmlConfig/system.config | 2 + .../StuInfoFresh/StuInfoFreshEntity.cs | 5 ++ .../StuInfoFresh/StuInfoFreshService.cs | 70 ++++++++++++++++++- 4 files changed, 106 insertions(+), 7 deletions(-) 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 fd0717a2b..0ba9c458a 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 @@ -25,7 +25,7 @@ var bootstrap = function ($, learun) { $("#HighTestSortNo").lrDataItemSelect({ code: 'GraduateCategory' }); $("#MatriculateSort").lrDataItemSelect({ code: 'EnrollStyle' }); $('#ResidenceNo').lrDataItemSelect({ code: 'ResidenceNo' }); - + //家庭成员(直系亲属) $('#StuInfoFreshFamily').jfGrid({ headData: [ { @@ -42,6 +42,13 @@ var bootstrap = function ($, learun) { code: 'FamilyRelation' } }, + { + label: '手机号码', name: 'Mobile', width: 100, align: 'left' + , edit: { + type: 'input', + + } + }, { label: '性别', name: 'Sex', width: 100, align: 'left' , edit: { @@ -53,7 +60,8 @@ var bootstrap = function ($, learun) { { label: '年龄', name: 'Age', width: 100, align: 'left' , edit: { - type: 'input' + type: 'input', + inputType: 'number', } }, { @@ -75,7 +83,7 @@ var bootstrap = function ($, learun) { isEditWithTip: true, height: 200 }); - + //紧急联系人 $('#StuInfoFreshEmergePeople').jfGrid({ headData: [ { @@ -147,13 +155,23 @@ var bootstrap = function ($, learun) { return false; } - //家庭成员:身份证号的验证 + //家庭成员: var familyList = $('#StuInfoFreshFamily').jfGridGet('rowdatas'); $.each(familyList, function (i, item) { + //身份证号的验证 if (!IsUserCard(item.IdCard)) {//身份证错误 learun.alert.warning("家庭成员:" + item.Name + "的身份证号有误!"); return false; } + //手机号验证 + if (!item.Mobile) { + learun.alert.warning("家庭成员:" + item.Name + "的手机号不可空!"); + return false; + } + else if(!IsMobile){ + learun.alert.warning("家庭成员:" + item.Name + "的手机号格式有误!"); + return false; + } }); var postData = {}; @@ -171,8 +189,14 @@ var bootstrap = function ($, learun) { 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) { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config b/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config index 689551bb5..c39d60519 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/system.config @@ -133,6 +133,8 @@ + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoFresh/StuInfoFreshEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoFresh/StuInfoFreshEntity.cs index b7a16a27b..bb33a915d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoFresh/StuInfoFreshEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoFresh/StuInfoFreshEntity.cs @@ -849,6 +849,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// [Column("IDCARD")] public string IdCard { get; set; } + /// + /// 手机号 + /// + [Column("MOBILE")] + public string Mobile { get; set; } #endregion #region 扩展操作 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 187bde2fb..cc3f9f557 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 @@ -160,7 +160,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } var data = this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp); - + return data; } catch (Exception ex) @@ -915,6 +915,74 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + private void GenerateAccoutForStuFamily(StuInfoFreshEntity entity, List stuInfoFreshFamilyList) + { + UserRelationIBLL userRelationIBLL = new UserRelationBLL(); + UserIBLL userIBLL = new UserBLL(); + try + { + var stuInfoBasicEntities = BaseRepository("CollegeMIS").FindList(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(x => x.IsEnabled == true); + if (Sys_DefaultPwdConfigEntity != null) + { + defaultpwd = Sys_DefaultPwdConfigEntity.Pwd; + } + var studentList = new List(); + 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(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); + } + } + } + /// /// 保存实体数据(新增、修改) /// 主键