From 7cca774ee20452a4821cbc22e8ab9ad3244cdb7c Mon Sep 17 00:00:00 2001 From: dyy <807692433@qq.com> Date: Thu, 8 Jun 2023 09:47:39 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=A2=9E=E5=8A=A0=E3=80=91=E7=BA=BF?= =?UTF-8?q?=E4=B8=8A=E9=80=89=E8=AF=BE=E6=83=85=E5=86=B5=EF=BC=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...ectLessonListOfElectiveOnlineController.cs | 40 +++- .../LessonInfoOfElectiveOnline/SetIndex.js | 8 +- .../InitScoreForm.cshtml | 15 ++ .../InitScoreForm.js | 53 ++++++ .../QueryStuSelectResult.cshtml | 46 +++-- .../QueryStuSelectResult.js | 171 ++++++++---------- .../Learun.Application.Web.csproj | 2 + .../StuSelectLessonListOfElectiveOnlineBLL.cs | 61 +++++-- ...StuSelectLessonListOfElectiveOnlineIBLL.cs | 16 +- ...SelectLessonListOfElectiveOnlineService.cs | 90 ++++++--- 10 files changed, 348 insertions(+), 154 deletions(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/InitScoreForm.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/InitScoreForm.js diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuSelectLessonListOfElectiveOnlineController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuSelectLessonListOfElectiveOnlineController.cs index 734f92fba..e152b39c5 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuSelectLessonListOfElectiveOnlineController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuSelectLessonListOfElectiveOnlineController.cs @@ -3,6 +3,7 @@ using System.Data; using Learun.Application.TwoDevelopment.EducationalAdministration; using System.Web.Mvc; using System.Collections.Generic; +using System.Linq; namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { @@ -68,6 +69,15 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { return View(); } + /// + /// 初始化线上课程成绩 + /// + /// + [HttpGet] + public ActionResult InitScoreForm() + { + return View(); + } #endregion #region 获取数据 @@ -123,6 +133,19 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers }; return Success(jsonData); } + /// + /// 获取选课情况里的课程信息 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetSelectLessonInfo(string academicYearNo, string semester) + { + var Data = stuSelectLessonListOfElectiveOnlineIBLL.GetSelectLessonInfo(academicYearNo, semester).OrderBy(x => x.LessonNo); + + return Success(Data); + } + #endregion #region 提交数据 @@ -238,7 +261,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers return Fail("当前选课的课程人数已满!"); } //选课的课程报名人数加1 - olpeEntity.StuNum = olpeEntity.StuNum.HasValue ? olpeEntity.StuNum.Value + 1 : 1 ; + olpeEntity.StuNum = olpeEntity.StuNum.HasValue ? olpeEntity.StuNum.Value + 1 : 1; lessonInfoOfElectiveOnlineIBLL.SaveEntity(olpeEntity.Id, olpeEntity); //报名成功 sslleEntity.Status = 2; @@ -253,6 +276,21 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers stuSelectLessonListOfElectiveOnlineIBLL.SaveEntity(keyValue, sslleEntity); return Success("保存成功!"); } + + /// + /// 初始化线上课程成绩 + /// 主键 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult DoInitScore(StuSelectLessonListOfElectiveOnlineEntity entity) + { + stuSelectLessonListOfElectiveOnlineIBLL.DoInitScore(entity); + return Success("初始化成功!"); + } + + #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LessonInfoOfElectiveOnline/SetIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LessonInfoOfElectiveOnline/SetIndex.js index 0e3b4eada..552839fa1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LessonInfoOfElectiveOnline/SetIndex.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/LessonInfoOfElectiveOnline/SetIndex.js @@ -175,8 +175,7 @@ var bootstrap = function ($, learun) { $('#Semester').lrselectSet(Semester); var param = { "AcademicYearNo": data.AcademicYearShort, "Semester": data.Semester }; - //todo:等待最后解除注释 - //page.search(param); + page.search(param); } }, error: function (XMLHttpRequest, textStatus, errorThrown) { @@ -264,7 +263,7 @@ var bootstrap = function ($, learun) { isMultiselect: true, sidx: 'AcademicYearNo DESC, Semester DESC, LessonNo ASC,EmpNo ASC' }); - page.search(); + //page.search(); }, search: function (param) { param = param || {}; @@ -273,7 +272,8 @@ var bootstrap = function ($, learun) { } }; refreshGirdData = function () { - page.search(); + var param = { "AcademicYearNo": $('#AcademicYearNo').lrselectGet(), "Semester": $('#Semester').lrselectGet() }; + page.search(param); }; page.init(); } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/InitScoreForm.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/InitScoreForm.cshtml new file mode 100644 index 000000000..89f25b5ff --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/InitScoreForm.cshtml @@ -0,0 +1,15 @@ +@{ + ViewBag.Title = "初始化线上课程成绩"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
学年*
+
+
+
+
学期*
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/InitScoreForm.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/InitScoreForm.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/InitScoreForm.js new file mode 100644 index 000000000..22b10b398 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/InitScoreForm.js @@ -0,0 +1,53 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-02-27 11:05 + * 描 述:按条件同步排课数据 + */ +var acceptClick; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.bind(); + page.initData(); + }, + bind: function () { + //学年 + $('#AcademicYearNo').lrselect({ + placeholder: "请选择学年", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo', + value: 'value', + text: 'text' + }); + //学期 + $('#Semester').lrselect({ + placeholder: "请选择学期", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester', + value: 'value', + text: 'text' + }); + + }, + initData: function () { + + } + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('#form').lrValidform()) { + return false; + } + var postData = $('#form').lrGetFormData(); + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/StuSelectLessonListOfElectiveOnline/DoInitScore', postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/QueryStuSelectResult.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/QueryStuSelectResult.cshtml index 0114ad8b1..f18e7b342 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/QueryStuSelectResult.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/QueryStuSelectResult.cshtml @@ -2,7 +2,7 @@ ViewBag.Title = "选修课课程"; Layout = "~/Views/Shared/_Index.cshtml"; } -
+
@@ -16,36 +16,40 @@
学期
-
+
-
+
+
学号
+ +
+
+
姓名
+ +
+
+
课程名称
+
+
+
+
建课教师
+ +
+
校区
-
系部
+
院系
专业
-
+
班级
-
-
教师
-
-
-
-
选修课程
-
-
-
-
选课状态
-
-
报名状态
@@ -53,15 +57,21 @@
+
+
提示:请输入学年和学期进行查询
+
-@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuSelectLessonListOfElective/QueryStuSelectResult.js") +@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/QueryStuSelectResult.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/QueryStuSelectResult.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/QueryStuSelectResult.js index 51b1447b5..ed12e538c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/QueryStuSelectResult.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuSelectLessonListOfElectiveOnline/QueryStuSelectResult.js @@ -24,7 +24,7 @@ var bootstrap = function ($, learun) { return; } page.search(queryJson); - }, 330, 400); + }, 330, 500); $('#AcademicYearNo').lrselect({ placeholder: "请选择学年", allowSearch: true, @@ -40,34 +40,95 @@ var bootstrap = function ($, learun) { value: 'value', text: 'text' }); - $('#ElectiveSelectStatus').lrDataItemSelect({ code: 'ElectiveSelectStatus' }); - $('#ElectiveSignUpStatus').lrDataItemSelect({ code: 'ElectiveSignUpStatus' }); - $('#F_SchoolId').lrDataSourceSelect({ code: 'company', value: 'f_companyid', text: 'f_fullname' }); - $('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' }); - $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorno', text: 'majorname' }); - $('#ClassNo').lrDataSourceSelect({ code: 'bjsj', value: 'classno', text: 'classname' }); - $('#EmpNo').lrDataSourceSelect({ code: 'EmpInfo', value: 'empno', text: 'empname' }); + //数据集不选择线上课程信息,选择选课情况里的课程信息 $('#LessonNo').lrselect({ allowSearch: true, - url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=LessonInfo', - param: { strWhere: "1=1 AND LessonSortNo='2' " }, - value: "lessonno", - text: "lessonname" + url: top.$.rootUrl + '/EducationalAdministration/StuSelectLessonListOfElectiveOnline/GetSelectLessonInfo', + value: "LessonNo", + text: "LessonName" + }); + $('#F_SchoolId').lrDataSourceSelect({ code: 'company', value: 'f_companyid', text: 'f_fullname' }); + $('#DeptNo').lrDataSourceSelect({ + code: 'CdDeptInfo', value: 'deptno', text: 'deptname', select: function (item) { + if (!!item) { + $('#MajorNo').lrselectRefresh({ + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', + param: { strWhere: "deptno='" + item.deptno + "' order by majorno " }, + }); + } else { + $('#MajorNo').lrselectRefresh({ + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', + param: { strWhere: "1=1 order by majorno " }, + }); + } + } + }); + $('#MajorNo').lrselect({ + allowSearch: true, + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=CdMajorInfo', + param: { strWhere: "1=1 order by majorno " }, + value: "majorno", + text: "majorname", + select: function (item) { + if (!!item) { + $('#ClassNo').lrselectRefresh({ + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', + param: { strWhere: "majorno='" + item.majorno + "' order by classno " }, + }); + } else { + $('#ClassNo').lrselectRefresh({ + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', + param: { strWhere: "1=1 order by classno " }, + }); + } + } + }); + $('#ClassNo').lrselect({ + allowSearch: true, + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=bjsj', + param: { strWhere: "1=1 order by classno " }, + value: "classno", + text: "classname" }); + $('#ElectiveSignUpStatus').lrDataItemSelect({ code: 'ElectiveSignUpStatus' }); + // 刷新 $('#lr_refresh').on('click', function () { location.reload(); }); + //初始化线上课程成绩 + $('#lr_initScore').on('click', function () { + learun.layerForm({ + id: 'InitScoreForm', + title: '初始化线上课程成绩', + url: top.$.rootUrl + '/EducationalAdministration/StuSelectLessonListOfElectiveOnline/InitScoreForm', + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(); + } + }); + }); }, // 初始化列表 initGird: function () { $('#gridtable').jfGrid({ - url: top.$.rootUrl + '/EducationalAdministration/StuSelectLessonListOfElective/GetQueryStuSelectResultList', + url: top.$.rootUrl + '/EducationalAdministration/StuSelectLessonListOfElectiveOnline/GetQueryStuSelectResultList', headData: [ - { label: "学年", name: "AcademicYearNo", width: 80, align: "left" }, - { label: "学期", name: "Semester", width: 60, align: "left" }, + { label: "学年", name: "AcademicYearNo", width: 50, align: "left" }, + { label: "学期", name: "Semester", width: 50, align: "left" }, + { label: "学号", name: "StuNo", width: 120, align: "left" }, + { label: "姓名", name: "StuName", width: 180, align: "left" }, + { label: "课程编号", name: "LessonNo", width: 100, align: "left" }, + { + label: "课程名称", name: "LessonName", width: 150, align: "left" + }, + //{ label: "教师编号", name: "EmpNo", width: 100, align: "left" }, { - label: "校区", name: "F_SchoolId", width: 200, align: "left", + label: "建课教师", name: "EmpName", width: 100, align: "left" + }, + { + label: "建课学校", name: "F_SchoolId", width: 200, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company', @@ -80,7 +141,7 @@ var bootstrap = function ($, learun) { } }, { - label: "系所", name: "DeptNo", width: 100, align: "left", + label: "院系", name: "DeptNo", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', @@ -118,24 +179,6 @@ var bootstrap = function ($, learun) { }); } }, - { label: "学号", name: "StuNo", width: 100, align: "left" }, - { label: "姓名", name: "StuName", width: 100, align: "left" }, - { - label: "性别", name: "GenderNo", width: 80, align: "left", - formatter: function (cellvalue) { - return cellvalue == true ? "男" : "女"; - } - }, - { - label: "选课状态", name: "Id", width: 100, align: "left", - formatter: function (cellvalue, row) { - if (cellvalue == null || cellvalue == undefined || cellvalue == "") { - return '未报名'; - } else { - return '已报名'; - } - } - }, { label: "报名状态", name: "Status", width: 100, align: "left", formatter: function (cellvalue, row) { @@ -150,62 +193,7 @@ var bootstrap = function ($, learun) { } } }, - { label: "所选课程号", name: "LessonNo", width: 100, align: "left" }, - { - label: "所选课程名称", name: "LessonName", width: 150, align: "left", - formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo', - key: row.LessonNo, - keyId: 'lessonno', - callback: function (_data) { - callback(_data['lessonname']); - } - }); - } - }, - { label: "课程学分", name: "StudyScore", width: 100, align: "left" }, - { label: "教师编号", name: "EmpNo", width: 100, align: "left" }, - { - label: "教师姓名", name: "EmpName", width: 100, align: "left", - formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo', - key: row.EmpNo, - keyId: 'empno', - callback: function (_data) { - callback(_data['empname']); - } - }); - } - }, - { - label: "上课节次", name: "LessonSection", width: 150, align: "left", - formatter: function (cellvalue, row) { - if (cellvalue != "" && cellvalue != undefined && cellvalue != null) { - if (cellvalue.indexOf(',') == -1) { - return "星期" + weekChina[cellvalue.slice(0, 1) - 1] + "第" + cellvalue.slice(1) + "节"; - } else { - return "星期" + weekChina[cellvalue.slice(0, 1) - 1] + "第" + cellvalue.slice(1, 2) + "、" + cellvalue.slice(4) + "节"; - } - } - } - }, - { label: "上课时间", name: "LessonTime", width: 180, align: "left" }, - { - label: "教室名称", name: "ClassRoomName", width: 100, align: "left", - formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'ClassRoomInfo', - key: row.ClassRoomNo, - keyId: 'classroomno', - callback: function (_data) { - callback(_data['classroomname']); - } - }); - } - }, - { label: "备注", name: "Remark", width: 100, align: "left" }, + ], mainId: 'StuId', isPage: true, @@ -215,7 +203,6 @@ var bootstrap = function ($, learun) { }, search: function (param) { param = param || {}; - //param.SqlParameter = " and a.ChangeStatus<>1 "; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; 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 ec299f091..f28aebf75 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 @@ -1036,6 +1036,7 @@ + @@ -8212,6 +8213,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElectiveOnline/StuSelectLessonListOfElectiveOnlineBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElectiveOnline/StuSelectLessonListOfElectiveOnlineBLL.cs index bfcb33704..24c65153e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElectiveOnline/StuSelectLessonListOfElectiveOnlineBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElectiveOnline/StuSelectLessonListOfElectiveOnlineBLL.cs @@ -14,7 +14,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration ///
public class StuSelectLessonListOfElectiveOnlineBLL : StuSelectLessonListOfElectiveOnlineIBLL { - private StuSelectLessonListOfElectiveOnlineService stuSelectLessonListOfElectiveService = new StuSelectLessonListOfElectiveOnlineService(); + private StuSelectLessonListOfElectiveOnlineService stuSelectLessonListOfElectiveOnlineService = new StuSelectLessonListOfElectiveOnlineService(); #region 获取数据 @@ -27,7 +27,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - return stuSelectLessonListOfElectiveService.GetPageList(pagination, queryJson); + return stuSelectLessonListOfElectiveOnlineService.GetPageList(pagination, queryJson); } catch (Exception ex) { @@ -51,7 +51,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - return stuSelectLessonListOfElectiveService.GetStuSelectLessonListOfElectiveOnlineEntity(keyValue); + return stuSelectLessonListOfElectiveOnlineService.GetStuSelectLessonListOfElectiveOnlineEntity(keyValue); } catch (Exception ex) { @@ -79,7 +79,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - stuSelectLessonListOfElectiveService.DeleteEntity(keyValue); + stuSelectLessonListOfElectiveOnlineService.DeleteEntity(keyValue); } catch (Exception ex) { @@ -103,7 +103,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - stuSelectLessonListOfElectiveService.SaveEntity(keyValue, entity); + stuSelectLessonListOfElectiveOnlineService.SaveEntity(keyValue, entity); } catch (Exception ex) { @@ -130,7 +130,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - return stuSelectLessonListOfElectiveService.GetStuSelectLessonListOfElectiveOnlineEntityByStuNo(stuno, olpeid); + return stuSelectLessonListOfElectiveOnlineService.GetStuSelectLessonListOfElectiveOnlineEntityByStuNo(stuno, olpeid); } catch (Exception ex) { @@ -150,7 +150,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - return stuSelectLessonListOfElectiveService.GetStuSelectLessonListOfElectiveOnlineEntityByLessonInfo(lessonNo, lessonTime, stuNo); + return stuSelectLessonListOfElectiveOnlineService.GetStuSelectLessonListOfElectiveOnlineEntityByLessonInfo(lessonNo, lessonTime, stuNo); } catch (Exception ex) { @@ -173,7 +173,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - return stuSelectLessonListOfElectiveService.GetStuSelectLessonListOfElectiveOnlineListByStuNo(stuno); + return stuSelectLessonListOfElectiveOnlineService.GetStuSelectLessonListOfElectiveOnlineListByStuNo(stuno); } catch (Exception ex) { @@ -192,7 +192,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - return stuSelectLessonListOfElectiveService.GetQueryStuSelectResultList(pagination, queryJson); + return stuSelectLessonListOfElectiveOnlineService.GetQueryStuSelectResultList(pagination, queryJson); } catch (Exception ex) { @@ -210,7 +210,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - stuSelectLessonListOfElectiveService.Pass(stulist, olpentity); + stuSelectLessonListOfElectiveOnlineService.Pass(stulist, olpentity); } catch (Exception ex) { @@ -228,7 +228,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - stuSelectLessonListOfElectiveService.UnPass(stulist, olpentity); + stuSelectLessonListOfElectiveOnlineService.UnPass(stulist, olpentity); } catch (Exception ex) { @@ -246,7 +246,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - stuSelectLessonListOfElectiveService.UnPassOfFinish(stulist, olpentity); + stuSelectLessonListOfElectiveOnlineService.UnPassOfFinish(stulist, olpentity); } catch (Exception ex) { @@ -260,12 +260,17 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } - - public IEnumerable GetAllElectiveLesson(string academicYearNo, string semester) + /// + /// 获取选课情况里的课程信息 + /// + /// + /// + /// + public IEnumerable GetSelectLessonInfo(string academicYearNo, string semester) { try { - return stuSelectLessonListOfElectiveService.GetAllElectiveLesson(academicYearNo, semester); + return stuSelectLessonListOfElectiveOnlineService.GetSelectLessonInfo(academicYearNo, semester); } catch (Exception ex) { @@ -289,7 +294,31 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - return stuSelectLessonListOfElectiveService.GetStuSelectLessonListOfElectiveOnlineListByOLPEId(olpeid); + return stuSelectLessonListOfElectiveOnlineService.GetStuSelectLessonListOfElectiveOnlineListByOLPEId(olpeid); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 初始化线上课程成绩 + /// 主键 + /// + /// + public void DoInitScore(StuSelectLessonListOfElectiveOnlineEntity entity) + { + try + { + stuSelectLessonListOfElectiveOnlineService.DoInitScore(entity); } catch (Exception ex) { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElectiveOnline/StuSelectLessonListOfElectiveOnlineIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElectiveOnline/StuSelectLessonListOfElectiveOnlineIBLL.cs index 7be9d24be..b5b94a037 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElectiveOnline/StuSelectLessonListOfElectiveOnlineIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElectiveOnline/StuSelectLessonListOfElectiveOnlineIBLL.cs @@ -71,6 +71,20 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration void Pass(string[] stulist, LessonInfoOfElectiveOnlineEntity olpentity); void UnPass(string[] stulist, LessonInfoOfElectiveOnlineEntity olpentity); void UnPassOfFinish(string[] stulist, LessonInfoOfElectiveOnlineEntity olpentity); - IEnumerable GetAllElectiveLesson(string academicYearNo, string semester); + /// + /// 获取选课情况里的课程信息 + /// + /// + /// + /// + IEnumerable GetSelectLessonInfo(string academicYearNo, string semester); + + /// + /// 初始化线上课程成绩 + /// 主键 + /// + /// + void DoInitScore(StuSelectLessonListOfElectiveOnlineEntity entity); + } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElectiveOnline/StuSelectLessonListOfElectiveOnlineService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElectiveOnline/StuSelectLessonListOfElectiveOnlineService.cs index 956fc4198..082500018 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElectiveOnline/StuSelectLessonListOfElectiveOnlineService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuSelectLessonListOfElectiveOnline/StuSelectLessonListOfElectiveOnlineService.cs @@ -92,7 +92,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration dp.Add("LIOEOId", queryParam["LIOEOId"].ToString(), DbType.String); strSql.Append(" AND t.LIOEOId = @LIOEOId "); } - var list= this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); + var list = this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); foreach (var item in list) { //模式二:正式选课 @@ -272,7 +272,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration //修改LessonInfoOfElectiveOnline通过人数 if (count > 0) { - olpentity.StuNum = olpentity.StuNum.HasValue ? olpentity.StuNum.Value - count : 0 ; + olpentity.StuNum = olpentity.StuNum.HasValue ? olpentity.StuNum.Value - count : 0; db.Update(olpentity); } db.Commit(); @@ -405,34 +405,33 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration #endregion - + /// + /// 线上选课情况 + /// + /// + /// + /// public IEnumerable GetQueryStuSelectResultList(Pagination pagination, string queryJson) { try { var queryParam = queryJson.ToJObject(); var strSql = new StringBuilder(); - strSql.Append("select a.StuNo,a.StuName,a.GenderNo,a.DeptNo,a.MajorNo,a.F_SchoolId,a.ClassNo,b.remark,b.Status,b.Id,"); + + strSql.Append("select a.StuNo,a.StuName,a.DeptNo,a.MajorNo,a.F_SchoolId,a.ClassNo,b.Status,b.Id,"); strSql.Append("'" + queryParam["AcademicYearNo"].ToString() + "' as AcademicYearNo,'" + queryParam["Semester"].ToString() + "' as Semester,"); - //strSql.Append("b.AcademicYearNo,b.Semester,"); - strSql.Append("c.LessonSection,c.LessonTime,c.StudyScore,c.LessonNo,c.LessonName,c.EmpNo,c.EmpName,c.ClassRoomNo,c.ClassRoomName"); - //strSql.Append(@"c.LessonSection,c.LessonTime,c.StudyScore,c.LessonNo,c.LessonName,c.EmpNo,c.EmpName,c.ClassRoomNo,c.ClassRoomName from stuinfobasic a - //left join StuSelectLessonListOfElectiveOnline - // b on a.stuno = b.stuno left join LessonInfoOfElectiveOnline c - //on b.OLPEId = c.Id AND c.AcademicYearNo = '" + queryParam["AcademicYearNo"].ToString() + "' AND c.Semester = '" + queryParam["Semester"].ToString() + "' "); + strSql.Append("b.LessonNo,b.LessonName,b.EmpNo,b.EmpName"); strSql.Append(" from stuinfobasic a"); strSql.Append(" left join StuSelectLessonListOfElectiveOnline b on a.stuno = b.stuno and b.AcademicYearNo = '" + queryParam["AcademicYearNo"].ToString() + "' AND b.Semester = '" + queryParam["Semester"].ToString() + "' "); - strSql.Append(" left join LessonInfoOfElectiveOnline c on b.OLPEId = c.Id and c.AcademicYearNo = '" + queryParam["AcademicYearNo"].ToString() + "' AND c.Semester = '" + queryParam["Semester"].ToString() + "' "); strSql.Append(" where 1=1 "); - //未选课的学分为空导出报错liang 为了导出数据零时增加了条件 此处暂放待处理 and c.LessonNo is not null //去掉转校、休学 退学的学生 - strSql.Append(" and a.StuNo not in (SELECT distinct StuNo FROM StuInfoBasicChange where stuchangetype in ('06','04','05') and checkstatus=1) "); + strSql.Append(" and a.StuNo not in (SELECT distinct StuNo FROM StuInfoBasic where ChangeStatus=1) "); // 虚拟参数 var dp = new DynamicParameters(new { }); if (!queryParam["StuNo"].IsEmpty()) { - dp.Add("StuNo", queryParam["StuNo"].ToString(), DbType.String); - strSql.Append(" AND a.StuNo = @StuNo "); + dp.Add("StuNo", "%" + queryParam["StuNo"].ToString() + "%", DbType.String); + strSql.Append(" AND a.StuNo like @StuNo "); } //if (!queryParam["AcademicYearNo"].IsEmpty()) //{ @@ -462,22 +461,22 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration if (!queryParam["LessonNo"].IsEmpty()) { dp.Add("LessonNo", queryParam["LessonNo"].ToString(), DbType.String); - strSql.Append(" AND c.LessonNo = @LessonNo "); + strSql.Append(" AND b.LessonNo = @LessonNo "); } if (!queryParam["LessonName"].IsEmpty()) { dp.Add("LessonName", "%" + queryParam["LessonName"].ToString() + "%", DbType.String); - strSql.Append(" AND c.LessonName Like @LessonName "); + strSql.Append(" AND b.LessonName Like @LessonName "); } if (!queryParam["EmpNo"].IsEmpty()) { dp.Add("EmpNo", queryParam["EmpNo"].ToString(), DbType.String); - strSql.Append(" AND c.EmpNo = @EmpNo "); + strSql.Append(" AND b.EmpNo = @EmpNo "); } if (!queryParam["EmpName"].IsEmpty()) { dp.Add("EmpName", "%" + queryParam["EmpName"].ToString() + "%", DbType.String); - strSql.Append(" AND c.EmpName Like @EmpName "); + strSql.Append(" AND b.EmpName Like @EmpName "); } if (!queryParam["StuName"].IsEmpty()) { @@ -487,7 +486,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration if (!queryParam["Status"].IsEmpty()) { dp.Add("Status", queryParam["Status"].ToInt(), DbType.Int32); - strSql.Append(" AND Status = @Status "); + strSql.Append(" AND b.Status = @Status "); } if (!queryParam["F_SchoolId"].IsEmpty()) { @@ -531,12 +530,58 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + /// + /// 获取选课情况里的课程信息 + /// + /// + /// + /// + public IEnumerable GetSelectLessonInfo(string academicYearNo, string semester) + { + try + { + if (!string.IsNullOrEmpty(academicYearNo) && !string.IsNullOrEmpty(semester)) + { + return this.BaseRepository("CollegeMIS").FindList($"select distinct t.LessonNo,t.LessonName from StuSelectLessonListOfElectiveOnline t where t.AcademicYearNo='{academicYearNo}' and t.Semester='{semester}' "); + } + else + { + return this.BaseRepository("CollegeMIS").FindList("select distinct t.LessonNo,t.LessonName from StuSelectLessonListOfElectiveOnline t where 1=1 "); + } + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } - public IEnumerable GetAllElectiveLesson(string academicYearNo, string semester) + /// + /// 初始化线上课程成绩 + /// 主键 + /// + /// + public void DoInitScore(StuSelectLessonListOfElectiveOnlineEntity entity) { try { - return this.BaseRepository("CollegeMIS").FindList("select * from StuSelectLessonListOfElectiveOnline where AcademicYearNo='" + academicYearNo + "' and Semester='" + semester + "'"); + string sql = @"insert into StuScoreOnline(NoticeBookNo,StuNo,DeptNo,MajorNo,ClassNo,StuName,GenderNo,AcademicYearNo,Semester,LessonNo,LessonName,Grade,TermEndScore,Remark,CheckMark,EmpNo,IsEditable,F_SchoolId) +select NoticeBookNo,StuNo,DeptNo,MajorNo,ClassNo,StuName,GenderNo,AcademicYearNo,Semester,LessonNo,LessonName,Grade,'0',Remark,0,EmpNo,IsEditable=1,F_SchoolId from +(select s.NoticeBookNo,s.StuNo,s.DeptNo,s.MajorNo,s.ClassNo,s.StuName,s.GenderNo,s.AcademicYearNo,s.Semester,s.LessonNo,s.LessonName,s.Grade,s.Remark,s.EmpNo,s.F_SchoolId +from StuSelectLessonListOfElectiveOnline s +where s.Status='2' +) as sl +where StuNo not in(Select StuNo from StuScoreOnline s where s.AcademicYearNo=sl.AcademicYearNo + and s.Semester=sl.Semester and s.LessonNo=sl.LessonNo and s.LessonName=sl.LessonName and s.EmpNo=sl.EmpNo +and s.AcademicYearNo='" + entity.AcademicYearNo + "' and s.Semester='" + entity.Semester + "') and sl.AcademicYearNo='" + entity.AcademicYearNo + "' and sl.Semester='" + entity.Semester + "'"; + BaseRepository("CollegeMIS").ExecuteBySql(sql); + } catch (Exception ex) { @@ -550,5 +595,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + } }