From 52452c3e2d21b26197b4f04e450c32248776df2e Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Mon, 16 May 2022 14:39:15 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=B8=93=E4=B8=9A=E5=BC=80=E8=AF=BE?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E6=96=B0=E5=A2=9E=E4=B8=80=E5=88=97=20=20?= =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E7=B1=BB=E5=9E=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Views/ClassPlan/Index.js | 72 ++++++------------- .../Learun.Application.Web.csproj | 1 + .../ClassPlan/ClassPlanService.cs | 3 +- .../OpenLessonPlan/OpenLessonPlanEntity.cs | 6 ++ 4 files changed, 32 insertions(+), 50 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Index.js index 302b579fe..561cf15c2 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Index.js @@ -197,22 +197,9 @@ var bootstrap = function ($, learun) { }, // 初始化列表 initGird: function () { - $('#gridtable').lrAuthorizeJfGrid({ + $('#gridtable').jfGrid({ url: top.$.rootUrl + '/EducationalAdministration/ClassPlan/GetPageList', headData: [ - { - label: "校区", name: "F_SchoolId", width: 200, align: "left", - formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company', - key: value, - keyId: 'f_companyid', - callback: function (_data) { - callback(_data['f_fullname']); - } - }); - } - }, { label: "学年", name: "AcademicYearNo", width: 80, align: "left" }, { label: "学期", name: "Semester", width: 50, align: "left", @@ -226,35 +213,22 @@ var bootstrap = function ($, learun) { }); } }, + { label: "年级", name: "Grade", width: 50, align: "left" }, + { label: "课程编码", name: "LessonNo", width: 200, align: "left" }, + { label: "课程名称", name: "LessonName", width: 200, align: "left" }, { - label: "系部", name: "DeptNo", width: 100, align: "left", - formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', - key: value, - keyId: 'deptno', - callback: function (_data) { - callback(_data['deptname']); - } - }); - } - }, - { - label: "专业", name: "MajorNo", width: 100, align: "left", + label: "课程类型", name: "LessonTypeId", width: 200, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdLessonType', key: value, - keyId: 'id', + keyId: 'ltid', callback: function (_data) { - callback(_data['majorname']); + callback(_data['lessontypename']); } }); } }, - { label: "年级", name: "Grade", width: 50, align: "left" }, - { label: "课程编码", name: "LessonNo", width: 200, align: "left" }, - { label: "课程名称", name: "LessonName", width: 200, align: "left" }, { label: "状态", name: "State", width: 100, align: "left", formatter: function (cellvalue, row) { @@ -266,25 +240,25 @@ var bootstrap = function ($, learun) { } }, { label: "拟开教学班数", name: "TeachClassNum", width: 100, align: "left" }, - { label: "人数", name: "StuNum", width: 80, align: "left" }, + //{ label: "人数", name: "StuNum", width: 80, align: "left" }, { label: "周课时", name: "WeekLessonHour", width: 80, align: "left" }, { label: "教室课时", name: "WeekHourClassroom", width: 80, align: "left" }, { label: "上机课时", name: "PracticeHour", width: 80, align: "left" }, { label: "起始周次", name: "StartWeek", width: 80, align: "left" }, - { label: "结束周次", name: "EndWeek", width: 80, align: "left" }, - { - label: "负责开课院系", name: "TeachDeptNo", width: 100, align: "left", - formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', - key: value, - keyId: 'deptno', - callback: function (_data) { - callback(_data['deptname']); - } - }); - } - }, + //{ label: "结束周次", name: "EndWeek", width: 80, align: "left" }, + //{ + // label: "负责开课院系", name: "TeachDeptNo", width: 100, align: "left", + // formatterAsync: function (callback, value, row, op, $cell) { + // learun.clientdata.getAsync('custmerData', { + // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', + // key: value, + // keyId: 'deptno', + // callback: function (_data) { + // callback(_data['deptname']); + // } + // }); + // } + //}, { label: "学分", name: "StudyScore", width: 80, align: "left" }, { label: "备注", name: "Remark", width: 100, align: "left" }, ], 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 8cf2eb00f..01162a6b9 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 @@ -7926,6 +7926,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanService.cs index 822519c21..ef0c94a41 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanService.cs @@ -32,8 +32,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { var strSql = new StringBuilder(); strSql.Append("SELECT "); - strSql.Append(@" * "); + strSql.Append(@" t.*,l.LessonTypeId "); strSql.Append(" FROM OpenLessonPlan t "); + strSql.Append(" left join lessoninfo l on t.lessonno=l.lessonno "); strSql.Append(" WHERE 1=1 "); var queryParam = queryJson.ToJObject(); // 虚拟参数 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlan/OpenLessonPlanEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlan/OpenLessonPlanEntity.cs index 0ebadc6b6..7c6df67ad 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlan/OpenLessonPlanEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlan/OpenLessonPlanEntity.cs @@ -316,6 +316,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration [NotMapped] public string TeachNo { get; set; } + /// + /// 课程类型 + /// + [NotMapped] + public string LessonTypeId { get; set; } + #endregion } } From d9eddebfbbdb110d7e2dabbe1ca8515ced619a39 Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Mon, 16 May 2022 15:52:05 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=85=A8=E6=A0=A1=E5=BC=80=E8=AF=BE?= =?UTF-8?q?=E8=AE=A1=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/ClassPlanController.cs | 31 +++++ .../Views/ClassPlan/IndexSchool.cshtml | 44 ++++++ .../Views/ClassPlan/IndexSchool.js | 129 ++++++++++++++++++ .../Learun.Application.Web.csproj | 2 + .../ClassPlan/ClassPlanBLL.cs | 26 ++++ .../ClassPlan/ClassPlanIBLL.cs | 1 + .../ClassPlan/ClassPlanService.cs | 70 ++++++++++ 7 files changed, 303 insertions(+) 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 cdb33e70f..00ec7b2f3 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); + } + /// /// 获取表单数据 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/IndexSchool.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/IndexSchool.cshtml new file mode 100644 index 000000000..7f499bb1f --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/IndexSchool.cshtml @@ -0,0 +1,44 @@ +@{ + ViewBag.Title = "开课计划"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
学年
+
+
+
+
学期
+
+
+
+
年级
+
+
+
+
课程
+
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+ +@Html.AppendJsFile("/Areas/EducationalAdministration/Views/ClassPlan/IndexSchool.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/IndexSchool.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/IndexSchool.js new file mode 100644 index 000000000..73ef466e3 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/IndexSchool.js @@ -0,0 +1,129 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-11-29 11:43 + * 描 述:开课计划 + */ +var refreshGirdData; +var bootstrap = function ($, learun) { + "use strict"; + var cddeptname = ''; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 250, 400); + //$('#F_SchoolId').lrDataSourceSelect({ code: 'company', value: 'f_companyid', text: 'f_fullname' }); + $('#AcademicYearNo').lrselect({ + placeholder: "请选择学年", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo', + value: 'value', + text: 'text' + }); + //年级 + $('#Grade').lrselect({ + placeholder: "请选择年级", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/StuInfoFresh/GetGradeData', + value: 'value', + text: 'text' + }); + $('#Semester').lrDataItemSelect({ code: 'Semester' }); + $("#MajorNo").lrselect(); + + $('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); + + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/ClassPlan/GetPageListForSchool', + headData: [ + { label: "学年", name: "AcademicYearNo", width: 80, align: "left" }, + { + label: "学期", name: "Semester", width: 50, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'Semester', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { label: "年级", name: "Grade", width: 50, align: "left" }, + { label: "课程编码", name: "LessonNo", width: 200, align: "left" }, + { label: "课程名称", name: "LessonName", width: 200, align: "left" }, + { + label: "课程类型", name: "LessonTypeId", width: 200, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdLessonType', + key: value, + keyId: 'ltid', + callback: function (_data) { + callback(_data['lessontypename']); + } + }); + } + }, + { + label: "状态", name: "State", width: 100, align: "left", + formatter: function (cellvalue, row) { + if (cellvalue == 0) { + return '未排课'; + } if (cellvalue == 1) { + return '已排课'; + } + } + }, + { label: "拟开教学班数", name: "TeachClassNum", width: 100, align: "left" }, + //{ label: "人数", name: "StuNum", width: 80, align: "left" }, + { label: "周课时", name: "WeekLessonHour", width: 80, align: "left" }, + { label: "教室课时", name: "WeekHourClassroom", width: 80, align: "left" }, + { label: "上机课时", name: "PracticeHour", width: 80, align: "left" }, + { label: "起始周次", name: "StartWeek", width: 80, align: "left" }, + //{ label: "结束周次", name: "EndWeek", width: 80, align: "left" }, + //{ + // label: "负责开课院系", name: "TeachDeptNo", width: 100, align: "left", + // formatterAsync: function (callback, value, row, op, $cell) { + // learun.clientdata.getAsync('custmerData', { + // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', + // key: value, + // keyId: 'deptno', + // callback: function (_data) { + // callback(_data['deptname']); + // } + // }); + // } + //}, + { label: "学分", name: "StudyScore", width: 80, align: "left" }, + { label: "备注", name: "Remark", width: 100, align: "left" }, + ], + mainId: 'ID', + sidx: 'MakeDate desc', + isPage: true + }); + page.search(); + }, + search: function (param) { + param = param || {}; + param.DeptNo = cddeptname; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + $('#gridtable').jfGridSet('reload'); + }; + page.init(); +} 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 01162a6b9..1221cf0c7 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 @@ -965,6 +965,7 @@ + @@ -7833,6 +7834,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanBLL.cs index 44d709d8a..550447792 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanBLL.cs @@ -43,6 +43,32 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetPageListForSchool(Pagination pagination, string queryJson) + { + try + { + return classPlanService.GetPageListForSchool(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// /// 获取OpenLessonPlan表实体数据 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanIBLL.cs index 012eb2fa5..694a3b362 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanIBLL.cs @@ -21,6 +21,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 查询参数 /// IEnumerable GetPageList(Pagination pagination, string queryJson); + IEnumerable GetPageListForSchool(Pagination pagination, string queryJson); /// /// 获取OpenLessonPlan表实体数据 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanService.cs index ef0c94a41..3fed56576 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ClassPlan/ClassPlanService.cs @@ -89,6 +89,76 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 全校开课计划 + /// + /// + /// + /// + public IEnumerable GetPageListForSchool(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@" t.AcademicYearNo,t.Semester,t.Grade,t.LessonNo,t.LessonName,l.LessonTypeId,t.TeachClassNum,t.WeekLessonHour,t.WeekHourClassroom,t.PracticeHour,t.StartWeek,t.StudyScore,t.Remark,t.MakeDate "); + strSql.Append(" FROM OpenLessonPlan t "); + strSql.Append(" left join lessoninfo l on t.lessonno=l.lessonno "); + strSql.Append(" where l.CheckMark=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["F_SchoolId"].IsEmpty()) + { + dp.Add("F_SchoolId", queryParam["F_SchoolId"].ToString(), DbType.String); + strSql.Append(" AND t.F_SchoolId = @F_SchoolId "); + } + if (!queryParam["AcademicYearNo"].IsEmpty()) + { + dp.Add("AcademicYearNo", queryParam["AcademicYearNo"].ToString(), DbType.String); + strSql.Append(" AND t.AcademicYearNo = @AcademicYearNo "); + } + if (!queryParam["Semester"].IsEmpty()) + { + dp.Add("Semester", queryParam["Semester"].ToString(), DbType.String); + strSql.Append(" AND t.Semester = @Semester "); + } + if (!queryParam["DeptNo"].IsEmpty()) + { + dp.Add("DeptNo", queryParam["DeptNo"].ToString(), DbType.String); + strSql.Append(" AND t.DeptNo = @DeptNo "); + } + if (!queryParam["MajorNo"].IsEmpty()) + { + dp.Add("MajorNo", queryParam["MajorNo"].ToString(), DbType.String); + strSql.Append(" AND t.MajorNo = @MajorNo "); + } + if (!queryParam["Grade"].IsEmpty()) + { + dp.Add("Grade", "%" + queryParam["Grade"].ToString() + "%", DbType.String); + strSql.Append(" AND t.Grade Like @Grade "); + } + if (!queryParam["LessonNo"].IsEmpty()) + { + dp.Add("LessonNo", queryParam["LessonNo"].ToString(), DbType.String); + strSql.Append(" AND t.LessonNo = @LessonNo "); + } + strSql.Append(" group by t.AcademicYearNo,t.Semester,t.Grade,t.LessonNo,t.LessonName,l.LessonTypeId,t.State, t.TeachClassNum, t.WeekLessonHour, t.WeekHourClassroom, t.PracticeHour, t.StartWeek, t.StudyScore, t.Remark,t.MakeDate "); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// /// 获取OpenLessonPlan表实体数据 /// From af6f937a782c12ec979e9d2e45cc3b39f5dda67b Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Tue, 17 May 2022 10:44:18 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E5=AE=89=E6=8E=92=E8=80=83=E8=AF=95?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE=E8=80=83=E8=AF=95=E6=97=B6=E9=97=B4=E6=97=B6?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=88=A4=E6=96=AD=E8=80=83=E8=AF=95=E6=97=B6?= =?UTF-8?q?=E9=97=B4=E6=98=AF=E5=90=A6=E5=86=B2=E7=AA=81=E7=9A=84=E9=99=90?= =?UTF-8?q?=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Exam_ExamPlanLessonController.cs | 9 +++++- .../Exam_ExamPlanLessonBLL.cs | 4 +-- .../Exam_ExamPlanLessonIBLL.cs | 2 +- .../Exam_ExamPlanLessonService.cs | 30 ++++++++++++++++--- 4 files changed, 37 insertions(+), 8 deletions(-) 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 index 12ab302e2..898802d3e 100644 --- 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 @@ -305,8 +305,15 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { entity.ExamTime = entity.ExamTimeStart.Trim() + "-" + entity.ExamTimeEnd; } + + entity.EPLId = keyValue; //判断考试时间是否冲突 - //exam_ExamPlanLessonIBLL.IsExamTimeClash(entity); + var res = exam_ExamPlanLessonIBLL.IsExamTimeClash(entity); + if (res.flag && !string.IsNullOrEmpty(res.lessonname)) + { + return Fail("考试时间与课程(" + res.lessonname + ")冲突!"); + } + //保存 exam_ExamPlanLessonIBLL.SaveEntity(keyValue, entity); return Success("保存成功!"); diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonBLL.cs index 4e8106348..c7c637b78 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonBLL.cs @@ -208,11 +208,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 判断考试时间是否冲突 ///
/// - public void IsExamTimeClash(Exam_ExamPlanLessonEntity entity) + public (bool flag, string lessonname) IsExamTimeClash(Exam_ExamPlanLessonEntity entity) { try { - exam_ExamPlanLessonService.IsExamTimeClash(entity); + return exam_ExamPlanLessonService.IsExamTimeClash(entity); } catch (Exception ex) { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonIBLL.cs index b34662b37..fa343c8f2 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonIBLL.cs @@ -50,7 +50,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 实体 void SaveEntity(string keyValue, Exam_ExamPlanLessonEntity entity); - void IsExamTimeClash(Exam_ExamPlanLessonEntity entity); + (bool flag, string lessonname) IsExamTimeClash(Exam_ExamPlanLessonEntity entity); #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonService.cs index c9b058f10..e311e7905 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonService.cs @@ -224,7 +224,7 @@ and AcademicYearNo='{exam_ExamPlan.AcademicYearNo}' and Semester='{exam_ExamPlan { //考试课程信息 var examLesson = db.FindEntity(x => x.ELId == lesson.ELId); - + //应排班级数 lesson.ClassNum = classInfo.Count(); //应考人数 @@ -281,14 +281,36 @@ and AcademicYearNo='{exam_ExamPlan.AcademicYearNo}' and Semester='{exam_ExamPlan } /// - /// 判断考试时间是否冲突(未完成) + /// 判断考试时间是否冲突 /// /// - public void IsExamTimeClash(Exam_ExamPlanLessonEntity entity) + public (bool flag, string lessonname) IsExamTimeClash(Exam_ExamPlanLessonEntity entity) { try { - + var epl = this.BaseRepository("CollegeMIS").FindEntity(entity.EPLId); + //查询和entity考试日期同一天的考试课程 + var daylist = this.BaseRepository("CollegeMIS").FindList($"select * from [dbo].[Exam_ExamPlanLesson] where epid='{epl.EPId}' and examtime is not null and datediff(day, examdate, '{entity.ExamDate}') = 0"); + //考试开始时间 + var examstartTime = Convert.ToDateTime(entity.ExamDate.Value.ToString("yyyy-MM-dd") + " " + entity.ExamTimeStart.Trim()); + //考试结束时间 + var examendTime = Convert.ToDateTime(entity.ExamDate.Value.ToString("yyyy-MM-dd") + " " + entity.ExamTimeEnd.Trim()); + + foreach (var examPlanLesson in daylist) + { + //开始时间 + var startTime = Convert.ToDateTime(examPlanLesson.ExamDate.Value.ToString("yyyy-MM-dd") + " " + examPlanLesson.ExamTime.Split('-')[0]); + //结束时间 + var endTime = Convert.ToDateTime(examPlanLesson.ExamDate.Value.ToString("yyyy-MM-dd") + " " + examPlanLesson.ExamTime.Split('-')[1]); + if ((examstartTime >= startTime && examstartTime <= endTime) || + (examendTime >= startTime && examendTime <= endTime)) + { + return (true, examPlanLesson.LessonName); + } + + } + + return (false, ""); } catch (Exception ex) { From e720176c9ece1dd555ff568f43ea99e1773f81ff Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Tue, 17 May 2022 16:22:58 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E5=AE=89=E6=8E=92=E8=80=83=E8=AF=95?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=8F=AD=E7=BA=A7=E6=97=B6=E5=88=A4=E6=96=AD?= =?UTF-8?q?=E8=80=83=E8=AF=95=E6=97=B6=E9=97=B4=E6=98=AF=E5=90=A6=E5=86=B2?= =?UTF-8?q?=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Exam_ExamPlanLessonController.cs | 27 +++++----- .../Exam_ExamPlanClassBLL.cs | 19 +++++++ .../Exam_ExamPlanClassIBLL.cs | 1 + .../Exam_ExamPlanClassService.cs | 52 +++++++++++++++++++ 4 files changed, 86 insertions(+), 13 deletions(-) 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 index 898802d3e..13be2c9ec 100644 --- 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 @@ -272,6 +272,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { return Fail("考场座位数不足!"); } + } exam_ExamPlanLessonIBLL.Check(keyValue, ELCheckMark); @@ -308,11 +309,11 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers entity.EPLId = keyValue; //判断考试时间是否冲突 - var res = exam_ExamPlanLessonIBLL.IsExamTimeClash(entity); - if (res.flag && !string.IsNullOrEmpty(res.lessonname)) - { - return Fail("考试时间与课程(" + res.lessonname + ")冲突!"); - } + //var res = exam_ExamPlanLessonIBLL.IsExamTimeClash(entity); + //if (res.flag && !string.IsNullOrEmpty(res.lessonname)) + //{ + // return Fail("考试时间与课程(" + res.lessonname + ")冲突!"); + //} //保存 exam_ExamPlanLessonIBLL.SaveEntity(keyValue, entity); @@ -325,6 +326,13 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers 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("保存成功!"); } @@ -342,14 +350,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers return Success("保存成功!"); } - //[HttpPost] - //[ValidateAntiForgeryToken] - //[AjaxOnly] - //public ActionResult SaveRoom(List list) - //{ - // exam_ExamPlanRoomIBLL.SaveList(list); - // return Success("保存成功!"); - //} + #endregion diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanClass/Exam_ExamPlanClassBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanClass/Exam_ExamPlanClassBLL.cs index 264503ac2..5599292d0 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanClass/Exam_ExamPlanClassBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanClass/Exam_ExamPlanClassBLL.cs @@ -163,6 +163,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + public (bool flag, string msg) IsExamConflict(List list) + { + try + { + return exam_ExamPlanClassService.IsExamConflict(list); + } + 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/Exam_ExamPlanClass/Exam_ExamPlanClassIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanClass/Exam_ExamPlanClassIBLL.cs index 23f3499a4..a8231b9ec 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanClass/Exam_ExamPlanClassIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanClass/Exam_ExamPlanClassIBLL.cs @@ -46,6 +46,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration void SaveEntity(string keyValue, Exam_ExamPlanClassEntity entity); void SaveList(List list); + (bool flag, string msg) IsExamConflict(List list); #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanClass/Exam_ExamPlanClassService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanClass/Exam_ExamPlanClassService.cs index ece9887d0..40de43186 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanClass/Exam_ExamPlanClassService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanClass/Exam_ExamPlanClassService.cs @@ -199,6 +199,58 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 判断排考班级的考试时间是否冲突 + /// + /// + public (bool flag, string msg) IsExamConflict(List list) + { + try + { + //排考安排课程表Id + var EPLId = list.Select(x => x.EPLId).FirstOrDefault(); + var examPlanLesson = this.BaseRepository("CollegeMIS").FindEntity(EPLId); + //开始时间 + var startTime = Convert.ToDateTime(examPlanLesson.ExamDate.Value.ToString("yyyy-MM-dd") + " " + examPlanLesson.ExamTime.Split('-')[0]); + //结束时间 + var endTime = Convert.ToDateTime(examPlanLesson.ExamDate.Value.ToString("yyyy-MM-dd") + " " + examPlanLesson.ExamTime.Split('-')[1]); + foreach (var classs in list) + { + //查询和entity考试日期同一天的考试课程 + string sql = $@"select * from [dbo].[Exam_ExamPlanLesson] where eplid in ( +select distinct eplid from [dbo].[Exam_ExamPlanclass] where classno='{classs.ClassNo}') and eplid <> '{examPlanLesson.EPLId}' +and examtime is not null and datediff(day, examdate, '{examPlanLesson.ExamDate}') = 0"; + var eplList = this.BaseRepository("CollegeMIS").FindList(sql); + foreach (var epl in eplList) + { + //开始时间 + var startTime1 = Convert.ToDateTime(epl.ExamDate.Value.ToString("yyyy-MM-dd") + " " + epl.ExamTime.Split('-')[0]); + //结束时间 + var endTime1 = Convert.ToDateTime(epl.ExamDate.Value.ToString("yyyy-MM-dd") + " " + epl.ExamTime.Split('-')[1]); + if ((startTime >= startTime1 && startTime <= endTime1) || + (endTime >= startTime1 && endTime <= endTime1)) + { + var ep = this.BaseRepository("CollegeMIS").FindEntity(epl.EPId); + return (true, classs.ClassName + "与" + ep.PlanName + "--" + epl.LessonName + "的考试时间冲突!"); + } + } + } + return (false, ""); + + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// /// 排考安排班级 /// 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 5/5] =?UTF-8?q?=E9=80=89=E4=BF=AE=E8=AF=BE=E8=AF=BE?= =?UTF-8?q?=E7=A8=8B=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