diff --git a/Learun.Framework.Ultimate V7/Doc文档/数字化智慧校园基础信息接口V1.0.docx b/Learun.Framework.Ultimate V7/Doc文档/数字化智慧校园基础信息接口V1.0.docx index e90f0903d..8d7eaece8 100644 --- a/Learun.Framework.Ultimate V7/Doc文档/数字化智慧校园基础信息接口V1.0.docx +++ b/Learun.Framework.Ultimate V7/Doc文档/数字化智慧校园基础信息接口V1.0.docx @@ -423,4 +423,42 @@ LessonTime 16:20-17:05,17:15-18:00 两节课的时间 +根据身份证号更新照片接口 +标准http post请求 +地址: +http://部署地址/EducationalAdministration/EmpRegister/updatePhotoByIdCard +所需参数:(限制一次最多传值50条) + +参数名称 +值 +备注 +IdCard + +身份证号 +PhotoUrl + +照片地址 +IdentityFlag +1、2 +身份标识(1老师,2学生) + +主要业务数据 其余字段可忽略 + 属性 + 返回值 + 备注 + 可否为空 +IdCard + +身份证号 + +OperateFlag +true , false +操作标识(true更新成功,false更新失败) + +FailMsg + +更新失败原因 + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanTeachController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanTeachController.cs index a1c563d14..192479ee4 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanTeachController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanTeachController.cs @@ -22,7 +22,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers private TeachClassIBLL teachClassIBLL = new TeachClassBLL(); private StuSelectLessonListIBLL StuSelectLesson = new StuSelectLessonListBLL(); private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL(); - + private StuScoreIBLL stuScoreIBLL = new StuScoreBLL(); #region 视图功能 /// @@ -70,6 +70,14 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { Pagination paginationobj = pagination.ToObject(); var data = teachClassIBLL.GetPageList(paginationobj, queryJson); + var studata = stuInfoBasicIBLL.GetAllList(); + foreach (var item in data) + { + item.StuNum = studata.Where(o => + o.DeptNo == item.DeptNo && o.MajorNo == item.MajorNo + && o.ClassNo == item.TeachClassNo && o.Grade == item.Grade + ).Count(); + } var jsonData = new { rows = data, @@ -199,80 +207,14 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers } public ActionResult QzSetTeach(string keyValue, string EmpNo) { - var entityList = teachClassIBLL.GetTeachListById(keyValue); - string Nid = ""; - if (entityList.Count > 0) + var entityList = teachClassIBLL.GetTeachListById(keyValue).ToList(); + foreach (var item in entityList) { - for (int i = 0; i < entityList.Count; i++) - { - List ssList = StuSelectLesson.GetAllList().Where( - y => y.DeptNo == entityList[i].DeptNo - && y.MajorNo == entityList[i].MajorNo - && y.F_SchoolId == entityList[i].F_SchoolId - && y.ClassNo == entityList[i].TeachClassNo - && y.LessonNo == entityList[i].LessonNo - && y.CheckMark == "1" - ).Select(x => x.SelectId.ToString()).ToList(); - Nid += string.Join(",", ssList) + ","; - } - } - - Nid = Nid.TrimEnd(','); - StuSelectLesson.DeleteEntity(Nid); - - List TeachList = new List(); - for (int i = 0; i < entityList.Count; i++) - { - var stuDataList = stuInfoBasicIBLL.GetAllList().Where(s => s.DeptNo == entityList[i].DeptNo - && s.MajorNo == entityList[i].MajorNo && s.F_SchoolId == entityList[i].F_SchoolId - && s.ClassNo == entityList[i].TeachClassNo - ).ToList(); - if (stuDataList.Count > 0) - { - for (int j = 0; j < stuDataList.Count; j++) - { - StuSelectLessonListEntity TeachEntity = new StuSelectLessonListEntity(); - TeachEntity.StuNo = stuDataList[j].StuNo; - TeachEntity.DeptNo = entityList[i].DeptNo; - TeachEntity.MajorNo = entityList[i].MajorNo; - TeachEntity.ClassNo = stuDataList[j].ClassNo; - TeachEntity.MajorDetailNo = entityList[i].MajorDetailNo; - TeachEntity.MajorDetailName = entityList[i].MajorDetailName; - TeachEntity.StuName = stuDataList[j].StuName; - TeachEntity.GenderNo = stuDataList[j].GenderNo == true ? "0" : "1"; - TeachEntity.AcademicYearNo = entityList[i].AcademicYearNo; - TeachEntity.Semester = entityList[i].Semester; - TeachEntity.OpenLessonDeptNo = entityList[i].DeptNo; - TeachEntity.OpenLessonMajorNo = entityList[i].MajorNo; - TeachEntity.LessonNo = entityList[i].LessonNo; - TeachEntity.PartCode = entityList[i].PartCode; - TeachEntity.OrdinaryScoreScale = 0; - TeachEntity.TermInScoreScale = 0; - TeachEntity.TermEndScoreScale = 0; - TeachEntity.OtherScoreScale = 0; - TeachEntity.TeachClassNo = entityList[i].TeachClassNo; - TeachEntity.LessonSortNo = entityList[i].LessonSortNo; - TeachEntity.StuSortNo = entityList[i].LessonSortNo; - TeachEntity.Grade = entityList[i].Grade; - TeachEntity.StudyScore = 2; - TeachEntity.TotalStudyHour = 2; - TeachEntity.IsInEffect = "1"; - TeachEntity.IsPitchOn = "1"; - TeachEntity.F_SchoolId = entityList[i].F_SchoolId; - TeachEntity.InsertTime = DateTime.Now; - TeachList.Add(TeachEntity); - } - } - else - { - return Fail("设置失败,未发现相关学生!"); - } + teachClassIBLL.UpEmpNos(item.AcademicYearNo, item.Semester, item.TeachClassNo, item.LessonNo, EmpNo, item.EmpNo,item.Grade); + stuScoreIBLL.UpEmpNos(item.AcademicYearNo, item.Semester, item.TeachClassNo, item.LessonNo, EmpNo, item.EmpNo, item.Grade); } - StuSelectLesson.SaveEntityList(TeachList); - teachClassIBLL.UpEmpNo(keyValue, EmpNo); //更改当前教师 - return Success("设置成功!"); } #endregion diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.js index 3ec306776..9c578defe 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.js @@ -185,12 +185,12 @@ var bootstrap = function ($, learun) { } }, { - label: "专业", name: "MajorNo", width: 100, align: "left", + label: "专业", name: "MajorNo", width: 200, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', key: value, - keyId: 'id', + keyId: 'majorno', callback: function (_data) { callback(_data['majorname']); } @@ -198,8 +198,9 @@ var bootstrap = function ($, learun) { } }, { label: "年级", name: "Grade", width: 50, align: "left" }, + { label: "课程编码", name: "LessonNo", width: 200, align: "left" }, { - label: "课程", name: "LessonNo", width: 200, align: "left", + label: "课程名称", name: "LessonNo", width: 200, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo', @@ -213,9 +214,20 @@ var bootstrap = function ($, learun) { }, { label: "人数", name: "StuNum", width: 80, align: "left" }, { label: "上机课时", name: "PracticeHour", width: 80, align: "left" }, - { label: "课程区别码", name: "PartCode", width: 80, align: "left" }, { label: "班级编号", name: "TeachClassNo", width: 80, align: "left" }, - { label: "班级名称", name: "TeachClassName", width: 80, align: "left" }, + { + label: "班级名称", name: "TeachClassNo", width: 80, align: "left" , + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', + key: value, + keyId: 'classno', + callback: function (_data) { + callback(_data['classname']); + } + }); + } + }, { label: "教师", name: "EmpNo", width: 80, align: "left", formatterAsync: function (callback, value, row, op, $cell) { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/EmpInfoApi.cs b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/EmpInfoApi.cs index 9ea62af54..f6ce342f3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/EmpInfoApi.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/EmpInfoApi.cs @@ -6,6 +6,8 @@ using static Learun.Application.WebApi.Modules.StuInfoFreshApi; using System; using System.IO; using Learun.Application.Base.SystemModule; +using System.Net; +using System.Linq; namespace Learun.Application.WebApi { @@ -22,6 +24,7 @@ namespace Learun.Application.WebApi private EmpInfoIBLL empInfoIBLL = new EmpInfoBLL(); private AnnexesFileIBLL annexesFileIBLL = new AnnexesFileBLL(); private TeachSwitchIBLL teachSwitchIBLL = new TeachSwitchBLL(); + private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL(); /// /// 注册接口 @@ -38,6 +41,8 @@ namespace Learun.Application.WebApi Post["/savePhoto"] = GetSavePhoto; Get["/registerbutton"] = RegisterButton; Post["/signon"] = Signon; + //根据身份证号更新学生和老师的照片 + Post["/updatePhotoByIdCard"] = UpdatePhotoByIdCard; } private Response Signon(dynamic _) @@ -190,6 +195,173 @@ namespace Learun.Application.WebApi empInfoIBLL.SaveEntity(this.userInfo, parameter.keyValue, entity); return Success("保存成功!"); } + + + /// + /// 根据身份证号更新学生和老师的照片 + /// + /// + /// + private Response UpdatePhotoByIdCard(dynamic _) + { + //传参 + var requestModels = this.GetReq>(); + //回参 + var responseModels = new List(); + //限制每次最多传值50条 + if (requestModels.Count() > 50) + { + return Fail("限制每次最多传值50条"); + } + //图片保存的文件夹地址 + string FileEextension = ".png"; + string directoryPathOfEmp = string.Format("{0}/{1}/{2}", Config.GetValue("AnnexesFile"), "ApiOfUpdatePhotoByIdCard", "Teacher"); + string directoryPathOfStu = string.Format("{0}/{1}/{2}", Config.GetValue("AnnexesFile"), "ApiOfUpdatePhotoByIdCard", "Student"); + if (!Directory.Exists(directoryPathOfEmp)) + { + Directory.CreateDirectory(directoryPathOfEmp); + }; + if (!Directory.Exists(directoryPathOfStu)) + { + Directory.CreateDirectory(directoryPathOfStu); + }; + //循环处理 + foreach (var item in requestModels) + { + if (item.IdentityFlag == 1)//老师 + { + var entity = empInfoIBLL.GetEmpInfoEntityByIdCard(item.IdCard); + if (entity == null) + { + var pmodel = new ResponseModel() + { + IdCard=item.IdCard, + OperateFlag=false, + FailMsg="该身份证号的教师信息不存在!" + }; + responseModels.Add(pmodel); + } + else + { + //图片地址 + var imgPath = string.Format("{0}/{1}{2}", directoryPathOfEmp, item.IdCard, FileEextension); + if (!System.IO.File.Exists(imgPath)) + { + //下载图片到本地 + WebClient my = new WebClient(); + byte[] mybyte = my.DownloadData(item.PhotoUrl); + FileInfo file = new FileInfo(imgPath); + FileStream fs = file.Create(); + fs.Write(mybyte, 0, mybyte.Length); + fs.Close(); + //图片地址保存到LR_Base_AnnexesFile表中 + var folderId = Guid.NewGuid().ToString(); + AnnexesFileEntity fileAnnexesEntity = new AnnexesFileEntity(); + fileAnnexesEntity.F_Id = Guid.NewGuid().ToString(); + fileAnnexesEntity.F_FileName =string.Format("{0}{1}",item.IdCard,FileEextension); + fileAnnexesEntity.F_FilePath = imgPath; + fileAnnexesEntity.F_FileSize = mybyte.Length.ToString(); + fileAnnexesEntity.F_FileExtensions = FileEextension; + fileAnnexesEntity.F_FileType = FileEextension.Replace(".", ""); + annexesFileIBLL.SaveEntity(folderId, fileAnnexesEntity); + //更新EmpInfo表照片字段 + entity.Photo = folderId; + empInfoIBLL.SaveEntity(entity.EmpId, entity); + //回参 + var pmodel = new ResponseModel() + { + IdCard = item.IdCard, + OperateFlag = true + }; + responseModels.Add(pmodel); + } + else + { + var pmodel = new ResponseModel() + { + IdCard = item.IdCard, + OperateFlag = false, + FailMsg = "该身份证号的图片已存在!" + }; + responseModels.Add(pmodel); + } + } + } + else if(item.IdentityFlag == 2)//学生 + { + var entity = stuInfoBasicIBLL.GetStuInfoBasicEntityByIdCard(item.IdCard); + if (entity == null) + { + var pmodel = new ResponseModel() + { + IdCard = item.IdCard, + OperateFlag = false, + FailMsg = "该身份证号的学生信息不存在!" + }; + responseModels.Add(pmodel); + } + else + { + //图片地址 + var imgPath = string.Format("{0}/{1}{2}", directoryPathOfStu, item.IdCard, FileEextension); + if (!System.IO.File.Exists(imgPath)) + { + //下载图片到本地 + WebClient my = new WebClient(); + byte[] mybyte = my.DownloadData(item.PhotoUrl); + FileInfo file = new FileInfo(imgPath); + FileStream fs = file.Create(); + fs.Write(mybyte, 0, mybyte.Length); + fs.Close(); + //图片地址保存到LR_Base_AnnexesFile表中 + var folderId = Guid.NewGuid().ToString(); + AnnexesFileEntity fileAnnexesEntity = new AnnexesFileEntity(); + fileAnnexesEntity.F_Id = Guid.NewGuid().ToString(); + fileAnnexesEntity.F_FileName = string.Format("{0}{1}", item.IdCard, FileEextension); + fileAnnexesEntity.F_FilePath = imgPath; + fileAnnexesEntity.F_FileSize = mybyte.Length.ToString(); + fileAnnexesEntity.F_FileExtensions = FileEextension; + fileAnnexesEntity.F_FileType = FileEextension.Replace(".", ""); + annexesFileIBLL.SaveEntity(folderId, fileAnnexesEntity); + //更新StuInfoBasic表照片字段 + entity.Photo = folderId; + stuInfoBasicIBLL.SaveEntity(entity.StuId, entity); + //回参 + var pmodel = new ResponseModel() + { + IdCard = item.IdCard, + OperateFlag = true + }; + responseModels.Add(pmodel); + } + else + { + var pmodel = new ResponseModel() + { + IdCard = item.IdCard, + OperateFlag = false, + FailMsg = "该身份证号的图片已存在!" + }; + responseModels.Add(pmodel); + } + } + } + else + { + var pmodel = new ResponseModel() + { + IdCard = item.IdCard, + OperateFlag = false, + FailMsg = "身份标识不存在!" + }; + responseModels.Add(pmodel); + } + } + + return Success(responseModels); + + } + #endregion #region 私有类 @@ -202,6 +374,43 @@ namespace Learun.Application.WebApi public string keyValue { get; set; } public string strEntity { get; set; } } + /// + /// 更新照片传参 + /// + private class RequestModel + { + /// + /// 身份证号 + /// + public string IdCard { get; set; } + /// + /// 照片地址 + /// + public string PhotoUrl { get; set; } + /// + /// 身份标识(1老师,2学生) + /// + public int IdentityFlag { get; set; } + + } + /// + /// 更新照片回参 + /// + private class ResponseModel + { + /// + /// 身份证号 + /// + public string IdCard { get; set; } + /// + /// 操作标识(true更新成功,false更新失败) + /// + public bool OperateFlag { get; set; } + /// + /// 更新失败原因 + /// + public string FailMsg { get; set; } + } #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoBLL.cs index d7cc9ca4c..f3ba14d90 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoBLL.cs @@ -144,6 +144,26 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + + public EmpInfoEntity GetEmpInfoEntityByIdCard(string idcard) + { + try + { + return empInfoService.GetEmpInfoEntityByIdCard(idcard); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// /// 教师年龄比例 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoIBLL.cs index f3d04be4c..ae1ce460e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoIBLL.cs @@ -39,6 +39,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration IEnumerable GetList(string queryJson); IEnumerable GetEmpInfoEntitiesByName(string name); + EmpInfoEntity GetEmpInfoEntityByIdCard(string idcard); + /// /// 教师年龄比例 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoService.cs index 0e1492ada..8154e36cd 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoService.cs @@ -349,6 +349,26 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + + public EmpInfoEntity GetEmpInfoEntityByIdCard(string idcard) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(m => m.IdentityCardNo == idcard); + } + 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/StuInfoBasic/StuInfoBasicBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicBLL.cs index 4572c22fd..ac49b9ca6 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicBLL.cs @@ -249,8 +249,26 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } - - + + public StuInfoBasicEntity GetStuInfoBasicEntityByIdCard(string idcard) + { + try + { + return stuInfoBasicService.GetStuInfoBasicEntityByIdCard(idcard); + } + 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/StuInfoBasic/StuInfoBasicIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicIBLL.cs index 739525f51..49686ff18 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicIBLL.cs @@ -41,6 +41,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// /// List GetTree(); + + StuInfoBasicEntity GetStuInfoBasicEntityByIdCard(string idcard); #endregion #region 提交数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicService.cs index 4572e4bcc..b8678945e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuInfoBasic/StuInfoBasicService.cs @@ -374,6 +374,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + public StuInfoBasicEntity GetStuInfoBasicEntityByIdCard(string idcard) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(a => a.IdentityCardNo == idcard); + } + 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/StuScore/StuScoreBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreBLL.cs index f311eb7a9..cf4e029e4 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreBLL.cs @@ -334,6 +334,29 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + public void UpEmpNos(string xn, string xq, string classNo, string LessonNo, string EmpNo, string HisEmpNo,string Grade) + { + try + { + stuScoreService.UpEmpNos(xn, xq, classNo, LessonNo, EmpNo, HisEmpNo,Grade); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } /// /// 获取一次补考名单数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreIBLL.cs index 7e987896c..453da19a7 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreIBLL.cs @@ -195,6 +195,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// IEnumerable GetAllScoreListByStuNo(string stuNo); object GetScoreCharts(string academicYearNo, string semester, string classNo, string lessonNo); + void UpEmpNos(string xn, string xq, string classNo, string LessonNo, string EmpNo, string HisEmpNo, string Grade); /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs index f61e58ed3..7b0921985 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs @@ -493,6 +493,31 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + public void UpEmpNos(string xn, string xq, string classNo, string LessonNo, string EmpNo, string hisempno, string Grade) + { + try + { + StringBuilder sb = new StringBuilder(); + sb.Append(" update StuScore set EmpNo ='" + EmpNo + "' where classno = '" + classNo + "' and Semester ='" + xq + "' and AcademicYearNo ='" + xn + "' and LessonNo ='" + LessonNo + "' and empno = '" + hisempno + "' and Grade='" + Grade + "' "); + this.BaseRepository("CollegeMIS").ExecuteBySql(sb.ToString()); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } #endregion private static HttpClient Client; @@ -1929,17 +1954,17 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad strSql.Append(" left join ClassInfo ci on bb.ClassNo= ci.ClassNo and ci.CheckMark='1' "); var result = this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp); - + //计算专业排名,班级排名 if (result.Any()) { - var temp = result.GroupBy(x=>new { x.AcademicYearNo,x.Semester}).Select(x => new StuScoreEntity() + var temp = result.GroupBy(x => new { x.AcademicYearNo, x.Semester }).Select(x => new StuScoreEntity() { - AcademicYearNo=x.Key.AcademicYearNo, - Semester=x.Key.Semester, - StuNo=x.FirstOrDefault().StuNo, - ClassNo=x.FirstOrDefault().ClassNo, - MajorNo=x.FirstOrDefault().MajorNo + AcademicYearNo = x.Key.AcademicYearNo, + Semester = x.Key.Semester, + StuNo = x.FirstOrDefault().StuNo, + ClassNo = x.FirstOrDefault().ClassNo, + MajorNo = x.FirstOrDefault().MajorNo }).ToList(); if (temp.Any()) { @@ -1976,7 +2001,7 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad ii.RankInMajor = temp.FirstOrDefault(x => x.AcademicYearNo == ii.AcademicYearNo && x.Semester == ii.Semester).RankInMajor; ii.RankInClass = temp.FirstOrDefault(x => x.AcademicYearNo == ii.AcademicYearNo && x.Semester == ii.Semester).RankInClass; } - + } return result; diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassBLL.cs index 8e07b0437..7ffe51eb1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassBLL.cs @@ -203,6 +203,29 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + public void UpEmpNos(string xn, string xq, string classNo, string LessonNo, string EmpNo, string HisEmpNo,string Grade) + { + try + { + teachClassEntity.UpEmpNos(xn, xq, classNo, LessonNo, EmpNo, HisEmpNo, Grade); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } /// /// 保存实体数据(新增、修改) /// 主键 @@ -226,7 +249,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } - #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassIBLL.cs index 27aeb4551..b84174ffa 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassIBLL.cs @@ -44,7 +44,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// void SaveEntity(string keyValue, TeachClassEntity entity); - + void UpEmpNos(string xn,string xq,string classNo,string LessonNo,string EmpNo,string HisEmpNo,string Grade); #endregion #region 扩展数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassService.cs index 34b009e87..a9155f15c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassService.cs @@ -209,7 +209,31 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } - + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + public void UpEmpNos(string xn, string xq, string classNo, string LessonNo, string EmpNo, string hisempno, string Grade) + { + try + { + StringBuilder sb = new StringBuilder(); + sb.Append(" update StuSelectLessonList set EmpNo ='" + EmpNo + "' where classno = '" + classNo + "' and Semester ='" + xq + "' and AcademicYearNo ='" + xn + "' and LessonNo ='" + LessonNo + "' and empno = '" + hisempno + "' and Grade = '" + Grade + "'"); + this.BaseRepository("CollegeMIS").ExecuteBySql(sb.ToString()); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } #endregion