From 5acd33c065fcb692f07affe69b00939560cd59b2 Mon Sep 17 00:00:00 2001 From: ndbs Date: Fri, 4 Nov 2022 09:29:51 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E5=AD=A6=E7=B1=8D=E7=AE=A1?= =?UTF-8?q?=E7=90=86=20=E5=AE=A1=E6=A0=B8=E5=8E=BB=E5=AE=A1=E6=A0=B8?= =?UTF-8?q?=E5=85=B3=E8=81=94=E7=94=A8=E6=88=B7=E5=90=AF=E7=94=A8=E7=A6=81?= =?UTF-8?q?=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/StuInfoBasicController.cs | 8 ++-- .../StuInfoBasic/StuInfoBasicBLL.cs | 21 ++++++++- .../StuInfoBasic/StuInfoBasicIBLL.cs | 1 + .../StuInfoBasic/StuInfoBasicService.cs | 45 ++++++++++++++++--- 4 files changed, 66 insertions(+), 9 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuInfoBasicController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuInfoBasicController.cs index 49057d604..e70b2484e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuInfoBasicController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuInfoBasicController.cs @@ -421,7 +421,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [HttpPost] [AjaxOnly] - public ActionResult GetCard(string keyValue,string status, string strEntity) + public ActionResult GetCard(string keyValue, string status, string strEntity) { if (status == "1")//领取 { @@ -430,7 +430,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers } else//取消领取 { - stuInfoBasicIBLL.GetCard(keyValue,status,new StuInfoBasicEntity()); + stuInfoBasicIBLL.GetCard(keyValue, status, new StuInfoBasicEntity()); } return Success("操作成功"); } @@ -513,7 +513,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [HttpPost] [AjaxOnly] - public ActionResult IsFileTransfer(string keyValue, string status,string fort) + public ActionResult IsFileTransfer(string keyValue, string status, string fort) { stuInfoBasicIBLL.IsFileTransfer(keyValue, status, fort); return Success("操作成功"); @@ -615,6 +615,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public ActionResult Check(string keyValue) { var keyValueArr = keyValue.Split(','); + stuInfoBasicIBLL.UpdateState(keyValue, "1"); foreach (var item in keyValueArr) { var StuInfoBasicData = stuInfoBasicIBLL.GetStuInfoBasicEntity(item); @@ -638,6 +639,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public ActionResult UnCheck(string keyValue) { var keyValueArr = keyValue.Split(','); + stuInfoBasicIBLL.UpdateState(keyValue, "0"); foreach (var item in keyValueArr) { var StuInfoBasicData = stuInfoBasicIBLL.GetStuInfoBasicEntity(item); 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 ce2fc8776..8502745a8 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 @@ -394,6 +394,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + public void UpdateState(string keyValue, string state) + { + try + { + stuInfoBasicService.UpdateState(keyValue, state); + + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } /// /// 删除实体数据 /// 主键 @@ -426,7 +445,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - stuInfoBasicService.GetCard(keyValue, status,entity); + stuInfoBasicService.GetCard(keyValue, status, entity); } catch (Exception ex) { 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 e07debd2d..f8314c069 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 @@ -108,6 +108,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// void SaveEntity(string keyValue, StuInfoBasicEntity entity); void UpdateAccount(); + void UpdateState(string keyValue,string state); #endregion void GenerateAccout(); 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 d03f0f719..6893b9cf1 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 @@ -411,11 +411,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration var DiplomaNoList = this.BaseRepository("CollegeMIS").FindList(x => x.DiplomaNo.Contains(year + schoolCode)).Select(x => x.DiplomaNo).ToList(); if (DiplomaNoList.Any()) { - numberCode = DiplomaNoList.Max(x => x).Substring(12,4).ToInt()+1; + numberCode = DiplomaNoList.Max(x => x).Substring(12, 4).ToInt() + 1; } //获取所有要毕业的学生按年级查询出来,再按学号进行由小到大排序, - var stuList = this.BaseRepository("CollegeMIS").FindList(x => (x.FinishSchoolMark == "1" || x.FinishSchoolMark == "2") && (x.DiplomaNo == null || x.DiplomaNo == "")).OrderBy(x=>x.Grade).ThenBy(x=>x.StuNo); + var stuList = this.BaseRepository("CollegeMIS").FindList(x => (x.FinishSchoolMark == "1" || x.FinishSchoolMark == "2") && (x.DiplomaNo == null || x.DiplomaNo == "")).OrderBy(x => x.Grade).ThenBy(x => x.StuNo); foreach (var item in stuList) { item.DiplomaNo = year + schoolCode + numberCode.ToString().PadLeft(4, '0'); @@ -423,7 +423,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration numberCode++; } - + db.Commit(); } catch (Exception ex) @@ -1131,7 +1131,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration var room = db.FindEntity(x => x.ID == dormitory.ParentID); if (room != null) { - if (room.CheckInStu.HasValue && room.CheckInStu.Value>0) + if (room.CheckInStu.HasValue && room.CheckInStu.Value > 0) { room.CheckInStu--; db.Update(room); @@ -1440,7 +1440,42 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } - + public void UpdateState(string keyValue, string state) + { + var db = this.BaseRepository().BeginTrans(); + try + { + var keyValueArr = keyValue.Split(','); + foreach (var item in keyValueArr) + { + var StuNo = this.BaseRepository("CollegeMIS").FindEntity(item).StuNo; + if (!StuNo.IsEmpty()) + { + if (state == "1") + { + db.ExecuteBySql("update LR_Base_User set F_EnabledMark=1 where F_EnCode='" + StuNo + "'"); + } + else + { + db.ExecuteBySql("update LR_Base_User set F_EnabledMark=0 where F_EnCode='" + StuNo + "'"); + } + } + } + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } public IEnumerable GetAllList() { try