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 622ce156b..356f0c186 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
@@ -79,6 +79,24 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
{
return View();
}
+ ///
+ /// 选 成绩比例设置
+ ///
+ ///
+ [HttpGet]
+ public ActionResult IndexElective()
+ {
+ return View();
+ }
+ ///
+ /// 选 成绩比例设置
+ ///
+ ///
+ [HttpGet]
+ public ActionResult FormOfElective()
+ {
+ return View();
+ }
#endregion
#region 获取数据
@@ -153,6 +171,59 @@ 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 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 提交数据
@@ -242,6 +313,23 @@ 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/OpenLessonPlanOfElective/FormOfElective.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/FormOfElective.cshtml
new file mode 100644
index 000000000..465f44a38
--- /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/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
new file mode 100644
index 000000000..5d4c4918b
--- /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/OpenLessonPlanOfElective/SaveFormOfElective?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..4de36f0f9
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/IndexElective.cshtml
@@ -0,0 +1,50 @@
+@{
+ 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..555862bf3
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/OpenLessonPlanOfElective/IndexElective.js
@@ -0,0 +1,152 @@
+/* * 版 本 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'
+ });
+ $('#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 () {
+ $('#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: "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" },
+ { 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/Areas/EducationalAdministration/Views/StuScore/InputScoreIndexOfElective.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/InputScoreIndexOfElective.cshtml
index e3518690a..838f6b268 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/InputScoreIndexOfElective.cshtml
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScore/InputScoreIndexOfElective.cshtml
@@ -86,17 +86,17 @@
- @*
- @*
+
比例设置:
平时成绩占比 0 %,
期中成绩占比 0 %,
@@ -108,7 +108,7 @@
分钟(
秒)
续时
-
*@
+
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..5692ed1a8 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,10 +198,10 @@ 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) {
+ $.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["StuSelectLessonList"] != null) {
$.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuScore/GetEntityByJson?queryJson=' + JSON.stringify(query), function (data) {
if (data != null) {
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 1efd44821..dfc7d6537 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
@@ -1032,6 +1032,8 @@
+
+
@@ -7703,6 +7705,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 1341890bd..f1478a74d 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
@@ -88,7 +88,75 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
}
-
+ ///
+ /// 获取OpenLessonPlanOfElective表实体数据
+ /// 主键
+ ///
+ ///
+ 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);
+ }
+ }
+ }
+ ///
+ /// 获取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 提交数据
@@ -141,6 +209,48 @@ 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);
+ }
+ }
+ }
+
+ 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
#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 c7b3e472e..053bdab44 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,31 @@ 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; }
+ ///
+ /// IsAllowEdit
+ ///
+ [Column("IsAllowEdit")]
+ public bool? IsAllowEdit { get; set; }
#endregion
#region 扩展操作
@@ -223,6 +248,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
[NotMapped] public string LessonNo2 { get; set; }
[NotMapped] public string EmpNo2 { get; set; }
[NotMapped] public string LessonTypeId { get; set; }
+ [NotMapped] public string F_School { 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 4909a120f..90c9b46d5 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
@@ -34,6 +34,26 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
///
///
OpenLessonPlanOfElectiveEntity GetOpenLessonPlanOfElectiveEntity(string keyValue);
+
+ ///
+ /// 获取页面显示列表数据
+ ///
+ /// 查询参数
+ ///
+ IEnumerable GetPageListElective(Pagination pagination, string queryJson);
+
+ ///
+ /// 获取OpenLessonPlanOfElectiveEntity表实体数据
+ /// 主键
+ ///
+ ///
+ OpenLessonPlanOfElectiveEntity GetOpenLessonPlanEntityByJson(string queryJson);
+ ///
+ /// 获取StuSelectLessonListEntity表实体数据
+ /// 主键
+ ///
+ ///
+ StuSelectLessonListOfElectiveEntity GetStuSelectLessonListEntityByJson(string queryJson);
#endregion
#region 提交数据
@@ -50,6 +70,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
///
///
void SaveEntity(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 bc9b0ce60..1df790a11 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
@@ -200,7 +200,178 @@ 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 ");
+ }
+ 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)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+ ///
+ /// 获取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 提交数据
@@ -262,6 +433,130 @@ 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);
+ }
+ }
+ }
+
+ ///
+ /// 保存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);
+ }
+ }
+ }
#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 a1c5524e5..a8c13a54a 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/StuSelectLessonListOfElectiveBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElective/StuSelectLessonListOfElectiveBLL.cs
index 67db95afa..26be30f28 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElective/StuSelectLessonListOfElectiveBLL.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElective/StuSelectLessonListOfElectiveBLL.cs
@@ -117,6 +117,30 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
}
+ ///
+ /// 保存实体数据(新增、修改)
+ /// 主键
+ ///
+ ///
+ public void SaveStuSelectLessonListScaleByJson(string queryJson, StuSelectLessonListOfElectiveEntity entity)
+ {
+ try
+ {
+ stuSelectLessonListOfElectiveService.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/StuSelectLessonListOfElective/StuSelectLessonListOfElectiveEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElective/StuSelectLessonListOfElectiveEntity.cs
index d27073da4..3d0d46d52 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
@@ -190,6 +190,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
///
[Column("OTHERSCORESCALE")]
public decimal? OtherScoreScale { get; set; }
+ ///
+ /// F_SchoolId
+ ///
+ [Column("F_SCHOOLID")]
+ public string F_SchoolId { get; set; }
#endregion
#region 扩展操作
@@ -211,7 +216,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
#endregion
#region 扩展字段
- [NotMapped] public string F_SchoolId { get; set; }
[NotMapped] public string LessonTypeId { get; set; }
#endregion
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElective/StuSelectLessonListOfElectiveIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElective/StuSelectLessonListOfElectiveIBLL.cs
index 353f44469..b5bd5b7d6 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElective/StuSelectLessonListOfElectiveIBLL.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElective/StuSelectLessonListOfElectiveIBLL.cs
@@ -43,6 +43,13 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
///
///
void SaveEntity(string keyValue, StuSelectLessonListOfElectiveEntity entity);
+
+ ///
+ /// 保存StuSelectLessonList中的成绩比例
+ /// 主键
+ ///
+ ///
+ void SaveStuSelectLessonListScaleByJson(string queryJson, StuSelectLessonListOfElectiveEntity entity);
#endregion
#region 扩展数据
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElective/StuSelectLessonListOfElectiveService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElective/StuSelectLessonListOfElectiveService.cs
index 9bff6fd34..c0f638173 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElective/StuSelectLessonListOfElectiveService.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElective/StuSelectLessonListOfElectiveService.cs
@@ -4,6 +4,7 @@ using Learun.Util;
using System;
using System.Collections.Generic;
using System.Data;
+using System.Linq;
using System.Text;
namespace Learun.Application.TwoDevelopment.EducationalAdministration
@@ -280,7 +281,60 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
}
+ ///
+ /// 保存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' ");
+ 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);
+ 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);
+ }
+ }
+ }
#endregion
#region 扩展数据