@@ -42,6 +42,15 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
{ | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 全校开课计划 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult IndexSchool() | |||
{ | |||
return View(); | |||
} | |||
#endregion | |||
@@ -68,6 +77,28 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
}; | |||
return Success(jsonData); | |||
} | |||
/// <summary> | |||
/// 全校开课计划 | |||
/// </summary> | |||
/// <param name="pagination"></param> | |||
/// <param name="queryJson"></param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetPageListForSchool(string pagination, string queryJson) | |||
{ | |||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||
var data = classPlanIBLL.GetPageListForSchool(paginationobj, queryJson); | |||
var jsonData = new | |||
{ | |||
rows = data, | |||
total = paginationobj.total, | |||
page = paginationobj.page, | |||
records = paginationobj.records | |||
}; | |||
return Success(jsonData); | |||
} | |||
/// <summary> | |||
/// 获取表单数据 | |||
/// </summary> | |||
@@ -272,6 +272,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
{ | |||
return Fail("考场座位数不足!"); | |||
} | |||
} | |||
exam_ExamPlanLessonIBLL.Check(keyValue, ELCheckMark); | |||
@@ -305,8 +306,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("保存成功!"); | |||
@@ -318,6 +326,13 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
public ActionResult SaveClass(string EPLId, string strEntity) | |||
{ | |||
var list = strEntity.ToObject<List<Exam_ExamPlanClassEntity>>(); | |||
//判断排考班级的考试时间是否冲突 | |||
var res = exam_ExamPlanClassIBLL.IsExamConflict(list); | |||
if (res.flag && !string.IsNullOrEmpty(res.msg)) | |||
{ | |||
return Fail(res.msg); | |||
} | |||
exam_ExamPlanClassIBLL.SaveList(list); | |||
return Success("保存成功!"); | |||
} | |||
@@ -335,14 +350,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
return Success("保存成功!"); | |||
} | |||
//[HttpPost] | |||
//[ValidateAntiForgeryToken] | |||
//[AjaxOnly] | |||
//public ActionResult SaveRoom(List<Exam_ExamPlanRoomEntity> list) | |||
//{ | |||
// exam_ExamPlanRoomIBLL.SaveList(list); | |||
// return Success("保存成功!"); | |||
//} | |||
#endregion | |||
@@ -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<OpenLessonPlanOfElectiveEntity>(); | |||
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("保存成功!"); | |||
} | |||
/// <summary> | |||
/// 保存实体数据(新增、修改) | |||
/// <param name="keyValue">主键</param> | |||
@@ -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" }, | |||
], | |||
@@ -0,0 +1,44 @@ | |||
@{ | |||
ViewBag.Title = "开课计划"; | |||
Layout = "~/Views/Shared/_Index.cshtml"; | |||
} | |||
<div class="lr-layout "> | |||
<div class="lr-layout-center"> | |||
<div class="lr-layout-wrap lr-layout-wrap-notitle "> | |||
<div class="lr-layout-tool"> | |||
<div class="lr-layout-tool-left"> | |||
<div class="lr-layout-tool-item"> | |||
<div id="multiple_condition_query"> | |||
<div class="lr-query-formcontent"> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">学年</div> | |||
<div id="AcademicYearNo"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">学期</div> | |||
<div id="Semester"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">年级</div> | |||
<div id="Grade"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">课程</div> | |||
<div id="LessonNo"></div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-tool-right"> | |||
<div class=" btn-group btn-group-sm"> | |||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/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 '<span class=\"label label-warning\">未排课</span>'; | |||
} if (cellvalue == 1) { | |||
return '<span class=\"label label-success\">已排课</span>'; | |||
} | |||
} | |||
}, | |||
{ 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(); | |||
} |
@@ -0,0 +1,31 @@ | |||
@{ | |||
ViewBag.Title = "选修课课程信息"; | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap"> | |||
<div class="col-xs-12 lr-form-item" data-table="OpenLessonPlanOfElective"> | |||
<div class="lr-form-item-title">学年<font face="宋体">*</font> </div> | |||
<div id="AcademicYearNo" isvalid="yes" checkexpession="NotNull" ></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="OpenLessonPlanOfElective"> | |||
<div class="lr-form-item-title">学期<font face="宋体">*</font> </div> | |||
<div id="Semester" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="OpenLessonPlanOfElective"> | |||
<div class="lr-form-item-title">课程<font face="宋体">*</font></div> | |||
<div id="LessonNo" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
@*<div class="col-xs-12 lr-form-item" data-table="OpenLessonPlanOfElective"> | |||
<div class="lr-form-item-title">学分 </div> | |||
<input id="StudyScore" type="text" class="form-control" /> | |||
</div>*@ | |||
<div class="col-xs-12 lr-form-item" data-table="OpenLessonPlanOfElective"> | |||
<div class="lr-form-item-title">教师<font face="宋体">*</font></div> | |||
<div id="EmpNo" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item" data-table="OpenLessonPlanOfElective"> | |||
<div class="lr-form-item-title">教室<font face="宋体">*</font></div> | |||
<div id="ClassRoomNo" isvalid="yes" checkexpession="NotNull"></div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/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(); | |||
} |
@@ -35,6 +35,7 @@ | |||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||
</div> | |||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 新增</a> | |||
<a id="lr_editMajor" class="btn btn-default"><i class="fa fa-plus"></i> 管理选课专业</a> | |||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-group"></i> 设置人数</a> | |||
<a id="lr_modify" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 异动</a> | |||
@@ -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 "<span class=\"label label-success\">是</span>"; | |||
} else { | |||
@@ -965,6 +965,7 @@ | |||
<Content Include="Areas\EducationalAdministration\Views\ClassPlanTeach\TeachFormQZ.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\ClassPlanTeach\TeachForm.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\ClassPlan\Form.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\ClassPlan\IndexSchool.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\ClassPlan\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Dispatch\Form.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Dispatch\FormView.js" /> | |||
@@ -1030,6 +1031,7 @@ | |||
<Content Include="Areas\EducationalAdministration\Views\LessonInfo\IndexNoMajor.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\LoginUserBind\Form.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\LoginUserBind\BindAccountIndex.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\OpenLessonPlanOfElective\FormElective.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\PracticeBase\Form.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\PracticeBase\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\R_EnterBuilding\ClassReport.js" /> | |||
@@ -7833,6 +7835,8 @@ | |||
<Content Include="Areas\EducationalAdministration\Views\Sys_PsychologicalCounse\IndexRecive.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Sys_PsychologicalCounse\FormViewReceive.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Sys_PsychologicalCounse\FormViewReceiveData.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\ClassPlan\IndexSchool.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\OpenLessonPlanOfElective\FormElective.cshtml" /> | |||
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" /> | |||
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> | |||
<Content Include="Views\Login\Default-beifen.cshtml" /> | |||
@@ -7926,6 +7930,7 @@ | |||
<None Include="Properties\PublishProfiles\FolderProfile3.pubxml" /> | |||
<None Include="Properties\PublishProfiles\FolderProfile4.pubxml" /> | |||
<None Include="Properties\PublishProfiles\FolderProfile5.pubxml" /> | |||
<None Include="Properties\PublishProfiles\FolderProfile6.pubxml" /> | |||
<None Include="Properties\PublishProfiles\learunadms6.1.pubxml" /> | |||
</ItemGroup> | |||
<ItemGroup> | |||
@@ -43,6 +43,32 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
} | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<OpenLessonPlanEntity> GetPageListForSchool(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
return classPlanService.GetPageListForSchool(pagination, queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取OpenLessonPlan表实体数据 | |||
/// </summary> | |||
@@ -21,6 +21,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
IEnumerable<OpenLessonPlanEntity> GetPageList(Pagination pagination, string queryJson); | |||
IEnumerable<OpenLessonPlanEntity> GetPageListForSchool(Pagination pagination, string queryJson); | |||
/// <summary> | |||
/// 获取OpenLessonPlan表实体数据 | |||
/// </summary> | |||
@@ -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(); | |||
// 虚拟参数 | |||
@@ -88,6 +89,76 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
} | |||
/// <summary> | |||
/// 全校开课计划 | |||
/// </summary> | |||
/// <param name="pagination"></param> | |||
/// <param name="queryJson"></param> | |||
/// <returns></returns> | |||
public IEnumerable<OpenLessonPlanEntity> 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<OpenLessonPlanEntity>(strSql.ToString(), dp, pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取OpenLessonPlan表实体数据 | |||
/// </summary> | |||
@@ -163,6 +163,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
} | |||
public (bool flag, string msg) IsExamConflict(List<Exam_ExamPlanClassEntity> list) | |||
{ | |||
try | |||
{ | |||
return exam_ExamPlanClassService.IsExamConflict(list); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
@@ -46,6 +46,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
void SaveEntity(string keyValue, Exam_ExamPlanClassEntity entity); | |||
void SaveList(List<Exam_ExamPlanClassEntity> list); | |||
(bool flag, string msg) IsExamConflict(List<Exam_ExamPlanClassEntity> list); | |||
#endregion | |||
} | |||
@@ -199,6 +199,58 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
} | |||
/// <summary> | |||
/// 判断排考班级的考试时间是否冲突 | |||
/// </summary> | |||
/// <param name="list"></param> | |||
public (bool flag, string msg) IsExamConflict(List<Exam_ExamPlanClassEntity> list) | |||
{ | |||
try | |||
{ | |||
//排考安排课程表Id | |||
var EPLId = list.Select(x => x.EPLId).FirstOrDefault(); | |||
var examPlanLesson = this.BaseRepository("CollegeMIS").FindEntity<Exam_ExamPlanLessonEntity>(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<Exam_ExamPlanLessonEntity>(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<Exam_ExamPlanEntity>(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); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 排考安排班级 | |||
/// </summary> | |||
@@ -208,11 +208,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// 判断考试时间是否冲突 | |||
/// </summary> | |||
/// <param name="entity"></param> | |||
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) | |||
{ | |||
@@ -50,7 +50,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// <param name="entity">实体</param> | |||
void SaveEntity(string keyValue, Exam_ExamPlanLessonEntity entity); | |||
void IsExamTimeClash(Exam_ExamPlanLessonEntity entity); | |||
(bool flag, string lessonname) IsExamTimeClash(Exam_ExamPlanLessonEntity entity); | |||
#endregion | |||
} | |||
@@ -224,7 +224,7 @@ and AcademicYearNo='{exam_ExamPlan.AcademicYearNo}' and Semester='{exam_ExamPlan | |||
{ | |||
//考试课程信息 | |||
var examLesson = db.FindEntity<Exam_ExamLessonEntity>(x => x.ELId == lesson.ELId); | |||
//应排班级数 | |||
lesson.ClassNum = classInfo.Count(); | |||
//应考人数 | |||
@@ -281,14 +281,36 @@ and AcademicYearNo='{exam_ExamPlan.AcademicYearNo}' and Semester='{exam_ExamPlan | |||
} | |||
/// <summary> | |||
/// 判断考试时间是否冲突(未完成) | |||
/// 判断考试时间是否冲突 | |||
/// </summary> | |||
/// <param name="entity"></param> | |||
public void IsExamTimeClash(Exam_ExamPlanLessonEntity entity) | |||
public (bool flag, string lessonname) IsExamTimeClash(Exam_ExamPlanLessonEntity entity) | |||
{ | |||
try | |||
{ | |||
var epl = this.BaseRepository("CollegeMIS").FindEntity<Exam_ExamPlanLessonEntity>(entity.EPLId); | |||
//查询和entity考试日期同一天的考试课程 | |||
var daylist = this.BaseRepository("CollegeMIS").FindList<Exam_ExamPlanLessonEntity>($"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) | |||
{ | |||
@@ -316,6 +316,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
[NotMapped] | |||
public string TeachNo { get; set; } | |||
/// <summary> | |||
/// 课程类型 | |||
/// </summary> | |||
[NotMapped] | |||
public string LessonTypeId { get; set; } | |||
#endregion | |||
} | |||
} | |||
@@ -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 扩展数据 | |||
@@ -50,6 +50,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// <summary> | |||
/// <returns></returns> | |||
void SaveEntity(string keyValue, OpenLessonPlanOfElectiveEntity entity); | |||
void AddForm(string keyValue, OpenLessonPlanOfElectiveEntity entity); | |||
#endregion | |||
#region 扩展数据 | |||
@@ -261,6 +261,64 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 添加选修课程、合班记录 | |||
/// </summary> | |||
/// <param name="keyValue"></param> | |||
/// <param name="entity"></param> | |||
public void AddForm(string keyValue, OpenLessonPlanOfElectiveEntity entity) | |||
{ | |||
var db = this.BaseRepository("CollegeMIS"); | |||
try | |||
{ | |||
db.BeginTrans(); | |||
var lesson = db.FindEntity<LessonInfoEntity>(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 | |||