From 9b083753d7148238291a9a68ff410f5334e832c8 Mon Sep 17 00:00:00 2001 From: ndbs Date: Wed, 15 Jun 2022 16:44:48 +0800 Subject: [PATCH 1/3] =?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 2/3] =?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 3/3] =?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); + } + } + } } }