From 0e932631733c21e7de230393cad777d7089ec943 Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Mon, 10 May 2021 18:12:44 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=B6=E5=BA=AD=E6=88=90=E5=91=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Learun.Application.Web.csproj | 10 ---- .../ClassInfo/ClassInfoBLL.cs | 24 +++++++++ .../ClassInfo/ClassInfoIBLL.cs | 7 +++ .../ClassInfo/ClassInfoService.cs | 29 +++++++++++ .../StuInfoFresh/StuInfoFreshService.cs | 50 ++++++++++--------- 5 files changed, 86 insertions(+), 34 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj index 7f8a8e17a..c7404e952 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj @@ -472,15 +472,7 @@ - - - - - - - - @@ -681,8 +673,6 @@ - - diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoBLL.cs index d23fd75a4..c1e38d488 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoBLL.cs @@ -132,6 +132,30 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 获取学校Id + /// 班级编号 + /// + /// + public string GetSchoolIdByClassNo(string classNo) + { + try + { + return classInfoService.GetSchoolIdByClassNo(classNo); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + #endregion #region 提交数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoIBLL.cs index d6972f2bf..5b379cca2 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoIBLL.cs @@ -40,6 +40,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// /// ClassInfoEntity GetClassInfoEntityByClassName(string className); + #endregion #region 提交数据 @@ -62,5 +63,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration IEnumerable GetAllClass(); IEnumerable GetClassByMajorNo(string majorNo); + /// + /// 根据班级编号获取学校Id + /// + /// + /// + string GetSchoolIdByClassNo(string classNo); } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoService.cs index 1075e48cd..0762bacdd 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassInfo/ClassInfoService.cs @@ -175,6 +175,35 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 获取ClassInfo表实体数据 + /// 班级名称 + /// + /// + public string GetSchoolIdByClassNo(string classNo) + { + try + { + string sql = $@"select F_SchoolId from [dbo].[CdDept] where deptno=( + select deptno from[dbo].[ClassInfo] where classno = '{classNo}')"; + 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); + } + } + } #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 cc3f9f557..91d695149 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 @@ -915,10 +915,16 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 家长生成账号 + /// + /// + /// private void GenerateAccoutForStuFamily(StuInfoFreshEntity entity, List stuInfoFreshFamilyList) { UserRelationIBLL userRelationIBLL = new UserRelationBLL(); UserIBLL userIBLL = new UserBLL(); + ClassInfoIBLL classInfoIBLL = new ClassInfoBLL(); try { var stuInfoBasicEntities = BaseRepository("CollegeMIS").FindList(m => m.CheckMark != "0"); @@ -939,30 +945,26 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration 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); + var schoolid= classInfoIBLL.GetSchoolIdByClassNo(entity.ClassNo); + if(string.IsNullOrEmpty((schoolid))) + continue; + + 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 = Config.GetValue("defaultheadimg"); + 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 = schoolid; + userbase.F_DepartmentId = entity.DeptNo; + userbase.F_IdentityCardNo = fEntity.IdCard; + userIBLL.SaveEntity(null, userbase); + studentList.Add(userbase); } if (studentList.Any()) {