From 46974c5bb6cd3d8b2fadc3114b4278391cab1ff0 Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Wed, 18 May 2022 11:44:53 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=89=E4=BF=AE=E8=AF=BE=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=20=E6=96=B0=E5=A2=9E=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OpenLessonPlanOfElectiveController.cs | 30 +++++ .../FormElective.cshtml | 31 +++++ .../OpenLessonPlanOfElective/FormElective.js | 110 ++++++++++++++++++ .../MergeIndex.cshtml | 1 + .../OpenLessonPlanOfElective/MergeIndex.js | 17 ++- .../Learun.Application.Web.csproj | 2 + .../OpenLessonPlanOfElectiveBLL.cs | 19 +++ .../OpenLessonPlanOfElectiveIBLL.cs | 1 + .../OpenLessonPlanOfElectiveService.cs | 58 +++++++++ 9 files changed, 268 insertions(+), 1 deletion(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/FormElective.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/FormElective.js diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/OpenLessonPlanOfElectiveController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/OpenLessonPlanOfElectiveController.cs index a1a8f1486..294664cc0 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/OpenLessonPlanOfElectiveController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/OpenLessonPlanOfElectiveController.cs @@ -81,6 +81,12 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { return View(); } + + [HttpGet] + public ActionResult FormElective() + { + return View(); + } #endregion #region 获取数据 @@ -191,6 +197,30 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers openLessonPlanOfElectiveIBLL.SaveEntity(keyValue, entity); return Success("保存成功!"); } + + + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult AddForm(string keyValue, string strEntity) + { + var loginUserInfo = LoginUserInfo.Get(); + + OpenLessonPlanOfElectiveEntity entity = strEntity.ToObject(); + entity.ModifyTime = DateTime.Now; + entity.ModifyUserId = loginUserInfo.userId; + entity.ModifyUserName = loginUserInfo.realName; + + entity.LessonSection = "57,58"; + entity.LessonTime = "18:00-18:45,18:45-19:30"; + entity.F_SchoolId = loginUserInfo.companyId; + entity.LessonSortNo = "2"; + entity.MakeDate = DateTime.Now; + entity.CheckMark = "1"; + openLessonPlanOfElectiveIBLL.AddForm(keyValue, entity); + return Success("保存成功!"); + } + /// /// 保存实体数据(新增、修改) /// 主键 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/FormElective.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/FormElective.cshtml new file mode 100644 index 000000000..4d9481e6f --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/FormElective.cshtml @@ -0,0 +1,31 @@ +@{ + ViewBag.Title = "选修课课程信息"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
学年*
+
+
+
+
学期*
+
+
+
+
课程*
+
+
+ @*
+
学分
+ +
*@ +
+
教师*
+
+
+
+
教室*
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/FormElective.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/FormElective.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/FormElective.js new file mode 100644 index 000000000..dabc5e0dd --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/FormElective.js @@ -0,0 +1,110 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-05-14 10:02 + * 描 述:选修课课程信息 + */ +var acceptClick; +var keyValue = request('keyValue'); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + }, + bind: function () { + $('#AcademicYearNo').lrselect({ + placeholder: "学年", + allowSearch: false, + url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo', + value: 'value', + text: 'text' + }); + //学期 + $('#Semester').lrselect({ + placeholder: "学期", + allowSearch: false, + url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester', + value: 'value', + text: 'text' + }); + //$('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); + $('#LessonNo').lrselect({ + placeholder: "课程", + allowSearch: true, + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo&strWhere=' + 'lessonsortno=2', + value: 'lessonno', + text: 'lessonname' + }); + $('#EmpNo').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname' }); + $('#ClassRoomNo').lrDataSourceSelect({ code: 'ClassRoomInfo', value: 'classroomno', text: 'classroomname' }); + + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/GetFormData?keyValue=' + keyValue, function (data) { + for (var id in data) { + if (!!data[id].length && data[id].length > 0) { + $('#' + id).jfGridSet('refreshdata', data[id]); + } + else { + $('[data-table="' + id + '"]').lrSetFormData(data[id]); + } + + //课程名称 + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo', + key: $('#LessonNo').val(), + keyId: 'lessonno', + callback: function (_data) { + $('#LessonName').val(_data['lessonname']); + } + }); + //教师姓名 + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo', + key: $('#EmpNo').val(), + keyId: 'empno', + callback: function (_data) { + $('#EmpName').val(_data['empname']); + } + }); + //教室名称 + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'ClassRoomInfo', + key: $('#ClassRoomNo').val(), + keyId: 'classroomno', + callback: function (_data) { + $('#ClassRoomName').val(_data['classroomname']); + } + }); + } + }); + + } + } + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('body').lrValidform()) { + return false; + } + var strEntity = $('body').lrGetFormData(); + strEntity.LessonName = $('#LessonNo').lrselectGetText(); + strEntity.EmpName = $('#EmpNo').lrselectGetText(); + strEntity.ClassRoomName = $('#ClassRoomNo').lrselectGetText(); + var postData = { + strEntity: JSON.stringify(strEntity) + }; + + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/AddForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/MergeIndex.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/MergeIndex.cshtml index b9ecccd05..569f8f870 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/MergeIndex.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/MergeIndex.cshtml @@ -35,6 +35,7 @@
+  新增  管理选课专业  设置人数  异动 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/MergeIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/MergeIndex.js index 470213e9a..de816bfd6 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/MergeIndex.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/MergeIndex.js @@ -48,6 +48,21 @@ var bootstrap = function ($, learun) { } }); + //新增 + $('#lr_add').on('click', function () { + learun.layerForm({ + id: 'formadd', + title: '新增', + url: top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/FormElective', + width: 700, + height: 500, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + + }); + //设置人数 $('#lr_edit').on('click', function () { var keyValue = $('#gridtable').jfGridValue('Id'); @@ -226,7 +241,7 @@ var bootstrap = function ($, learun) { { label: "已报人数(预)", name: "StuNumOfApplyPre", width: 80, align: "left" }, { label: "通过人数(预)", name: "StuNumPre", width: 80, align: "left" }, { - label: "是否已选专业", name: "IsElectiveMajor", width: 100, align: "left", formatter: function (cellvalue,row) { + label: "是否已选专业", name: "IsElectiveMajor", width: 100, align: "left", formatter: function (cellvalue, row) { if (!!row.ElectiveMajorList && row.ElectiveMajorList.length > 0) { return ""; } else { 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 1221cf0c7..c6bcf0abe 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 @@ -1031,6 +1031,7 @@ + @@ -7835,6 +7836,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveBLL.cs index 1341890bd..40c7f19fd 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveBLL.cs @@ -141,6 +141,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + + public void AddForm(string keyValue, OpenLessonPlanOfElectiveEntity entity) + { + try + { + openLessonPlanOfElectiveService.AddForm(keyValue, entity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } #endregion #region 扩展数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveIBLL.cs index 4909a120f..85d78ac9c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveIBLL.cs @@ -50,6 +50,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// /// void SaveEntity(string keyValue, OpenLessonPlanOfElectiveEntity entity); + void AddForm(string keyValue, OpenLessonPlanOfElectiveEntity entity); #endregion #region 扩展数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveService.cs index 6e76ce297..a57f4a014 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveService.cs @@ -261,6 +261,64 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + /// + /// 添加选修课程、合班记录 + /// + /// + /// + public void AddForm(string keyValue, OpenLessonPlanOfElectiveEntity entity) + { + var db = this.BaseRepository("CollegeMIS"); + try + { + db.BeginTrans(); + var lesson = db.FindEntity(x => x.CheckMark == true && x.LessonNo == entity.LessonNo); + entity.StudyScore = lesson.StudyScore; + entity.Create(); + db.Insert(entity); + //添加选修合班记录 + ElectiveMergeEntity emEntity = new ElectiveMergeEntity(); + emEntity.Create(); + emEntity.AcademicYearNo = entity.AcademicYearNo; + emEntity.Semester = entity.Semester; + emEntity.LessonId = lesson.LessonId; + emEntity.LessonNo = entity.LessonNo; + emEntity.LessonName = entity.LessonName; + emEntity.F_SchoolId = LoginUserInfo.Get().companyId; + db.Insert(emEntity); + + var lessonSection = entity.LessonSection.Split(','); + for (int i = 0; i < lessonSection.Length; i++) + { + //合班明细 + ElectiveMergeItemEntity emItemEntity = new ElectiveMergeItemEntity(); + emItemEntity.Create(); + emItemEntity.EmId = emEntity.EMId; + emItemEntity.OLPOEId = entity.Id; + emItemEntity.LessonSection = lessonSection[i]; + emItemEntity.LessonTime = entity.LessonTime.Split(',')[i]; + emItemEntity.EmpNo = entity.EmpNo; + emItemEntity.EmpName = entity.EmpName; + emItemEntity.ClassRoomNo = entity.ClassRoomNo; + emItemEntity.ClassRoomName = entity.ClassRoomName; + db.Insert(emItemEntity); + } + + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } #endregion