From 4f2365fef710a97faf1fbfc987c45e7227709c98 Mon Sep 17 00:00:00 2001 From: dyy <807692433@qq.com> Date: Wed, 25 Dec 2024 14:15:28 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E7=8F=AD?= =?UTF-8?q?=E7=BA=A7=E5=BC=80=E8=AF=BE=E8=AE=A1=E5=88=92=EF=BC=9A=E5=BC=BA?= =?UTF-8?q?=E5=88=B6=E4=BF=AE=E6=94=B9=E6=95=99=E5=B8=88=E6=96=B9=E6=B3=95?= =?UTF-8?q?=E6=95=B4=E5=90=88=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/ClassPlanTeachController.cs | 9 +-- .../Views/ClassPlanTeach/Index.js | 8 +-- .../TeachClass/TeachClassBLL.cs | 24 ++++++++ .../TeachClass/TeachClassEntity.cs | 2 + .../TeachClass/TeachClassIBLL.cs | 6 ++ .../TeachClass/TeachClassService.cs | 56 +++++++++++++++++-- 6 files changed, 89 insertions(+), 16 deletions(-) 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 165ac917c..23f447650 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 @@ -234,14 +234,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers /// public ActionResult QzSetTeach(string keyValue, string EmpNo) { - var entityList = teachClassIBLL.GetTeachListById(keyValue).ToList(); - foreach (var item in entityList) - { - teachClassIBLL.UpEmpNos(item.AcademicYearNo, item.Semester, item.TeachClassNo, item.LessonNo, EmpNo, item.EmpNo, item.Grade, item.LessonSortNo); - stuScoreIBLL.UpEmpNos(item.AcademicYearNo, item.Semester, item.TeachClassNo, item.LessonNo, EmpNo, item.EmpNo, item.Grade, item.LessonSortNo); - } - - teachClassIBLL.UpEmpNo(keyValue, EmpNo); + teachClassIBLL.DoQzSetTeach(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 66f93adae..4250355c1 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 @@ -99,10 +99,10 @@ var bootstrap = function ($, learun) { return false; } var EmpNoMain = $('#gridtable').jfGridValue('EmpNoMain'); - if (EmpNoMain) { - learun.alert.warning("已完成强制设置!"); - return false; - } + //if (EmpNoMain) { + // learun.alert.warning("已完成强制设置!"); + // return false; + //} learun.layerForm({ id: 'form', title: '强制设置教师', 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 fd5272107..992b9344c 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 @@ -321,6 +321,30 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + + /// + /// 强制设置录成绩教师 + /// + /// + /// 已选择的录成绩教师 + public void DoQzSetTeach(string keyValue, string EmpNo) + { + try + { + teachClassEntity.DoQzSetTeach(keyValue, EmpNo); + } + 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/TeachClass/TeachClassEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassEntity.cs index a47faafc5..7aaf360ba 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassEntity.cs @@ -140,6 +140,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration public string LessonSortDetailNo { get; set; } [NotMapped] public decimal? ClassHour { get; set; } + [NotMapped] + public string ExamType { get; set; } #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 3500b1a37..af3e0eb8a 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 @@ -82,6 +82,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// /// IEnumerable GetEmpNoData(string keyValue); + /// + /// 强制设置录成绩教师 + /// + /// + /// 已选择的录成绩教师 + void DoQzSetTeach(string keyValue, string EmpNo); #endregion } } 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 3996a2ed1..27748d52b 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 @@ -32,8 +32,10 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { var strSql = new StringBuilder(); strSql.Append("SELECT "); - strSql.Append(@" t.*,le.LessonName "); - strSql.Append(" FROM TeachClass t left join LessonInfo le on t.LessonNo=le.LessonNo "); + strSql.Append(@" t.*,op.ExamType,op.LessonName "); + strSql.Append(" FROM TeachClass t "); + strSql.Append(" left join openlessonplan op on op.academicyearno=t.academicyearno and op.semester=t.semester and op.DeptNo=t.DeptNo and op.majorno =t.majorno "); + strSql.Append(" and op.grade =t.grade and op.lessonno =t.lessonno and op.F_SchoolId =t.F_SchoolId "); strSql.Append(" WHERE 1=1 "); var queryParam = queryJson.ToJObject(); // 虚拟参数 @@ -76,7 +78,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration if (!queryParam["ClassNo"].IsEmpty()) { dp.Add("ClassNo", queryParam["ClassNo"].ToString(), DbType.String); - strSql.Append(" AND t.ClassNo = @ClassNo "); + strSql.Append(" AND t.TeachClassNo = @ClassNo "); } if (!queryParam["EmpNo"].IsEmpty()) { @@ -732,7 +734,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { int ID = Convert.ToInt32(keyValue); var teachclassEntity = this.BaseRepository("CollegeMIS").FindEntity(ID); - return this.BaseRepository("CollegeMIS").FindList($"select * from EmpInfo e where EmpNo in ({teachclassEntity.EmpNo}) "); + return this.BaseRepository("CollegeMIS").FindList($"select * from EmpInfo e where EmpNo in ('{teachclassEntity.EmpNo.Replace(",", "','")}') "); } catch (Exception ex) { @@ -747,6 +749,52 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 强制设置录成绩教师 + /// + /// + /// 已选择的录成绩教师 + public void DoQzSetTeach(string keyValue, string EmpNo) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + try + { + foreach (var item in keyValue.Split(',')) + { + var entityList = this.GetTeachClassEntity(item); + if (entityList != null && entityList.EmpNoMain != EmpNo) + { + //选课 + var ssllstr = $"update StuSelectLessonList set EmpNo ='{EmpNo}' where classno = '{entityList.TeachClassNo}' and Semester ='{entityList.Semester}' and AcademicYearNo ='{entityList.AcademicYearNo}' and LessonNo ='{entityList.LessonNo}' and empno = '{(!string.IsNullOrEmpty(entityList.EmpNoMain) ? entityList.EmpNoMain : entityList.EmpNo)}' and Grade = '{entityList.Grade}' and LessonSortNo='{entityList.LessonSortNo}' "; + db.ExecuteBySql(ssllstr); + //成绩 + var ssstr = $"update StuScore set EmpNo ='{EmpNo}' where classno = '{entityList.TeachClassNo}' and Semester ='{entityList.Semester}' and AcademicYearNo ='{entityList.AcademicYearNo}' and LessonNo ='{entityList.LessonNo}' and empno = '{(!string.IsNullOrEmpty(entityList.EmpNoMain) ? entityList.EmpNoMain : entityList.EmpNo)}' and Grade='{entityList.Grade}' and LessonSortNo='{entityList.LessonSortNo}' "; + db.ExecuteBySql(ssstr); + //教师成绩单 + var ercstr = $"update EmpReportCard set EmpNo='{EmpNo}',EmpName=(select EmpName from EmpInfo where EmpNo='{EmpNo}') where AcademicYearNo='{entityList.AcademicYearNo}' and Semester='{entityList.Semester}' and LessonNo='{entityList.LessonNo}' and ClassNo='{entityList.TeachClassNo}' and EmpNo='{(!string.IsNullOrEmpty(entityList.EmpNoMain) ? entityList.EmpNoMain : entityList.EmpNo)}' and LessonSortNo='{entityList.LessonSortNo}' "; + db.ExecuteBySql(ercstr); + //开课计划 + entityList.EmpNoMain = EmpNo; + entityList.SetUserId = LoginUserInfo.Get().userId; + entityList.SetTime = DateTime.Now; + db.Update(entityList); + } + } + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } #endregion } }