课程细类码
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Form.js
index eb03c43cc..1da2073ca 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Form.js
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Form.js
@@ -89,7 +89,7 @@ var bootstrap = function ($, learun) {
});
}
$('#StuSortNo').val('02');
- $('#LessonSortNo').val('2');
+ $('#LessonSortNo').val('1');
$('#CheckStyleNo').val('1');
$('#ScoreRecordStyleNo').val('1');
$('#CheckMark').val('1');
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.js
index 7cc95e2cb..4c44259ce 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.js
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.js
@@ -39,14 +39,8 @@ var bootstrap = function ($, learun) {
$('#EmpNo').lrDataSourceSelect({ code: 'teacheruserdata', value: 'f_encode', text: 'f_realname' });
$('#ClassNo').lrDataSourceSelect({ code: 'bjsj', value: 'classno', text: 'classname' });
- $('#LessonNo').lrselect({
- placeholder: "请选择课程",
- allowSearch: true,
- url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetLessonNoDataOfAllWithNo',
- value: 'value',
- text: 'text',
- maxHeight: 200
- });
+ $('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' });
+
// 刷新
$('#lr_refresh').on('click', function () {
location.reload();
@@ -217,7 +211,7 @@ var bootstrap = function ($, learun) {
{ label: "上机课时", name: "PracticeHour", width: 80, align: "left" },
{ label: "班级编号", name: "TeachClassNo", width: 80, align: "left" },
{
- label: "班级名称", name: "TeachClassNo", width: 80, align: "left" ,
+ label: "班级名称", name: "TeachClassNo", width: 80, align: "left",
formatterAsync: function (callback, value, row, op, $cell) {
learun.clientdata.getAsync('custmerData', {
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj',
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachForm.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachForm.js
index db907b115..f67ed63ad 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachForm.js
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachForm.js
@@ -24,8 +24,7 @@ var bootstrap = function ($, learun) {
}
var postData = $('#form').lrGetFormData();
var EmpNo = postData.EmpNo;
- console.log(EmpNo);
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/ClassPlanTeach/SetTeach', { keyValue: keyValue, EmpNo: EmpNo}, function () {
+ learun.postForm(top.$.rootUrl + '/EducationalAdministration/ClassPlanTeach/SetTeach', { keyValue: keyValue, EmpNo: EmpNo }, function () {
});
};
page.init();
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachFormQZ.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachFormQZ.js
index 02ee00152..e3366d758 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachFormQZ.js
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/TeachFormQZ.js
@@ -24,9 +24,9 @@ var bootstrap = function ($, learun) {
}
var postData = $('#form').lrGetFormData();
var EmpNo = postData.EmpNo;
- console.log(EmpNo);
- learun.postForm(top.$.rootUrl + '/EducationalAdministration/ClassPlanTeach/QZSetTeach', { keyValue: keyValue, EmpNo: EmpNo}, function () {
+ learun.postForm(top.$.rootUrl + '/EducationalAdministration/ClassPlanTeach/QZSetTeach', { keyValue: keyValue, EmpNo: EmpNo }, function () {
});
};
page.init();
+
}
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/FormOfElective.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/FormOfElective.cshtml
new file mode 100644
index 000000000..53e18db28
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/FormOfElective.cshtml
@@ -0,0 +1,47 @@
+@{
+ ViewBag.Title = "成绩比例设置";
+ Layout = "~/Views/Shared/_Form.cshtml";
+}
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/Form.js")
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/FormOfElective.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/FormOfElective.js
new file mode 100644
index 000000000..a8c9402a5
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/FormOfElective.js
@@ -0,0 +1,62 @@
+/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
+ * Copyright (c) 2013-2018 北京泉江科技有限公司
+ * 创建人:超级管理员
+ * 日 期:2019-08-21 17:28
+ * 描 述:成绩比例设置
+ */
+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 () {
+ $('#IsAllowEdit').lrDataItemSelect({ code: 'YesOrNoBit' });
+ },
+ 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]);
+ }
+ }
+ });
+ }
+ }
+ };
+ // 保存数据
+ acceptClick = function (callBack) {
+ if (!$('body').lrValidform()) {
+ return false;
+ }
+ //计算比例
+ var OrdinaryScoreScale = $('#OrdinaryScoreScale').val();
+ var TermInScoreScale = $('#TermInScoreScale').val();
+ var TermEndScoreScale = $('#TermEndScoreScale').val();
+ var OtherScoreScale = $('#OtherScoreScale').val();
+ var totalScale = Number(OrdinaryScoreScale) + Number(TermInScoreScale) + Number(TermEndScoreScale) + Number(OtherScoreScale);
+ if (totalScale !== 100) {
+ learun.alert.warning("成绩比例之和必须等于100!");
+ return false;
+ }
+
+ var postData = {
+ strEntity: JSON.stringify($('body').lrGetFormData())
+ };
+ $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlan/SaveForm?keyValue=' + keyValue, postData, function (res) {
+ // 保存成功后才回调
+ if (!!callBack) {
+ callBack();
+ }
+ });
+ };
+ page.init();
+}
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/IndexElective.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/IndexElective.cshtml
new file mode 100644
index 000000000..7a4d1bbc6
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/IndexElective.cshtml
@@ -0,0 +1,42 @@
+@{
+ ViewBag.Title = "选修课课程信息";
+ Layout = "~/Views/Shared/_Index.cshtml";
+}
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/IndexElective.js")
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/IndexElective.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/IndexElective.js
new file mode 100644
index 000000000..d85c7ca36
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/IndexElective.js
@@ -0,0 +1,134 @@
+/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn)
+ * Copyright (c) 2013-2018 北京泉江科技有限公司
+ * 创建人:超级管理员
+ * 日 期:2019-08-21 17:28
+ * 描 述:成绩比例设置
+ */
+var refreshGirdData;
+var bootstrap = function ($, learun) {
+ "use strict";
+ var page = {
+ init: function () {
+ page.initGird();
+ page.bind();
+ page.bindSelect();
+ },
+ bind: function () {
+ $('#multiple_condition_query').lrMultipleQuery(function (queryJson) {
+ page.search(queryJson);
+ }, 200, 400);
+ // 刷新
+ $('#lr_refresh').on('click', function () {
+ location.reload();
+ });
+ // 新增
+ $('#lr_add').on('click', function () {
+ learun.layerForm({
+ id: 'form',
+ title: '新增',
+ url: top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/FormOfElective',
+ width: 600,
+ height: 400,
+ callBack: function (id) {
+ return top[id].acceptClick(refreshGirdData);
+ }
+ });
+ });
+ // 编辑
+ $('#lr_edit').on('click', function () {
+ var keyValue = $('#gridtable').jfGridValue('Id');
+ if (learun.checkrow(keyValue)) {
+ learun.layerForm({
+ id: 'form',
+ title: '成绩比例设置',
+ url: top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/FormOfElective?keyValue=' + keyValue,
+ width: 600,
+ height: 400,
+ callBack: function (id) {
+ return top[id].acceptClick(refreshGirdData);
+ }
+ });
+ }
+ });
+ // 删除
+ $('#lr_delete').on('click', function () {
+ var keyValue = $('#gridtable').jfGridValue('Id');
+ if (learun.checkrow(keyValue)) {
+ learun.layerConfirm('是否确认删除该项!', function (res) {
+ if (res) {
+ learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/DeleteForm', { keyValue: keyValue }, function () {
+ refreshGirdData();
+ });
+ }
+ });
+ }
+ });
+ },
+ bindSelect: function () {
+ //校区
+ $('#F_SchoolId').lrDataSourceSelect({
+ code: 'company', value: 'f_companyid', text: 'f_fullname', select: function (item) { }
+ });
+ //学年
+ $('#AcademicYearNo').lrselect({
+ placeholder: "请选择学年",
+ allowSearch: true,
+ url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetAcademicYearNoData',
+ value: 'value',
+ text: 'text'
+ });
+ //学期
+ $('#Semester').lrselect({
+ placeholder: "请选择学期",
+ allowSearch: true,
+ url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetSemesterData',
+ value: 'value',
+ text: 'text'
+ });
+ $('#LessonNo').lrselect({
+ placeholder: "请选择课程",
+ allowSearch: true,
+ url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetLessonNoDataOfAllWithNo',
+ value: 'value',
+ text: 'text'
+ });
+
+ },
+ // 初始化列表
+ initGird: function () {
+ $('#gridtable').jfGrid({
+ url: top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/GetPageListElective',
+ headData: [
+ { label: "校区", name: "F_School", width: 150, align: "left" },
+ { label: "学年", name: "AcademicYearNo", width: 80, align: "left" },
+ { label: "学期", name: "Semester", width: 80, align: "left" },
+ { label: "课程编号", name: "LessonNo", width: 100, align: "left" },
+ { label: "课程名称", name: "LessonName", width: 150, align: "left" },
+ { label: "平时成绩占比", name: "OrdinaryScoreScale", width: 100, align: "left" },
+ { label: "期中成绩占比", name: "TermInScoreScale", width: 100, align: "left" },
+ { label: "期末成绩占比", name: "TermEndScoreScale", width: 100, align: "left" },
+ { label: "其他成绩占比", name: "OtherScoreScale", width: 100, align: "left" },
+ {
+ label: "是否允许编辑", name: "IsAllowEdit", width: 100, align: "left", formatter: function (cellvalue) {
+ return (cellvalue === true || cellvalue === "true") ? "
" : "
";
+ }
+ },
+ ],
+ mainId: 'Id',
+ isPage: true,
+ isMultiselect: true,
+ sidx: 'AcademicYearNo,Semester',
+ sord: 'desc'
+ });
+ page.search();
+ },
+ search: function (param) {
+ param = param || {};
+ $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) });
+ }
+ };
+ refreshGirdData = function () {
+ page.search();
+ };
+ 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 20185ec92..41845996d 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
@@ -1035,6 +1035,8 @@
+
+
@@ -7848,6 +7850,8 @@
+
+
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 cda5ed42b..9c7a6345e 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
@@ -42,6 +42,29 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
///
+ /// 获取页面显示列表数据
+ ///
+ /// 查询参数
+ ///
+ public IEnumerable GetPageListElective(Pagination pagination, string queryJson)
+ {
+ try
+ {
+ return openLessonPlanOfElectiveService.GetPageListElective(pagination, queryJson);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+ ///
/// 获取页面显示列表数据【学子在线-选课中心】
///
/// 查询参数
@@ -141,7 +164,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
-
+
public void AddForm(string keyValue, OpenLessonPlanOfElectiveEntity entity)
{
try
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveEntity.cs
index c7b3e472e..5f574df36 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveEntity.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveEntity.cs
@@ -162,6 +162,30 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
///
[Column("F_SCHOOLID")]
public string F_SchoolId { get; set; }
+ ///
+ /// OrdinaryScoreScale
+ ///
+ [Column("ORDINARYSCORESCALE")]
+ public decimal OrdinaryScoreScale { get; set; }
+ ///
+ /// TermInScoreScale
+ ///
+ [Column("TERMINSCORESCALE")]
+ public decimal TermInScoreScale { get; set; }
+ ///
+ /// TermEndScoreScale
+ ///
+ [Column("TERMENDSCORESCALE")]
+ public decimal TermEndScoreScale { get; set; }
+ ///
+ /// OtherScoreScale
+ ///
+ [Column("OTHERSCORESCALE")]
+
+ public decimal OtherScoreScale { get; set; }
+
+ public bool? IsAllowEdit { get; set; }
+
#endregion
#region 扩展操作
@@ -182,6 +206,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
#endregion
#region 扩展字段
+ ///
+ /// 校区名称
+ ///
+ [NotMapped]
+ public string F_School { get; set; }
[NotMapped]
public string StuNo { get; set; }
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 ee3178329..ce7c6d08d 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
@@ -22,6 +22,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
///
IEnumerable GetPageList(Pagination pagination, string queryJson);
///
+ /// 获取页面显示列表数据
+ ///
+ /// 查询参数
+ ///
+ IEnumerable GetPageListElective(Pagination pagination, string queryJson);
+ ///
/// 获取页面显示列表数据【学子在线-选课中心】
///
/// 查询参数
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 43d2a0eb2..c9c2aa932 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
@@ -79,6 +79,93 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
///
+ /// 选修成绩比例设置
+ ///
+ /// 查询参数
+ ///
+ public IEnumerable GetPageListElective(Pagination pagination, string queryJson)
+ {
+ try
+ {
+ var basedbname = BaseRepository().getDbConnection().Database;
+
+ var strSql = new StringBuilder();
+ strSql.Append("select t.*,c.F_FullName as F_School from OpenLessonPlanOfElective t ");
+ strSql.Append(" left join " + basedbname + ".dbo.LR_Base_Company c on t.F_SchoolId=c.f_CompanyId ");
+ strSql.Append(" WHERE 1=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["F_School"].IsEmpty())
+ {
+ dp.Add("F_School", "%" + queryParam["F_School"].ToString() + "%", DbType.String);
+ strSql.Append(" AND c.F_FullName Like @F_School ");
+ }
+ 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["Grade"].IsEmpty())
+ {
+ dp.Add("Grade", queryParam["Grade"].ToString(), DbType.String);
+ strSql.Append(" AND t.Grade = @Grade ");
+ }
+ if (!queryParam["DeptNo"].IsEmpty())
+ {
+ dp.Add("DeptNo", queryParam["DeptNo"].ToString(), DbType.String);
+ strSql.Append(" AND t.DeptNo = @DeptNo ");
+ }
+ if (!queryParam["DeptName"].IsEmpty())
+ {
+ dp.Add("DeptName", "%" + queryParam["DeptName"].ToString() + "%", DbType.String);
+ strSql.Append(" AND d.DeptName Like @DeptName ");
+ }
+ if (!queryParam["MajorNo"].IsEmpty())
+ {
+ dp.Add("MajorNo", queryParam["MajorNo"].ToString(), DbType.String);
+ strSql.Append(" AND t.MajorNo = @MajorNo ");
+ }
+ if (!queryParam["MajorName"].IsEmpty())
+ {
+ dp.Add("MajorName", "%" + queryParam["MajorName"].ToString() + "%", DbType.String);
+ strSql.Append(" AND m.MajorName Like @MajorName ");
+ }
+ if (!queryParam["LessonNo"].IsEmpty())
+ {
+ dp.Add("LessonNo", queryParam["LessonNo"].ToString(), DbType.String);
+ strSql.Append(" AND t.LessonNo = @LessonNo ");
+ }
+ if (!queryParam["LessonName"].IsEmpty())
+ {
+ dp.Add("LessonName", "%" + queryParam["LessonName"].ToString() + "%", DbType.String);
+ strSql.Append(" AND t.LessonName Like @LessonName ");
+ }
+ return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+ ///
/// 获取页面显示列表数据【学子在线-选课中心】
///
/// 查询参数
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonList/StuSelectLessonListService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonList/StuSelectLessonListService.cs
index e45e7762f..a50586234 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonList/StuSelectLessonListService.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonList/StuSelectLessonListService.cs
@@ -167,6 +167,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
stuLessonList.F_SchoolId = item.F_SchoolId;
stuLessonList.NoticeBookNo = item.NoticeBookNo;
stuLessonList.StuNo = item.StuNo;
+ stuLessonList.StuNo = item.StuNo;
stuLessonList.DeptNo = item.DeptNo;
stuLessonList.MajorNo = item.MajorNo;
stuLessonList.ClassNo = item.ClassNo;
@@ -203,7 +204,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
stuLessonList.CheckMark = "1";
if (db.FindEntity(x => x.AcademicYearNo == item.AcademicYearNo && x.Semester == item.Semester && x.DeptNo == item.DeptNo && x.StuNo == item.StuNo && x.EmpNo == item.EmpNo
- && x.MajorNo == item.MajorNo && x.Grade == item.Grade && x.LessonNo == item.LessonNo && x.F_SchoolId == item.F_SchoolId) == null)
+ && x.MajorNo == item.MajorNo && x.ClassNo == item.ClassNo && x.Grade == item.Grade && x.LessonNo == item.LessonNo && x.F_SchoolId == item.F_SchoolId) == null)
{
db.Insert(stuLessonList);
}
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassService.cs
index f0ffb5769..d50031bb3 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassService.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassService.cs
@@ -312,8 +312,10 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
Teach.LessonSortNo = item.LessonSortNo;
Teach.F_SchoolId = item.F_SchoolId;
- if (db.FindEntity(x => x.AcademicYearNo == Teach.AcademicYearNo && x.Semester == Teach.Semester && x.DeptNo == Teach.DeptNo && x.EmpNo == Teach.EmpNo
- && x.MajorNo == Teach.MajorNo && x.Grade == Teach.Grade && x.LessonNo == Teach.LessonNo && x.F_SchoolId == Teach.F_SchoolId) == null)
+ if (db.FindEntity(x => x.AcademicYearNo == Teach.AcademicYearNo && x.Semester == Teach.Semester
+ && x.DeptNo == Teach.DeptNo && x.TeachClassNo == Teach.TeachClassNo
+ && x.MajorNo == Teach.MajorNo && x.Grade == Teach.Grade
+ && x.LessonNo == Teach.LessonNo && x.F_SchoolId == Teach.F_SchoolId) == null)
{
db.Insert(Teach);
}
From bc62ca43fe76cf38042891cc3e69b9ec5b067e91 Mon Sep 17 00:00:00 2001
From: zhangli <1109134334@qq.com>
Date: Wed, 15 Jun 2022 16:43:16 +0800
Subject: [PATCH 08/18] =?UTF-8?q?=E6=8E=92=E8=80=83=E8=AE=B0=E5=BD=95-?=
=?UTF-8?q?=E4=B8=80=E9=94=AE=E5=AE=89=E6=8E=92=E8=80=83=E5=9C=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Exam_ExamPlanLessonController.cs | 6 ++
.../Exam_ExamPlanClassService.cs | 4 +-
.../Exam_ExamPlanLessonBLL.cs | 20 +++++
.../Exam_ExamPlanLessonIBLL.cs | 1 +
.../Exam_ExamPlanLessonService.cs | 74 +++++++++++++++---
.../Exam_ExamPlanRoomEntity.cs | 12 ++-
.../Exam_ExamPlanRoomService.cs | 78 ++++++++++++++++++-
7 files changed, 182 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 66be01a30..1b29bacd0 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
@@ -196,6 +196,12 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
Exam_ExamPlanLessonData.ExamTimeEnd = etime[1];
}
+ if ((Exam_ExamPlanLessonData.ClassNum == null || Exam_ExamPlanLessonData.ClassNum <= 0) ||
+ (Exam_ExamPlanLessonData.SeatCount == null || Exam_ExamPlanLessonData.SeatCount <= 0))
+ {
+ exam_ExamPlanLessonIBLL.UpdateClassNumAndStuCount(Exam_ExamPlanLessonData.EPLId);
+ }
+
var jsonData = new
{
Exam_ExamPlanLesson = Exam_ExamPlanLessonData,
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 93660d231..7c2e4c8dd 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
@@ -364,9 +364,9 @@ where l.EPLId='{EPLId}'
}
- //更新排考安排课程表实排班级数、实排人数
+ //更新排考安排课程表实排班级数、实排人数和应排班级数、应排人数(如果没有点击【一键安排班级】,应排班级数、应排人数在安排考试页面切换课程时候更新)
string sql = $@"update l
-set l.RealStuCount=t.RealStuCount,l.RealClassNum=t.RealClassNum
+set l.RealStuCount=t.RealStuCount,l.RealClassNum=t.RealClassNum,ClassNum=t.RealClassNum,StuCount=t.RealStuCount
from Exam_ExamPlanLesson l
join (select '{lesson.EPLId}' as EPLId,count(1) as RealClassNum,sum(ClassStuNum) as RealStuCount from Exam_ExamPlanClass where EPLId='{lesson.EPLId}'
)t on l.EPLId=t.EPLId
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 3dd2fe689..88d9b16d4 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
@@ -216,6 +216,26 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
}
+
+ public void UpdateClassNumAndStuCount(string EPLId)
+ {
+ try
+ {
+ exam_ExamPlanLessonService.UpdateClassNumAndStuCount(EPLId);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(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 051781014..1d0b71c78 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
@@ -45,6 +45,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
void DeleteEntity(string keyValue);
void Check(string keyValue,int ELCheckMark);
void InitExamPlanLesson(string EPId);
+ void UpdateClassNumAndStuCount(string EPLId);
///
/// 保存实体数据(新增、修改)
///
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 a758d7769..5d3a310ae 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
@@ -311,15 +311,7 @@ and AcademicYearNo='{exam_ExamPlan.AcademicYearNo}' and Semester='{exam_ExamPlan
group by LessonNo,lessonname";
this.BaseRepository("CollegeMIS").ExecuteBySql(sql);
}
-
- //排考课程表
- var EPLIdlist = this.BaseRepository("CollegeMIS").FindList(x => x.EPId == EPId).Select(x => x.EPLId);
- var EPLIds = string.Join("','", EPLIdlist);
- //班级
- var classInfo = this.BaseRepository("CollegeMIS").FindList($"select ClassNo,count(1) as StuNum FROM Exam_ExamStudent where ESEnabled=1 and ESType='{exam_ExamPlan.PlanType}' and AcademicYearNo='{exam_ExamPlan.AcademicYearNo}' and Semester='{exam_ExamPlan.Semester}' group by ClassNo");
- //修改应排班级数和应考人数
- var UpdSql = $"update Exam_ExamPlanLesson set ClassNum='{classInfo.Count()}',StuCount='{classInfo.Sum(x => x.StuNum)}' where EPLId in ('{EPLIds}')";
- this.BaseRepository("CollegeMIS").ExecuteBySql(UpdSql);
+
}
catch (Exception ex)
{
@@ -334,6 +326,70 @@ and AcademicYearNo='{exam_ExamPlan.AcademicYearNo}' and Semester='{exam_ExamPlan
}
}
+ ///
+ /// 更新应考班级数和应考人数(安排考试切换课程时更新)
+ /// 【一键安排班级】功能也有更新
+ ///
+ /// 主键
+ public void UpdateClassNumAndStuCount(string EPLId)
+ {
+ var db = this.BaseRepository("CollegeMIS");
+ try
+ {
+ db.BeginTrans();
+ var lesson = db.FindEntity(x => x.EPLId == EPLId);
+ //排考记录表
+ var examPlan = db.FindEntity(lesson.EPId);
+ var lessonno = lesson.LessonNo;
+ if (lesson.LessonNo.Contains("("))
+ {
+ lessonno = lesson.LessonNo.Split('(')[0];
+ }
+
+ //查询课程信息
+ var lessoninfo = db.FindList($@"select top 1 t.LessonTypeName,l.* from lessoninfo l
+ join [dbo].[CdLessonType] t on l.LessonTypeId = t.LTId where l.LessonNo='{lessonno}' ").FirstOrDefault();
+ if (lessoninfo != null)
+ {
+ var updSql = $@"update a set a.ClassNum=b.ClassNum,a.StuCount=b.StuCount
+from Exam_ExamPlanLesson a join
+(
+select count(1) as ClassNum,SUM(StuNum) as StuCount,'{EPLId}' as EPLId from (
+SELECT t.ClassNo,count(1) as StuNum FROM Exam_ExamStudent t
+ left join classinfo c on t.ClassNo=c.ClassNo WHERE t.ESEnabled=1 and t.AcademicYearNo='{examPlan.AcademicYearNo}' and t.Semester='{examPlan.Semester}' and t.ESType='{examPlan.PlanType}'
+
+";
+ if (lessoninfo.LessonTypeName.Contains("专业"))
+ {
+ updSql += $" and c.majorno='{lessoninfo.TeachMajorNo}' ";
+ }
+ //else if (lessoninfo.LessonTypeName.Contains("公共") || lessoninfo.LessonTypeName.Contains("公开"))
+ //{
+ // //公共课添加所有班级
+ //}
+
+ updSql += $@" group by t.ClassNo,t.AcademicYearNo,t.Semester,t.ESType,c.ClassName
+ ) t) b on a.EPLId=b.EPLId
+ where a.EPLId='{EPLId}'";
+
+ db.ExecuteBySql(updSql);
+ db.Commit();
+ }
+
+ }
+ catch (Exception ex)
+ {
+ db.Rollback();
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
///
/// 保存实体数据(新增、修改)
///
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomEntity.cs
index c03fe1c6b..d601e4b92 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomEntity.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomEntity.cs
@@ -11,7 +11,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// 日 期:2022-04-15 18:12
/// 描 述:排考安排考场表
///
- public class Exam_ExamPlanRoomEntity
+ public class Exam_ExamPlanRoomEntity
{
#region 实体成员
///
@@ -75,6 +75,16 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
this.EPRId = keyValue;
}
#endregion
+ ///
+ /// 考试日期
+ ///
+ [NotMapped]
+ public DateTime? ExamDate { get; set; }
+ ///
+ /// 考试时间
+ ///
+ [NotMapped]
+ public string ExamTime { get; set; }
}
}
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomService.cs
index 994a329c3..2c9bfeb67 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomService.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomService.cs
@@ -300,8 +300,84 @@ where l.EPLId='{EPLId}'";
return (false, "请先设置排考时间!");
}
//考试班级
-
+ var EPLIds = examLessonList.Select(y => y.EPLId).ToList();
+ if (db.FindList(x => EPLIds.Contains(x.EPLId)).Count() <= 0)
+ {
+ return (false, "请先添加考试班级!");
+ }
+
+ List list = new List();
+ //循环考试课程
+ foreach (var examLesson in examLessonList)
+ {
+ //删除考场
+ db.ExecuteBySql($"delete Exam_ExamPlanRoom where EPLId='{examLesson.EPLId}'");
+ //已设置考试时间且已添加班级
+ if (examLesson.ExamDate != null && examLesson.ExamTime.Contains("-") && examLesson.RealStuCount > 0)
+ {
+ //当前考试课程考试时间
+ var examtimeStart = Convert.ToDateTime(examLesson.ExamDate.Value.ToString("yyyy-MM-dd") + " " + (examLesson.ExamTime).Split('-')[0]);
+ var examtimeEnd = Convert.ToDateTime(examLesson.ExamDate.Value.ToString("yyyy-MM-dd") + " " + examLesson.ExamTime.Split('-')[1]);
+
+ //查询与考试课程的考试时间在同一天的考场,如果存在考试时间冲突的考场 则排除此考场
+ List conflictRoom = new List();
+ var examRoomByDateSql = $@"select a.ClassroomNo,b.ExamDate,b.ExamTime from [dbo].[Exam_ExamPlanRoom] a
+ join Exam_ExamPlanLesson b on a.EPLId = b.EPLId
+ where ExamDate = '{examLesson.ExamDate}'";
+ var examRoomsByDate = db.FindList(examRoomByDateSql).ToList();
+ //并集(和当前考试记录的考试课程在同一天的)
+ var examDatelist = list.Where(x => x.ExamDate == examLesson.ExamDate);
+ examRoomsByDate = examRoomsByDate.Union(examDatelist).ToList();
+ foreach (var examRoom in examRoomsByDate)
+ {
+ var examRoomTime1 = Convert.ToDateTime(examRoom.ExamDate.Value.ToString("yyyy-MM-dd") + " " + examRoom.ExamTime.Split('-')[0]);
+ var examRoomTime2 = Convert.ToDateTime(examRoom.ExamDate.Value.ToString("yyyy-MM-dd") + " " + examRoom.ExamTime.Split('-')[1]);
+ //此处判断当前考场时间是否在考试课程排考时间的开始前30分钟到结束后30分钟
+ if ((examRoomTime1 >= examtimeStart.AddMinutes(-30) && examRoomTime1 <= examtimeEnd.AddMinutes(30)) || (examRoomTime2 >= examtimeStart.AddMinutes(-30) && examRoomTime2 <= examtimeEnd.AddMinutes(30)))
+ {
+ conflictRoom.Add(examRoom.ClassroomNo);
+ }
+ }
+
+ //考场座位数
+ int? seatCount = 0;
+ var roomListSql =
+ $"select * from Exam_ExamRoom where AcademicYearNo='{examPlan.AcademicYearNo}' and Semester='{examPlan.Semester}' and EREnabled=1 ";
+ if (conflictRoom.Count() > 0)
+ {
+ var classroomNo = string.Join("','", conflictRoom.ToList());
+ roomListSql += $" and ClassroomNo not in ('{classroomNo}')";
+ }
+ var examRoomList = db.FindList(roomListSql).OrderBy(x => Guid.NewGuid());
+
+ foreach (var room in examRoomList)
+ {
+ list.Add(new Exam_ExamPlanRoomEntity
+ {
+ ClassroomNo = room.ClassroomNo,
+ ExamDate = examLesson.ExamDate,
+ ExamTime = examLesson.ExamTime,
+ });
+ Exam_ExamPlanRoomEntity EPRoom = new Exam_ExamPlanRoomEntity();
+ EPRoom.Create();
+ EPRoom.EPLId = examLesson.EPLId;
+ EPRoom.ClassroomName = room.ClassroomName;
+ EPRoom.ClassroomNo = room.ClassroomNo;
+ EPRoom.SeatCount = room.SeatCount;
+ db.Insert(EPRoom);
+ seatCount += room.SeatCount;
+ if (seatCount >= examLesson.RealStuCount)
+ {
+ break;
+ }
+ }
+
+ db.ExecuteBySql(
+ $"update Exam_ExamPlanLesson set SeatCount='{seatCount}' where EPLId='{examLesson.EPLId}'");
+ }
+
+ }
db.Commit();
return (true, "");
}
From 9b083753d7148238291a9a68ff410f5334e832c8 Mon Sep 17 00:00:00 2001
From: ndbs
Date: Wed, 15 Jun 2022 16:44:48 +0800
Subject: [PATCH 09/18] =?UTF-8?q?=E9=80=89=E4=BF=AE=E6=88=90=E7=BB=A9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../OpenLessonPlanOfElectiveController.cs | 48 ++++++
.../Views/OpenLessonPlan/FormOfClass.js | 48 ++++--
.../FormOfElective.cshtml | 2 +-
.../FormOfElective.js | 2 +-
.../StuScore/InputScoreIndexOfElective.js | 16 +-
.../InputScoreIndexOfElectiveInTeacher.js | 14 +-
.../OpenLessonPlanOfElectiveBLL.cs | 70 +++++++++
.../OpenLessonPlanOfElectiveEntity.cs | 8 +-
.../OpenLessonPlanOfElectiveIBLL.cs | 16 ++
.../OpenLessonPlanOfElectiveService.cs | 147 +++++++++++++++++-
.../StuScore/StuScoreService.cs | 11 +-
.../StuSelectLessonListOfElectiveEntity.cs | 7 +-
12 files changed, 351 insertions(+), 38 deletions(-)
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 783df263e..3a8e76569 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
@@ -201,6 +201,38 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
};
return Success(jsonData);
}
+
+ ///
+ /// 获取表单数据
+ ///
+ ///
+ [HttpGet]
+ [AjaxOnly]
+ public ActionResult GetOpenLessonPlanEntityByJson(string queryJson)
+ {
+ var OpenLessonPlanData = openLessonPlanOfElectiveIBLL.GetOpenLessonPlanEntityByJson(queryJson);
+ var jsonData = new
+ {
+ OpenLessonPlanOfElective = OpenLessonPlanData,
+ };
+ return Success(jsonData);
+ }
+
+ ///
+ /// 获取表单数据
+ ///
+ ///
+ [HttpGet]
+ [AjaxOnly]
+ public ActionResult GetStuSelectLessonListEntityByJson(string queryJson)
+ {
+ var StuSelectLessonListData = openLessonPlanOfElectiveIBLL.GetStuSelectLessonListEntityByJson(queryJson);
+ var jsonData = new
+ {
+ StuSelectLessonListOfElective = StuSelectLessonListData,
+ };
+ return Success(jsonData);
+ }
#endregion
#region 提交数据
@@ -357,6 +389,22 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
return Success("保存成功!");
}
+ ///
+ /// 设置成绩比例
+ ///
+ ///
+ ///
+ ///
+ [HttpPost]
+ [ValidateAntiForgeryToken]
+ [AjaxOnly]
+ public ActionResult SaveFormOfElective(string keyValue, string strEntity)
+ {
+ OpenLessonPlanOfElectiveEntity entity = strEntity.ToObject();
+ openLessonPlanOfElectiveIBLL.SaveFormOfElective(keyValue, entity);
+
+ return Success("保存成功!");
+ }
#endregion
#region 扩展数据
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlan/FormOfClass.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlan/FormOfClass.js
index ba65aa129..7329dd9a7 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlan/FormOfClass.js
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlan/FormOfClass.js
@@ -10,13 +10,18 @@ var AcademicYearNo = request('AcademicYearNo');
var Semester = request('Semester');
var LessonNo = request('LessonNo');
var ClassNo = request('ClassNo');
+var ClassRoomNo = request('ClassRoomNo');
+var LessonSection = request('LessonSection');
var param = {};
-if (!!F_SchoolId && !!AcademicYearNo && !!Semester && !!LessonNo && !!ClassNo) {
+if (!!F_SchoolId && !!AcademicYearNo && !!Semester && !!LessonNo && !!ClassNo && !!ClassRoomNo && !!LessonSection) {
param.F_SchoolId = F_SchoolId;
param.AcademicYearNo = AcademicYearNo;
param.Semester = Semester;
param.LessonNo = LessonNo;
param.ClassNo = ClassNo;
+ param.ClassRoomNo = ClassRoomNo;
+ param.LessonSection = LessonSection;
+
}
var bootstrap = function ($, learun) {
"use strict";
@@ -31,20 +36,37 @@ var bootstrap = function ($, learun) {
},
initData: function () {
if (!!param) {
- $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlan/GetStuSelectLessonListEntityByJson?queryJson=' + JSON.stringify(param), function (data) {
- for (var id in data) {
- if (data[id] == null) {
- learun.alert.warning("学生选课数据不存在!");
- return false;
- }
- if (!!data[id].length && data[id].length > 0) {
- $('#' + id).jfGridSet('refreshdata', data[id]);
+ if (!!ClassNo) {
+ $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlan/GetStuSelectLessonListEntityByJson?queryJson=' + JSON.stringify(param), function (data) {
+ for (var id in data) {
+ if (data[id] == null) {
+ learun.alert.warning("学生选课数据不存在!");
+ return false;
+ }
+ if (!!data[id].length && data[id].length > 0) {
+ $('#' + id).jfGridSet('refreshdata', data[id]);
+ }
+ else {
+ $('[data-table="' + id + '"]').lrSetFormData(data[id]);
+ }
}
- else {
- $('[data-table="' + id + '"]').lrSetFormData(data[id]);
+ });
+ } else {
+ $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/GetStuSelectLessonListEntityByJson?queryJson=' + JSON.stringify(param), function (data) {
+ for (var id in data) {
+ if (data[id] == null) {
+ learun.alert.warning("学生选课数据不存在!");
+ return false;
+ }
+ if (!!data[id].length && data[id].length > 0) {
+ $('#' + id).jfGridSet('refreshdata', data[id]);
+ }
+ else {
+ $('[data-table="' + id + '"]').lrSetFormData(data[id]);
+ }
}
- }
- });
+ });
+ }
}
}
};
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/FormOfElective.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/FormOfElective.cshtml
index 53e18db28..465f44a38 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/FormOfElective.cshtml
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/FormOfElective.cshtml
@@ -44,4 +44,4 @@
-@Html.AppendJsFile("/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/Form.js")
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/FormOfElective.js")
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/FormOfElective.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/FormOfElective.js
index a8c9402a5..5d4c4918b 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/FormOfElective.js
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/FormOfElective.js
@@ -51,7 +51,7 @@ var bootstrap = function ($, learun) {
var postData = {
strEntity: JSON.stringify($('body').lrGetFormData())
};
- $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlan/SaveForm?keyValue=' + keyValue, postData, function (res) {
+ $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/SaveFormOfElective?keyValue=' + keyValue, postData, function (res) {
// 保存成功后才回调
if (!!callBack) {
callBack();
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/InputScoreIndexOfElective.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/InputScoreIndexOfElective.js
index a090a20b0..e21f26580 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/InputScoreIndexOfElective.js
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/InputScoreIndexOfElective.js
@@ -198,11 +198,11 @@ var bootstrap = function ($, learun) {
$('#lr_setScale').on('click', function () {
var query = judgeSelect();
if (query) {
- $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlan/GetOpenLessonPlanEntityByJson?queryJson=' + JSON.stringify(query), function (data) {
- if (data["OpenLessonPlan"] != null) {
- if (data["OpenLessonPlan"].IsAllowEdit) { //教务允许成绩录入时编辑比例
- $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlan/GetStuSelectLessonListEntityByJson?queryJson=' + JSON.stringify(query), function (data) {
- if (data["StuSelectLessonList"] != null) {
+ $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/GetOpenLessonPlanEntityByJson?queryJson=' + JSON.stringify(query), function (data) {
+ if (data["OpenLessonPlanOfElective"] != null) {
+ if (data["OpenLessonPlanOfElective"].IsAllowEdit) { //教务允许成绩录入时编辑比例
+ $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/GetStuSelectLessonListEntityByJson?queryJson=' + JSON.stringify(query), function (data) {
+ if (data["StuSelectLessonListOfElective"] != null) {
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuScore/GetEntityByJson?queryJson=' + JSON.stringify(query), function (data) {
if (data != null) {
if (data.CheckMark == 1) { //学生成绩已审核
@@ -212,7 +212,7 @@ var bootstrap = function ($, learun) {
learun.layerForm({
id: 'FormOfClass',
title: '班级成绩比例设置',
- url: top.$.rootUrl + '/EducationalAdministration/OpenLessonPlan/FormOfClass?F_SchoolId=' + query.F_SchoolId + '&AcademicYearNo=' + query.AcademicYearNo + '&Semester=' + query.Semester + '&LessonNo=' + query.LessonNo + '&ClassNo=' + query.ClassNo,
+ url: top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/FormOfClass?F_SchoolId=' + query.F_SchoolId + '&AcademicYearNo=' + query.AcademicYearNo + '&Semester=' + query.Semester + '&LessonNo=' + query.LessonNo + '&ClassNo=' + query.ClassNo,
width: 600,
height: 400,
callBack: function (id) {
@@ -235,7 +235,7 @@ var bootstrap = function ($, learun) {
return false;
}
} else {
- learun.alert.warning("开课计划不存在!");
+ learun.alert.warning("选修开课计划不存在!");
return false;
}
});
@@ -533,7 +533,7 @@ var bootstrap = function ($, learun) {
},
searchScale: function (param) {
param = param || {};
- $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlan/GetStuSelectLessonListEntityByJson?queryJson=' + JSON.stringify(param), function (data) {
+ $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/GetStuSelectLessonListEntityByJson?queryJson=' + JSON.stringify(param), function (data) {
if (data["StuSelectLessonList"] != null) {
var ssll = data["StuSelectLessonList"];
$('#OrdinaryScoreScale').html(ssll.OrdinaryScoreScale > 0 ? ssll.OrdinaryScoreScale : 0);
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/InputScoreIndexOfElectiveInTeacher.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/InputScoreIndexOfElectiveInTeacher.js
index a965be528..5d92e39a4 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/InputScoreIndexOfElectiveInTeacher.js
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/InputScoreIndexOfElectiveInTeacher.js
@@ -198,11 +198,11 @@ var bootstrap = function ($, learun) {
$('#lr_setScale').on('click', function () {
var query = judgeSelect();
if (query) {
- $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlan/GetOpenLessonPlanEntityByJson?queryJson=' + JSON.stringify(query), function (data) {
- if (data["OpenLessonPlan"] != null) {
- if (data["OpenLessonPlan"].IsAllowEdit) { //教务允许成绩录入时编辑比例
- $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlan/GetStuSelectLessonListEntityByJson?queryJson=' + JSON.stringify(query), function (data) {
- if (data["StuSelectLessonList"] != null) {
+ $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/GetOpenLessonPlanEntityByJson?queryJson=' + JSON.stringify(query), function (data) {
+ if (data["OpenLessonPlanOfElective"] != null) {
+ if (data["OpenLessonPlanOfElective"].IsAllowEdit) { //教务允许成绩录入时编辑比例
+ $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/GetStuSelectLessonListEntityByJson?queryJson=' + JSON.stringify(query), function (data) {
+ if (data["StuSelectLessonListOfElective"] != null) {
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuScore/GetEntityByJson?queryJson=' + JSON.stringify(query), function (data) {
if (data != null) {
if (data.CheckMark == 1) { //学生成绩已审核
@@ -212,7 +212,7 @@ var bootstrap = function ($, learun) {
learun.layerForm({
id: 'FormOfClass',
title: '班级成绩比例设置',
- url: top.$.rootUrl + '/EducationalAdministration/OpenLessonPlan/FormOfClass?F_SchoolId=' + query.F_SchoolId + '&AcademicYearNo=' + query.AcademicYearNo + '&Semester=' + query.Semester + '&LessonNo=' + query.LessonNo + '&ClassNo=' + query.ClassNo,
+ url: top.$.rootUrl + '/EducationalAdministration/OpenLessonPlan/FormOfClass?F_SchoolId=' + query.F_SchoolId + '&AcademicYearNo=' + query.AcademicYearNo + '&Semester=' + query.Semester + '&LessonNo=' + query.LessonNo + '&LessonSection=' + query.LessonSection + '&ClassRoomNo=' + query.ClassRoomNo,
width: 600,
height: 400,
callBack: function (id) {
@@ -533,7 +533,7 @@ var bootstrap = function ($, learun) {
},
searchScale: function (param) {
param = param || {};
- $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlan/GetStuSelectLessonListEntityByJson?queryJson=' + JSON.stringify(param), function (data) {
+ $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/GetStuSelectLessonListEntityByJson?queryJson=' + JSON.stringify(param), function (data) {
if (data["StuSelectLessonList"] != null) {
var ssll = data["StuSelectLessonList"];
$('#OrdinaryScoreScale').html(ssll.OrdinaryScoreScale > 0 ? ssll.OrdinaryScoreScale : 0);
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 9c7a6345e..0441597bc 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
@@ -112,6 +112,52 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
+ ///