From 93c79eaf9976f73a4767f5f5ff3863ac07c35fdd Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Tue, 14 Jun 2022 15:28:00 +0800 Subject: [PATCH 01/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 --- .../Controllers/Exam_ExamPlanController.cs | 19 +++++++ .../Views/Exam_ExamPlan/Index.js | 15 ++++++ .../Exam_ExamPlanRoom/Exam_ExamPlanRoomBLL.cs | 21 +++++++- .../Exam_ExamPlanRoomIBLL.cs | 1 + .../Exam_ExamPlanRoomService.cs | 51 ++++++++++++++++++- 5 files changed, 105 insertions(+), 2 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamPlanController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamPlanController.cs index 0399d666e..9a8722fa3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamPlanController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamPlanController.cs @@ -21,6 +21,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers private Exam_ExamPlanIBLL exam_ExamPlanIBLL = new Exam_ExamPlanBLL(); private Exam_ExamPlanLessonIBLL exam_ExamPlanLessonIBLL = new Exam_ExamPlanLessonBLL(); private Exam_ExamPlanClassIBLL exam_ExamPlanClassIBLL = new Exam_ExamPlanClassBLL(); + private Exam_ExamPlanRoomIBLL exam_ExamPlanRoomIBLL = new Exam_ExamPlanRoomBLL(); #region 视图功能 @@ -321,6 +322,24 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers return Success("操作成功!"); } + /// + /// 一键安排考场 + /// + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult PlanRoomByEPId(string keyValue) + { + var res = exam_ExamPlanRoomIBLL.PlanRoomByEPId(keyValue); + if (!res.flag) + { + return Fail(res.str); + } + + return Success("操作成功!"); + } + #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/Index.js index bb5017349..95948ea43 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/Index.js @@ -193,6 +193,21 @@ var bootstrap = function ($, learun) { } }); + //一键安排考场 + $('#lr_examroom').on('click', + function () { + var keyValue = $('#gridtable').jfGridValue('EPId'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认安排考场!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/PlanRoomByEPId', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + //自动生成排考时间 $('#lr_examlessontime').on('click', function () { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomBLL.cs index b6afaf0d3..5be5c89e9 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomBLL.cs @@ -130,7 +130,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } - + /// /// 保存实体数据(新增、修改) @@ -175,6 +175,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + + public (bool flag, string str) PlanRoomByEPId(string EPId) + { + try + { + return exam_ExamPlanRoomService.PlanRoomByEPId(EPId); + } + 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_ExamPlanRoom/Exam_ExamPlanRoomIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomIBLL.cs index 21f15eed4..cc7bc85cb 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomIBLL.cs @@ -47,6 +47,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 实体 void SaveEntity(string keyValue, Exam_ExamPlanRoomEntity entity); void SaveList (List list); + (bool flag,string str) PlanRoomByEPId(string EPId); #endregion } 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 7a9c0aa77..25cff5d35 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 @@ -128,7 +128,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - return this.BaseRepository("CollegeMIS").FindList(x => x.EPLId == EPLId && x.ClassroomNo == ClassroomNo).Count() > 0 ? true : false; + return this.BaseRepository("CollegeMIS").FindList(x => x.EPLId == EPLId && x.ClassroomNo == ClassroomNo).Count() > 0 ? true : false; } catch (Exception ex) { @@ -269,6 +269,55 @@ where l.EPLId='{EPLId}'"; } } } + + /// + /// 自动安排考场 + /// + /// 考试记录表Id + /// + public (bool flag, string str) PlanRoomByEPId(string EPId) + { + var db = this.BaseRepository("CollegeMIS"); + try + { + db.BeginTrans(); + /* + * 1.查询是否已添加考试课程和班级 + * 2.查询是否生成课程排考时间 + * 3.查询考试课程并循环, + * 根据考试课程的总班级人数和排考时间,随机安排考场(同一时间段考场不能重复) + */ + //考试记录表 + var examPlan = db.FindEntity(EPId); + //考试课程 + var examLessonList = db.FindList(x => x.EPId == EPId).ToList(); + if (examLessonList.Count() <= 0) + { + return (false, "请先添加考试课程!"); + } + if (!examLessonList.Exists(x => x.ExamDate != null)) + { + return (false, "请先设置排考时间!"); + } + //考试班级 + + + + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } #endregion } From 4cc31a4b2f2293f3382c45eddce5424dd1beef30 Mon Sep 17 00:00:00 2001 From: ndbs Date: Tue, 14 Jun 2022 15:35:17 +0800 Subject: [PATCH 02/18] =?UTF-8?q?=E5=BC=80=E8=AF=BE=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E4=B8=93=E4=B8=9A=E5=BC=80=E8=AF=BE=E8=AE=A1=E5=88=92=20?= =?UTF-8?q?=E7=8F=AD=E7=BA=A7=E5=BC=80=E8=AF=BE=E8=AE=A1=E5=88=92=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/ClassPlanController.cs | 1 - .../Views/ClassPlan/Form.js | 1 - .../Views/ClassPlan/Index.cshtml | 12 ++++-------- .../Views/ClassPlan/Index.js | 19 +++++++++++++++++-- .../Views/ClassPlanTeach/Index.cshtml | 14 +++++++------- .../Views/ClassPlanTeach/Index.js | 6 ++++-- .../ArrangeLessonTermService.cs | 1 - .../TeachClass/TeachClassEntity.cs | 6 ------ .../TeachClass/TeachClassService.cs | 5 +++++ 9 files changed, 37 insertions(+), 28 deletions(-) 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 eb15366b0..01c73d550 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 @@ -188,7 +188,6 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { TeachClassEntity TeachEntity = new TeachClassEntity(); TeachEntity.TeachClassNo = lessonList[j].ClassNo; - TeachEntity.TeachClassName = lessonList[j].ClassName; TeachEntity.AcademicYearNo = entity[i].AcademicYearNo; TeachEntity.DeptNo = entity[i].DeptNo; TeachEntity.MajorNo = entity[i].MajorNo; 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 024fb9e46..eb03c43cc 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 @@ -69,7 +69,6 @@ var bootstrap = function ($, learun) { text: "lessonname", maxHeight: 200 }); - console.log(param); } } }); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Index.cshtml index 670778a6d..9a398c75b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Index.cshtml @@ -5,25 +5,21 @@
-
学校信息
+
系部信息
- 未选择学校 - 专业信息 + 未选择系部 - 系部信息
-
-
学校
-
-
-
+
专业
@@ -39,7 +35,7 @@
系部
*@ -
+
年级
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 a61228835..a27d8ba21 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 @@ -18,7 +18,7 @@ var bootstrap = function ($, learun) { $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { page.search(queryJson); }, 250, 400); - $('#F_SchoolId').lrDataSourceSelect({ code: 'company', value: 'f_companyid', text: 'f_fullname' }); + //$('#F_SchoolId').lrDataSourceSelect({ code: 'company', value: 'f_companyid', text: 'f_fullname' }); $('#AcademicYearNo').lrselect({ placeholder: "请选择学年", allowSearch: true, @@ -35,6 +35,7 @@ var bootstrap = function ($, learun) { text: 'text' }); $('#Semester').lrDataItemSelect({ code: 'Semester' }); + $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorno', text: 'majorname' }); $('#MajorNo').lrselect({ url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', param: { strWhere: " 1=1 and CheckMark=1 " }, @@ -222,8 +223,22 @@ var bootstrap = function ($, learun) { } }, { label: "年级", name: "Grade", width: 50, align: "left" }, + { label: "专业编码", name: "MajorNo", width: 120, align: "left" }, + { + label: "专业名称", name: "MajorNo", width: 200, align: "left" , + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', + key: value, + keyId: 'majorno', + callback: function (_data) { + callback(_data['majorname']); + } + }); + } + }, { label: "课程编码", name: "LessonNo", width: 200, align: "left" }, - { label: "课程名称", name: "LessonName", 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) { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.cshtml index 6cf2377a4..5cf443015 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.cshtml @@ -5,28 +5,28 @@
-
学校信息
+
系部信息
- 未选择学校 - 专业信息 + 系部学校 - 系部信息
-
-
学校
-
-
-
+
专业
+
+
班级
+
+
学年
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 9c578defe..7cc95e2cb 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 @@ -18,7 +18,6 @@ var bootstrap = function ($, learun) { $('#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, @@ -35,8 +34,10 @@ var bootstrap = function ($, learun) { text: 'text' }); $('#Semester').lrDataItemSelect({ code: 'Semester' }); + $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorno', text: 'majorname' }); $("#MajorNo").lrselect(); $('#EmpNo').lrDataSourceSelect({ code: 'teacheruserdata', value: 'f_encode', text: 'f_realname' }); + $('#ClassNo').lrDataSourceSelect({ code: 'bjsj', value: 'classno', text: 'classname' }); $('#LessonNo').lrselect({ placeholder: "请选择课程", @@ -228,8 +229,9 @@ var bootstrap = function ($, learun) { }); } }, + { label: "教师编号", name: "EmpNo", width: 80, align: "left" }, { - label: "教师", name: "EmpNo", width: 80, align: "left", + label: "教师名称", name: "EmpNo", width: 80, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata', diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermService.cs index bd4c6d752..d58701a62 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/ArrangeLessonTerm/ArrangeLessonTermService.cs @@ -819,7 +819,6 @@ WHERE (AcademicYearNo = '" + strAcademicYear + "') and semester='" + strSemest Grade = classitemEntity?.Grade, LessonSortNo = teachClassEntity.LessonSortNo, TeachClassNo = teachClassEntity.TeachClassNo, - TeachClassName = teachClassEntity.TeachClassName, EmpNo = teachClassEntity.EmpNo, F_SchoolId = entity.F_SchoolId }; diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassEntity.cs index 60a21345b..c0a69b63d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeachClass/TeachClassEntity.cs @@ -82,12 +82,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration [Column("TEACHCLASSNO")] public string TeachClassNo { get; set; } /// - /// TeachClassNo - /// - /// - [Column("TEACHCLASSNAME")] - public string TeachClassName { get; set; } - /// /// 学生数 /// /// 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 a9155f15c..ea4845908 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 @@ -77,6 +77,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration dp.Add("EmpNo", queryParam["EmpNo"].ToString(), DbType.String); strSql.Append(" AND t.EmpNo = @EmpNo "); } + if (!queryParam["ClassNo"].IsEmpty()) + { + dp.Add("ClassNo", queryParam["ClassNo"].ToString(), DbType.String); + strSql.Append(" AND t.TeachClassNo = @ClassNo "); + } return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); } catch (Exception ex) From 7294aca78df572592aad9aecc44d5898db204783 Mon Sep 17 00:00:00 2001 From: ndbs Date: Tue, 14 Jun 2022 16:03:56 +0800 Subject: [PATCH 03/18] =?UTF-8?q?=E5=A4=84=E7=90=86=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Exam_ExamPlanRoom/Exam_ExamPlanRoomService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 25cff5d35..994a329c3 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 @@ -302,8 +302,8 @@ where l.EPLId='{EPLId}'"; //考试班级 - db.Commit(); + return (true, ""); } catch (Exception ex) { From 270b3730fa188750acaf30e67a5299fd31208d17 Mon Sep 17 00:00:00 2001 From: ndbs Date: Tue, 14 Jun 2022 16:26:16 +0800 Subject: [PATCH 04/18] --- .../EducationalAdministration/Views/ClassPlanTeach/Index.cshtml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.cshtml index 5cf443015..b0de850af 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlanTeach/Index.cshtml @@ -12,7 +12,7 @@
- 系部学校 - 系部信息 + 未选择系部 - 系部信息
From 5b900a714eaa4da55609781e9a38ef580c88f27f Mon Sep 17 00:00:00 2001 From: ndbs Date: Tue, 14 Jun 2022 18:09:57 +0800 Subject: [PATCH 05/18] =?UTF-8?q?=E4=B8=93=E4=B8=9A=E5=BC=80=E8=AF=BE?= =?UTF-8?q?=E8=AE=A1=E5=88=92=E7=94=9F=E6=88=90=20=20=E5=AD=A6=E7=94=9F?= =?UTF-8?q?=E9=80=89=E8=AF=BE=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/ClassPlanController.cs | 46 +++++++++++++++++++ .../StuSelectLessonListService.cs | 7 ++- .../TeachClass/TeachClassService.cs | 8 +++- 3 files changed, 59 insertions(+), 2 deletions(-) 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 01c73d550..581e10704 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 @@ -21,6 +21,9 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers private ClassPlanIBLL classPlanIBLL = new ClassPlanBLL(); private ClassInfoIBLL classInfoIBLL = new ClassInfoBLL(); private TeachClassIBLL teachClassIBLL = new TeachClassBLL(); + private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL(); + private LessonInfoIBLL lessonInfoIBLL = new LessonInfoBLL(); + private StuSelectLessonListIBLL stuSelectLessonListBLL = new StuSelectLessonListBLL(); #region 视图功能 @@ -175,8 +178,12 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public ActionResult CourseArranging(string keyValue) { var entity = classPlanIBLL.GetListById(keyValue); + var stuinfobasicData = stuInfoBasicIBLL.GetAllList(); + var lessonData = lessonInfoIBLL.GetAllLesson(); List TeachList = new List(); + List StuSelectLessonList = new List(); + for (int i = 0; i < entity.Count; i++) { var lessonList = classInfoIBLL.GetAllClass(). @@ -198,6 +205,44 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers TeachEntity.LessonSortNo = entity[i].LessonSortNo; TeachEntity.F_SchoolId = entity[i].F_SchoolId; TeachList.Add(TeachEntity); + + var classstulist = stuinfobasicData.Where(m => m.ClassNo == TeachEntity.TeachClassNo) + .ToList(); + foreach (var stu in classstulist) + { + var insertDatastuselect = new StuSelectLessonListEntity(); + insertDatastuselect.NoticeBookNo = stu.NoticeNo; + insertDatastuselect.StuNo = stu.StuNo; + insertDatastuselect.DeptNo = stu.DeptNo; + insertDatastuselect.ClassNo = stu.ClassNo; + insertDatastuselect.MajorNo = stu.MajorNo; + insertDatastuselect.StuName = stu.StuName; + insertDatastuselect.GenderNo = stu.GenderNo != null && stu.GenderNo.Value ? "1" : "0"; + insertDatastuselect.AcademicYearNo = TeachEntity.AcademicYearNo; + insertDatastuselect.Semester = TeachEntity.Semester; + insertDatastuselect.OpenLessonDeptNo = TeachEntity.DeptNo; + insertDatastuselect.OpenLessonMajorNo = TeachEntity.MajorNo; + insertDatastuselect.LessonNo = TeachEntity.LessonNo; + insertDatastuselect.LessonName = lessonData.FirstOrDefault(m => m.LessonNo == TeachEntity.LessonNo)?.LessonName; + insertDatastuselect.PartCode = ""; + insertDatastuselect.OrdinaryScoreScale = 1; + insertDatastuselect.TermInScoreScale = 1; + insertDatastuselect.TermEndScoreScale = 1; + insertDatastuselect.OtherScoreScale = 1; + insertDatastuselect.TeachClassNo = stu.ClassNo; + insertDatastuselect.LessonSortNo = lessonData.FirstOrDefault(m => m.LessonNo == TeachEntity.LessonNo)?.LessonSortNo; + insertDatastuselect.StuSortNo = "02"; + insertDatastuselect.Grade = stu.Grade; + insertDatastuselect.StudyScore = 0; + insertDatastuselect.TotalStudyHour = 0; + insertDatastuselect.IsInEffect = "1"; + insertDatastuselect.EmpNo = TeachEntity.EmpNo; + insertDatastuselect.IsPitchOn = "1"; + insertDatastuselect.CheckMark = "1"; + insertDatastuselect.InsertTime = DateTime.Now; + insertDatastuselect.F_SchoolId = TeachEntity.F_SchoolId; + StuSelectLessonList.Add(insertDatastuselect); + } } } else @@ -206,6 +251,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers } } teachClassIBLL.SaveEntityList(TeachList); + stuSelectLessonListBLL.SaveEntityList(StuSelectLessonList); classPlanIBLL.SaveEntityList(keyValue, entity); return Success("排课成功"); } 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 c3dfede79..e45e7762f 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 @@ -201,7 +201,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration stuLessonList.CheckMark = item.CheckMark; stuLessonList.InsertTime = item.InsertTime; stuLessonList.CheckMark = "1"; - db.Insert(stuLessonList); + + 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) + { + db.Insert(stuLessonList); + } } db.Commit(); } 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 ea4845908..f0ffb5769 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 @@ -305,12 +305,18 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration Teach.DeptNo = item.DeptNo; Teach.MajorNo = item.MajorNo; Teach.Grade = item.Grade; + Teach.EmpNo = item.EmpNo; Teach.Semester = item.Semester; Teach.LessonNo = item.LessonNo; Teach.StuNum = item.StuNum; Teach.LessonSortNo = item.LessonSortNo; Teach.F_SchoolId = item.F_SchoolId; - db.Insert(Teach); + + 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) + { + db.Insert(Teach); + } } db.Commit(); } From 75f970f74bfe7765a84f0d0b3dab8833c3c15920 Mon Sep 17 00:00:00 2001 From: ndbs Date: Tue, 14 Jun 2022 18:29:48 +0800 Subject: [PATCH 06/18] =?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=95=B0=E6=8D=AE=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EducationalAdministration/ClassPlan/ClassPlanService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 3fed56576..f0d9bac85 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 @@ -35,7 +35,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration 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 "); + strSql.Append(" WHERE 1=1 and l.CheckMark=1 "); var queryParam = queryJson.ToJObject(); // 虚拟参数 var dp = new DynamicParameters(new { }); From 034f33a1224e8b2cbd37c2314d9f38b14ce65ff7 Mon Sep 17 00:00:00 2001 From: ndbs Date: Wed, 15 Jun 2022 14:26:59 +0800 Subject: [PATCH 07/18] =?UTF-8?q?=E5=AD=A6=E7=94=9F=E9=80=89=E4=BF=AE?= =?UTF-8?q?=E8=AF=BE=E6=88=90=E7=BB=A9=20=E6=9C=AA=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/ClassPlanController.cs | 50 +------ .../Controllers/ClassPlanTeachController.cs | 19 ++- .../OpenLessonPlanOfElectiveController.cs | 40 ++++++ .../Views/ClassPlan/Form.cshtml | 4 - .../Views/ClassPlan/Form.js | 2 +- .../Views/ClassPlanTeach/Index.js | 12 +- .../Views/ClassPlanTeach/TeachForm.js | 3 +- .../Views/ClassPlanTeach/TeachFormQZ.js | 4 +- .../FormOfElective.cshtml | 47 ++++++ .../FormOfElective.js | 62 ++++++++ .../IndexElective.cshtml | 42 ++++++ .../OpenLessonPlanOfElective/IndexElective.js | 134 ++++++++++++++++++ .../Learun.Application.Web.csproj | 4 + .../OpenLessonPlanOfElectiveBLL.cs | 25 +++- .../OpenLessonPlanOfElectiveEntity.cs | 29 ++++ .../OpenLessonPlanOfElectiveIBLL.cs | 6 + .../OpenLessonPlanOfElectiveService.cs | 87 ++++++++++++ .../StuSelectLessonListService.cs | 3 +- .../TeachClass/TeachClassService.cs | 6 +- 19 files changed, 505 insertions(+), 74 deletions(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/FormOfElective.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/FormOfElective.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/IndexElective.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/IndexElective.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 581e10704..7be2dbf20 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanController.cs @@ -21,9 +21,6 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers private ClassPlanIBLL classPlanIBLL = new ClassPlanBLL(); private ClassInfoIBLL classInfoIBLL = new ClassInfoBLL(); private TeachClassIBLL teachClassIBLL = new TeachClassBLL(); - private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL(); - private LessonInfoIBLL lessonInfoIBLL = new LessonInfoBLL(); - private StuSelectLessonListIBLL stuSelectLessonListBLL = new StuSelectLessonListBLL(); #region 视图功能 @@ -152,6 +149,8 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers } entity.State = 0; entity.IsAllowEdit = true; + entity.LessonSortNo = "1"; + entity.CheckMark = "1"; entity.MakeDate = DateTime.Now; var model = classPlanIBLL.GetRepetitions(entity.F_SchoolId, entity.AcademicYearNo, entity.Semester, entity.DeptNo, entity.MajorNo, entity.Grade, entity.LessonNo); if (model != null) @@ -178,12 +177,9 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public ActionResult CourseArranging(string keyValue) { var entity = classPlanIBLL.GetListById(keyValue); - var stuinfobasicData = stuInfoBasicIBLL.GetAllList(); - var lessonData = lessonInfoIBLL.GetAllLesson(); List TeachList = new List(); - List StuSelectLessonList = new List(); - + for (int i = 0; i < entity.Count; i++) { var lessonList = classInfoIBLL.GetAllClass(). @@ -204,45 +200,8 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers TeachEntity.StuNum = entity[i].StuNum; TeachEntity.LessonSortNo = entity[i].LessonSortNo; TeachEntity.F_SchoolId = entity[i].F_SchoolId; - TeachList.Add(TeachEntity); - var classstulist = stuinfobasicData.Where(m => m.ClassNo == TeachEntity.TeachClassNo) - .ToList(); - foreach (var stu in classstulist) - { - var insertDatastuselect = new StuSelectLessonListEntity(); - insertDatastuselect.NoticeBookNo = stu.NoticeNo; - insertDatastuselect.StuNo = stu.StuNo; - insertDatastuselect.DeptNo = stu.DeptNo; - insertDatastuselect.ClassNo = stu.ClassNo; - insertDatastuselect.MajorNo = stu.MajorNo; - insertDatastuselect.StuName = stu.StuName; - insertDatastuselect.GenderNo = stu.GenderNo != null && stu.GenderNo.Value ? "1" : "0"; - insertDatastuselect.AcademicYearNo = TeachEntity.AcademicYearNo; - insertDatastuselect.Semester = TeachEntity.Semester; - insertDatastuselect.OpenLessonDeptNo = TeachEntity.DeptNo; - insertDatastuselect.OpenLessonMajorNo = TeachEntity.MajorNo; - insertDatastuselect.LessonNo = TeachEntity.LessonNo; - insertDatastuselect.LessonName = lessonData.FirstOrDefault(m => m.LessonNo == TeachEntity.LessonNo)?.LessonName; - insertDatastuselect.PartCode = ""; - insertDatastuselect.OrdinaryScoreScale = 1; - insertDatastuselect.TermInScoreScale = 1; - insertDatastuselect.TermEndScoreScale = 1; - insertDatastuselect.OtherScoreScale = 1; - insertDatastuselect.TeachClassNo = stu.ClassNo; - insertDatastuselect.LessonSortNo = lessonData.FirstOrDefault(m => m.LessonNo == TeachEntity.LessonNo)?.LessonSortNo; - insertDatastuselect.StuSortNo = "02"; - insertDatastuselect.Grade = stu.Grade; - insertDatastuselect.StudyScore = 0; - insertDatastuselect.TotalStudyHour = 0; - insertDatastuselect.IsInEffect = "1"; - insertDatastuselect.EmpNo = TeachEntity.EmpNo; - insertDatastuselect.IsPitchOn = "1"; - insertDatastuselect.CheckMark = "1"; - insertDatastuselect.InsertTime = DateTime.Now; - insertDatastuselect.F_SchoolId = TeachEntity.F_SchoolId; - StuSelectLessonList.Add(insertDatastuselect); - } + TeachList.Add(TeachEntity); } } else @@ -251,7 +210,6 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers } } teachClassIBLL.SaveEntityList(TeachList); - stuSelectLessonListBLL.SaveEntityList(StuSelectLessonList); classPlanIBLL.SaveEntityList(keyValue, entity); return Success("排课成功"); } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanTeachController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanTeachController.cs index 192479ee4..512b8cd1d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanTeachController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/ClassPlanTeachController.cs @@ -23,6 +23,8 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers private StuSelectLessonListIBLL StuSelectLesson = new StuSelectLessonListBLL(); private StuInfoBasicIBLL stuInfoBasicIBLL = new StuInfoBasicBLL(); private StuScoreIBLL stuScoreIBLL = new StuScoreBLL(); + private LessonInfoIBLL lessonInfoIBLL = new LessonInfoBLL(); + #region 视图功能 /// @@ -150,7 +152,10 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public ActionResult SetTeach(string keyValue, string EmpNo) { var entityList = teachClassIBLL.GetTeachListById(keyValue); + var lessonData = lessonInfoIBLL.GetAllLesson(); + List TeachList = new List(); + for (int i = 0; i < entityList.Count; i++) { var stuDataList = stuInfoBasicIBLL.GetAllList().Where(s => s.DeptNo == entityList[i].DeptNo @@ -162,31 +167,33 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers for (int j = 0; j < stuDataList.Count; j++) { StuSelectLessonListEntity TeachEntity = new StuSelectLessonListEntity(); + TeachEntity.NoticeBookNo = stuDataList[j].StuNo; TeachEntity.StuNo = stuDataList[j].StuNo; TeachEntity.DeptNo = entityList[i].DeptNo; TeachEntity.MajorNo = entityList[i].MajorNo; TeachEntity.ClassNo = stuDataList[j].ClassNo; - TeachEntity.MajorDetailNo = entityList[i].MajorDetailNo; - TeachEntity.MajorDetailName = entityList[i].MajorDetailName; TeachEntity.StuName = stuDataList[j].StuName; + TeachEntity.GenderNo = Convert.ToInt32(stuDataList[j].GenderNo).ToString(); TeachEntity.AcademicYearNo = entityList[i].AcademicYearNo; TeachEntity.Semester = entityList[i].Semester; TeachEntity.OpenLessonDeptNo = entityList[i].DeptNo; TeachEntity.OpenLessonMajorNo = entityList[i].MajorNo; TeachEntity.LessonNo = entityList[i].LessonNo; - TeachEntity.PartCode = entityList[i].PartCode; + TeachEntity.LessonName = lessonData.FirstOrDefault(m => m.LessonNo == TeachEntity.LessonNo)?.LessonName; + TeachEntity.PartCode = ""; TeachEntity.OrdinaryScoreScale = 0; TeachEntity.TermInScoreScale = 0; TeachEntity.TermEndScoreScale = 0; TeachEntity.OtherScoreScale = 0; TeachEntity.TeachClassNo = entityList[i].TeachClassNo; TeachEntity.LessonSortNo = entityList[i].LessonSortNo; - TeachEntity.StuSortNo = entityList[i].LessonSortNo; + TeachEntity.StuSortNo = "02"; TeachEntity.Grade = entityList[i].Grade; - TeachEntity.StudyScore = 2; - TeachEntity.TotalStudyHour = 2; + TeachEntity.StudyScore = 0; + TeachEntity.TotalStudyHour = 0; TeachEntity.IsInEffect = "1"; TeachEntity.IsPitchOn = "1"; + TeachEntity.EmpNo = EmpNo; TeachEntity.F_SchoolId = entityList[i].F_SchoolId; TeachEntity.CheckMark = "1"; TeachEntity.InsertTime = DateTime.Now; 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 a2ff405f1..783df263e 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 @@ -87,6 +87,24 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { return View(); } + /// + /// 选 成绩比例设置 + /// + /// + [HttpGet] + public ActionResult IndexElective() + { + return View(); + } + /// + /// 选 成绩比例设置 + /// + /// + [HttpGet] + public ActionResult FormOfElective() + { + return View(); + } #endregion #region 获取数据 @@ -111,6 +129,28 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers }; return Success(jsonData); } + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageListElective(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = openLessonPlanOfElectiveIBLL.GetPageListElective(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + [HttpGet] [AjaxOnly] public ActionResult GetPageListOfMerge(string pagination, string queryJson) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Form.cshtml index 9f664a33d..e8a8160a4 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/ClassPlan/Form.cshtml @@ -32,10 +32,6 @@
- @*
-
课程类别码
-
-
*@
课程细类码
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 } } + /// + /// 获取OpenLessonPlan表实体数据 + /// 主键 + /// + /// + public OpenLessonPlanOfElectiveEntity GetOpenLessonPlanEntityByJson(string queryJson) + { + try + { + return openLessonPlanOfElectiveService.GetOpenLessonPlanEntityByJson(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// + /// 获取StuSelectLessonListEntity表实体数据 + /// 主键 + /// + /// + public StuSelectLessonListOfElectiveEntity GetStuSelectLessonListEntityByJson(string queryJson) + { + try + { + return openLessonPlanOfElectiveService.GetStuSelectLessonListEntityByJson(queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } #endregion #region 提交数据 @@ -183,6 +229,30 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + public void SaveFormOfElective(string keyValue, OpenLessonPlanOfElectiveEntity entity) + { + try + { + openLessonPlanOfElectiveService.SaveFormOfElective(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/OpenLessonPlanOfElectiveEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveEntity.cs index 5f574df36..1a51d8dd1 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 @@ -166,23 +166,23 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// OrdinaryScoreScale /// [Column("ORDINARYSCORESCALE")] - public decimal OrdinaryScoreScale { get; set; } + public decimal? OrdinaryScoreScale { get; set; } /// /// TermInScoreScale /// [Column("TERMINSCORESCALE")] - public decimal TermInScoreScale { get; set; } + public decimal? TermInScoreScale { get; set; } /// /// TermEndScoreScale /// [Column("TERMENDSCORESCALE")] - public decimal TermEndScoreScale { get; set; } + public decimal? TermEndScoreScale { get; set; } /// /// OtherScoreScale /// [Column("OTHERSCORESCALE")] - public decimal OtherScoreScale { get; set; } + public decimal? OtherScoreScale { get; set; } public bool? IsAllowEdit { 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 ce7c6d08d..40fa61a6a 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 @@ -40,6 +40,19 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// /// OpenLessonPlanOfElectiveEntity GetOpenLessonPlanOfElectiveEntity(string keyValue); + + /// + /// 获取OpenLessonPlanOfElectiveEntity表实体数据 + /// 主键 + /// + /// + OpenLessonPlanOfElectiveEntity GetOpenLessonPlanEntityByJson(string queryJson); + /// + /// 获取StuSelectLessonListEntity表实体数据 + /// 主键 + /// + /// + StuSelectLessonListOfElectiveEntity GetStuSelectLessonListEntityByJson(string queryJson); #endregion #region 提交数据 @@ -57,6 +70,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// void SaveEntity(string keyValue, OpenLessonPlanOfElectiveEntity entity); void AddForm(string keyValue, OpenLessonPlanOfElectiveEntity entity); + + void SaveFormOfElective(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 c9c2aa932..21cfdce6f 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 @@ -288,6 +288,81 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 获取OpenLessonPlan表实体数据 + /// 主键 + /// + /// + public OpenLessonPlanOfElectiveEntity GetOpenLessonPlanEntityByJson(string queryJson) + { + try + { + var queryParam = queryJson.ToJObject(); + var F_SchoolId = queryParam["F_SchoolId"].ToString(); + var AcademicYearNo = queryParam["AcademicYearNo"].ToString(); + var Semester = queryParam["Semester"].ToString(); + var LessonNo = queryParam["LessonNo"].ToString(); + var LessonSection =queryParam["LessonSection"].ToString(); + var ClassRoomNo = queryParam["ClassRoomNo"].ToString(); + + var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassroomNo == ClassRoomNo); + if (classInfoEntity == null) + { + return new OpenLessonPlanOfElectiveEntity(); + } + + return this.BaseRepository("CollegeMIS").FindEntity(x => x.F_SchoolId == F_SchoolId && x.AcademicYearNo == AcademicYearNo && x.Semester == Semester && x.ClassRoomNo == classInfoEntity.ClassroomNo && x.LessonSection == LessonSection && x.LessonNo == LessonNo && x.LessonSortNo == "2"); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取StuSelectLessonListEntity表实体数据 + /// 主键 + /// + /// + public StuSelectLessonListOfElectiveEntity GetStuSelectLessonListEntityByJson(string queryJson) + { + try + { + var queryParam = queryJson.ToJObject(); + var F_SchoolId = queryParam["F_SchoolId"].ToString(); + var AcademicYearNo = queryParam["AcademicYearNo"].ToString(); + var Semester = queryParam["Semester"].ToString(); + var LessonNo = queryParam["LessonNo"].ToString(); + var LessonSection = queryParam["LessonSection"].ToString(); + var ClassRoomNo = queryParam["ClassRoomNo"].ToString(); + + var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassroomNo == ClassRoomNo); + if (classInfoEntity == null) + { + return new StuSelectLessonListOfElectiveEntity(); + } + + return this.BaseRepository("CollegeMIS").FindEntity(x => x.F_SchoolId == F_SchoolId && x.AcademicYearNo == AcademicYearNo && x.Semester == Semester && x.LessonNo == LessonNo && x.LessonSortNo == "2" && x.ClassRoomNo == ClassRoomNo && x.LessonSection == LessonSection); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } #endregion #region 提交数据 @@ -390,7 +465,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration emItemEntity.ClassRoomName = entity.ClassRoomName; db.Insert(emItemEntity); } - + db.Commit(); } catch (Exception ex) @@ -407,6 +482,76 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + public void SaveFormOfElective(string keyValue, OpenLessonPlanOfElectiveEntity entity) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + try + { + if (!string.IsNullOrEmpty(keyValue)) + { + //单个编辑 + //entity.Modify(keyValue); + //this.BaseRepository("CollegeMIS").Update(entity); + + //多个编辑 + var keyValueArr = keyValue.Split(','); + foreach (var item in keyValueArr) + { + var model = db.FindEntity(item); + if (model != null) + { + model.OrdinaryScoreScale = entity.OrdinaryScoreScale; + model.TermInScoreScale = entity.TermInScoreScale; + model.TermEndScoreScale = entity.TermEndScoreScale; + model.OtherScoreScale = entity.OtherScoreScale; + model.IsAllowEdit = entity.IsAllowEdit; + db.Update(model); + + //修改StuSelectLessonList中的比例 + db.ExecuteBySql("update StuSelectLessonListOfElective set OrdinaryScoreScale=" + entity.OrdinaryScoreScale + ",TermInScoreScale=" + entity.TermInScoreScale + ",TermEndScoreScale=" + entity.TermEndScoreScale + ",OtherScoreScale=" + entity.OtherScoreScale + " where AcademicYearNo='" + model.AcademicYearNo + "' and Semester='" + model.Semester + "' and LessonNo='" + model.LessonNo + "' and LessonSortNo='" + model.LessonSortNo + "' "); + + //修改StuScore中的成绩 + var beforeList = db.FindList(x => x.AcademicYearNo == model.AcademicYearNo && x.Semester == model.Semester && x.LessonNo == model.LessonNo && x.LessonSortNo == model.LessonSortNo); + if (beforeList.Any()) + { + foreach (var stuScoreItem in beforeList) + { + if (stuScoreItem.Score != null) + { + stuScoreItem.Score = (stuScoreItem.OrdinaryScore * (model.OrdinaryScoreScale / 100) + stuScoreItem.TermInScore * (model.TermInScoreScale / 100) + stuScoreItem.TermEndScore * (model.TermEndScoreScale / 100) + stuScoreItem.OtherScore * (model.OtherScoreScale / 100)).ToDecimal(0); + db.Update(stuScoreItem); + } + } + } + + } + } + } + else + { + entity.Create(); + db.Insert(entity); + } + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } #endregion #region 扩展数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs index 7b0921985..43f4bd762 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs @@ -374,7 +374,16 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration strSql.Append(" and t.ClassNo=@ClassNo "); dp.Add("ClassNo", queryParam["ClassNo"].ToString(), DbType.String); } - + if (!queryParam["LessonSection"].IsEmpty()) + { + strSql.Append(" and t.LessonSection=@LessonSection "); + dp.Add("LessonSection", queryParam["LessonSection"].ToString(), DbType.String); + } + if (!queryParam["ClassRoomNo"].IsEmpty()) + { + strSql.Append(" and t.ClassRoomNo=@ClassRoomNo "); + dp.Add("ClassRoomNo", queryParam["ClassRoomNo"].ToString(), DbType.String); + } return this.BaseRepository("CollegeMIS").FindEntity(strSql.ToString(), dp); } catch (Exception ex) diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElective/StuSelectLessonListOfElectiveEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElective/StuSelectLessonListOfElectiveEntity.cs index d27073da4..c3fb1967d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElective/StuSelectLessonListOfElectiveEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElective/StuSelectLessonListOfElectiveEntity.cs @@ -170,6 +170,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration [Column("STATUS")] public int? Status { get; set; } + /// + /// F_SchoolId + /// + [Column("F_SCHOOLID")] + public string F_SchoolId { get; set; } /// /// OrdinaryScoreScale /// @@ -210,8 +215,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } #endregion #region 扩展字段 - - [NotMapped] public string F_SchoolId { get; set; } [NotMapped] public string LessonTypeId { get; set; } #endregion From 2065d731f933ab01d59c3a25fb1cf4ed7412e8ec Mon Sep 17 00:00:00 2001 From: ndbs Date: Wed, 15 Jun 2022 17:36:38 +0800 Subject: [PATCH 10/18] =?UTF-8?q?=E9=80=89=E4=BF=AE=E8=AF=BE=E6=88=90?= =?UTF-8?q?=E7=BB=A9=E6=AF=94=E4=BE=8B=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../IndexElective.cshtml | 8 ++++++++ .../OpenLessonPlanOfElective/IndexElective.js | 20 ++++++++++++++++++- .../OpenLessonPlanOfElectiveService.cs | 10 ++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) 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 index 7a4d1bbc6..4de36f0f9 100644 --- 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 @@ -22,6 +22,14 @@
课程
+
+
教师
+
+
+
+
教室
+
+
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 index d85c7ca36..555862bf3 100644 --- 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 @@ -92,7 +92,20 @@ var bootstrap = function ($, learun) { value: 'value', text: 'text' }); - + $('#EmpNo').lrselect({ + placeholder: "请选择老师", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetEmpNoData', + value: 'value', + text: 'text' + }); + $('#ClassRoomNo').lrselect({ + placeholder: "请选择教室", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetElectiveClassRoomNoData', + value: 'value', + text: 'text' + }); }, // 初始化列表 initGird: function () { @@ -104,6 +117,11 @@ var bootstrap = function ($, learun) { { label: "学期", name: "Semester", width: 80, align: "left" }, { label: "课程编号", name: "LessonNo", width: 100, align: "left" }, { label: "课程名称", name: "LessonName", width: 150, align: "left" }, + { label: "节次", name: "LessonSection", width: 100, align: "left" }, + { label: "教室编号", name: "ClassRoomNo", width: 100, align: "left" }, + { label: "教室", name: "ClassRoomName", width: 100, align: "left" }, + { label: "教师编号", name: "EmpNo", width: 100, align: "left" }, + { label: "教师名称", name: "EmpName", 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" }, 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 21cfdce6f..7c450437d 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 @@ -151,6 +151,16 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration dp.Add("LessonName", "%" + queryParam["LessonName"].ToString() + "%", DbType.String); strSql.Append(" AND t.LessonName Like @LessonName "); } + if (!queryParam["EmpNo"].IsEmpty()) + { + dp.Add("EmpNo", "%" + queryParam["EmpNo"].ToString() + "%", DbType.String); + strSql.Append(" AND t.EmpNo Like @EmpNo "); + } + if (!queryParam["ClassRoomNo"].IsEmpty()) + { + dp.Add("ClassRoomNo", "%" + queryParam["ClassRoomNo"].ToString() + "%", DbType.String); + strSql.Append(" AND t.ClassRoomNo Like @ClassRoomNo "); + } return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); } catch (Exception ex) From 3bed44d5cf189b8459233739b117cfb2778bf183 Mon Sep 17 00:00:00 2001 From: liangkun Date: Wed, 15 Jun 2022 17:38:41 +0800 Subject: [PATCH 11/18] =?UTF-8?q?=E9=80=89=E4=BF=AE=E6=88=90=E7=BB=A9?= =?UTF-8?q?=E5=BD=95=E5=85=A5=E5=8F=AF=E7=BC=96=E8=BE=91=E6=AF=94=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OpenLessonPlanOfElectiveController.cs | 16 ++++++ .../Views/OpenLessonPlan/FormOfClass.js | 31 ++++++++--- .../StuScore/InputScoreIndexOfElective.js | 8 +-- .../OpenLessonPlanOfElectiveBLL.cs | 20 +++++++ .../OpenLessonPlanOfElectiveIBLL.cs | 6 +++ .../OpenLessonPlanOfElectiveService.cs | 54 +++++++++++++++++++ 6 files changed, 124 insertions(+), 11 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 3a8e76569..03e98533b 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 @@ -864,5 +864,21 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers } #endregion + + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveFormOfClass(string queryJson, string strEntity) + { + StuSelectLessonListOfElectiveEntity entity = strEntity.ToObject(); + openLessonPlanOfElectiveIBLL.SaveStuSelectLessonListScaleByJson(queryJson, entity); + + return Success("保存成功!"); + } } } 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 7329dd9a7..eecb21218 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 @@ -13,12 +13,19 @@ var ClassNo = request('ClassNo'); var ClassRoomNo = request('ClassRoomNo'); var LessonSection = request('LessonSection'); var param = {}; -if (!!F_SchoolId && !!AcademicYearNo && !!Semester && !!LessonNo && !!ClassNo && !!ClassRoomNo && !!LessonSection) { +if (!!F_SchoolId && !!AcademicYearNo && !!Semester && !!LessonNo && !!ClassNo) { param.F_SchoolId = F_SchoolId; param.AcademicYearNo = AcademicYearNo; param.Semester = Semester; param.LessonNo = LessonNo; param.ClassNo = ClassNo; + +} +if (!!F_SchoolId && !!AcademicYearNo && !!Semester && !!LessonNo && !!ClassRoomNo && !!LessonSection) { + param.F_SchoolId = F_SchoolId; + param.AcademicYearNo = AcademicYearNo; + param.Semester = Semester; + param.LessonNo = LessonNo; param.ClassRoomNo = ClassRoomNo; param.LessonSection = LessonSection; @@ -89,12 +96,22 @@ var bootstrap = function ($, learun) { var postData = { strEntity: JSON.stringify($('body').lrGetFormData()) }; - $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlan/SaveFormOfClass?queryJson=' + JSON.stringify(param), postData, function (res) { - // 保存成功后才回调 - if (!!callBack) { - callBack(); - } - }); + if (!!ClassNo) { + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlan/SaveFormOfClass?queryJson=' + JSON.stringify(param), postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + } else { + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/SaveFormOfClass?queryJson=' + JSON.stringify(param), postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + } + }; page.init(); } 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 e21f26580..f82ae4030 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 @@ -212,7 +212,7 @@ var bootstrap = function ($, learun) { learun.layerForm({ id: 'FormOfClass', title: '班级成绩比例设置', - url: top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/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) { @@ -534,8 +534,8 @@ var bootstrap = function ($, learun) { searchScale: function (param) { param = param || {}; $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/GetStuSelectLessonListEntityByJson?queryJson=' + JSON.stringify(param), function (data) { - if (data["StuSelectLessonList"] != null) { - var ssll = data["StuSelectLessonList"]; + if (data["StuSelectLessonListOfElective"] != null) { + var ssll = data["StuSelectLessonListOfElective"]; $('#OrdinaryScoreScale').html(ssll.OrdinaryScoreScale > 0 ? ssll.OrdinaryScoreScale : 0); $('#TermInScoreScale').html(ssll.TermInScoreScale > 0 ? ssll.TermInScoreScale : 0); $('#TermEndScoreScale').html(ssll.TermEndScoreScale > 0 ? ssll.TermEndScoreScale : 0); @@ -590,7 +590,7 @@ var bootstrap = function ($, learun) { page.initGird(); page.search(query); - //page.searchScale(query); + page.searchScale(query); } }; judgeSelect = function () { 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 0441597bc..0b6632323 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 @@ -341,6 +341,26 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + + public void SaveStuSelectLessonListScaleByJson(string queryJson, StuSelectLessonListOfElectiveEntity entity) + { + try + { + openLessonPlanOfElectiveService.SaveStuSelectLessonListScaleByJson(queryJson, entity); + } + 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/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/OpenLessonPlanOfElective/OpenLessonPlanOfElectiveIBLL.cs index 40fa61a6a..28607fca3 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 @@ -96,5 +96,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration #endregion + /// + /// 保存StuSelectLessonList中的成绩比例 + /// 主键 + /// + /// + void SaveStuSelectLessonListScaleByJson(string queryJson, StuSelectLessonListOfElectiveEntity entity); } } 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 21cfdce6f..77c7b1054 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 @@ -766,5 +766,59 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } #endregion + + /// + /// 保存StuSelectLessonList中的成绩比例 + /// 主键 + /// + /// + public void SaveStuSelectLessonListScaleByJson(string queryJson, StuSelectLessonListOfElectiveEntity entity) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + try + { + var queryParam = queryJson.ToJObject(); + var F_SchoolId = queryParam["F_SchoolId"].ToString(); + var AcademicYearNo = queryParam["AcademicYearNo"].ToString(); + var Semester = queryParam["Semester"].ToString(); + var LessonNo = queryParam["LessonNo"].ToString(); + var ClassRoomNo = queryParam["ClassRoomNo"].ToString(); + var LessonSection = queryParam["LessonSection"].ToString(); + + var classInfoEntity = db.FindEntity(x => x.ClassroomNo == ClassRoomNo); + if (classInfoEntity != null) + { + db.ExecuteBySql("update StuSelectLessonListOfElective set OrdinaryScoreScale=" + entity.OrdinaryScoreScale + ",TermInScoreScale=" + entity.TermInScoreScale + ",TermEndScoreScale=" + entity.TermEndScoreScale + ",OtherScoreScale=" + entity.OtherScoreScale + " where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and LessonSection='" + LessonSection + "' and ClassroomNo='" + classInfoEntity.ClassroomNo + "' and LessonNo='" + LessonNo + "' and LessonSortNo='2' "); + + //修改StuScore中的成绩 + var beforeList = db.FindList(x => x.F_SchoolId == F_SchoolId && x.AcademicYearNo == AcademicYearNo && x.Semester == Semester && x.ClassRoomNo == classInfoEntity.ClassroomNo && x.LessonNo == LessonNo && x.LessonSortNo == "2" && x.LessonSection == LessonSection); + if (beforeList.Any()) + { + foreach (var stuScoreItem in beforeList) + { + if (stuScoreItem.Score != null) + { + stuScoreItem.Score = (stuScoreItem.OrdinaryScore * (entity.OrdinaryScoreScale / 100) + stuScoreItem.TermInScore * (entity.TermInScoreScale / 100) + stuScoreItem.TermEndScore * (entity.TermEndScoreScale / 100) + stuScoreItem.OtherScore * (entity.OtherScoreScale / 100)).ToDecimal(0); + db.Update(stuScoreItem); + } + } + } + + } + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } } } From cfa1ff4ec27d8a691c0b4ac7b832464045805fac Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Wed, 15 Jun 2022 17:41:33 +0800 Subject: [PATCH 12/18] =?UTF-8?q?=E8=80=83=E8=AF=95=E8=AE=B0=E5=BD=95-?= =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=80=83=E5=9C=BA=E5=88=A4=E6=96=AD=E8=80=83?= =?UTF-8?q?=E8=AF=95=E6=97=B6=E9=97=B4=E6=98=AF=E5=90=A6=E8=AE=BE=E7=BD=AE?= =?UTF-8?q?=EF=BC=9B=E6=96=B0=E5=A2=9E=E8=80=83=E5=9C=BA-=E9=80=89?= =?UTF-8?q?=E6=8B=A9=E8=80=83=E5=9C=BA=E5=88=97=E8=A1=A8=E7=AD=9B=E6=8E=89?= =?UTF-8?q?=E6=8E=92=E8=80=83=E6=97=B6=E9=97=B4=E5=AD=98=E5=9C=A8=E5=86=B2?= =?UTF-8?q?=E7=AA=81=E7=9A=84=E6=95=99=E5=AE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Exam_ExamPlanLesson/FormRoomTeacher.js | 20 ++++---- .../Views/Exam_ExamPlanLesson/Index.js | 12 +++-- .../Exam_ExamPlanRoomService.cs | 2 +- .../Exam_ExamRoom/Exam_ExamRoomService.cs | 46 ++++++++++++++++++- 4 files changed, 64 insertions(+), 16 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoomTeacher.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoomTeacher.js index 244a8d55d..6a43b138b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoomTeacher.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoomTeacher.js @@ -56,7 +56,7 @@ var bootstrap = function ($, learun) { selectedRow = null; learun.layerForm({ id: 'formroom1', - title: '新增考场', + title: '选择考场', url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/FormRoom?EPLId=' + EPLId, width: 850, height: 500, @@ -92,11 +92,13 @@ var bootstrap = function ($, learun) { } else { $('[data-table="' + id + '"]').lrSetFormData(data[id]); - var empnoArr = data[id].EmpNo.split(','); - var empnameArr = data[id].EmpName.split(','); - $.each(empnoArr, function (i, val) { - tempdatra.push({ EmpNo: val, EmpName: empnameArr[i] }); - }); + if (data[id].EmpNo && (data[id].EmpNo).indexOf(',') != -1) { + var empnoArr = data[id].EmpNo.split(','); + var empnameArr = data[id].EmpName.split(','); + $.each(empnoArr, function (i, val) { + tempdatra.push({ EmpNo: val, EmpName: empnameArr[i] }); + }); + } $('#Exam_ExamPlanTeacher').jfGridSet('refreshdata', tempdatra); } } @@ -146,7 +148,7 @@ var bootstrap = function ($, learun) { } var datas = $('#Exam_ExamPlanTeacher').jfGridGet('rowdatas'); if (datas == null || datas.length == 0) { - learun.alert.warning("请先新增监考老师!"); + learun.alert.warning("请新增监考老师!"); return false; } return true; @@ -169,14 +171,14 @@ var bootstrap = function ($, learun) { '/EducationalAdministration/Exam_ExamPlanLesson/SaveRoomAndTeacher?keyValue=' + keyValue, postData, - function(res) { + function (res) { // 保存成功后才回调 if (!!callBack) { callBack(res, formData, i); } }); - } + } }; page.init(); } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/Index.js index 883428f9e..4ed2217cb 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/Index.js @@ -129,12 +129,16 @@ var bootstrap = function ($, learun) { if (ELCheckMark == 1) { return learun.alert.warning("该项已审核!"); } - var param ={}; + var param = {}; param.EPId = EPId; param.EPLId = EPLId; + //判断是否已设置考试时间 + if (!$('#examDate').html() || !$('#examTime').html()) { + return learun.alert.warning("请先设置考试时间!"); + } //判断是否已新增班级 - var data= learun.httpGet(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/GetListForClass?queryJson='+JSON.stringify(param)); - + var data = learun.httpGet(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/GetListForClass?queryJson=' + JSON.stringify(param)); + if (data.data.length > 0) { learun.layerForm({ id: 'formteacherRoom', @@ -149,7 +153,7 @@ var bootstrap = function ($, learun) { } else { return learun.alert.warning("请先添加班级!"); } - + } else { return learun.alert.warning("请选择考试课程!"); } 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 2c9bfeb67..a11efa94d 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 @@ -303,7 +303,7 @@ where l.EPLId='{EPLId}'"; var EPLIds = examLessonList.Select(y => y.EPLId).ToList(); if (db.FindList(x => EPLIds.Contains(x.EPLId)).Count() <= 0) { - return (false, "请先添加考试班级!"); + return (false, "请先新增考试班级!"); } List list = new List(); diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamRoom/Exam_ExamRoomService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamRoom/Exam_ExamRoomService.cs index 3c830ea23..0b12a54a3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamRoom/Exam_ExamRoomService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamRoom/Exam_ExamRoomService.cs @@ -59,15 +59,57 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } if (!queryParam["EPLId"].IsEmpty()) { + var examLesson = this.BaseRepository("CollegeMIS").FindEntity(queryParam["EPLId"].ToString()); //排考安排课程表Id - var ELEntity = this.BaseRepository("CollegeMIS").FindList($@"select * from Exam_ExamPlan where EPId=( -select EPId from Exam_ExamPlanLesson where EPLId='{queryParam["EPLId"].ToString()}')").FirstOrDefault(); + var ELEntity = this.BaseRepository("CollegeMIS").FindEntity(examLesson.EPId); if (ELEntity != null) { strSql.Append($" AND t.AcademicYearNo = '{ELEntity.AcademicYearNo}' "); strSql.Append($" AND t.Semester = '{ELEntity.Semester}' "); } strSql.Append($" AND t.ClassroomNo not in (select ClassroomNo from Exam_ExamPlanRoom where EPLId='{queryParam["EPLId"].ToString()}') "); + + //查询与考试课程的考试时间在同一天的考场,如果存在考试时间冲突的考场 则排除此考场 + 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 = this.BaseRepository("CollegeMIS") + .FindList(examRoomByDateSql).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); + } + } + if (conflictRoom.Count() > 0) + { + var classroomNo = string.Join("','", conflictRoom.ToList()); + strSql.Append($" AND t.ClassroomNo not in ('{classroomNo}') "); + } + + } } if (!queryParam["SqlParameter"].IsEmpty()) From 249554651d056053b3863dc9193ac0aaf85c6967 Mon Sep 17 00:00:00 2001 From: ndbs Date: Wed, 15 Jun 2022 18:06:56 +0800 Subject: [PATCH 13/18] =?UTF-8?q?=E9=80=89=E4=BF=AE=E8=AF=BE=E6=95=99?= =?UTF-8?q?=E5=B8=88=E8=AE=BE=E7=BD=AE=E6=88=90=E7=BB=A9=E6=AF=94=E4=BE=8B?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E5=88=B0=E9=80=89=E4=BF=AE=E8=AF=BE=E5=BC=80?= =?UTF-8?q?=E8=AF=BE=E8=AE=A1=E5=88=92?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../OpenLessonPlanOfElective/OpenLessonPlanOfElectiveService.cs | 1 + 1 file changed, 1 insertion(+) 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 95c01e4b1..be1622439 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 @@ -799,6 +799,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration if (classInfoEntity != null) { db.ExecuteBySql("update StuSelectLessonListOfElective set OrdinaryScoreScale=" + entity.OrdinaryScoreScale + ",TermInScoreScale=" + entity.TermInScoreScale + ",TermEndScoreScale=" + entity.TermEndScoreScale + ",OtherScoreScale=" + entity.OtherScoreScale + " where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and LessonSection='" + LessonSection + "' and ClassroomNo='" + classInfoEntity.ClassroomNo + "' and LessonNo='" + LessonNo + "' and LessonSortNo='2' "); + db.ExecuteBySql("update OpenLessonPlanOfElective set OrdinaryScoreScale=" + entity.OrdinaryScoreScale + ",TermInScoreScale=" + entity.TermInScoreScale + ",TermEndScoreScale=" + entity.TermEndScoreScale + ",OtherScoreScale=" + entity.OtherScoreScale + " where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and LessonSection='" + LessonSection + "' and ClassroomNo='" + classInfoEntity.ClassroomNo + "' and LessonNo='" + LessonNo + "' and LessonSortNo='2' "); //修改StuScore中的成绩 var beforeList = db.FindList(x => x.F_SchoolId == F_SchoolId && x.AcademicYearNo == AcademicYearNo && x.Semester == Semester && x.ClassRoomNo == classInfoEntity.ClassroomNo && x.LessonNo == LessonNo && x.LessonSortNo == "2" && x.LessonSection == LessonSection); From f6f87b622d966c9b02ff0622ea9bddac3215c1a4 Mon Sep 17 00:00:00 2001 From: liangkun Date: Wed, 15 Jun 2022 18:30:52 +0800 Subject: [PATCH 14/18] =?UTF-8?q?=E9=80=89=E4=BF=AE=E5=BD=95=E5=85=A5?= =?UTF-8?q?=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StuScore/StuScoreService.cs | 43 +++++++++++++++---- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs index 43f4bd762..b1bfd504b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs @@ -1633,15 +1633,28 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad var Semester = queryParam["Semester"].ToString(); var LessonNo = queryParam["LessonNo"].ToString(); var ClassNo = queryParam["ClassNo"].ToString(); + var LessonSection = queryParam["LessonSection"].ToString(); + var ClassRoomNo = queryParam["ClassRoomNo"].ToString(); var now = DateTime.Now; var loginUserInfo = LoginUserInfo.Get(); - - var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassNo == ClassNo); - if (classInfoEntity != null) + if (!string.IsNullOrEmpty(ClassNo)) + { + var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassNo == ClassNo); + if (classInfoEntity != null) + { + this.BaseRepository("CollegeMIS").ExecuteBySql("update StuScore set IsEditable='0',EditUserId='" + loginUserInfo.account + "',BeginModifyDate='" + now + "' where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and OpenLessonDeptNo='" + classInfoEntity.DeptNo + "' and OpenLessonMajorNo='" + classInfoEntity.MajorNo + "' and LessonNo='" + LessonNo + "' and LessonSortNo='1' and ClassNo='" + ClassNo + "' "); + } + } + else { - this.BaseRepository("CollegeMIS").ExecuteBySql("update StuScore set IsEditable='0',EditUserId='" + loginUserInfo.account + "',BeginModifyDate='" + now + "' where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and OpenLessonDeptNo='" + classInfoEntity.DeptNo + "' and OpenLessonMajorNo='" + classInfoEntity.MajorNo + "' and LessonNo='" + LessonNo + "' and LessonSortNo='1' and ClassNo='" + ClassNo + "' "); + var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassroomNo == ClassRoomNo); + if (classInfoEntity != null) + { + this.BaseRepository("CollegeMIS").ExecuteBySql("update StuScore set IsEditable='0',EditUserId='" + loginUserInfo.account + "',BeginModifyDate='" + now + "' where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and ClassRoomNo='" + classInfoEntity.ClassroomNo + "' and LessonNo='" + LessonNo + "' and LessonSortNo='2' and LessonSection='" + LessonSection + "' "); + } } + } catch (Exception ex) { @@ -1713,15 +1726,29 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad var Semester = queryParam["Semester"].ToString(); var LessonNo = queryParam["LessonNo"].ToString(); var ClassNo = queryParam["ClassNo"].ToString(); + var LessonSection = queryParam["LessonSection"].ToString(); + var ClassRoomNo = queryParam["ClassRoomNo"].ToString(); var now = DateTime.Now; var loginUserInfo = LoginUserInfo.Get(); - - var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassNo == ClassNo); - if (classInfoEntity != null) + if (!string.IsNullOrEmpty(ClassNo)) { - this.BaseRepository("CollegeMIS").ExecuteBySql($"update StuScore set IsEditable='1',EditUserId=null,BeginModifyDate=null,ModifyDate='{now}',ModifyUserId='{loginUserInfo.account}',ModifyUserName='{loginUserInfo.realName}' where F_SchoolId='{F_SchoolId}' and AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' and OpenLessonDeptNo='{classInfoEntity.DeptNo}' and OpenLessonMajorNo='{classInfoEntity.MajorNo}' and LessonNo='{LessonNo}' and LessonSortNo='1' and ClassNo='{ClassNo}' "); + var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassNo == ClassNo); + if (classInfoEntity != null) + { + this.BaseRepository("CollegeMIS").ExecuteBySql($"update StuScore set IsEditable='1',EditUserId=null,BeginModifyDate=null,ModifyDate='{now}',ModifyUserId='{loginUserInfo.account}',ModifyUserName='{loginUserInfo.realName}' where F_SchoolId='{F_SchoolId}' and AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' and OpenLessonDeptNo='{classInfoEntity.DeptNo}' and OpenLessonMajorNo='{classInfoEntity.MajorNo}' and LessonNo='{LessonNo}' and LessonSortNo='1' and ClassNo='{ClassNo}' "); + } } + else + { + var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassroomNo == ClassRoomNo); + if (classInfoEntity != null) + { + this.BaseRepository("CollegeMIS").ExecuteBySql("update StuScore set IsEditable='1',EditUserId=null,BeginModifyDate=null where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and ClassRoomNo='" + classInfoEntity.ClassroomNo + "' and LessonNo='" + LessonNo + "' and LessonSortNo='2' and LessonSection='" + LessonSection + "' "); + } + } + + } catch (Exception ex) { From 6294ee5b79b026f1ba4ff02db11b7bf746cadaa6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=9D=A4=20=E6=A2=81?= Date: Wed, 15 Jun 2022 20:56:33 +0800 Subject: [PATCH 15/18] =?UTF-8?q?=E9=80=89=E4=BF=AE=E8=AF=BE=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E6=88=90=E7=BB=A9=E5=8D=95=E5=8A=9F=E8=83=BD=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StuScore/StuScoreService.cs | 86 +++++++++++++------ 1 file changed, 60 insertions(+), 26 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs index b1bfd504b..d3396434f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs @@ -1632,26 +1632,29 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad var AcademicYearNo = queryParam["AcademicYearNo"].ToString(); var Semester = queryParam["Semester"].ToString(); var LessonNo = queryParam["LessonNo"].ToString(); - var ClassNo = queryParam["ClassNo"].ToString(); - var LessonSection = queryParam["LessonSection"].ToString(); - var ClassRoomNo = queryParam["ClassRoomNo"].ToString(); + var ClassNo = queryParam["ClassNo"]; + var LessonSection = queryParam["LessonSection"]; + var ClassRoomNo = queryParam["ClassRoomNo"]; var now = DateTime.Now; var loginUserInfo = LoginUserInfo.Get(); - if (!string.IsNullOrEmpty(ClassNo)) + if (!ClassNo.IsEmpty()) { - var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassNo == ClassNo); + string classno = ClassNo.ToString(); + var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassNo == classno); if (classInfoEntity != null) { - this.BaseRepository("CollegeMIS").ExecuteBySql("update StuScore set IsEditable='0',EditUserId='" + loginUserInfo.account + "',BeginModifyDate='" + now + "' where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and OpenLessonDeptNo='" + classInfoEntity.DeptNo + "' and OpenLessonMajorNo='" + classInfoEntity.MajorNo + "' and LessonNo='" + LessonNo + "' and LessonSortNo='1' and ClassNo='" + ClassNo + "' "); + this.BaseRepository("CollegeMIS").ExecuteBySql("update StuScore set IsEditable='0',EditUserId='" + loginUserInfo.account + "',BeginModifyDate='" + now + "' where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and OpenLessonDeptNo='" + classInfoEntity.DeptNo + "' and OpenLessonMajorNo='" + classInfoEntity.MajorNo + "' and LessonNo='" + LessonNo + "' and LessonSortNo='1' and ClassNo='" + classno+ "' "); } } else { - var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassroomNo == ClassRoomNo); + string classroomno = ClassRoomNo.ToString(); + string lessonsection = LessonSection.ToString(); + var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassroomNo == classroomno); if (classInfoEntity != null) { - this.BaseRepository("CollegeMIS").ExecuteBySql("update StuScore set IsEditable='0',EditUserId='" + loginUserInfo.account + "',BeginModifyDate='" + now + "' where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and ClassRoomNo='" + classInfoEntity.ClassroomNo + "' and LessonNo='" + LessonNo + "' and LessonSortNo='2' and LessonSection='" + LessonSection + "' "); + this.BaseRepository("CollegeMIS").ExecuteBySql("update StuScore set IsEditable='0',EditUserId='" + loginUserInfo.account + "',BeginModifyDate='" + now + "' where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and ClassRoomNo='" + classInfoEntity.ClassroomNo + "' and LessonNo='" + LessonNo + "' and LessonSortNo='2' and LessonSection='" + lessonsection + "' "); } } @@ -1725,26 +1728,29 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad var AcademicYearNo = queryParam["AcademicYearNo"].ToString(); var Semester = queryParam["Semester"].ToString(); var LessonNo = queryParam["LessonNo"].ToString(); - var ClassNo = queryParam["ClassNo"].ToString(); - var LessonSection = queryParam["LessonSection"].ToString(); - var ClassRoomNo = queryParam["ClassRoomNo"].ToString(); + var ClassNo = queryParam["ClassNo"]; + var LessonSection = queryParam["LessonSection"]; + var ClassRoomNo = queryParam["ClassRoomNo"]; var now = DateTime.Now; var loginUserInfo = LoginUserInfo.Get(); - if (!string.IsNullOrEmpty(ClassNo)) + if (!ClassNo.IsEmpty()) { - var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassNo == ClassNo); + string classno = ClassNo.ToString(); + var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassNo == classno); if (classInfoEntity != null) { - this.BaseRepository("CollegeMIS").ExecuteBySql($"update StuScore set IsEditable='1',EditUserId=null,BeginModifyDate=null,ModifyDate='{now}',ModifyUserId='{loginUserInfo.account}',ModifyUserName='{loginUserInfo.realName}' where F_SchoolId='{F_SchoolId}' and AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' and OpenLessonDeptNo='{classInfoEntity.DeptNo}' and OpenLessonMajorNo='{classInfoEntity.MajorNo}' and LessonNo='{LessonNo}' and LessonSortNo='1' and ClassNo='{ClassNo}' "); + this.BaseRepository("CollegeMIS").ExecuteBySql($"update StuScore set IsEditable='1',EditUserId=null,BeginModifyDate=null,ModifyDate='{now}',ModifyUserId='{loginUserInfo.account}',ModifyUserName='{loginUserInfo.realName}' where F_SchoolId='{F_SchoolId}' and AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' and OpenLessonDeptNo='{classInfoEntity.DeptNo}' and OpenLessonMajorNo='{classInfoEntity.MajorNo}' and LessonNo='{LessonNo}' and LessonSortNo='1' and ClassNo='{classno}' "); } } else { - var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassroomNo == ClassRoomNo); + string classroomno = ClassRoomNo.ToString(); + string lessonsection = LessonSection.ToString(); + var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassroomNo == classroomno); if (classInfoEntity != null) { - this.BaseRepository("CollegeMIS").ExecuteBySql("update StuScore set IsEditable='1',EditUserId=null,BeginModifyDate=null where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and ClassRoomNo='" + classInfoEntity.ClassroomNo + "' and LessonNo='" + LessonNo + "' and LessonSortNo='2' and LessonSection='" + LessonSection + "' "); + this.BaseRepository("CollegeMIS").ExecuteBySql("update StuScore set IsEditable='1',EditUserId=null,BeginModifyDate=null where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and ClassRoomNo='" + classInfoEntity.ClassroomNo + "' and LessonNo='" + LessonNo + "' and LessonSortNo='2' and LessonSection='" + lessonsection + "' "); } } @@ -1819,23 +1825,51 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad var AcademicYearNo = queryParam["AcademicYearNo"].ToString(); var Semester = queryParam["Semester"].ToString(); var LessonNo = queryParam["LessonNo"].ToString(); - var ClassNo = queryParam["ClassNo"].ToString(); + var ClassNo = queryParam["ClassNo"]; + var LessonSection = queryParam["LessonSection"]; + var ClassRoomNo = queryParam["ClassRoomNo"]; - var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassNo == ClassNo); - if (classInfoEntity != null) + if (!ClassNo.IsEmpty()) { - db.ExecuteBySql($"update StuScore set CheckMark='{checkMark}' where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and OpenLessonDeptNo='" + classInfoEntity.DeptNo + "' and OpenLessonMajorNo='" + classInfoEntity.MajorNo + "' and LessonNo='" + LessonNo + "' and LessonSortNo='1' and ClassNo='" + ClassNo + "' "); - //教师电子成绩单 - if (checkMark == 0)//撤销 + string classno = ClassNo.ToString(); + var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassNo == classno); + if (classInfoEntity != null) { - db.ExecuteBySql("update EmpReportCard set ElectronicStatus=0,ElectronicTime=null where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and LessonNo='" + LessonNo + "' and ClassNo='" + ClassNo + "' and LessonSortNo='1' "); + db.ExecuteBySql($"update StuScore set CheckMark='{checkMark}' where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and OpenLessonDeptNo='" + classInfoEntity.DeptNo + "' and OpenLessonMajorNo='" + classInfoEntity.MajorNo + "' and LessonNo='" + LessonNo + "' and LessonSortNo='1' and ClassNo='" + classno + "' "); + //教师电子成绩单 + if (checkMark == 0)//撤销 + { + db.ExecuteBySql("update EmpReportCard set ElectronicStatus=0,ElectronicTime=null where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and LessonNo='" + LessonNo + "' and ClassNo='" + classno + "' and LessonSortNo='1' "); + } + else + { + db.ExecuteBySql("update EmpReportCard set ElectronicStatus=1,ElectronicTime='" + DateTime.Now + "' where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and LessonNo='" + LessonNo + "' and ClassNo='" + classno + "' and LessonSortNo='1' "); + } } - else + db.Commit(); + } + else + { + string classroomno = ClassRoomNo.ToString(); + string lessonsection = LessonSection.ToString(); + var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassroomNo == classroomno); + if (classInfoEntity != null) { - db.ExecuteBySql("update EmpReportCard set ElectronicStatus=1,ElectronicTime='" + DateTime.Now + "' where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and LessonNo='" + LessonNo + "' and ClassNo='" + ClassNo + "' and LessonSortNo='1' "); + db.ExecuteBySql($"update StuScore set CheckMark='{checkMark}' where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and ClassRoomNo='" + classInfoEntity.ClassroomNo + "' and LessonNo='" + LessonNo + "' and LessonSortNo='2' and LessonSection='" + lessonsection + "' "); + //教师电子成绩单 + if (checkMark == 0)//撤销 + { + db.ExecuteBySql("update EmpReportCard set ElectronicStatus=0,ElectronicTime=null where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and LessonNo='" + LessonNo + "' and ClassRoomNo='" + classroomno + "' and LessonSortNo='2' and LessonSection='"+ lessonsection + "'"); + } + else + { + db.ExecuteBySql("update EmpReportCard set ElectronicStatus=1,ElectronicTime='" + DateTime.Now + "' where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and LessonNo='" + LessonNo + "' and classroomno='" + classroomno + "' and LessonSortNo='2' and LessonSection='"+ lessonsection + "'"); + } } + db.Commit(); } - db.Commit(); + + } catch (Exception ex) { From fc8fe9efa46fa5df6c0c410bc356bccd939512f1 Mon Sep 17 00:00:00 2001 From: liangkun Date: Thu, 16 Jun 2022 16:28:04 +0800 Subject: [PATCH 16/18] =?UTF-8?q?=E8=80=83=E8=AF=95=E6=88=90=E7=BB=A9?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E8=AF=BE=E7=A8=8B=E5=A2=9E=E5=8A=A0=E5=BD=93?= =?UTF-8?q?=E5=89=8D=E5=AD=A6=E5=B9=B4=E5=AD=A6=E6=9C=9F=E5=85=B3=E8=81=94?= =?UTF-8?q?=EF=BC=8C=E8=80=83=E8=AF=95=E6=88=90=E7=BB=A9=E5=8E=BB=E6=8E=89?= =?UTF-8?q?=E9=80=80=E5=AD=A6=E8=BD=AC=E6=A0=A1=E7=9A=84=E5=AD=A6=E7=94=9F?= =?UTF-8?q?=EF=BC=8C=E4=BF=9D=E7=95=99=E4=BC=91=E5=AD=A6=E5=AD=A6=E7=94=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/StuScoreController.cs | 6 ++++-- .../Views/StuScore/InputScoreIndexInTeacher.js | 2 ++ .../InputScoreIndexOfElectiveInTeacher.js | 9 ++++++--- .../StuScore/StuScoreBLL.cs | 8 ++++---- .../StuScore/StuScoreIBLL.cs | 4 ++-- .../StuScore/StuScoreService.cs | 17 +++++++++++++---- 6 files changed, 31 insertions(+), 15 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreController.cs index 67e843cd9..2e67b4fe8 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreController.cs @@ -534,7 +534,8 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public ActionResult GetLessonNoDataWithNo() { var loginInfo = LoginUserInfo.Get(); - var data = stuScoreIBLL.GetLessonNoDataOfAll(loginInfo.account, loginInfo.Description); + var semesterAndYear = Common.GetSemesterAndYear(); + var data = stuScoreIBLL.GetLessonNoDataOfAll(loginInfo.account, loginInfo.Description,semesterAndYear.AcademicYearShort,semesterAndYear.Semester); foreach (var item in data) { item.text = string.Format("{0}({1})", item.text, item.value); @@ -567,7 +568,8 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public ActionResult GetElectiveLessonNoDataWithNo() { var loginInfo = LoginUserInfo.Get(); - var data = stuScoreIBLL.GetElectiveLessonNoDataOfAll(loginInfo.account, loginInfo.Description); + var semesterAndYear = Common.GetSemesterAndYear(); + var data = stuScoreIBLL.GetElectiveLessonNoDataOfAll(loginInfo.account, loginInfo.Description, semesterAndYear.AcademicYearShort, semesterAndYear.Semester); foreach (var item in data) { item.text = string.Format("{0}({1})", item.text, item.value); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/InputScoreIndexInTeacher.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/InputScoreIndexInTeacher.js index b0e0da3de..6176dbfb2 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/InputScoreIndexInTeacher.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/InputScoreIndexInTeacher.js @@ -496,6 +496,8 @@ var bootstrap = function ($, learun) { if (ref.code == "200") { $('#AcademicYearNo').lrselectSet(ref.data.Item1); $('#Semester').lrselectSet(ref.data.Item3); + $('#AcademicYearNo').attr('disabled', "disabled"); + $('#Semester').attr('disabled', "disabled"); } }.bind(this), "json"); }, 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 5d92e39a4..d721b9c2d 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 @@ -513,6 +513,9 @@ var bootstrap = function ($, learun) { if (ref.code == "200") { $('#AcademicYearNo').lrselectSet(ref.data.Item1); $('#Semester').lrselectSet(ref.data.Item3); + $('#AcademicYearNo').attr('disabled', "disabled"); + $('#Semester').attr('disabled', "disabled"); + } }.bind(this), "json"); }, @@ -534,8 +537,8 @@ var bootstrap = function ($, learun) { searchScale: function (param) { param = param || {}; $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/OpenLessonPlanOfElective/GetStuSelectLessonListEntityByJson?queryJson=' + JSON.stringify(param), function (data) { - if (data["StuSelectLessonList"] != null) { - var ssll = data["StuSelectLessonList"]; + if (data["StuSelectLessonListOfElective"] != null) { + var ssll = data["StuSelectLessonListOfElective"]; $('#OrdinaryScoreScale').html(ssll.OrdinaryScoreScale > 0 ? ssll.OrdinaryScoreScale : 0); $('#TermInScoreScale').html(ssll.TermInScoreScale > 0 ? ssll.TermInScoreScale : 0); $('#TermEndScoreScale').html(ssll.TermEndScoreScale > 0 ? ssll.TermEndScoreScale : 0); @@ -590,7 +593,7 @@ var bootstrap = function ($, learun) { page.initGird(); page.search(query); - //page.searchScale(query); + page.searchScale(query); } }; judgeSelect = function () { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreBLL.cs index cf4e029e4..fe16b50c0 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreBLL.cs @@ -547,11 +547,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 课程下拉框信息【学生成绩录入可去审核】 /// /// - public IEnumerable GetLessonNoDataOfAll(string userAccount, string userType) + public IEnumerable GetLessonNoDataOfAll(string userAccount, string userType, string AcademicYearNo="", string Semester="") { try { - return stuScoreService.GetLessonNoDataOfAll(userAccount, userType); + return stuScoreService.GetLessonNoDataOfAll(userAccount, userType,AcademicYearNo, Semester); } catch (Exception ex) { @@ -570,11 +570,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 课程下拉框信息【选修课】 /// /// - public IEnumerable GetElectiveLessonNoDataOfAll(string userAccount, string userType) + public IEnumerable GetElectiveLessonNoDataOfAll(string userAccount, string userType, string AcademicYearNo = "", string Semester = "") { try { - return stuScoreService.GetElectiveLessonNoDataOfAll(userAccount, userType); + return stuScoreService.GetElectiveLessonNoDataOfAll(userAccount, userType,AcademicYearNo,Semester); } catch (Exception ex) { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreIBLL.cs index 453da19a7..840f76b7a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreIBLL.cs @@ -145,13 +145,13 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 课程下拉框信息【学生成绩录入可去审核】 /// /// - IEnumerable GetLessonNoDataOfAll(string userAccount, string userType); + IEnumerable GetLessonNoDataOfAll(string userAccount, string userType, string AcademicYearNo="", string Semester=""); /// /// 课程下拉框信息【选修课】 /// /// - IEnumerable GetElectiveLessonNoDataOfAll(string userAccount, string userType); + IEnumerable GetElectiveLessonNoDataOfAll(string userAccount, string userType, string AcademicYearNo = "", string Semester = ""); /// /// 教室下拉框信息【选修课】 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs index d3396434f..a04b3c9de 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScore/StuScoreService.cs @@ -130,8 +130,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration strSql.Append("SELECT t.* FROM StuScore t where 1=1 "); //学籍异动的学生不显示 - strSql.Append(" and t.StuNo not in (select StuNo from StuInfoBasic where ChangeStatus=1) "); - + //strSql.Append(" and t.StuNo not in (select StuNo from StuInfoBasic where ChangeStatus=1) "); + //20220616改 休学的要录入成绩,退学和转校的不用 + strSql.Append(" and t.StuNo not in (select StuNo from StuInfoBasicChange where StuChangeType in('04','06')) "); var queryParam = queryJson.ToJObject(); var dp = new DynamicParameters(new { }); if (!queryParam["F_SchoolId"].IsEmpty()) @@ -1112,7 +1113,7 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad /// 课程下拉框信息【学生成绩录入可去审核】 /// /// - public IEnumerable GetLessonNoDataOfAll(string userAccount, string userType) + public IEnumerable GetLessonNoDataOfAll(string userAccount, string userType,string AcademicYearNo="",string Semester="") { try { @@ -1126,6 +1127,10 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad { strSql.Append(" and s.EmpNo='" + userAccount + "' "); } + if (!string.IsNullOrEmpty(AcademicYearNo)) + { + strSql.Append(" and s.AcademicYearNo='" + AcademicYearNo + "' and s.Semester='"+Semester+"' "); + } var data = this.BaseRepository("CollegeMIS").FindList(strSql.ToString()); data = data.Where(x => !string.IsNullOrEmpty(x.value)).OrderBy(x => x.value); return data; @@ -1147,7 +1152,7 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad /// 课程下拉框信息【选修课】 /// /// - public IEnumerable GetElectiveLessonNoDataOfAll(string userAccount, string userType) + public IEnumerable GetElectiveLessonNoDataOfAll(string userAccount, string userType, string AcademicYearNo = "", string Semester = "") { try { @@ -1157,6 +1162,10 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad { strSql.Append(" and s.EmpNo='" + userAccount + "' "); } + if (!string.IsNullOrEmpty(AcademicYearNo)) + { + strSql.Append(" and s.AcademicYearNo='" + AcademicYearNo + "' and s.Semester='" + Semester + "' "); + } var data = this.BaseRepository("CollegeMIS").FindList(strSql.ToString()); data = data.Where(x => !string.IsNullOrEmpty(x.value)).OrderBy(x => x.value); return data; From 0fa11099e9ebb12cbca388645a1021d0310a7ccf Mon Sep 17 00:00:00 2001 From: ndbs Date: Fri, 17 Jun 2022 10:33:42 +0800 Subject: [PATCH 17/18] =?UTF-8?q?=E5=81=A5=E5=BA=B7=E6=89=93=E5=8D=A1?= =?UTF-8?q?=E6=97=B6=E9=97=B4=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/HealthPunchTimeController.cs | 126 ++++++++++++ .../Views/HealthPunchTime/Form.cshtml | 35 ++++ .../Views/HealthPunchTime/Form.js | 56 ++++++ .../Views/HealthPunchTime/Index.cshtml | 42 ++++ .../Views/HealthPunchTime/Index.js | 154 ++++++++++++++ .../Learun.Application.Web.csproj | 5 + .../HealthPunchTimeMap.cs | 29 +++ .../Learun.Application.Mapping.csproj | 1 + .../HealthPunchTime/HealthPunchTimeBLL.cs | 148 ++++++++++++++ .../HealthPunchTime/HealthPunchTimeEntity.cs | 80 ++++++++ .../HealthPunchTime/HealthPunchTimeIBLL.cs | 51 +++++ .../HealthPunchTime/HealthPunchTimeService.cs | 188 ++++++++++++++++++ .../Learun.Application.TwoDevelopment.csproj | 4 + 13 files changed, 919 insertions(+) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/HealthPunchTimeController.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchTime/Form.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchTime/Form.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchTime/Index.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchTime/Index.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/HealthPunchTimeMap.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchTime/HealthPunchTimeBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchTime/HealthPunchTimeEntity.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchTime/HealthPunchTimeIBLL.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchTime/HealthPunchTimeService.cs diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/HealthPunchTimeController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/HealthPunchTimeController.cs new file mode 100644 index 000000000..4b93c7489 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/HealthPunchTimeController.cs @@ -0,0 +1,126 @@ +using Learun.Util; +using System.Data; +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Web.Mvc; +using System.Collections.Generic; + +namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-06-17 09:17 + /// 描 述:健康打卡时段 + /// + public class HealthPunchTimeController : MvcControllerBase + { + private HealthPunchTimeIBLL healthPunchTimeIBLL = new HealthPunchTimeBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form() + { + return View(); + } + #endregion + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = healthPunchTimeIBLL.GetPageList(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + /// + /// 获取表单数据 + /// + /// 主键 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormData(string keyValue) + { + var HealthPunchTimeData = healthPunchTimeIBLL.GetHealthPunchTimeEntity(keyValue); + var jsonData = new + { + HealthPunchTime = HealthPunchTimeData, + }; + return Success(jsonData); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + healthPunchTimeIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity) + { + HealthPunchTimeEntity entity = strEntity.ToObject(); + healthPunchTimeIBLL.SaveEntity(keyValue, entity); + if (string.IsNullOrEmpty(keyValue)) + { + } + return Success("保存成功!"); + } + [HttpPost] + [AjaxOnly] + public ActionResult EnableForm(string keyValue) + { + healthPunchTimeIBLL.EnableEntity(keyValue); + return Success("修改成功!"); + } + + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchTime/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchTime/Form.cshtml new file mode 100644 index 000000000..e2d6315e3 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchTime/Form.cshtml @@ -0,0 +1,35 @@ +@{ + ViewBag.Title = "健康打卡时段"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
开始时间*
+ +
+
+
结束时间*
+ +
+
+
描述*
+
+
+
+
是否启用*
+
+
+ + +
+
备注
+ +
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/HealthPunchTime/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchTime/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchTime/Form.js new file mode 100644 index 000000000..8050ebec4 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchTime/Form.js @@ -0,0 +1,56 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2022-06-17 09:17 + * 描 述:健康打卡时段 + */ +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 () { + $('#Description').lrDataItemSelect({ code: 'HealthPunchType' }); + $('#CheckMark').lrDataItemSelect({ code: 'YesOrNoInt' }); + $('#CheckMark').lrselectSet("1"); + $('#CreateUser')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; + $('#CreateUser').val(learun.clientdata.get(['userinfo']).realName); + $('#CreateTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/HealthPunchTime/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 postData = { + strEntity: JSON.stringify($('body').lrGetFormData()) + }; + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/HealthPunchTime/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchTime/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchTime/Index.cshtml new file mode 100644 index 000000000..5c19a70aa --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchTime/Index.cshtml @@ -0,0 +1,42 @@ +@{ + ViewBag.Title = "健康打卡时段"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
描述
+
+
+ @*
+
是否启用
+
+
*@ +
+
+
+
+ +
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/HealthPunchTime/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchTime/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchTime/Index.js new file mode 100644 index 000000000..7aa3016e6 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/HealthPunchTime/Index.js @@ -0,0 +1,154 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2022-06-17 09:17 + * 描 述:健康打卡时段 + */ +var refreshGirdData; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 400); + $('#Description').lrDataItemSelect({ code: 'HealthPunchType' }); + $('#CheckMark').lrDataItemSelect({ code: 'YesOrNoInt' }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 新增 + $('#lr_add').on('click', function () { + learun.layerForm({ + id: 'form', + title: '新增', + url: top.$.rootUrl + '/EducationalAdministration/HealthPunchTime/Form', + 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/HealthPunchTime/Form?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)) { + var keyValue = $('#gridtable').jfGridValue('ID'); + var CheckMark = $('#gridtable').jfGridValue('CheckMark'); + if (CheckMark == 1) { + return + } + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/HealthPunchTime/DeleteForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + //  启用 + $('#lr_lock').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + console.log(keyValue) + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认启用!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/EducationalAdministration/HealthPunchTime/EnableForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + //  禁用 + $('#lr_unlock').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认启用!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/EducationalAdministration/HealthPunchTime/EnableForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/HealthPunchTime/GetPageList', + headData: [ + { label: "开始时间", name: "StarTime", width: 100, align: "left" }, + { label: "结束时间", name: "EndTime", width: 100, align: "left" }, + { + label: "描述", name: "Description", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'HealthPunchType', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { + label: "录入用户", name: "CreateUser", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('user', { + key: value, + callback: function (_data) { + callback(_data.name); + } + }); + } + }, + { label: "录入时间", name: "CreateTime", width: 200, align: "left" }, + { + label: "是否启用", name: "CheckMark", width: 100, align: "left", + formatter: function (cellvalue) { + return cellvalue == "0" ? "启用" : + "禁用"; + } + }, + { label: "备注", name: "Remark", width: 100, align: "left" }, + ], + mainId: 'ID', + isPage: true + }); + page.search(); + }, + search: function (param) { + param = param || {}; + $('#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 41845996d..7a88a1e0e 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 @@ -833,6 +833,7 @@ + @@ -6551,6 +6552,10 @@ + + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/HealthPunchTimeMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/HealthPunchTimeMap.cs new file mode 100644 index 000000000..3a49861b1 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/HealthPunchTimeMap.cs @@ -0,0 +1,29 @@ +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Data.Entity.ModelConfiguration; + +namespace Learun.Application.Mapping +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-06-17 09:17 + /// 描 述:健康打卡时段 + /// + public class HealthPunchTimeMap : EntityTypeConfiguration + { + public HealthPunchTimeMap() + { + #region 表、主键 + //表 + this.ToTable("HEALTHPUNCHTIME"); + //主键 + this.HasKey(t => t.ID); + #endregion + + #region 配置关系 + #endregion + } + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj index 719cf7c99..7cbcc4ae0 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj @@ -588,6 +588,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchTime/HealthPunchTimeBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchTime/HealthPunchTimeBLL.cs new file mode 100644 index 000000000..48b16879f --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchTime/HealthPunchTimeBLL.cs @@ -0,0 +1,148 @@ +using Learun.Util; +using System; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-06-17 09:17 + /// 描 述:健康打卡时段 + /// + public class HealthPunchTimeBLL : HealthPunchTimeIBLL + { + private HealthPunchTimeService healthPunchTimeService = new HealthPunchTimeService(); + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + return healthPunchTimeService.GetPageList(pagination, queryJson); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 获取HealthPunchTime表实体数据 + /// + /// 主键 + /// + public HealthPunchTimeEntity GetHealthPunchTimeEntity(string keyValue) + { + try + { + return healthPunchTimeService.GetHealthPunchTimeEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + healthPunchTimeService.DeleteEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + public void SaveEntity(string keyValue, HealthPunchTimeEntity entity) + { + try + { + healthPunchTimeService.SaveEntity(keyValue, entity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + public void EnableEntity(string keyValue) + { + try + { + healthPunchTimeService.EnableEntity(keyValue); + } + 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/HealthPunchTime/HealthPunchTimeEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchTime/HealthPunchTimeEntity.cs new file mode 100644 index 000000000..1cb778797 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchTime/HealthPunchTimeEntity.cs @@ -0,0 +1,80 @@ +using Learun.Util; +using System; +using System.ComponentModel.DataAnnotations.Schema; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-06-17 09:17 + /// 描 述:健康打卡时段 + /// + public class HealthPunchTimeEntity + { + #region 实体成员 + /// + /// ID + /// + [Column("ID")] + public string ID { get; set; } + /// + /// StarTime + /// + [Column("STARTIME")] + public string StarTime { get; set; } + /// + /// EndTime + /// + [Column("ENDTIME")] + public string EndTime { get; set; } + /// + /// 描述 + /// + [Column("DESCRIPTION")] + public string Description { get; set; } + /// + /// CreateTime + /// + [Column("CREATETIME")] + public DateTime? CreateTime { get; set; } + /// + /// CreateUser + /// + [Column("CREATEUSER")] + public string CreateUser { get; set; } + /// + /// Remark + /// + [Column("REMARK")] + public string Remark { get; set; } + /// + /// CheckMark + /// + [Column("CHECKMARK")] + public int? CheckMark { get; set; } + #endregion + + #region 扩展操作 + /// + /// 新增调用 + /// + public void Create() + { + this.ID = Guid.NewGuid().ToString(); + } + /// + /// 编辑调用 + /// + /// + public void Modify(string keyValue) + { + this.ID = keyValue; + } + #endregion + #region 扩展字段 + #endregion + } +} + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchTime/HealthPunchTimeIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchTime/HealthPunchTimeIBLL.cs new file mode 100644 index 000000000..c62c4186b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchTime/HealthPunchTimeIBLL.cs @@ -0,0 +1,51 @@ +using Learun.Util; +using System.Data; +using System.Collections.Generic; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-06-17 09:17 + /// 描 述:健康打卡时段 + /// + public interface HealthPunchTimeIBLL + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// + IEnumerable GetPageList(Pagination pagination, string queryJson); + /// + /// 获取HealthPunchTime表实体数据 + /// + /// 主键 + /// + HealthPunchTimeEntity GetHealthPunchTimeEntity(string keyValue); + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + void DeleteEntity(string keyValue); + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + void SaveEntity(string keyValue, HealthPunchTimeEntity entity); + + void EnableEntity(string keyValue); + + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchTime/HealthPunchTimeService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchTime/HealthPunchTimeService.cs new file mode 100644 index 000000000..fad36cb22 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/HealthPunchTime/HealthPunchTimeService.cs @@ -0,0 +1,188 @@ +using Dapper; +using Learun.DataBase.Repository; +using Learun.Util; +using System; +using System.Collections.Generic; +using System.Data; +using System.Text; + +namespace Learun.Application.TwoDevelopment.EducationalAdministration +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2022-06-17 09:17 + /// 描 述:健康打卡时段 + /// + public class HealthPunchTimeService : RepositoryFactory + { + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 查询参数 + /// 查询参数 + /// + public IEnumerable GetPageList(Pagination pagination, string queryJson) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("SELECT "); + strSql.Append(@" + t.ID, + t.StarTime, + t.EndTime, + t.Description, + t.CheckMark, + t.CreateUser, + t.CreateTime, + t.Remark + "); + strSql.Append(" FROM HealthPunchTime t "); + strSql.Append(" WHERE 1=1 "); + var queryParam = queryJson.ToJObject(); + // 虚拟参数 + var dp = new DynamicParameters(new { }); + if (!queryParam["Description"].IsEmpty()) + { + dp.Add("Description", queryParam["Description"].ToString(), DbType.String); + strSql.Append(" AND t.Description = @Description "); + } + if (!queryParam["CheckMark"].IsEmpty()) + { + dp.Add("CheckMark", queryParam["CheckMark"].ToString(), DbType.String); + strSql.Append(" AND t.CheckMark = @CheckMark "); + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 获取HealthPunchTime表实体数据 + /// + /// 主键 + /// + public HealthPunchTimeEntity GetHealthPunchTimeEntity(string keyValue) + { + try + { + return this.BaseRepository("CollegeMIS").FindEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + public void DeleteEntity(string keyValue) + { + try + { + this.BaseRepository("CollegeMIS").Delete(t => t.ID == keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + public void SaveEntity(string keyValue, HealthPunchTimeEntity entity) + { + try + { + if (!string.IsNullOrEmpty(keyValue)) + { + entity.Modify(keyValue); + this.BaseRepository("CollegeMIS").Update(entity); + } + else + { + entity.Create(); + this.BaseRepository("CollegeMIS").Insert(entity); + } + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + public void EnableEntity(string keyValue) + { + try + { + var entity = this.BaseRepository("CollegeMIS").FindEntity(keyValue); + if (entity.CheckMark == 0) + { + entity.CheckMark = 1; + } + else if (entity.CheckMark == 1) + { + entity.CheckMark = 0; + } + this.BaseRepository("CollegeMIS").Update(entity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj index d907d81ba..944b75ed2 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Learun.Application.TwoDevelopment.csproj @@ -1782,6 +1782,10 @@ + + + + From 96c162227e2f6c8c5235a726caedcc3f6b819d54 Mon Sep 17 00:00:00 2001 From: liangkun Date: Fri, 17 Jun 2022 10:48:09 +0800 Subject: [PATCH 18/18] =?UTF-8?q?=E6=94=BF=E6=B2=BB=E9=9D=A2=E8=B2=8C?= =?UTF-8?q?=E5=AD=97=E5=85=B8code=E6=9B=B4=E6=AD=A3=EF=BC=8C=E6=88=90?= =?UTF-8?q?=E7=BB=A9=E5=BD=95=E5=85=A5=E5=9B=9B=E8=88=8D=E4=BA=94=E5=85=A5?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E4=BC=98=E5=8C=96=E6=94=AF=E6=8C=81chrome?= =?UTF-8?q?=E6=B5=8F=E8=A7=88=E5=99=A8=EF=BC=8C=E5=8E=9F=E6=9C=89toFixed?= =?UTF-8?q?=E6=96=B9=E6=B3=95=E4=B8=8D=E5=85=BC=E5=AE=B9chrome?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../EducationalAdministration/Views/EmpInfo/Form.js | 2 +- .../EducationalAdministration/Views/EmpInfo/Index.js | 4 ++-- .../Views/StuScore/InputScoreIndex.js | 8 ++++---- .../Views/StuScore/InputScoreIndexInTeacher.js | 9 +++++---- .../Views/StuScore/InputScoreIndexOfElective.js | 8 ++++---- .../Views/StuScore/InputScoreIndexOfElectiveInTeacher.js | 8 ++++---- 6 files changed, 20 insertions(+), 19 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/EmpInfo/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/EmpInfo/Form.js index b688d360c..4c57d991b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/EmpInfo/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/EmpInfo/Form.js @@ -91,7 +91,7 @@ var bootstrap = function ($, learun) { $('#GenderNo').lrDataItemSelect({ code: 'usersexbit' }); $('#IsHasLesson').lrDataItemSelect({ code: 'YesOrNoBit' }); $('#NationalityNo').lrDataItemSelect({ code: 'National' }); - $('#PartyFaceNo').lrDataItemSelect({ code: 'BCdPartyFace' }); + $('#PartyFaceNo').lrDataItemSelect({ code: 'PolityStatus' }); $('#ProvinceNo').lrDataSourceSelect({ code: 'DIC_PROVINCE', value: 'pcode', text: 'pname', select: function (item) { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/EmpInfo/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/EmpInfo/Index.js index 5e58fa009..d0a13be6f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/EmpInfo/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/EmpInfo/Index.js @@ -48,7 +48,7 @@ var bootstrap = function ($, learun) { }); $('#RegionNo').lrselect(); //政治面貌 - $('#PartyFaceNo').lrDataItemSelect({ code: 'BCdPartyFace', allowSearch: true }); + $('#PartyFaceNo').lrDataItemSelect({ code: 'PolityStatus', allowSearch: true }); //最高学历 $('#HighestRecord').lrDataItemSelect({ code: 'HighestEducation'}); @@ -482,7 +482,7 @@ var bootstrap = function ($, learun) { formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('dataItem', { key: value, - code: 'BCdPartyFace', + code: 'PolityStatus', callback: function (_data) { callback(_data.text); } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/InputScoreIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/InputScoreIndex.js index 6ead81c74..3ccd1b4bc 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/InputScoreIndex.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/InputScoreIndex.js @@ -110,7 +110,7 @@ var bootstrap = function ($, learun) { type: 'input', inputType: 'number', change: function (row, rownum) { - row.Score = (parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)).toFixed(0); + row.Score = Math.round(parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)); $('#gridtable').jfGridSet('updateRow', rownum); }, } @@ -121,7 +121,7 @@ var bootstrap = function ($, learun) { type: 'input', inputType: 'number', change: function (row, rownum) { - row.Score = (parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)).toFixed(0); + row.Score = Math.round(parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)); $('#gridtable').jfGridSet('updateRow', rownum); }, } @@ -132,7 +132,7 @@ var bootstrap = function ($, learun) { type: 'input', inputType: 'number', change: function (row, rownum) { - row.Score = (parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)).toFixed(0); + row.Score = Math.round(parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)); $('#gridtable').jfGridSet('updateRow', rownum); }, } @@ -143,7 +143,7 @@ var bootstrap = function ($, learun) { type: 'input', inputType: 'number', change: function (row, rownum) { - row.Score = (parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)).toFixed(0); + row.Score = Math.round(parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)); $('#gridtable').jfGridSet('updateRow', rownum); }, } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/InputScoreIndexInTeacher.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/InputScoreIndexInTeacher.js index 6176dbfb2..c450a42ae 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/InputScoreIndexInTeacher.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/InputScoreIndexInTeacher.js @@ -4,6 +4,7 @@ * 日 期:2019-06-14 11:02 * 描 述:全院学生成绩录入(新) */ + var selectedRow; var refreshGirdData; var refreshGirdData2; @@ -110,7 +111,7 @@ var bootstrap = function ($, learun) { type: 'input', inputType: 'number', change: function (row, rownum) { - row.Score = (parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)).toFixed(0); + row.Score = Math.round(parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)); $('#gridtable').jfGridSet('updateRow', rownum); }, } @@ -121,7 +122,7 @@ var bootstrap = function ($, learun) { type: 'input', inputType: 'number', change: function (row, rownum) { - row.Score = (parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)).toFixed(0); + row.Score = Math.round(parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)); $('#gridtable').jfGridSet('updateRow', rownum); }, } @@ -132,7 +133,7 @@ var bootstrap = function ($, learun) { type: 'input', inputType: 'number', change: function (row, rownum) { - row.Score = (parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)).toFixed(0); + row.Score = Math.round(parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)); $('#gridtable').jfGridSet('updateRow', rownum); }, } @@ -143,7 +144,7 @@ var bootstrap = function ($, learun) { type: 'input', inputType: 'number', change: function (row, rownum) { - row.Score = (parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)).toFixed(0); + row.Score = Math.round(parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)); $('#gridtable').jfGridSet('updateRow', rownum); }, } 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 f82ae4030..e8edfed56 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 @@ -111,7 +111,7 @@ var bootstrap = function ($, learun) { type: 'input', inputType: 'number', change: function (row, rownum) { - row.Score = (parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)).toFixed(2); + row.Score = Math.round(parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)); $('#gridtable').jfGridSet('updateRow', rownum); }, } @@ -122,7 +122,7 @@ var bootstrap = function ($, learun) { type: 'input', inputType: 'number', change: function (row, rownum) { - row.Score = (parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)).toFixed(2); + row.Score = Math.round(parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)); $('#gridtable').jfGridSet('updateRow', rownum); }, } @@ -133,7 +133,7 @@ var bootstrap = function ($, learun) { type: 'input', inputType: 'number', change: function (row, rownum) { - row.Score = (parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)).toFixed(2); + row.Score = Math.round(parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)); $('#gridtable').jfGridSet('updateRow', rownum); }, } @@ -144,7 +144,7 @@ var bootstrap = function ($, learun) { type: 'input', inputType: 'number', change: function (row, rownum) { - row.Score = (parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)).toFixed(2); + row.Score = Math.round(parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)); $('#gridtable').jfGridSet('updateRow', rownum); }, } 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 d721b9c2d..f38c4a386 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 @@ -111,7 +111,7 @@ var bootstrap = function ($, learun) { type: 'input', inputType: 'number', change: function (row, rownum) { - row.Score = (parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)).toFixed(2); + row.Score = Math.round(parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)); $('#gridtable').jfGridSet('updateRow', rownum); }, } @@ -122,7 +122,7 @@ var bootstrap = function ($, learun) { type: 'input', inputType: 'number', change: function (row, rownum) { - row.Score = (parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)).toFixed(2); + row.Score = Math.round(parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)); $('#gridtable').jfGridSet('updateRow', rownum); }, } @@ -133,7 +133,7 @@ var bootstrap = function ($, learun) { type: 'input', inputType: 'number', change: function (row, rownum) { - row.Score = (parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)).toFixed(2); + row.Score = Math.round(parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)); $('#gridtable').jfGridSet('updateRow', rownum); }, } @@ -144,7 +144,7 @@ var bootstrap = function ($, learun) { type: 'input', inputType: 'number', change: function (row, rownum) { - row.Score = (parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)).toFixed(2); + row.Score = Math.round(parseFloat(row.OrdinaryScore || '0') * (Number($('#OrdinaryScoreScale').html()) / 100) + parseFloat(row.TermInScore || '0') * (Number($('#TermInScoreScale').html()) / 100) + parseFloat(row.TermEndScore || '0') * (Number($('#TermEndScoreScale').html()) / 100) + parseFloat(row.OtherScore || '0') * (Number($('#OtherScoreScale').html()) / 100)); $('#gridtable').jfGridSet('updateRow', rownum); }, }