From d05cb44e2cad618ef81e0d4e0a9de67037d92298 Mon Sep 17 00:00:00 2001 From: dyy <807692433@qq.com> Date: Mon, 22 Aug 2022 15:01:54 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E6=AF=95?= =?UTF-8?q?=E4=B8=9A=E8=AF=81=E8=B5=84=E6=A0=BC=E5=AE=A1=E6=A0=B8=EF=BC=9A?= =?UTF-8?q?=E5=87=86=E8=AE=B8=E3=80=81=E4=B8=8D=E5=87=86=E6=AF=95=E4=B8=9A?= =?UTF-8?q?=E6=8C=89=E9=92=AE=E5=AE=8C=E5=96=84=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StuInfoBasic/StuInfoBasicService.cs | 28 +++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) 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 2613e4335..d71341038 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 @@ -395,15 +395,39 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// public void AllowGraduate(string stuNo, string status) { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); try { - var list = stuNo.Split(',').ToList().Select(a => "'" + a + "'"); var stulist = string.Join(",", list); - this.BaseRepository("CollegeMIS").ExecuteBySql($"UPDATE dbo.StuInfoBasic SET FinishSchoolMark ='{status}' WHERE StuNo in({stulist})"); + + if (status == "1")//准许毕业 + { + //判断离校手续是否全办完,若满足则修改毕业状态为已毕业和毕业时间,若不满足则修改毕业状态为准许毕业; + foreach (var item in stuNo.Split(',')) + { + var itementity = db.FindEntity(x => x.StuNo == item); + if (itementity.ReturnBooksStatus == "1" && itementity.EmployAgreeStatus == "1" && itementity.FeeSettleStatus == "1" && itementity.CheckOutStatus == "1" && itementity.CardDeregistrateStatus == "1" && itementity.DiplomaReceiveStatus == "1" && itementity.FileTransferStatus == "1") + { + db.ExecuteBySql($"UPDATE dbo.StuInfoBasic SET FinishSchoolMark ='2',FinishSchoolDate='" + DateTime.Now + "' WHERE StuNo='" + item + "' "); + } + else + { + db.ExecuteBySql($"UPDATE dbo.StuInfoBasic SET FinishSchoolMark ='{status}',FinishSchoolDate=null WHERE StuNo='" + item + "' "); + } + } + } + else//不准毕业 + { + //毕业状态修改为不准毕业,毕业时间为空; + db.ExecuteBySql($"UPDATE dbo.StuInfoBasic SET FinishSchoolMark ='{status}',FinishSchoolDate=null WHERE StuNo in({stulist})"); + } + + db.Commit(); } catch (Exception ex) { + db.Rollback(); if (ex is ExceptionEx) { throw;