From bb78a79bf5acc9418ad951a23892719cde06a9c1 Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Mon, 8 Aug 2022 15:06:26 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E8=80=83=E5=8A=A1=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Exam_ArrangeExamTermItemNewController.cs | 117 ++++++ .../Exam_ArrangeExamTermNewController.cs | 166 ++++++++ .../Controllers/Exam_ExamLessonController.cs | 196 +++++++++ .../Controllers/Exam_ExamPlanController.cs | 376 +++++++++++++++++ .../Exam_ExamPlanLessonController.cs | 396 ++++++++++++++++++ .../Controllers/Exam_ExamRoomController.cs | 179 ++++++++ .../Controllers/Exam_ExamStudentController.cs | 187 +++++++++ .../Exam_ExamTeacherTimeController.cs | 117 ++++++ .../Exam_InvigilateTeacherController.cs | 187 +++++++++ .../Learun.Application.Web.csproj | 9 + 10 files changed, 1930 insertions(+) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ArrangeExamTermItemNewController.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ArrangeExamTermNewController.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamLessonController.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamPlanController.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamPlanLessonController.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamRoomController.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamStudentController.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamTeacherTimeController.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_InvigilateTeacherController.cs diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ArrangeExamTermItemNewController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ArrangeExamTermItemNewController.cs new file mode 100644 index 000000000..ea0f05b07 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ArrangeExamTermItemNewController.cs @@ -0,0 +1,117 @@ +using Learun.Util; +using System.Data; +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Web.Mvc; +using System.Collections.Generic; + +namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-04-22 16:51 + /// 描 述:考场安排明细 + /// + public class Exam_ArrangeExamTermItemNewController : MvcControllerBase + { + private Exam_ArrangeExamTermItemNewIBLL exam_ArrangeExamTermItemNewIBLL = new Exam_ArrangeExamTermItemNewBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form() + { + return View(); + } + #endregion + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = exam_ArrangeExamTermItemNewIBLL.GetPageList(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + /// + /// 获取表单数据 + /// + /// 主键 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormData(string keyValue) + { + var Exam_ArrangeExamTermItemNewData = exam_ArrangeExamTermItemNewIBLL.GetExam_ArrangeExamTermItemNewEntity( keyValue ); + var jsonData = new { + Exam_ArrangeExamTermItemNew = Exam_ArrangeExamTermItemNewData, + }; + return Success(jsonData); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + exam_ArrangeExamTermItemNewIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity) + { + Exam_ArrangeExamTermItemNewEntity entity = strEntity.ToObject(); + exam_ArrangeExamTermItemNewIBLL.SaveEntity(keyValue,entity); + if (string.IsNullOrEmpty(keyValue)) + { + } + return Success("保存成功!"); + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ArrangeExamTermNewController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ArrangeExamTermNewController.cs new file mode 100644 index 000000000..23d942e08 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ArrangeExamTermNewController.cs @@ -0,0 +1,166 @@ +using Learun.Util; +using System.Data; +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Web.Mvc; +using System.Collections.Generic; + +namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-04-22 16:00 + /// 描 述:排考安排 + /// + public class Exam_ArrangeExamTermNewController : MvcControllerBase + { + private Exam_ArrangeExamTermNewIBLL exam_ArrangeExamTermNewIBLL = new Exam_ArrangeExamTermNewBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult IndexForClass() + { + return View(); + } + [HttpGet] + public ActionResult IndexItem() + { + return View(); + } + #endregion + + #region 获取数据 + [HttpGet] + [AjaxOnly] + public ActionResult GetPageListForClass(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = exam_ArrangeExamTermNewIBLL.GetPageListForClass(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + + [HttpGet] + public ActionResult GetClassTree() + { + return Success(exam_ArrangeExamTermNewIBLL.GetClassTree()); + } + [HttpGet] + [AjaxOnly] + public ActionResult GetItemPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = exam_ArrangeExamTermNewIBLL.GetItemPageList(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = exam_ArrangeExamTermNewIBLL.GetPageList(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + /// + /// 获取表单数据 + /// + /// 主键 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormData(string keyValue) + { + var ArrangeExamTermNewData = exam_ArrangeExamTermNewIBLL.GetExam_ArrangeExamTermNewEntity( keyValue ); + var jsonData = new { + ArrangeExamTermNew = ArrangeExamTermNewData, + }; + return Success(jsonData); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + exam_ArrangeExamTermNewIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity) + { + Exam_ArrangeExamTermNewEntity entity = strEntity.ToObject(); + exam_ArrangeExamTermNewIBLL.SaveEntity(keyValue,entity); + if (string.IsNullOrEmpty(keyValue)) + { + } + return Success("保存成功!"); + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamLessonController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamLessonController.cs new file mode 100644 index 000000000..2443f0bb3 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamLessonController.cs @@ -0,0 +1,196 @@ +using Learun.Util; +using System.Data; +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Web.Mvc; +using System.Collections.Generic; + +namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-04-12 15:47 + /// 描 述:考试课程表 + /// + public class Exam_ExamLessonController : MvcControllerBase + { + private Exam_ExamLessonIBLL exam_ExamLessonIBLL = new Exam_ExamLessonBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form() + { + return View(); + } + /// + /// 导入/清空数据 + /// + /// + [HttpGet] + public ActionResult FormYearSemester() + { + return View(); + } + /// + /// 设置考试时长 + /// + /// + [HttpGet] + public ActionResult FormExamTime() + { + return View(); + } + #endregion + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = exam_ExamLessonIBLL.GetPageList(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + /// + /// 获取表单数据 + /// + /// 主键 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormData(string keyValue) + { + var Exam_ExamLessonData = exam_ExamLessonIBLL.GetExam_ExamLessonEntity(keyValue); + var jsonData = new + { + Exam_ExamLesson = Exam_ExamLessonData, + }; + return Success(jsonData); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + exam_ExamLessonIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + + /// + /// 导入开课计划 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult Import(string AcademicYearNo, string Semester,string ExamTime) + { + int res = exam_ExamLessonIBLL.Import(AcademicYearNo, Semester, ExamTime); + return Success("导入" + res + "条数据!"); + } + /// + /// 按条件清空数据 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteWhere(string AcademicYearNo, string Semester) + { + int res = exam_ExamLessonIBLL.DeleteWhere(AcademicYearNo, Semester); + return Success("清空" + res + "条数据!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity) + { + Exam_ExamLessonEntity entity = strEntity.ToObject(); + //判断课程编号有无重复 + var model = exam_ExamLessonIBLL.GetEntityByLessonNo(entity.LessonNo, entity.AcademicYearNo, entity.Semester); + if (model != null && string.IsNullOrEmpty(keyValue)) + { + return Fail("课程编号重复!"); + } + else if (model != null && !string.IsNullOrEmpty(keyValue) && keyValue != model.ELId) + { + return Fail("课程编号重复!"); + } + + exam_ExamLessonIBLL.SaveEntity(keyValue, entity); + if (string.IsNullOrEmpty(keyValue)) + { + } + return Success("保存成功!"); + } + + /// + /// 设置考试时长 + /// + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult SaveExamTime(string keyValue, int ExamTime) + { + exam_ExamLessonIBLL.SaveExamTime(keyValue, ExamTime); + return Success("设置成功!"); + } + /// + /// 启用/停用 + /// + /// + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult Lock(string keyValue, int ELEnabled) + { + exam_ExamLessonIBLL.Lock(keyValue, ELEnabled); + return Success("操作成功!"); + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamPlanController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamPlanController.cs new file mode 100644 index 000000000..1426f30ad --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamPlanController.cs @@ -0,0 +1,376 @@ +using Learun.Util; +using System.Data; +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Web.Mvc; +using System.Collections.Generic; +using System; +using System.Linq; +using Newtonsoft.Json; + +namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-04-14 18:12 + /// 描 述:考试记录表 + /// + public class Exam_ExamPlanController : MvcControllerBase + { + private Exam_ExamPlanIBLL exam_ExamPlanIBLL = new Exam_ExamPlanBLL(); + private Exam_ExamPlanLessonIBLL exam_ExamPlanLessonIBLL = new Exam_ExamPlanLessonBLL(); + private Exam_ExamPlanClassIBLL exam_ExamPlanClassIBLL = new Exam_ExamPlanClassBLL(); + private Exam_ExamPlanRoomIBLL exam_ExamPlanRoomIBLL = new Exam_ExamPlanRoomBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult GenerateForm() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult ClearForm() + { + return View(); + } + /// + /// 安排时间 + /// + /// + [HttpGet] + public ActionResult FormTime() + { + return View(); + } + #endregion + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = exam_ExamPlanIBLL.GetPageList(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + /// + /// 获取表单数据 + /// + /// 主键 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormData(string keyValue) + { + var Exam_ExamPlanData = exam_ExamPlanIBLL.GetExam_ExamPlanEntity(keyValue); + var jsonData = new + { + Exam_ExamPlan = Exam_ExamPlanData, + }; + return Success(jsonData); + } + + /// + /// 安排时间 + /// + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPlanTimeList(string EPId) + { + var data = exam_ExamPlanIBLL.GetPlanTimeList(EPId); + return Success(data); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + exam_ExamPlanIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 生成排考名单 + /// + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult Generate(string keyValue) + { + var data = exam_ExamPlanIBLL.IsGenerate(keyValue); + if (!data.flag) + { + return Fail(data.str); + } + + exam_ExamPlanIBLL.Generate(keyValue); + return Success("生成成功!"); + } + + /// + /// 安排考试 + /// + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult SavePlanTime(string EPId, List list) + { + if (list.Count <= 0) + { + return Fail("请安排时间!"); + } + + foreach (var entity in list) + { + DateTime time; + if (!DateTime.TryParse(entity.ExamTimeStart, out time)) + { + return Fail("开始时间格式不正确!"); + } + if (!DateTime.TryParse(entity.ExamTimeEnd, out time)) + { + return Fail("结束时间格式不正确!"); + } + + var startTime = Convert.ToDateTime(entity.ExamDate.Value.ToString("yyyy-MM-dd") + " " + entity.ExamTimeStart); + var endTime = Convert.ToDateTime(entity.ExamDate.Value.ToString("yyyy-MM-dd") + " " + entity.ExamTimeEnd); + if (endTime <= startTime) + { + return Fail("结束时间必须大于开始时间!"); + } + //考试时长 + entity.ExamTimeLength = (endTime - startTime).TotalMinutes; + } + exam_ExamPlanIBLL.SavePlanTime(EPId, list); + return Success("保存成功!"); + } + + /// + /// 清除排考名单/清除所有排考记录 + /// + /// 排考记录主表Id + /// 1:清除排考名单;2:清除所有排考记录 + /// + [HttpPost] + [AjaxOnly] + public ActionResult ClearGenerate(string keyValue, int type) + { + exam_ExamPlanIBLL.ClearGenerate(keyValue, type); + return Success("操作成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity) + { + Exam_ExamPlanEntity entity = strEntity.ToObject(); + exam_ExamPlanIBLL.SaveEntity(keyValue, entity); + if (string.IsNullOrEmpty(keyValue)) + { + } + return Success("保存成功!"); + } + + /// + /// 生成排考名单 + /// + /// + /// + /// + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult GenerateForm(string AcademicYearNo, string Semester, string PlanType) + { + int res = exam_ExamPlanIBLL.ClaerForm(AcademicYearNo, Semester, PlanType); + return Success("清空(" + res + ")条数据成功!"); + } + /// + /// 清除排考名单 + /// + /// + /// + /// + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult ClearForm(string AcademicYearNo, string Semester, string PlanType) + { + int res = exam_ExamPlanIBLL.GenerateForm(AcademicYearNo, Semester, PlanType); + return Success("清空(" + res + ")条数据成功!"); + } + /// + /// 一键安排课程 + /// + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult PlanLessonByEPId(string keyValue) + { + exam_ExamPlanLessonIBLL.InitExamPlanLesson(keyValue); + return Success("操作成功!"); + } + /// + /// 一键安排班级 + /// + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult PlanClassByEPId(string keyValue) + { + var count = exam_ExamPlanLessonIBLL.GetListByEPId(keyValue).Count(); + if (count <= 0) + { + return Fail("请先安排课程!"); + } + + exam_ExamPlanClassIBLL.PlanClassByEPId(keyValue); + return Success("操作成功!"); + } + /// + /// 自动生成考试课程排考时间 + /// + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult PlanLessonTimeByEPId(string keyValue) + { + var count = exam_ExamPlanLessonIBLL.GetListByEPId(keyValue).Count(); + if (count <= 0) + { + return Fail("请先安排课程!"); + } + var res = exam_ExamPlanLessonIBLL.PlanLessonTimeByEPId(keyValue); + if (res.flag) + { + return Success("操作成功!"); + } + else + { + return Fail(res.msg); + } + + return Success("操作成功!"); + } + + /// + /// 一键安排考场 + /// + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult PlanRoomByEPId(string keyValue) + { + var res = exam_ExamPlanRoomIBLL.PlanRoomByEPId(keyValue); + if (!res.flag) + { + return Fail(res.str); + } + + return Success("操作成功!"); + } + + /// + /// 一键安排监考老师 + /// + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult PlanTeacherByEPId(string keyValue) + { + var res = exam_ExamPlanRoomIBLL.PlanTeacherByEPId(keyValue); + if (!res.flag) + { + return Fail(res.str); + } + + return Success("操作成功!"); + } + + /// + /// 审核所有考试课程 + /// + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult CheckAllPlanLesson(string keyValue) + { + var res = exam_ExamPlanLessonIBLL.CheckAllPlanLesson(keyValue); + if (!res.flag) + { + return Fail(res.str); + } + + return Success("操作成功!"); + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamPlanLessonController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamPlanLessonController.cs new file mode 100644 index 000000000..86baa8d27 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamPlanLessonController.cs @@ -0,0 +1,396 @@ +using Learun.Util; +using System.Data; +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Web.Mvc; +using System.Collections.Generic; +using System; +using System.Linq; + +namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-04-15 15:03 + /// 描 述:排考安排课程 + /// + public class Exam_ExamPlanLessonController : MvcControllerBase + { + private Exam_ExamPlanLessonIBLL exam_ExamPlanLessonIBLL = new Exam_ExamPlanLessonBLL(); + private Exam_ExamPlanClassIBLL exam_ExamPlanClassIBLL = new Exam_ExamPlanClassBLL(); + private Exam_ExamStudentIBLL exam_ExamStudentIBLL = new Exam_ExamStudentBLL(); + private Exam_ExamPlanRoomIBLL exam_ExamPlanRoomIBLL = new Exam_ExamPlanRoomBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// 排考记录主表Id + /// + [HttpGet] + public ActionResult Index(string EPId) + { + exam_ExamPlanLessonIBLL.InitExamPlanLesson(EPId); + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form() + { + return View(); + } + [HttpGet] + public ActionResult FormClass() + { + return View(); + } + + [HttpGet] + public ActionResult FormRoom() + { + return View(); + } + [HttpGet] + public ActionResult FormTeacher() + { + return View(); + } + + [HttpGet] + public ActionResult FormRoomTeacher() + { + return View(); + } + + #endregion + + #region 获取数据 + /// + /// 获取班级分页列表 + /// + /// + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetClassInfoPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = exam_ExamStudentIBLL.GetPageListForExam(paginationobj, queryJson); + //var stuList = StuInfoBasicIBLL.GetAllList(); + //foreach (var item in data) + //{ + // item.StuNum = stuList.Count(x => x.ClassNo == item.ClassNo); + //} + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetListForClass(string queryJson) + { + var data = exam_ExamPlanClassIBLL.GetList(queryJson); + + return Success(data); + } + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetListForRoom(string pagination, string queryJson) + { + var data = exam_ExamPlanRoomIBLL.GetList(queryJson); + + return Success(data); + } + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = exam_ExamPlanLessonIBLL.GetPageList(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + /// + /// 排考计划 + /// + /// + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageListForLesson(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = exam_ExamPlanLessonIBLL.GetPageListForLesson(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + [HttpGet] + [AjaxOnly] + public ActionResult GetFormRoom(string keyValue) + { + var data = exam_ExamPlanRoomIBLL.GetEntity(keyValue); + + var jsonData = new + { + Exam_ExamPlanRoom = data, + }; + return Success(jsonData); + } + /// + /// 获取表单数据 + /// + /// 主键 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormData(string keyValue) + { + var Exam_ExamPlanLessonData = exam_ExamPlanLessonIBLL.GetExam_ExamPlanLessonEntity(keyValue); + if (!string.IsNullOrEmpty(Exam_ExamPlanLessonData.ExamTime)) + { + var etime = Exam_ExamPlanLessonData.ExamTime.Split('-'); + Exam_ExamPlanLessonData.ExamTimeStart = etime[0]; + Exam_ExamPlanLessonData.ExamTimeEnd = etime[1]; + } + + if ((Exam_ExamPlanLessonData.ClassNum == null || Exam_ExamPlanLessonData.ClassNum <= 0) || + (Exam_ExamPlanLessonData.SeatCount == null || Exam_ExamPlanLessonData.SeatCount <= 0)) + { + exam_ExamPlanLessonIBLL.UpdateClassNumAndStuCount(Exam_ExamPlanLessonData.EPLId); + } + + var jsonData = new + { + Exam_ExamPlanLesson = Exam_ExamPlanLessonData, + }; + return Success(jsonData); + } + /// + /// 获取左侧树形数据 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetTree(string EPId) + { + var data = exam_ExamPlanLessonIBLL.GetTree(EPId); + return Success(data); + } + [HttpGet] + [AjaxOnly] + public ActionResult ValidateRoom(string EPLId, string ClassroomNo) + { + var data = exam_ExamPlanRoomIBLL.ValidateRoom(EPLId, ClassroomNo); + return Success(data); + } + + + /// + /// 获取考试记录安排时间数据 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetExamDateSel(string EPLId) + { + var data = exam_ExamPlanLessonIBLL.GetExamDateSel(EPLId); + return Success(data); + } + #endregion + + #region 提交数据 + + /// + /// 初始化Exam_ExamPlanLesson,如果表中没有数据,将考试课程表数据添加进去 + /// + /// 排考记录主表Id + /// + [HttpPost] + [AjaxOnly] + public ActionResult InitExamPlanLesson(string EPId) + { + exam_ExamPlanLessonIBLL.InitExamPlanLesson(EPId); + return Success("初始化成功!"); + } + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + exam_ExamPlanLessonIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + [HttpPost] + [AjaxOnly] + public ActionResult DeleteClass(string keyValue) + { + exam_ExamPlanClassIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + + [HttpPost] + [AjaxOnly] + public ActionResult DeleteRoom(string keyValue) + { + exam_ExamPlanRoomIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 审核 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult Check(string keyValue, int ELCheckMark) + { + if (ELCheckMark == 1) + { + var entity = exam_ExamPlanLessonIBLL.GetExam_ExamPlanLessonEntity(keyValue); + if (entity.ExamDate == null || entity.ExamTime == null) + { + return Fail("请先设置考试时间!"); + } + + if ((entity.RealClassNum == null || entity.RealClassNum == 0) || + (entity.SeatCount == null || entity.SeatCount == 0)) + { + return Fail("请先安排班级和考场!"); + } + + if (entity.SeatCount < entity.RealStuCount) + { + return Fail("考场座位数不足!"); + } + + } + + exam_ExamPlanLessonIBLL.Check(keyValue, ELCheckMark); + return Success("操作成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// 设置考试时间 + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity) + { + Exam_ExamPlanLessonEntity entity = strEntity.ToObject(); + DateTime time; + bool flag = DateTime.TryParse(entity.ExamTimeStart, out time); + if (!flag) + { + return Fail("考试开始时间格式不正确!"); + } + if (!DateTime.TryParse(entity.ExamTimeEnd, out time)) + { + return Fail("考试结束时间格式不正确!"); + } + + if (!string.IsNullOrEmpty(entity.ExamTimeStart) && !string.IsNullOrEmpty(entity.ExamTimeEnd)) + { + entity.ExamTime = entity.ExamTimeStart.Trim() + "-" + entity.ExamTimeEnd; + } + + entity.EPLId = keyValue; + + //判断考试时间是否冲突,同一专业同一时间段只能安排一门考试课程 + var res = exam_ExamPlanLessonIBLL.IsAllowSave(entity); + if (!res.flag && !string.IsNullOrEmpty(res.str)) + { + return Fail(res.str); + } + + //保存 + exam_ExamPlanLessonIBLL.SaveEntity(keyValue, entity); + return Success("保存成功!"); + } + + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveClass(string EPLId, string strEntity) + { + var list = strEntity.ToObject>(); + //判断排考班级的考试时间是否冲突 + var res = exam_ExamPlanClassIBLL.IsExamConflict(list); + if (res.flag && !string.IsNullOrEmpty(res.msg)) + { + return Fail(res.msg); + } + + exam_ExamPlanClassIBLL.SaveList(list); + return Success("保存成功!"); + } + + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveRoomAndTeacher(string keyValue, string strEntity, string Exam_ExamPlanTeacherList) + { + var entity = strEntity.ToObject(); + var teacherList = Exam_ExamPlanTeacherList.ToObject>(); + entity.EmpNo = string.Join(",", teacherList.Select(x => x.EmpNo).ToList()); + entity.EmpName = string.Join(",", teacherList.Select(x => x.EmpName).ToList()); + exam_ExamPlanRoomIBLL.SaveEntity(keyValue, entity); + return Success("保存成功!"); + } + + + + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamRoomController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamRoomController.cs new file mode 100644 index 000000000..c2ee9a8f6 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamRoomController.cs @@ -0,0 +1,179 @@ +using Learun.Util; +using System.Data; +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Web.Mvc; +using System.Collections.Generic; + +namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-04-12 15:47 + /// 描 述:考场表 + /// + public class Exam_ExamRoomController : MvcControllerBase + { + private Exam_ExamRoomIBLL exam_ExamRoomIBLL = new Exam_ExamRoomBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form() + { + return View(); + } + /// + /// 导入/清空数据 + /// + /// + [HttpGet] + public ActionResult FormYearSemester() + { + return View(); + } + + #endregion + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = exam_ExamRoomIBLL.GetPageList(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + /// + /// 获取表单数据 + /// + /// 主键 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormData(string keyValue) + { + var Exam_ExamRoomData = exam_ExamRoomIBLL.GetExam_ExamRoomEntity(keyValue); + var jsonData = new + { + Exam_ExamRoom = Exam_ExamRoomData, + }; + return Success(jsonData); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + exam_ExamRoomIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + + /// + /// 导入教室 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult Import(string AcademicYearNo, string Semester, int SeatRows, int SeatColumns) + { + int res = exam_ExamRoomIBLL.Import(AcademicYearNo, Semester,SeatRows,SeatColumns); + return Success("导入" + res + "条数据!"); + } + /// + /// 按条件清空数据 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteWhere(string AcademicYearNo, string Semester) + { + int res = exam_ExamRoomIBLL.DeleteWhere(AcademicYearNo, Semester); + return Success("清空" + res + "条数据!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity) + { + Exam_ExamRoomEntity entity = strEntity.ToObject(); + + //判断考场编号有无重复 + var model = exam_ExamRoomIBLL.GetEntityByClassroomNo(entity.ClassroomNo,entity.AcademicYearNo,entity.Semester); + if (model != null && string.IsNullOrEmpty(keyValue)) + { + return Fail("考场编号重复!"); + } + else if (model != null && !string.IsNullOrEmpty(keyValue) && keyValue != model.ERId) + { + return Fail("考场编号重复!"); + } + + //计算考场座位数 + entity.SeatCount = entity.SeatRows * entity.SeatColumns; + exam_ExamRoomIBLL.SaveEntity(keyValue, entity); + if (string.IsNullOrEmpty(keyValue)) + { + } + return Success("保存成功!"); + } + + /// + /// 启用/停用 + /// + /// + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult Lock(string keyValue, int EREnabled) + { + exam_ExamRoomIBLL.Lock(keyValue, EREnabled); + return Success("操作成功!"); + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamStudentController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamStudentController.cs new file mode 100644 index 000000000..f34ba8599 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamStudentController.cs @@ -0,0 +1,187 @@ +using Learun.Util; +using System.Data; +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Web.Mvc; +using System.Collections.Generic; + +namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-04-12 15:47 + /// 描 述:考试课程表 + /// + public class Exam_ExamStudentController : MvcControllerBase + { + private Exam_ExamStudentIBLL exam_ExamStudentIBLL = new Exam_ExamStudentBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form() + { + return View(); + } + /// + /// 导入 + /// + /// + [HttpGet] + public ActionResult FormImport() + { + return View(); + } + /// + /// 按条件清空 + /// + /// + [HttpGet] + public ActionResult FormClear() + { + return View(); + } + + #endregion + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = exam_ExamStudentIBLL.GetPageList(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + /// + /// 获取表单数据 + /// + /// 主键 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormData(string keyValue) + { + var Exam_ExamStudentData = exam_ExamStudentIBLL.GetExam_ExamStudentEntity(keyValue); + var jsonData = new + { + Exam_ExamStudent = Exam_ExamStudentData, + }; + return Success(jsonData); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + exam_ExamStudentIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity) + { + Exam_ExamStudentEntity entity = strEntity.ToObject(); + #region 去重 + var model = exam_ExamStudentIBLL.GetExam_ExamStudentbyStuNo(entity.StuNo); + if (string.IsNullOrEmpty(keyValue)) + { + if (model != null && model.AcademicYearNo == entity.AcademicYearNo && model.Semester == entity.Semester && model.ESType == entity.ESType) + { + return Fail("此学生考试数据已存在!"); + } + } + else + { + if (model != null && model.ESId != keyValue && model.AcademicYearNo == entity.AcademicYearNo && model.Semester == entity.Semester && model.ESType == entity.ESType) + { + return Fail("此学生考试数据已存在!"); + } + } + #endregion + exam_ExamStudentIBLL.SaveEntity(keyValue, entity); + return Success("保存成功!"); + } + + /// + /// 启用/停用 + /// + /// + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult Lock(string keyValue, int ESEnabled) + { + exam_ExamStudentIBLL.Lock(keyValue, ESEnabled); + return Success("操作成功!"); + } + /// + /// 清空数据 + /// + /// + /// + /// + /// + [HttpPost] + [AjaxOnly] + [ValidateAntiForgeryToken] + public ActionResult ClearTable(string AcademicYearNo, string Semester, string ESType) + { + int res = exam_ExamStudentIBLL.ClaerForm(AcademicYearNo, Semester, ESType); + return Success("清空(" + res + ")条数据成功!"); + } + + public ActionResult ImportTable(string AcademicYearNo, int Semester, string ESType) + { + int res = exam_ExamStudentIBLL.ImportForm(AcademicYearNo, Semester, ESType); + return Success("同步(" + res + ")条数据成功!"); + } + + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamTeacherTimeController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamTeacherTimeController.cs new file mode 100644 index 000000000..fac91a660 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamTeacherTimeController.cs @@ -0,0 +1,117 @@ +using Learun.Util; +using System.Data; +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Web.Mvc; +using System.Collections.Generic; + +namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-06-13 15:41 + /// 描 述:老师时间管理 + /// + public class Exam_ExamTeacherTimeController : MvcControllerBase + { + private Exam_ExamTeacherTimeIBLL exam_ExamTeacherTimeIBLL = new Exam_ExamTeacherTimeBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form() + { + return View(); + } + #endregion + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = exam_ExamTeacherTimeIBLL.GetPageList(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + /// + /// 获取表单数据 + /// + /// 主键 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormData(string keyValue) + { + var Exam_ExamTeacherTimeData = exam_ExamTeacherTimeIBLL.GetExam_ExamTeacherTimeEntity( keyValue ); + var jsonData = new { + Exam_ExamTeacherTime = Exam_ExamTeacherTimeData, + }; + return Success(jsonData); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + exam_ExamTeacherTimeIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity) + { + Exam_ExamTeacherTimeEntity entity = strEntity.ToObject(); + exam_ExamTeacherTimeIBLL.SaveEntity(keyValue,entity); + if (string.IsNullOrEmpty(keyValue)) + { + } + return Success("保存成功!"); + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_InvigilateTeacherController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_InvigilateTeacherController.cs new file mode 100644 index 000000000..1eba6143f --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_InvigilateTeacherController.cs @@ -0,0 +1,187 @@ +using Learun.Util; +using System.Data; +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Web.Mvc; +using System.Collections.Generic; + +namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-04-14 09:49 + /// 描 述:监考老师 + /// + public class Exam_InvigilateTeacherController : MvcControllerBase + { + private Exam_InvigilateTeacherIBLL exam_InvigilateTeacherIBLL = new Exam_InvigilateTeacherBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult FormYearSemester() + { + return View(); + } + + #endregion + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = exam_InvigilateTeacherIBLL.GetPageList(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + /// + /// 获取表单数据 + /// + /// 主键 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormData(string keyValue) + { + var Exam_InvigilateTeacherData = exam_InvigilateTeacherIBLL.GetExam_InvigilateTeacherEntity( keyValue ); + var jsonData = new { + Exam_InvigilateTeacher = Exam_InvigilateTeacherData, + }; + return Success(jsonData); + } + + /// + /// 获取监考老师数据 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetList(string AcademicYearNo, int? Semester) + { + var data = exam_InvigilateTeacherIBLL.GetList(AcademicYearNo, Semester); + return Success(data); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + exam_InvigilateTeacherIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity) + { + Exam_InvigilateTeacherEntity entity = strEntity.ToObject(); + //判断教师编号有无重复 + var model = exam_InvigilateTeacherIBLL.GetEntityByWhere(entity.AcademicYearNo, entity.Semester,entity.EmpNo); + if (model != null && string.IsNullOrEmpty(keyValue)) + { + return Fail("教师编号重复!"); + } + else if (model != null && !string.IsNullOrEmpty(keyValue) && keyValue != model.ITId) + { + return Fail("教师编号重复!"); + } + exam_InvigilateTeacherIBLL.SaveEntity(keyValue,entity); + if (string.IsNullOrEmpty(keyValue)) + { + } + return Success("保存成功!"); + } + + /// + /// 启用/停用 + /// + /// + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult Lock(string keyValue, int ITEnabled) + { + exam_InvigilateTeacherIBLL.Lock(keyValue, ITEnabled); + return Success("操作成功!"); + } + + /// + /// 导入教师基础数据 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult Import(string AcademicYearNo, string Semester) + { + int res = exam_InvigilateTeacherIBLL.Import(AcademicYearNo, Semester); + return Success("导入" + res + "条数据!"); + } + /// + /// 按条件清空数据 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteWhere(string AcademicYearNo, string Semester) + { + int res = exam_InvigilateTeacherIBLL.DeleteWhere(AcademicYearNo, Semester); + return Success("清空" + res + "条数据!"); + } + + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj index 7dd170d89..5d935a001 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj @@ -328,6 +328,15 @@ + + + + + + + + + From 61610ccc1e8f74bb02e62d9fb4b66e2ab9c584f6 Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Mon, 8 Aug 2022 16:00:43 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E5=BC=80=E8=AF=BE=E8=AE=A1=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/ClassPlanController.cs | 68 ++++++--- .../Controllers/ClassPlanTeachController.cs | 124 +++-------------- .../Views/ClassPlan/Form.cshtml | 44 +++--- .../Views/ClassPlan/Form.js | 54 ++++++-- .../Views/ClassPlan/Index.cshtml | 18 ++- .../Views/ClassPlan/Index.js | 117 ++++++++++------ .../Views/ClassPlan/IndexSchool.cshtml | 44 ++++++ .../Views/ClassPlan/IndexSchool.js | 129 ++++++++++++++++++ .../Views/ClassPlanTeach/Index.cshtml | 22 ++- .../Views/ClassPlanTeach/Index.js | 119 +++++++++------- .../Views/ClassPlanTeach/TeachForm.js | 3 +- .../Views/ClassPlanTeach/TeachFormQZ.js | 4 +- .../Learun.Application.Web.csproj | 2 + .../ClassPlan/ClassPlanBLL.cs | 32 ++++- .../ClassPlan/ClassPlanIBLL.cs | 3 +- .../ClassPlan/ClassPlanService.cs | 102 ++++++++++++-- .../Learun.Application.TwoDevelopment.csproj | 4 +- 17 files changed, 616 insertions(+), 273 deletions(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/IndexSchool.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/IndexSchool.js diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanController.cs index ea4221272..7be2dbf20 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanController.cs @@ -42,6 +42,15 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { return View(); } + /// + /// 全校开课计划 + /// + /// + [HttpGet] + public ActionResult IndexSchool() + { + return View(); + } #endregion @@ -68,6 +77,28 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers }; return Success(jsonData); } + /// + /// 全校开课计划 + /// + /// + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageListForSchool(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = classPlanIBLL.GetPageListForSchool(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + /// /// 获取表单数据 /// @@ -121,7 +152,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers entity.LessonSortNo = "1"; entity.CheckMark = "1"; entity.MakeDate = DateTime.Now; - var model = classPlanIBLL.GetRepetitions(entity.F_SchoolId, entity.AcademicYearNo, entity.Semester, entity.MajorNo, entity.Grade, entity.LessonNo); + var model = classPlanIBLL.GetRepetitions(entity.F_SchoolId, entity.AcademicYearNo, entity.Semester, entity.DeptNo, entity.MajorNo, entity.Grade, entity.LessonNo); if (model != null) { if (keyValue != model.ID.ToString()) @@ -146,29 +177,30 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public ActionResult CourseArranging(string keyValue) { var entity = classPlanIBLL.GetListById(keyValue); + List TeachList = new List(); for (int i = 0; i < entity.Count; i++) { - var classList = classInfoIBLL.GetAllClass(). - Where(x => x.MajorNo == entity[i].MajorNo && x.Grade == entity[i].Grade) - .OrderBy(x => x.ClassNo).Select(stringClass => new { stringClass.ClassNo, stringClass.ClassName }).ToList(); - if (classList.Count > 0) + var lessonList = classInfoIBLL.GetAllClass(). + Where(x => x.DeptNo == entity[i].DeptNo && x.MajorNo == entity[i].MajorNo && x.Grade == entity[i].Grade) + .OrderBy(x => x.ClassNo).Select(field1 => new { field1.ClassNo, field1.ClassName }).ToList(); + if (lessonList.Count > 0) { - for (int j = 0; j < classList.Count; j++) + for (int j = 0; j < lessonList.Count; j++) { - TeachClassEntity TeachEntity = new TeachClassEntity - { - TeachClassNo = classList[j].ClassNo, - AcademicYearNo = entity[i].AcademicYearNo, - MajorNo = entity[i].MajorNo, - Grade = entity[i].Grade, - Semester = entity[i].Semester, - LessonNo = entity[i].LessonNo, - StuNum = entity[i].StuNum, - LessonSortNo = entity[i].LessonSortNo, - F_SchoolId = entity[i].F_SchoolId - }; + TeachClassEntity TeachEntity = new TeachClassEntity(); + TeachEntity.TeachClassNo = lessonList[j].ClassNo; + TeachEntity.AcademicYearNo = entity[i].AcademicYearNo; + TeachEntity.DeptNo = entity[i].DeptNo; + TeachEntity.MajorNo = entity[i].MajorNo; + TeachEntity.Grade = entity[i].Grade; + TeachEntity.Semester = entity[i].Semester; + TeachEntity.LessonNo = entity[i].LessonNo; + TeachEntity.StuNum = entity[i].StuNum; + TeachEntity.LessonSortNo = entity[i].LessonSortNo; + TeachEntity.F_SchoolId = entity[i].F_SchoolId; + TeachList.Add(TeachEntity); } } 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 0fa2695f2..d71bb6b59 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,8 +22,9 @@ 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(); private LessonInfoIBLL lessonInfoIBLL = new LessonInfoBLL(); - + #region 视图功能 /// @@ -71,6 +72,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, @@ -146,11 +155,12 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers var lessonData = lessonInfoIBLL.GetAllLesson(); 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 + 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) { @@ -187,6 +197,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers TeachEntity.F_SchoolId = entityList[i].F_SchoolId; TeachEntity.CheckMark = "1"; TeachEntity.InsertTime = DateTime.Now; + TeachList.Add(TeachEntity); } } else @@ -203,111 +214,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.MajorNo == entityList[i].MajorNo - && y.F_SchoolId == entityList[i].F_SchoolId - && y.ClassNo == entityList[i].TeachClassNo - && y.LessonNo == entityList[i].LessonNo - ).Select(x => x.SelectId.ToString()).ToList(); - Nid += string.Join(",", ssList) + ","; - } + //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); } - 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.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.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("设置失败,未发现相关学生!"); - } - } - - StuSelectLesson.SaveEntityList(TeachList); - teachClassIBLL.UpEmpNo(keyValue, EmpNo); //更改当前教师 - - return Success("设置成功!"); - } - - [HttpPost] - [AjaxOnly] - public ActionResult UpTeach(string keyValue, string EmpNo) - { - var entityList = teachClassIBLL.GetTeachListById(keyValue); - if (entityList != null) - { - var res = teachClassIBLL.UpSetTeach(keyValue, EmpNo); //更改当前教师 - if (!string.IsNullOrEmpty(res)) - { - return Fail(res); - } - } - else - { - return Fail("设置失败"); - } - - return Success("设置成功!"); - } - - [HttpPost] - [AjaxOnly] - public ActionResult QzUpTeach(string keyValue, string EmpNo) - { - var entityList = teachClassIBLL.GetTeachListById(keyValue); - if (entityList != null) - { - teachClassIBLL.UpQzSetTeach(keyValue, EmpNo); //更改当前教师 - } return Success("设置成功!"); } #endregion diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Form.cshtml index eb807f5b4..ed3522e02 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Form.cshtml @@ -15,58 +15,70 @@
学期*
-
-
专业*
-
+
+
考试类型*
+
-
+
年级*
+
+
系部*
+
+
+
+
专业*
+
+
课程*
-
+
课程细类码
-