From 53e307777553f6f15819b4e1f14c01fd98e50f13 Mon Sep 17 00:00:00 2001 From: dyy <807692433@qq.com> Date: Wed, 9 Aug 2023 15:59:51 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91?= =?UTF-8?q?=E6=95=99=E5=AD=A6=E5=B7=A5=E4=BD=9C=E5=AE=89=E6=8E=92=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=B7=A5=E4=BD=9C=E6=8E=A5=E5=8F=A3=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EADateArrange/EADateArrangeService.cs | 38 ++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EADateArrange/EADateArrangeService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EADateArrange/EADateArrangeService.cs index 01565ae86..61a974a10 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EADateArrange/EADateArrangeService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EADateArrange/EADateArrangeService.cs @@ -321,6 +321,43 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + + /// + /// 增加工作安排 + /// + /// 工作名称 + public void AddWork(string workName) + { + try + { + var yearAndSemester = Common.GetSemesterAndYear(); + if (!string.IsNullOrEmpty(workName)) + { + //判断是否存在 + var model = this.BaseRepository("CollegeMIS").FindEntity(x => x.WorkName == workName); + if (model == null) + { + //不存在的话写入一条 + var strSql = new StringBuilder(); + strSql.Append($@"insert into EADateArrange(dm, WorkName, MakeDate, AcademicYearNo, Semester, EndDate, CheckMark, WhoArrange) +values((select Max(CONVERT(int, dm)) + 1 from EADateArrange),'{workName}' , GETDATE(), '{yearAndSemester.AcademicYearShort}', '{yearAndSemester.Semester}', DATEADD(month, 1, GETDATE()), 0, '超级管理员') "); + this.BaseRepository("CollegeMIS").ExecuteBySql(strSql.ToString()); + } + } + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion /// @@ -532,6 +569,5 @@ and a.Academicyearno='" + entity.AcademicYearNo + "' and a.Semester='" + entity. } } - } } From ebb97a52e00a57459f1bc7a84473731236fa8983 Mon Sep 17 00:00:00 2001 From: dyy <807692433@qq.com> Date: Wed, 9 Aug 2023 17:47:13 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91?= =?UTF-8?q?=E6=95=99=E5=AD=A6=E6=95=99=E6=A1=88=E6=A3=80=E6=9F=A5=EF=BC=9A?= =?UTF-8?q?=E6=89=93=E5=88=86=E6=8C=89=E9=92=AE=E5=A2=9E=E5=8A=A0=E6=89=93?= =?UTF-8?q?=E5=88=86=E6=97=B6=E9=97=B4=E9=99=90=E5=88=B6=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/TeacherPlanCheckController.cs | 15 ++++++++++++++- .../Views/TeacherPlanCheck/Index.cshtml | 3 +++ .../Views/TeacherPlanCheck/Index.js | 6 +++++- .../TeacherPlanCheck/TeacherPlanCheckService.cs | 5 +++++ 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TeacherPlanCheckController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TeacherPlanCheckController.cs index 47a53a256..8a684e42a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TeacherPlanCheckController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TeacherPlanCheckController.cs @@ -1,5 +1,6 @@ using Learun.Application.TwoDevelopment.EducationalAdministration; using Learun.Util; +using System; using System.Data; using System.Web.Mvc; @@ -15,6 +16,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public class TeacherPlanCheckController : MvcControllerBase { private TeacherPlanCheckIBLL teacherPlanCheckIBLL = new TeacherPlanCheckBLL(); + private EADateArrangeIBLL eADateArrangeIBLL = new EADateArrangeBLL(); #region 视图功能 @@ -25,7 +27,18 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [HttpGet] public ActionResult Index() { - return View(); + //获取“教学工作安排”中“教学教案检查打分”的记录 + var entity = eADateArrangeIBLL.GetEADateArrangeEntityByName("教学教案检查打分"); + if (entity != null && entity.CheckMark == "1" && DateTime.Now > entity.MakeDate && DateTime.Now < entity.EndDate) + { + ViewBag.CanInputFlag = true;//可以打分标识 + } + else + { + ViewBag.CanInputFlag = false; + } + + return View(); } /// /// 表单页 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeacherPlanCheck/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeacherPlanCheck/Index.cshtml index 76dafb8ba..ff76a9d4b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeacherPlanCheck/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeacherPlanCheck/Index.cshtml @@ -36,3 +36,6 @@ @Html.AppendJsFile("/Areas/EducationalAdministration/Views/TeacherPlanCheck/Index.js") + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeacherPlanCheck/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeacherPlanCheck/Index.js index 79d8479b8..1951f0874 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeacherPlanCheck/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeacherPlanCheck/Index.js @@ -59,8 +59,12 @@ var bootstrap = function ($, learun) { location.reload(); }); - // 编辑 + // 打分 $('#lr_edit').on('click', function () { + if (CanInputFlag != "True") { + top.learun.layerConfirm('当前时间不是打分时间!', function (res) { }); + return false; + } var keyValue = $('#gridtable').jfGridValue('EmpId'); selectedRow = $('#gridtable').jfGridGet('rowdata'); if (learun.checkrow(keyValue)) { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeacherPlanCheck/TeacherPlanCheckService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeacherPlanCheck/TeacherPlanCheckService.cs index 7cf659349..20ba30338 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeacherPlanCheck/TeacherPlanCheckService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeacherPlanCheck/TeacherPlanCheckService.cs @@ -17,6 +17,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// public class TeacherPlanCheckService : RepositoryFactory { + private EADateArrangeService eADateArrangeService = new EADateArrangeService(); + #region 构造函数和属性 private string fieldSql; @@ -105,6 +107,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { + //“教学工作安排”表增加“教学教案检查打分”项 + eADateArrangeService.AddWork("教学教案检查打分"); + //学年、学期 var yearAndSemester = Common.GetSemesterAndYear(); var year = yearAndSemester.AcademicYearShort;