diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreController.cs index 296c0921d..8893bc212 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreController.cs @@ -1065,7 +1065,16 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { var loginInfo = LoginUserInfo.Get(); var name = loginInfo.account + "_" + loginInfo.realName + "_成绩录入"; + + //判断选修课 + var queryParam = queryJson.ToJObject(); + if (queryParam["ClassNo"].IsEmpty()) + { + name = loginInfo.account + "_" + loginInfo.realName + "_选修成绩录入"; + } + stuScoreIBLL.StartInputScore(queryJson); + //添加任务 //RecurringJob.AddOrUpdate(name, // () => SaveInputScoreStatus2(queryJson, name), @@ -1091,6 +1100,14 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { var loginInfo = LoginUserInfo.Get(); var name = loginInfo.account + "_" + loginInfo.realName + "_成绩录入"; + + //判断选修课 + var queryParam = queryJson.ToJObject(); + if (queryParam["ClassNo"].IsEmpty()) + { + name = loginInfo.account + "_" + loginInfo.realName + "_选修成绩录入"; + } + //更新任务 //var m = DateTime.Now.Minute + minutes; //if (m >= 60) @@ -1130,6 +1147,13 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers var loginInfo = LoginUserInfo.Get(); var name = loginInfo.account + "_" + loginInfo.realName + "_成绩录入"; + //判断选修课 + var queryParam = queryJson.ToJObject(); + if (queryParam["ClassNo"].IsEmpty()) + { + name = loginInfo.account + "_" + loginInfo.realName + "_选修成绩录入"; + } + stuScoreIBLL.SaveInputScoreStatus(queryJson); //删除任务 RecurringJob.RemoveIfExists(name); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreNotPassController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreNotPassController.cs index ca0f374d9..aca10a3aa 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreNotPassController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreNotPassController.cs @@ -122,6 +122,47 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers return View(); } + /// + /// 全院学生选修补考成绩录入(新) + /// + /// + [HttpGet] + public ActionResult InputScoreIndexOfElective() + { + //获取“教学工作安排”中“选修补考成绩录入”的记录 + var entity = eADateArrangeIBLL.GetEADateArrangeEntityByName("选修补考成绩录入"); + if (entity != null && entity.CheckMark == "1" && DateTime.Now > entity.MakeDate && DateTime.Now < entity.EndDate) + { + ViewBag.CanInputFlag = true;//可以录入成绩标识 + } + else + { + ViewBag.CanInputFlag = false; + } + + return View(); + } + /// + /// 全院学生选修补考成绩录入(新) + /// + /// + [HttpGet] + public ActionResult InputScoreIndexOfElectiveInTeacher() + { + //获取“教学工作安排”中“选修补考成绩录入”的记录 + var entity = eADateArrangeIBLL.GetEADateArrangeEntityByName("选修补考成绩录入"); + if (entity != null && entity.CheckMark == "1" && DateTime.Now > entity.MakeDate && DateTime.Now < entity.EndDate) + { + ViewBag.CanInputFlag = true;//可以录入成绩标识 + } + else + { + ViewBag.CanInputFlag = false; + } + + return View(); + } + #endregion #region 获取数据 @@ -385,6 +426,92 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers return Success(data); } + /// + /// 选修课程下拉框 带编号【选修课】 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetElectiveLessonNoDataOfAllWithNo() + { + var data = stuScoreNotPassIBLL.GetElectiveLessonNoDataOfAll("", ""); + foreach (var item in data) + { + item.text = string.Format("{0}({1})", item.text, item.value); + } + + return Success(data); + } + /// + /// 选修课程下拉框 带编号【选修课】 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetElectiveLessonNoDataWithNo(string AcademicYearShort, string Semester) + { + var loginInfo = LoginUserInfo.Get(); + //var semesterAndYear = Common.GetSemesterAndYear(); + var data = stuScoreNotPassIBLL.GetElectiveLessonNoDataOfAll(loginInfo.account, loginInfo.Description, AcademicYearShort, Semester); + foreach (var item in data) + { + item.text = string.Format("{0}({1})", item.text, item.value); + } + + return Success(data); + } + + /// + /// 教室下拉框信息【选修课】 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetElectiveClassRoomNoDataOfAll(string lessonNo) + { + var data = stuScoreNotPassIBLL.GetElectiveClassRoomNoData("", "", lessonNo); + + return Success(data); + } + /// + /// 教室下拉框信息【选修课】 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetElectiveClassRoomNoData(string lessonNo) + { + var loginInfo = LoginUserInfo.Get(); + var data = stuScoreNotPassIBLL.GetElectiveClassRoomNoData(loginInfo.account, loginInfo.Description, lessonNo); + + return Success(data); + } + + /// + /// 节次下拉框信息【选修课】 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetElectiveLessonSectionDataOfAll(string classRoomNo) + { + var data = stuScoreNotPassIBLL.GetElectiveLessonSectionData("", "", classRoomNo); + + return Success(data); + } + /// + /// 节次下拉框信息【选修课】 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetElectiveLessonSectionData(string classRoomNo) + { + var loginInfo = LoginUserInfo.Get(); + var data = stuScoreNotPassIBLL.GetElectiveLessonSectionData(loginInfo.account, loginInfo.Description, classRoomNo); + + return Success(data); + } /// /// 开始录入:占用成绩 @@ -396,6 +523,14 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { var loginInfo = LoginUserInfo.Get(); var name = loginInfo.account + "_" + loginInfo.realName + "_补考成绩录入"; + + //判断选修课 + var queryParam = queryJson.ToJObject(); + if (queryParam["ClassNo"].IsEmpty()) + { + name = loginInfo.account + "_" + loginInfo.realName + "_选修补考成绩录入"; + } + stuScoreNotPassIBLL.StartInputScore(queryJson); //添加任务 var newDate = DateTime.Now.AddMinutes(30); @@ -415,6 +550,14 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { var loginInfo = LoginUserInfo.Get(); var name = loginInfo.account + "_" + loginInfo.realName + "_补考成绩录入"; + + //判断选修课 + var queryParam = queryJson.ToJObject(); + if (queryParam["ClassNo"].IsEmpty()) + { + name = loginInfo.account + "_" + loginInfo.realName + "_选修补考成绩录入"; + } + //更新任务 var newDate = DateTime.Now.AddMinutes(minutes); RecurringJob.AddOrUpdate(name, @@ -449,6 +592,13 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers var loginInfo = LoginUserInfo.Get(); var name = loginInfo.account + "_" + loginInfo.realName + "_补考成绩录入"; + //判断选修课 + var queryParam = queryJson.ToJObject(); + if (queryParam["ClassNo"].IsEmpty()) + { + name = loginInfo.account + "_" + loginInfo.realName + "_选修补考成绩录入"; + } + stuScoreNotPassIBLL.SaveInputScoreStatus(queryJson); //删除任务 RecurringJob.RemoveIfExists(name); 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 2f35b232d..9bb4964ed 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 @@ -501,13 +501,11 @@ var bootstrap = function ($, learun) { if (!!item) { $("#ClassRoomNo").lrselectRefresh({ url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetElectiveClassRoomNoDataOfAll?lessonNo=' + item.value, - value: 'value', - text: 'text', }); } } }); - //班级 + //教室 $('#ClassRoomNo').lrselect({ placeholder: "请选择教室", allowSearch: true, @@ -518,8 +516,6 @@ var bootstrap = function ($, learun) { if (!!item) { $("#LessonSection").lrselectRefresh({ url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetElectiveLessonSectionDataOfAll?classRoomNo=' + item.value, - value: 'value', - text: 'text', }); } } 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 44d5d3f25..6523c7d5e 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 @@ -570,8 +570,6 @@ var bootstrap = function ($, learun) { if (!!item) { $("#LessonNo").lrselectRefresh({ url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetElectiveLessonNoDataWithNo?AcademicYearShort=' + item.value + '&Semester=' + $('#Semester').lrselectGet(), - value: 'value', - text: 'text', }); } } @@ -587,8 +585,6 @@ var bootstrap = function ($, learun) { if (!!item) { $("#LessonNo").lrselectRefresh({ url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetElectiveLessonNoDataWithNo?AcademicYearShort=' + $('#AcademicYearNo').lrselectGet() + '&Semester=' + item.value , - value: 'value', - text: 'text', }); } } @@ -597,32 +593,28 @@ var bootstrap = function ($, learun) { $('#LessonNo').lrselect({ placeholder: "请选择课程", allowSearch: true, - //url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetElectiveLessonNoDataWithNo', + url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetElectiveLessonNoDataWithNo', value: 'value', text: 'text', select: function (item) { if (!!item) { $("#ClassRoomNo").lrselectRefresh({ url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetElectiveClassRoomNoData?lessonNo=' + item.value, - value: 'value', - text: 'text', }); } } }); - //班级 + //教室 $('#ClassRoomNo').lrselect({ placeholder: "请选择教室", allowSearch: true, - // url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetElectiveClassRoomNoData', + url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetElectiveClassRoomNoData', value: 'value', text: 'text', select: function (item) { if (!!item) { $("#LessonSection").lrselectRefresh({ url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetElectiveLessonSectionData?classRoomNo=' + item.value, - value: 'value', - text: 'text', }); } } @@ -631,7 +623,7 @@ var bootstrap = function ($, learun) { $('#LessonSection').lrselect({ placeholder: "请选择节次", allowSearch: true, - //url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetElectiveLessonSectionData', + url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetElectiveLessonSectionData', value: 'value', text: 'text' }); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreNotPass/InputScoreIndexOfElective.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreNotPass/InputScoreIndexOfElective.cshtml new file mode 100644 index 000000000..d15ebd7e8 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreNotPass/InputScoreIndexOfElective.cshtml @@ -0,0 +1,118 @@ +@{ ViewBag.Title = "全院学生选修补考成绩录入(新)"; Layout = "~/Views/Shared/_Index.cshtml"; } + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+  查询 +
+
+ + +
+
+ +
提示:录入完成后,请务必点击“提交成绩”按钮,避免成绩丢失!
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuScoreNotPass/InputScoreIndexOfElective.js") + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreNotPass/InputScoreIndexOfElective.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreNotPass/InputScoreIndexOfElective.js new file mode 100644 index 000000000..00f6348cd --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreNotPass/InputScoreIndexOfElective.js @@ -0,0 +1,533 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-06-14 11:02 + * 描 述:全院学生选修补考成绩录入(新) + */ +var selectedRow; +var refreshGirdData; +var refreshGirdData2; +var judgeSelect; //判断下拉框是否选择 +var modifyDate; //成绩被占用,且是登录用户时,成绩表中的编辑时间; +var timer; //计时器 +var submitScoreTimer; //五分钟提交成绩计时器 +var headData; //常规列头 +var headDataEdit; //可编辑列头 +var headDataNoEdit; //不可编辑列头 +var headDataFinally; //最终列头 +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + headData = [ + { + label: "审核状态", name: "CheckMark", width: 80, align: "center", + formatter: function (cellvalue) { + return cellvalue == "1" ? "已审核" : "未审核"; + } + }, + { label: '学号', name: 'StuNo', width: 100, align: "left" }, + { label: '姓名', name: 'StuName', width: 100, align: "left" }, + { + label: "性别", name: "GenderNo", width: 60, align: "left", + formatter: function (cellvalue) { + return cellvalue == true ? "男" : "女"; + } + }, + { + label: "学习形式", name: "StudyModality", width: 55, align: "left", formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'StudyModality', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { + label: "异动类型", name: "MoveType", width: 55, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'StuChangeType', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { + label: "校区", name: "F_SchoolId", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company', + key: value, + keyId: 'f_companyid', + callback: function (_data) { + callback(_data['f_fullname']); + } + }); + } + }, + { + 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', + key: value, + keyId: 'deptno', + callback: function (_data) { + callback(_data['deptname']); + } + }); + } + }, + { + label: "专业", name: "MajorNo", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', + key: value, + keyId: 'majorno', + callback: function (_data) { + callback(_data['majorname']); + } + }); + } + }, + { label: "年级", name: "Grade", width: 100, align: "left" }, + { label: '学年', name: 'AcademicYearNo', width: 100, align: "left" }, + { label: '学期', name: 'Semester', width: 80, align: "left" }, + { label: '课程名称', name: 'LessonName', width: 150, align: "left" }, + //{ + // label: '课程名称', name: 'LessonNo', width: 150, align: "left", + // formatterAsync: function (callback, value, row, op, $cell) { + // learun.clientdata.getAsync('custmerData', { + // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo', + // key: value, + // keyId: 'lessonno', + // callback: function (_data) { + // callback(_data['lessonname']); + // } + // }); + // } + //}, + { + label: '教室名称', name: 'ClassRoomNo', width: 150, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'ClassRoomInfo', + key: value, + keyId: 'classroomno', + callback: function (_data) { + callback(_data['classroomname']); + } + }); + } + }, + { label: '节次', name: 'LessonSection', width: 150, align: "left" }, + ]; + headDataEdit = [ + { + label: '补考成绩', name: 'TermEndScore', width: 80, align: "left", + edit: { + type: 'input', + inputType: 'number', + change: function (row, rownum) { + row.Score = (parseFloat(row.TermEndScore || '0') * 1) >= 60 ? 60 : (parseFloat(row.TermEndScore || '0') * 1).toFixed(2); + $('#gridtable').jfGridSet('updateRow', rownum); + }, + } + }, + { label: '总成绩', name: 'Score', width: 80, align: "left" }, + { + label: '备注', name: 'Remark', width: 100, align: "left", + edit: { + type: 'input', + } + }, + ]; + headDataNoEdit = [ + { + label: '期末成绩', name: 'TermEndScore', width: 80, align: "left" + }, + { label: '总成绩', name: 'Score', width: 80, align: "left" }, + { + label: '备注', name: 'Remark', width: 100, align: "left" + }, + ]; + headDataFinally = headData.concat(headDataNoEdit); + + page.initGird(); + page.bind(); + page.bindSelect(); + }, + bind: function () { + //多条件选择 + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 500); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + //查询 + $('#btn_Search').on('click', function () { + refreshGirdData2(); + }); + // 开始录入 + $('#lr_input').on('click', function () { + //提示弹框 + learun.layerConfirm('录入完成后,请务必点击“提交成绩”按钮,避免成绩丢失!', function (res) { + if (res) { + + var query = judgeSelect(); + if (query) { + //判断是否已审核;判断是否被其他教师占用 + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/GetEntityByJson?queryJson=' + JSON.stringify(query), function (data) { + if (data != null) { + if (data.CheckMark == 1) { + learun.alert.warning("学生成绩已审核!"); + return false; + } + if (data.IsEditable == 0) { + if (data.EditUserId == learun.clientdata.get(['userinfo']).account) { + modifyDate = data.ModifyDate; + } else { + learun.alert.warning("当前班级成绩由账号为" + data.EditUserId + "的教师在使用!"); + return false; + } + } else { + //占用成绩 + learun.postFormSilence(top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/StartInputScore', { queryJson: JSON.stringify(query) }, function (res) { }); + } + //显示可编辑列头 + headDataFinally = headData.concat(headDataEdit); + $("#gridtable")[0].dfop = undefined; + page.initGird(); + page.search(query); + //显示“提交成绩”按钮 + $('#lr_save').show(); + //隐藏“开始录入”按钮 + $('#lr_input').hide(); + //显示“倒计时” + $('.timeBox').show(); + $('#minutes').html($('#minutes').attr('data-minutes')); + //开始倒计时 + page.countDown(); + //五分钟提交成绩 + page.submitScore(); + } else { + learun.alert.warning("学生成绩不存在!"); + return false; + } + }); + } + + } + }); + }); + //提交成绩 + $('#lr_save').on('click', function () { + var query = judgeSelect(); + if (query) { + //成绩被占用,且是登录用户时,根据编辑时间判断是否是本人; + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/GetEntityByJson?queryJson=' + JSON.stringify(query), function (data) { + if (data != null) { + if (data.CheckMark == 1) { + learun.alert.warning("学生成绩已审核!"); + return false; + } + if (data.IsEditable == 0) { + if (data.EditUserId == learun.clientdata.get(['userinfo']).account) { + if (modifyDate != null && modifyDate != data.ModifyDate) { + learun.alert.warning("当前班级成绩被修改,请重新获取!"); + return false; + } + } else { + learun.alert.warning("当前班级成绩由账号为" + data.EditUserId + "的教师在使用!"); + return false; + } + } else if (data.IsEditable == 1) { + learun.alert.warning("学生成绩已提交!"); + return false; + } + //提交成绩 + var rowdatas = $('#gridtable').jfGridGet('rowdatas'); + learun.postFormSilence(top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/SaveInputScore', { data: JSON.stringify(rowdatas) }, function (res) { + if (res.code == 200) { + //提交成绩:取消占用 + learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/SaveInputScoreStatus', { queryJson: JSON.stringify(query) }, function (res) { + if (res.code == 200) { + refreshGirdData2(); + modifyDate = null; + //隐藏“提交成绩”按钮 + $('#lr_save').hide(); + //显示“开始录入”按钮 + $('#lr_input').show(); + //隐藏“倒计时” + $('.timeBox').hide(); + //停止倒计时 + clearInterval(timer); + //停止五分钟提交成绩 + clearInterval(submitScoreTimer); + } else { + learun.alert.warning("提交成绩:取消占用失败!"); + return false; + } + }); + } else { + learun.alert.warning("提交成绩失败!"); + return false; + } + }); + + } else { + learun.alert.warning("学生成绩不存在!"); + return false; + } + }); + } + }); + // 审核 + $('#lr_check').on('click', function () { + var query = judgeSelect(); + if (query) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/GetEntityByJson?queryJson=' + JSON.stringify(query), function (data) { + if (data != null) { + if (data.CheckMark == 1) { + learun.alert.warning("学生成绩已审核!"); + return false; + } + learun.layerConfirm('是否确认审核当前班级的学生成绩!', function (res) { + if (res) { + //审核成绩 + learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/DoCheckScore', { queryJson: JSON.stringify(query), checkMark: 1 }, function (res) { + if (res.code == 200) { + refreshGirdData2(); + } else { + learun.alert.warning("审核成绩失败!"); + return false; + } + }); + } + }); + } else { + learun.alert.warning("学生成绩不存在!"); + return false; + } + }); + } + }); + // 去审核 + $('#lr_uncheck').on('click', function () { + var query = judgeSelect(); + if (query) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/GetEntityByJson?queryJson=' + JSON.stringify(query), function (data) { + if (data != null) { + if (data.CheckMark != 1) { + learun.alert.warning("学生成绩未审核!"); + return false; + } + learun.layerConfirm('是否确认去审核当前班级的学生成绩!', function (res) { + if (res) { + //去审核成绩 + learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/DoCheckScore', { queryJson: JSON.stringify(query), checkMark: 0 }, function (res) { + if (res.code == 200) { + refreshGirdData2(); + } else { + learun.alert.warning("去审核成绩失败!"); + return false; + } + }); + } + }); + } else { + learun.alert.warning("学生成绩不存在!"); + return false; + } + }); + } + }); + //续时 + $('#addMinutesBtn').on('click', function () { + var query = judgeSelect(); + if (query) { + clearInterval(timer); + var addMinutes = $('#addMinutesBtn').attr('data-minutes'); + var newMinutes = addMinutes; + var minutes = $('#minutes').html(); + if (minutes > 0) { + newMinutes = Number(newMinutes) + Number(minutes); + } + $('#minutes').html(newMinutes); + page.countDown(); + //修改服务时间 + learun.postFormSilence(top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/AddMinutes', { queryJson: JSON.stringify(query), minutes: newMinutes }, function (res) { }); + } + }); + }, + bindSelect: function () { + //校区 + $('#F_SchoolId').lrDataSourceSelect({ + code: 'company', value: 'f_companyid', text: 'f_fullname', select: function (item) { } + }); + $('#F_SchoolId').lrselectSet(learun.clientdata.get(['userinfo']).companyId); + //学年 + $('#AcademicYearNo').lrselect({ + placeholder: "学年", + allowSearch: false, + url: top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/GetAcademicYearNoData', + value: 'value', + text: 'text' + }); + //学期 + $('#Semester').lrselect({ + placeholder: "学期", + allowSearch: false, + url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetSemesterData', + value: 'value', + text: 'text' + }); + //课程 + $('#LessonNo').lrselect({ + placeholder: "请选择课程", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/GetElectiveLessonNoDataOfAllWithNo', + value: 'value', + text: 'text', + select: function (item) { + if (!!item) { + $("#ClassRoomNo").lrselectRefresh({ + url: top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/GetElectiveClassRoomNoDataOfAll?lessonNo=' + item.value, + }); + } + } + }); + //教室 + $('#ClassRoomNo').lrselect({ + placeholder: "请选择教室", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/GetElectiveClassRoomNoDataOfAll', + value: 'value', + text: 'text', + select: function (item) { + if (!!item) { + $("#LessonSection").lrselectRefresh({ + url: top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/GetElectiveLessonSectionDataOfAll?classRoomNo=' + item.value, + }); + } + } + }); + //节次 + $('#LessonSection').lrselect({ + placeholder: "请选择节次", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/GetElectiveLessonSectionDataOfAll', + value: 'value', + text: 'text' + }); + //绑定学年、学期 + $.get('/Home/GetYearAndSemesteResult', function (ref) { + if (ref.code == "200") { + $('#AcademicYearNo').lrselectSet(ref.data.Item1); + $('#Semester').lrselectSet(ref.data.Item3); + } + }.bind(this), "json"); + }, + initGird: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/GetList', + headData: headDataFinally, + mainId: 'ScoreId', + isPage: false, + sidx: 'StuNo', + sord: 'asc' + }); + //page.search(); + }, + search: function (param) { + param = param || {}; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + }, + countDown: function () { + var minutes = $('#minutes').html(); + var minutesTemp = minutes; + var seconds = $('#seconds').attr('data-seconds'); + $('#seconds').html(seconds); + var secondsTemp = seconds; + timer = setInterval(function () { + secondsTemp--; + $('#seconds').html(secondsTemp); + if (secondsTemp == 0) { + secondsTemp = seconds; + minutesTemp--; + $('#minutes').html(minutesTemp); + if (minutesTemp == 0) { + //停止倒计时 + clearInterval(timer); + //自动提交成绩 + $('#lr_save').trigger("click"); + } + } + }, 1000); + }, + submitScore: function () { + submitScoreTimer = setInterval(function () { + var rowdatas = $('#gridtable').jfGridGet('rowdatas'); + learun.postFormSilence(top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/SaveInputScore', { data: JSON.stringify(rowdatas) }, function (res) { + }); + }, 300000); + }, + }; + refreshGirdData = function () { + page.search(); + }; + refreshGirdData2 = function () { + var query = judgeSelect(); + if (query) { + //显示不可编辑列头 + headDataFinally = headData.concat(headDataNoEdit); + $("#gridtable")[0].dfop = undefined; + page.initGird(); + + page.search(query); + } + }; + judgeSelect = function () { + if (CanInputFlag != "True") { + top.learun.layerConfirm('当前时间不是选修补考成绩录入时间!', function (res) { }); + return false; + } + + var $content = $('body').find('.lr-layout-tool-left'); + var query = $content.lrGetFormData(); + if (query.F_SchoolId == null || query.F_SchoolId == "") { + learun.alert.warning("请选择校区!"); + return false; + } + if (query.AcademicYearNo == null || query.AcademicYearNo == "") { + learun.alert.warning("请选择学年!"); + return false; + } + if (query.Semester == null || query.Semester == "") { + learun.alert.warning("请选择学期!"); + return false; + } + if (query.LessonNo == null || query.LessonNo == "") { + learun.alert.warning("请选择课程!"); + return false; + } + if (query.ClassRoomNo == null || query.ClassRoomNo == "") { + learun.alert.warning("请选择教室!"); + return false; + } + if (query.LessonSection == null || query.LessonSection == "") { + learun.alert.warning("请选择节次!"); + return false; + } + return query; + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreNotPass/InputScoreIndexOfElectiveInTeacher.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreNotPass/InputScoreIndexOfElectiveInTeacher.cshtml new file mode 100644 index 000000000..15e45fb02 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreNotPass/InputScoreIndexOfElectiveInTeacher.cshtml @@ -0,0 +1,118 @@ +@{ ViewBag.Title = "选修补考成绩录入(新)"; Layout = "~/Views/Shared/_Index.cshtml"; } + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+  查询 +
+
+ + +
+
+ +
提示:录入完成后,请务必点击“提交成绩”按钮,避免成绩丢失!
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuScoreNotPass/InputScoreIndexOfElectiveInTeacher.js") + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreNotPass/InputScoreIndexOfElectiveInTeacher.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreNotPass/InputScoreIndexOfElectiveInTeacher.js new file mode 100644 index 000000000..115417030 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreNotPass/InputScoreIndexOfElectiveInTeacher.js @@ -0,0 +1,547 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-06-14 11:02 + * 描 述:选修补考成绩录入(新) + */ +var selectedRow; +var refreshGirdData; +var refreshGirdData2; +var judgeSelect; //判断下拉框是否选择 +var modifyDate; //成绩被占用,且是登录用户时,成绩表中的编辑时间; +var timer; //计时器 +var submitScoreTimer; //五分钟提交成绩计时器 +var headData; //常规列头 +var headDataEdit; //可编辑列头 +var headDataNoEdit; //不可编辑列头 +var headDataFinally; //最终列头 +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + headData = [ + { + label: "审核状态", name: "CheckMark", width: 80, align: "center", + formatter: function (cellvalue) { + return cellvalue == "1" ? "已审核" : "未审核"; + } + }, + { label: '学号', name: 'StuNo', width: 100, align: "left" }, + { label: '姓名', name: 'StuName', width: 100, align: "left" }, + { + label: "性别", name: "GenderNo", width: 60, align: "left", + formatter: function (cellvalue) { + return cellvalue == true ? "男" : "女"; + } + }, + { + label: "学习形式", name: "StudyModality", width: 55, align: "left", formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'StudyModality', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { + label: "异动类型", name: "MoveType", width: 55, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'StuChangeType', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { + label: "校区", name: "F_SchoolId", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'company', + key: value, + keyId: 'f_companyid', + callback: function (_data) { + callback(_data['f_fullname']); + } + }); + } + }, + { + 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', + key: value, + keyId: 'deptno', + callback: function (_data) { + callback(_data['deptname']); + } + }); + } + }, + { + label: "专业", name: "MajorNo", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', + key: value, + keyId: 'majorno', + callback: function (_data) { + callback(_data['majorname']); + } + }); + } + }, + { label: "年级", name: "Grade", width: 100, align: "left" }, + { label: '学年', name: 'AcademicYearNo', width: 100, align: "left" }, + { label: '学期', name: 'Semester', width: 80, align: "left" }, + { label: '课程名称', name: 'LessonName', width: 150, align: "left" }, + //{ + // label: '课程名称', name: 'LessonNo', width: 150, align: "left", + // formatterAsync: function (callback, value, row, op, $cell) { + // learun.clientdata.getAsync('custmerData', { + // url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo', + // key: value, + // keyId: 'lessonno', + // callback: function (_data) { + // callback(_data['lessonname']); + // } + // }); + // } + //}, + { + label: '教室名称', name: 'ClassRoomNo', width: 150, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'ClassRoomInfo', + key: value, + keyId: 'classroomno', + callback: function (_data) { + callback(_data['classroomname']); + } + }); + } + }, + { label: '节次', name: 'LessonSection', width: 150, align: "left" }, + ]; + headDataEdit = [ + { + label: '补考成绩', name: 'TermEndScore', width: 80, align: "left", + edit: { + type: 'input', + inputType: 'number', + change: function (row, rownum) { + row.Score = (parseFloat(row.TermEndScore || '0') * 1) >= 60 ? 60 : (parseFloat(row.TermEndScore || '0') * 1).toFixed(2); + $('#gridtable').jfGridSet('updateRow', rownum); + }, + } + }, + { label: '总成绩', name: 'Score', width: 80, align: "left" }, + { + label: '备注', name: 'Remark', width: 100, align: "left", + edit: { + type: 'input', + } + }, + ]; + headDataNoEdit = [ + { + label: '期末成绩', name: 'TermEndScore', width: 80, align: "left" + }, + { label: '总成绩', name: 'Score', width: 80, align: "left" }, + { + label: '备注', name: 'Remark', width: 100, align: "left" + }, + ]; + headDataFinally = headData.concat(headDataNoEdit); + + page.initGird(); + page.bind(); + page.bindSelect(); + }, + bind: function () { + //多条件选择 + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 500); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + //查询 + $('#btn_Search').on('click', function () { + refreshGirdData2(); + }); + // 开始录入 + $('#lr_input').on('click', function () { + //提示弹框 + learun.layerConfirm('录入完成后,请务必点击“提交成绩”按钮,避免成绩丢失!', function (res) { + if (res) { + + var query = judgeSelect(); + if (query) { + //判断是否已审核;判断是否被其他教师占用 + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/GetEntityByJson?queryJson=' + JSON.stringify(query), function (data) { + if (data != null) { + if (data.CheckMark == 1) { + learun.alert.warning("学生成绩已审核!"); + return false; + } + if (data.IsEditable == 0) { + if (data.EditUserId == learun.clientdata.get(['userinfo']).account) { + modifyDate = data.ModifyDate; + } else { + learun.alert.warning("当前班级成绩由账号为" + data.EditUserId + "的教师在使用!"); + return false; + } + } else { + //占用成绩 + learun.postFormSilence(top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/StartInputScore', { queryJson: JSON.stringify(query) }, function (res) { }); + } + //显示可编辑列头 + headDataFinally = headData.concat(headDataEdit); + $("#gridtable")[0].dfop = undefined; + page.initGird(); + page.search(query); + //显示“提交成绩”按钮 + $('#lr_save').show(); + //隐藏“开始录入”按钮 + $('#lr_input').hide(); + //显示“倒计时” + $('.timeBox').show(); + $('#minutes').html($('#minutes').attr('data-minutes')); + //开始倒计时 + page.countDown(); + //五分钟提交成绩 + page.submitScore(); + } else { + learun.alert.warning("学生成绩不存在!"); + return false; + } + }); + } + + } + }); + }); + //提交成绩 + $('#lr_save').on('click', function () { + var query = judgeSelect(); + if (query) { + //成绩被占用,且是登录用户时,根据编辑时间判断是否是本人; + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/GetEntityByJson?queryJson=' + JSON.stringify(query), function (data) { + if (data != null) { + if (data.CheckMark == 1) { + learun.alert.warning("学生成绩已审核!"); + return false; + } + if (data.IsEditable == 0) { + if (data.EditUserId == learun.clientdata.get(['userinfo']).account) { + if (modifyDate != null && modifyDate != data.ModifyDate) { + learun.alert.warning("当前班级成绩被修改,请重新获取!"); + return false; + } + } else { + learun.alert.warning("当前班级成绩由账号为" + data.EditUserId + "的教师在使用!"); + return false; + } + } else if (data.IsEditable == 1) { + learun.alert.warning("学生成绩已提交!"); + return false; + } + //提交成绩 + var rowdatas = $('#gridtable').jfGridGet('rowdatas'); + learun.postFormSilence(top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/SaveInputScore', { data: JSON.stringify(rowdatas) }, function (res) { + if (res.code == 200) { + //提交成绩:取消占用 + learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/SaveInputScoreStatus', { queryJson: JSON.stringify(query) }, function (res) { + if (res.code == 200) { + refreshGirdData2(); + modifyDate = null; + //隐藏“提交成绩”按钮 + $('#lr_save').hide(); + //显示“开始录入”按钮 + $('#lr_input').show(); + //隐藏“倒计时” + $('.timeBox').hide(); + //停止倒计时 + clearInterval(timer); + //停止五分钟提交成绩 + clearInterval(submitScoreTimer); + } else { + learun.alert.warning("提交成绩:取消占用失败!"); + return false; + } + }); + } else { + learun.alert.warning("提交成绩失败!"); + return false; + } + }); + + } else { + learun.alert.warning("学生成绩不存在!"); + return false; + } + }); + } + }); + // 审核 + $('#lr_check').on('click', function () { + var query = judgeSelect(); + if (query) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/GetEntityByJson?queryJson=' + JSON.stringify(query), function (data) { + if (data != null) { + if (data.CheckMark == 1) { + learun.alert.warning("学生成绩已审核!"); + return false; + } + learun.layerConfirm('是否确认审核当前班级的学生成绩!', function (res) { + if (res) { + //审核成绩 + learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/DoCheckScore', { queryJson: JSON.stringify(query), checkMark: 1 }, function (res) { + if (res.code == 200) { + refreshGirdData2(); + } else { + learun.alert.warning("审核成绩失败!"); + return false; + } + }); + } + }); + } else { + learun.alert.warning("学生成绩不存在!"); + return false; + } + }); + } + }); + // 去审核 + $('#lr_uncheck').on('click', function () { + var query = judgeSelect(); + if (query) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/GetEntityByJson?queryJson=' + JSON.stringify(query), function (data) { + if (data != null) { + if (data.CheckMark != 1) { + learun.alert.warning("学生成绩未审核!"); + return false; + } + learun.layerConfirm('是否确认去审核当前班级的学生成绩!', function (res) { + if (res) { + //去审核成绩 + learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/DoCheckScore', { queryJson: JSON.stringify(query), checkMark: 0 }, function (res) { + if (res.code == 200) { + refreshGirdData2(); + } else { + learun.alert.warning("去审核成绩失败!"); + return false; + } + }); + } + }); + } else { + learun.alert.warning("学生成绩不存在!"); + return false; + } + }); + } + }); + //续时 + $('#addMinutesBtn').on('click', function () { + var query = judgeSelect(); + if (query) { + clearInterval(timer); + var addMinutes = $('#addMinutesBtn').attr('data-minutes'); + var newMinutes = addMinutes; + var minutes = $('#minutes').html(); + if (minutes > 0) { + newMinutes = Number(newMinutes) + Number(minutes); + } + $('#minutes').html(newMinutes); + page.countDown(); + //修改服务时间 + learun.postFormSilence(top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/AddMinutes', { queryJson: JSON.stringify(query), minutes: newMinutes }, function (res) { }); + } + }); + }, + bindSelect: function () { + //校区 + $('#F_SchoolId').lrDataSourceSelect({ + code: 'company', value: 'f_companyid', text: 'f_fullname', select: function (item) { } + }); + $('#F_SchoolId').lrselectSet(learun.clientdata.get(['userinfo']).companyId); + //学年 + $('#AcademicYearNo').lrselect({ + placeholder: "学年", + allowSearch: false, + url: top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/GetAcademicYearNoData', + value: 'value', + text: 'text', + select: function (item) { + if (!!item) { + $("#LessonNo").lrselectRefresh({ + url: top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/GetElectiveLessonNoDataWithNo?AcademicYearShort=' + item.value + '&Semester=' + $('#Semester').lrselectGet(), + }); + } + } + }); + //学期 + $('#Semester').lrselect({ + placeholder: "学期", + allowSearch: false, + url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetSemesterData', + value: 'value', + text: 'text', + select: function (item) { + if (!!item) { + $("#LessonNo").lrselectRefresh({ + url: top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/GetElectiveLessonNoDataWithNo?AcademicYearShort=' + $('#AcademicYearNo').lrselectGet() + '&Semester=' + item.value, + }); + } + } + }); + //课程 + $('#LessonNo').lrselect({ + placeholder: "请选择课程", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/GetElectiveLessonNoDataWithNo', + value: 'value', + text: 'text', + select: function (item) { + if (!!item) { + $("#ClassRoomNo").lrselectRefresh({ + url: top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/GetElectiveClassRoomNoData?lessonNo=' + item.value, + }); + } + } + }); + //教室 + $('#ClassRoomNo').lrselect({ + placeholder: "请选择教室", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/GetElectiveClassRoomNoData', + value: 'value', + text: 'text', + select: function (item) { + if (!!item) { + $("#LessonSection").lrselectRefresh({ + url: top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/GetElectiveLessonSectionData?classRoomNo=' + item.value, + }); + } + } + }); + //节次 + $('#LessonSection').lrselect({ + placeholder: "请选择节次", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/GetElectiveLessonSectionData', + value: 'value', + text: 'text' + }); + //绑定学年、学期 + $.get('/Home/GetYearAndSemesteResult', function (ref) { + if (ref.code == "200") { + $('#AcademicYearNo').lrselectSet(ref.data.Item1); + $('#Semester').lrselectSet(ref.data.Item3); + } + }.bind(this), "json"); + }, + initGird: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/GetList', + headData: headDataFinally, + mainId: 'ScoreId', + isPage: false, + sidx: 'StuNo', + sord: 'asc' + }); + //page.search(); + }, + search: function (param) { + param = param || {}; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + }, + countDown: function () { + var minutes = $('#minutes').html(); + var minutesTemp = minutes; + var seconds = $('#seconds').attr('data-seconds'); + $('#seconds').html(seconds); + var secondsTemp = seconds; + timer = setInterval(function () { + secondsTemp--; + $('#seconds').html(secondsTemp); + if (secondsTemp == 0) { + secondsTemp = seconds; + minutesTemp--; + $('#minutes').html(minutesTemp); + if (minutesTemp == 0) { + //停止倒计时 + clearInterval(timer); + //自动提交成绩 + $('#lr_save').trigger("click"); + } + } + }, 1000); + }, + submitScore: function () { + submitScoreTimer = setInterval(function () { + var rowdatas = $('#gridtable').jfGridGet('rowdatas'); + learun.postFormSilence(top.$.rootUrl + '/EducationalAdministration/StuScoreNotPass/SaveInputScore', { data: JSON.stringify(rowdatas) }, function (res) { + }); + }, 300000); + }, + }; + refreshGirdData = function () { + page.search(); + }; + refreshGirdData2 = function () { + var query = judgeSelect(); + if (query) { + //显示不可编辑列头 + headDataFinally = headData.concat(headDataNoEdit); + $("#gridtable")[0].dfop = undefined; + page.initGird(); + + page.search(query); + } + }; + judgeSelect = function () { + if (CanInputFlag != "True") { + top.learun.layerConfirm('当前时间不是选修补考成绩录入时间!', function (res) { }); + return false; + } + + var $content = $('body').find('.lr-layout-tool-left'); + var query = $content.lrGetFormData(); + if (query.F_SchoolId == null || query.F_SchoolId == "") { + learun.alert.warning("请选择校区!"); + return false; + } + if (query.AcademicYearNo == null || query.AcademicYearNo == "") { + learun.alert.warning("请选择学年!"); + return false; + } + if (query.Semester == null || query.Semester == "") { + learun.alert.warning("请选择学期!"); + return false; + } + if (query.LessonNo == null || query.LessonNo == "") { + learun.alert.warning("请选择课程!"); + return false; + } + if (query.ClassRoomNo == null || query.ClassRoomNo == "") { + learun.alert.warning("请选择教室!"); + return false; + } + if (query.LessonSection == null || query.LessonSection == "") { + learun.alert.warning("请选择节次!"); + return false; + } + return query; + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj index 0e97f5ad9..c9b85a78b 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 @@ -1004,6 +1004,8 @@ + + @@ -8138,6 +8140,8 @@ + + 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 89bed8578..c003b1300 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 @@ -1941,7 +1941,7 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassroomNo == classroomno); if (classInfoEntity != null) { - this.BaseRepository("CollegeMIS").ExecuteBySql("update StuScore set IsEditable='1',EditUserId=null,BeginModifyDate=null where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and ClassRoomNo='" + classInfoEntity.ClassroomNo + "' and LessonNo='" + LessonNo + "' and LessonSortNo='2' and LessonSection='" + lessonsection + "' "); + this.BaseRepository("CollegeMIS").ExecuteBySql($"update StuScore set IsEditable='1',EditUserId=null,BeginModifyDate=null,ModifyDate='{now}',ModifyUserId='{loginUserInfo.account}',ModifyUserName='{loginUserInfo.realName}' where F_SchoolId='{F_SchoolId}' and AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' and ClassRoomNo='{classInfoEntity.ClassroomNo}' and LessonNo='{LessonNo}' and LessonSortNo='2' and LessonSection='{lessonsection}' "); } } @@ -1972,21 +1972,37 @@ where StuNo not in(Select StuNo from stuscore s where s.Academicyearno = sl.Acad var AcademicYearNo = queryParam["AcademicYearNo"].ToString(); var Semester = queryParam["Semester"].ToString(); var LessonNo = queryParam["LessonNo"].ToString(); - var ClassNo = queryParam["ClassNo"].ToString(); + var ClassNo = queryParam["ClassNo"]; + var LessonSection = queryParam["LessonSection"]; + var ClassRoomNo = queryParam["ClassRoomNo"]; var now = DateTime.Now; - //var loginUserInfo = LoginUserInfo.Get(); var loginUserInfo = new { account = name.Split('_')[0], realName = name.Split('_')[1] }; - - var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassNo == ClassNo); - if (classInfoEntity != null) + if (!ClassNo.IsEmpty()) + { + string classno = ClassNo.ToString(); + var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassNo == classno); + if (classInfoEntity != null) + { + this.BaseRepository("CollegeMIS").ExecuteBySql($"update StuScore set IsEditable='1',EditUserId=null,BeginModifyDate=null,ModifyDate='{now}',ModifyUserId='{loginUserInfo.account}',ModifyUserName='{loginUserInfo.realName}' where F_SchoolId='{F_SchoolId}' and AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' and OpenLessonDeptNo='{classInfoEntity.DeptNo}' and OpenLessonMajorNo='{classInfoEntity.MajorNo}' and LessonNo='{LessonNo}' and LessonSortNo='1' and ClassNo='{classno}' "); + } + } + else { - this.BaseRepository("CollegeMIS").ExecuteBySql($"update StuScore set IsEditable='1',EditUserId=null,BeginModifyDate=null,ModifyDate='{now}',ModifyUserId='{loginUserInfo.account}',ModifyUserName='{loginUserInfo.realName}' where F_SchoolId='{F_SchoolId}' and AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' and OpenLessonDeptNo='{classInfoEntity.DeptNo}' and OpenLessonMajorNo='{classInfoEntity.MajorNo}' and LessonNo='{LessonNo}' and LessonSortNo='1' and ClassNo='{ClassNo}' "); + string classroomno = ClassRoomNo.ToString(); + string lessonsection = LessonSection.ToString(); + var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassroomNo == classroomno); + if (classInfoEntity != null) + { + this.BaseRepository("CollegeMIS").ExecuteBySql($"update StuScore set IsEditable='1',EditUserId=null,BeginModifyDate=null,ModifyDate='{now}',ModifyUserId='{loginUserInfo.account}',ModifyUserName='{loginUserInfo.realName}' where F_SchoolId='{F_SchoolId}' and AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' and ClassRoomNo='{classInfoEntity.ClassroomNo}' and LessonNo='{LessonNo}' and LessonSortNo='2' and LessonSection='{lessonsection}' "); + } } + + } catch (Exception ex) { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreNotPass/StuScoreNotPassBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreNotPass/StuScoreNotPassBLL.cs index 161d47a27..ff85b54ca 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreNotPass/StuScoreNotPassBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreNotPass/StuScoreNotPassBLL.cs @@ -355,6 +355,75 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 课程下拉框信息【选修课】 + /// + /// + public IEnumerable GetElectiveLessonNoDataOfAll(string userAccount, string userType, string AcademicYearNo = "", string Semester = "") + { + try + { + return stuScoreNotPassService.GetElectiveLessonNoDataOfAll(userAccount, userType, AcademicYearNo, Semester); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 教室下拉框信息【选修课】 + /// + /// + public IEnumerable GetElectiveClassRoomNoData(string userAccount, string userType, string lessonNo) + { + try + { + return stuScoreNotPassService.GetElectiveClassRoomNoData(userAccount, userType, lessonNo); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 节次下拉框信息【选修课】 + /// + /// + public IEnumerable GetElectiveLessonSectionData(string userAccount, string userType, string classRoomNo) + { + try + { + return stuScoreNotPassService.GetElectiveLessonSectionData(userAccount, userType, classRoomNo); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// /// 开始录入:占用成绩 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreNotPass/StuScoreNotPassIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreNotPass/StuScoreNotPassIBLL.cs index f24e05c3f..1c7dc7a15 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreNotPass/StuScoreNotPassIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreNotPass/StuScoreNotPassIBLL.cs @@ -106,6 +106,24 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// IEnumerable GetClassNoData(string userAccount, string userType, string lessonNo, string AcademicYearNo, string Semester); + /// + /// 课程下拉框信息【选修课】 + /// + /// + IEnumerable GetElectiveLessonNoDataOfAll(string userAccount, string userType, string AcademicYearNo = "", string Semester = ""); + + /// + /// 教室下拉框信息【选修课】 + /// + /// + IEnumerable GetElectiveClassRoomNoData(string userAccount, string userType, string lessonNo); + + /// + /// 节次下拉框信息【选修课】 + /// + /// + IEnumerable GetElectiveLessonSectionData(string userAccount, string userType, string classRoomNo); + /// /// 开始录入:占用成绩 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreNotPass/StuScoreNotPassService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreNotPass/StuScoreNotPassService.cs index 6f09948ca..1f4fe7abb 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreNotPass/StuScoreNotPassService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreNotPass/StuScoreNotPassService.cs @@ -127,6 +127,16 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration strSql.Append(" and t.ClassNo=@ClassNo "); dp.Add("ClassNo", queryParam["ClassNo"].ToString(), DbType.String); } + if (!queryParam["ClassRoomNo"].IsEmpty()) + { + strSql.Append(" and t.ClassRoomNo=@ClassRoomNo "); + dp.Add("ClassRoomNo", queryParam["ClassRoomNo"].ToString(), DbType.String); + } + if (!queryParam["LessonSection"].IsEmpty()) + { + strSql.Append(" and t.LessonSection=@LessonSection "); + dp.Add("LessonSection", queryParam["LessonSection"].ToString(), DbType.String); + } return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp); } @@ -413,6 +423,16 @@ and (b.EduSystem is null or b.EduSystem != '6') "); 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); } @@ -728,6 +748,111 @@ order by bb.ScoreId"; } } + /// + /// 课程下拉框信息【选修课】 + /// + /// + public IEnumerable GetElectiveLessonNoDataOfAll(string userAccount, string userType, string AcademicYearNo = "", string Semester = "") + { + try + { + var strSql = new StringBuilder(); + strSql.Append("select distinct s.LessonNo as value,l.LessonName as text from StuScoreNotPass s left join LessonInfo l on s.LessonNo=l.LessonNo where s.LessonSortNo='2' "); + if (userType == "教师") + { + strSql.Append(" and s.EmpNo='" + userAccount + "' "); + } + if (!string.IsNullOrEmpty(AcademicYearNo)) + { + strSql.Append(" and s.AcademicYearNo='" + AcademicYearNo + "' and s.Semester='" + Semester + "' "); + } + var data = this.BaseRepository("CollegeMIS").FindList(strSql.ToString()); + data = data.Where(x => !string.IsNullOrEmpty(x.value)).OrderBy(x => x.value); + return data; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 教室下拉框信息【选修课】 + /// + /// + public IEnumerable GetElectiveClassRoomNoData(string userAccount, string userType, string lessonNo) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("select distinct s.ClassRoomNo as value,c.ClassroomName as text from StuScoreNotPass s inner join ClassroomInfo c on s.ClassRoomNo=c.ClassroomNo where s.LessonSortNo='2' "); + if (userType == "教师") + { + strSql.Append(" and s.EmpNo='" + userAccount + "' "); + } + if (!string.IsNullOrEmpty(lessonNo)) + { + strSql.Append(" and s.LessonNo='" + lessonNo + "' "); + } + var data = this.BaseRepository("CollegeMIS").FindList(strSql.ToString()); + data = data.Where(x => !string.IsNullOrEmpty(x.value)).OrderBy(x => x.value); + return data; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 节次下拉框信息【选修课】 + /// + /// + public IEnumerable GetElectiveLessonSectionData(string userAccount, string userType, string classRoomNo) + { + try + { + var strSql = new StringBuilder(); + strSql.Append("select distinct s.LessonSection as value,s.LessonSection as text from StuScoreNotPass s where s.LessonSortNo='2' "); + if (userType == "教师") + { + strSql.Append(" and s.EmpNo='" + userAccount + "' "); + } + if (!string.IsNullOrEmpty(classRoomNo)) + { + strSql.Append(" and s.ClassRoomNo='" + classRoomNo + "' "); + } + var data = this.BaseRepository("CollegeMIS").FindList(strSql.ToString()); + data = data.Where(x => !string.IsNullOrEmpty(x.value)).OrderBy(x => x.value); + return data; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// /// 开始录入:占用成绩 /// @@ -741,16 +866,32 @@ order by bb.ScoreId"; var AcademicYearNo = queryParam["AcademicYearNo"].ToString(); var Semester = queryParam["Semester"].ToString(); var LessonNo = queryParam["LessonNo"].ToString(); - var ClassNo = queryParam["ClassNo"].ToString(); + var ClassNo = queryParam["ClassNo"]; + var LessonSection = queryParam["LessonSection"]; + var ClassRoomNo = queryParam["ClassRoomNo"]; var now = DateTime.Now; var loginUserInfo = LoginUserInfo.Get(); - - var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassNo == ClassNo); - if (classInfoEntity != null) + if (!ClassNo.IsEmpty()) { - this.BaseRepository("CollegeMIS").ExecuteBySql("update StuScoreNotPass set IsEditable='0',EditUserId='" + loginUserInfo.account + "',BeginModifyDate='" + now + "' where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and OpenLessonDeptNo='" + classInfoEntity.DeptNo + "' and OpenLessonMajorNo='" + classInfoEntity.MajorNo + "' and LessonNo='" + LessonNo + "' and LessonSortNo='1' and ClassNo='" + ClassNo + "' "); + string classno = ClassNo.ToString(); + var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassNo == classno); + if (classInfoEntity != null) + { + this.BaseRepository("CollegeMIS").ExecuteBySql("update StuScoreNotPass set IsEditable='0',EditUserId='" + loginUserInfo.account + "',BeginModifyDate='" + now + "' where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and OpenLessonDeptNo='" + classInfoEntity.DeptNo + "' and OpenLessonMajorNo='" + classInfoEntity.MajorNo + "' and LessonNo='" + LessonNo + "' and LessonSortNo='1' and ClassNo='" + classno + "' "); + } + } + else + { + string classroomno = ClassRoomNo.ToString(); + string lessonsection = LessonSection.ToString(); + var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassroomNo == classroomno); + if (classInfoEntity != null) + { + this.BaseRepository("CollegeMIS").ExecuteBySql("update StuScoreNotPass set IsEditable='0',EditUserId='" + loginUserInfo.account + "',BeginModifyDate='" + now + "' where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and ClassRoomNo='" + classInfoEntity.ClassroomNo + "' and LessonNo='" + LessonNo + "' and LessonSortNo='2' and LessonSection='" + lessonsection + "' "); + } } + } catch (Exception ex) { @@ -816,16 +957,33 @@ order by bb.ScoreId"; var AcademicYearNo = queryParam["AcademicYearNo"].ToString(); var Semester = queryParam["Semester"].ToString(); var LessonNo = queryParam["LessonNo"].ToString(); - var ClassNo = queryParam["ClassNo"].ToString(); + var ClassNo = queryParam["ClassNo"]; + var LessonSection = queryParam["LessonSection"]; + var ClassRoomNo = queryParam["ClassRoomNo"]; var now = DateTime.Now; var loginUserInfo = LoginUserInfo.Get(); - - var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassNo == ClassNo); - if (classInfoEntity != null) + if (!ClassNo.IsEmpty()) { - this.BaseRepository("CollegeMIS").ExecuteBySql($"update StuScoreNotPass set IsEditable='1',EditUserId=null,BeginModifyDate=null,ModifyDate='{now}',ModifyUserId='{loginUserInfo.account}',ModifyUserName='{loginUserInfo.realName}' where F_SchoolId='{F_SchoolId}' and AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' and OpenLessonDeptNo='{classInfoEntity.DeptNo}' and OpenLessonMajorNo='{classInfoEntity.MajorNo}' and LessonNo='{LessonNo}' and LessonSortNo='1' and ClassNo='{ClassNo}' "); + string classno = ClassNo.ToString(); + var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassNo == classno); + if (classInfoEntity != null) + { + this.BaseRepository("CollegeMIS").ExecuteBySql($"update StuScoreNotPass set IsEditable='1',EditUserId=null,BeginModifyDate=null,ModifyDate='{now}',ModifyUserId='{loginUserInfo.account}',ModifyUserName='{loginUserInfo.realName}' where F_SchoolId='{F_SchoolId}' and AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' and OpenLessonDeptNo='{classInfoEntity.DeptNo}' and OpenLessonMajorNo='{classInfoEntity.MajorNo}' and LessonNo='{LessonNo}' and LessonSortNo='1' and ClassNo='{classno}' "); + } } + else + { + string classroomno = ClassRoomNo.ToString(); + string lessonsection = LessonSection.ToString(); + var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassroomNo == classroomno); + if (classInfoEntity != null) + { + this.BaseRepository("CollegeMIS").ExecuteBySql($"update StuScoreNotPass set IsEditable='1',EditUserId=null,BeginModifyDate=null,ModifyDate='{now}',ModifyUserId='{loginUserInfo.account}',ModifyUserName='{loginUserInfo.realName}' where F_SchoolId='{F_SchoolId}' and AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' and ClassRoomNo='{classInfoEntity.ClassroomNo}' and LessonNo='{LessonNo}' and LessonSortNo='2' and LessonSection='{lessonsection}' "); + } + } + + } catch (Exception ex) { @@ -852,21 +1010,38 @@ order by bb.ScoreId"; var AcademicYearNo = queryParam["AcademicYearNo"].ToString(); var Semester = queryParam["Semester"].ToString(); var LessonNo = queryParam["LessonNo"].ToString(); - var ClassNo = queryParam["ClassNo"].ToString(); + var ClassNo = queryParam["ClassNo"]; + var LessonSection = queryParam["LessonSection"]; + var ClassRoomNo = queryParam["ClassRoomNo"]; var now = DateTime.Now; - //var loginUserInfo = LoginUserInfo.Get(); var loginUserInfo = new { account = name.Split('_')[0], realName = name.Split('_')[1] }; - - var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassNo == ClassNo); - if (classInfoEntity != null) + + if (!ClassNo.IsEmpty()) { - this.BaseRepository("CollegeMIS").ExecuteBySql($"update StuScoreNotPass set IsEditable='1',EditUserId=null,BeginModifyDate=null,ModifyDate='{now}',ModifyUserId='{loginUserInfo.account}',ModifyUserName='{loginUserInfo.realName}' where F_SchoolId='{F_SchoolId}' and AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' and OpenLessonDeptNo='{classInfoEntity.DeptNo}' and OpenLessonMajorNo='{classInfoEntity.MajorNo}' and LessonNo='{LessonNo}' and LessonSortNo='1' and ClassNo='{ClassNo}' "); + string classno = ClassNo.ToString(); + var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassNo == classno); + if (classInfoEntity != null) + { + this.BaseRepository("CollegeMIS").ExecuteBySql($"update StuScoreNotPass set IsEditable='1',EditUserId=null,BeginModifyDate=null,ModifyDate='{now}',ModifyUserId='{loginUserInfo.account}',ModifyUserName='{loginUserInfo.realName}' where F_SchoolId='{F_SchoolId}' and AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' and OpenLessonDeptNo='{classInfoEntity.DeptNo}' and OpenLessonMajorNo='{classInfoEntity.MajorNo}' and LessonNo='{LessonNo}' and LessonSortNo='1' and ClassNo='{classno}' "); + } } + else + { + string classroomno = ClassRoomNo.ToString(); + string lessonsection = LessonSection.ToString(); + var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassroomNo == classroomno); + if (classInfoEntity != null) + { + this.BaseRepository("CollegeMIS").ExecuteBySql($"update StuScoreNotPass set IsEditable='1',EditUserId=null,BeginModifyDate=null,ModifyDate='{now}',ModifyUserId='{loginUserInfo.account}',ModifyUserName='{loginUserInfo.realName}' where F_SchoolId='{F_SchoolId}' and AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' and ClassRoomNo='{classInfoEntity.ClassroomNo}' and LessonNo='{LessonNo}' and LessonSortNo='2' and LessonSection='{lessonsection}' "); + } + } + + } catch (Exception ex) { @@ -895,13 +1070,31 @@ order by bb.ScoreId"; var AcademicYearNo = queryParam["AcademicYearNo"].ToString(); var Semester = queryParam["Semester"].ToString(); var LessonNo = queryParam["LessonNo"].ToString(); - var ClassNo = queryParam["ClassNo"].ToString(); - - var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassNo == ClassNo); - if (classInfoEntity != null) + var ClassNo = queryParam["ClassNo"]; + var LessonSection = queryParam["LessonSection"]; + var ClassRoomNo = queryParam["ClassRoomNo"]; + + if (!ClassNo.IsEmpty()) { - this.BaseRepository("CollegeMIS").ExecuteBySql($"update StuScoreNotPass set CheckMark='{checkMark}' where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and OpenLessonDeptNo='" + classInfoEntity.DeptNo + "' and OpenLessonMajorNo='" + classInfoEntity.MajorNo + "' and LessonNo='" + LessonNo + "' and LessonSortNo='1' and ClassNo='" + ClassNo + "' "); + string classno = ClassNo.ToString(); + var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassNo == classno); + if (classInfoEntity != null) + { + this.BaseRepository("CollegeMIS").ExecuteBySql($"update StuScoreNotPass set CheckMark='{checkMark}' where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and OpenLessonDeptNo='" + classInfoEntity.DeptNo + "' and OpenLessonMajorNo='" + classInfoEntity.MajorNo + "' and LessonNo='" + LessonNo + "' and LessonSortNo='1' and ClassNo='" + classno + "' "); + } } + else + { + string classroomno = ClassRoomNo.ToString(); + string lessonsection = LessonSection.ToString(); + var classInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.ClassroomNo == classroomno); + if (classInfoEntity != null) + { + this.BaseRepository("CollegeMIS").ExecuteBySql($"update StuScoreNotPass set CheckMark='{checkMark}' where F_SchoolId='" + F_SchoolId + "' and AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and ClassRoomNo='" + classInfoEntity.ClassroomNo + "' and LessonNo='" + LessonNo + "' and LessonSortNo='2' and LessonSection='" + lessonsection + "' "); + } + } + + } catch (Exception ex) {