From 08bc0715e65a03a6d6ff1cf8b540c1c99fa34d44 Mon Sep 17 00:00:00 2001 From: dyy <807692433@qq.com> Date: Mon, 31 Jul 2023 17:37:09 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=A2=9E=E5=8A=A0=E3=80=91=E5=AE=9E?= =?UTF-8?q?=E8=AE=AD=E8=AF=BE=E6=88=90=E7=BB=A9=E5=BD=95=E5=85=A5=E3=80=81?= =?UTF-8?q?=E6=88=90=E7=BB=A9=E5=BD=95=E5=85=A5=E7=9B=91=E6=8E=A7=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StuScoreExperimentController.cs | 365 +++++++++++++ .../StuScoreExperiment/InputScoreIndex.cshtml | 110 ++++ .../StuScoreExperiment/InputScoreIndex.js | 487 ++++++++++++++++++ .../Views/StuScoreExperiment/Monitor.cshtml | 38 ++ .../Views/StuScoreExperiment/Monitor.js | 158 ++++++ .../Learun.Application.Web.csproj | 5 + .../EADateArrange/EADateArrangeService.cs | 1 + .../StuScoreExperimentService.cs | 6 +- 8 files changed, 1167 insertions(+), 3 deletions(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreExperimentController.cs create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreExperiment/InputScoreIndex.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreExperiment/InputScoreIndex.js create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreExperiment/Monitor.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreExperiment/Monitor.js diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreExperimentController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreExperimentController.cs new file mode 100644 index 000000000..4e7a8e605 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreExperimentController.cs @@ -0,0 +1,365 @@ +using Hangfire; +using Learun.Application.Organization; +using Learun.Application.TwoDevelopment.EducationalAdministration; +using Learun.Util; +using Newtonsoft.Json; +using System; +using System.Collections.Generic; +using System.Data; +using System.Linq; +using System.Web.Mvc; + +namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers +{ + /// + /// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园 + /// Copyright (c) 2013-2018 北京泉江科技有限公司 + /// 创 建:超级管理员 + /// 日 期:2019-11-05 15:25 + /// 描 述:全院学生实训课成绩录入 + /// + public class StuScoreExperimentController : MvcControllerBase + { + private StuScoreExperimentIBLL stuScoreExperimentIBLL = new StuScoreExperimentBLL(); + private UserIBLL userIBLL = new UserBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form() + { + return View(); + } + + /// + /// 全院学生实训课成绩录入 + /// + /// + [HttpGet] + public ActionResult InputScoreIndex() + { + return View(); + } + /// + /// 成绩录入监控管理 + /// + /// + [HttpGet] + public ActionResult Monitor() + { + return View(); + } + + #endregion + + #region 获取数据 + + /// + /// 获取列表数据 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetList(string queryJson) + { + var data = stuScoreExperimentIBLL.GetList(queryJson).OrderBy(x => x.StuNo); + return Success(data); + } + /// + /// 获取列表分页数据 + /// 分页参数 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = stuScoreExperimentIBLL.GetPageList(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + + /// + /// 获取表单数据 + /// 主键 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormData(string keyValue) + { + var data = stuScoreExperimentIBLL.GetEntity(keyValue); + return Success(data); + } + + /// + /// 获取列表数据 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetEntityByJson(string queryJson) + { + var data = stuScoreExperimentIBLL.GetEntityByJson(queryJson); + return Success(data); + } + /// + /// 获取监控管理列表 + /// + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetMonitorList(string queryJson) + { + var data = stuScoreExperimentIBLL.GetMonitorList(queryJson); + return Success(data); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// 主键 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + stuScoreExperimentIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// 主键 + /// + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, StuScoreExperimentEntity entity) + { + stuScoreExperimentIBLL.SaveEntity(keyValue, entity); + return Success("保存成功!"); + } + + #endregion + + #region 扩展数据 + + /// + /// 学年下拉框信息 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetAcademicYearNoData() + { + var data = stuScoreExperimentIBLL.GetAcademicYearNoData(); + + return Success(data); + } + + /// + /// 课程下拉框 带编号 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetLessonNoDataOfAllWithNo() + { + var data = stuScoreExperimentIBLL.GetLessonNoDataOfAll("", ""); + foreach (var item in data) + { + item.text = string.Format("{0}({1})", item.text, item.value); + } + + return Success(data); + } + /// + /// 课程下拉框 带编号 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetLessonNoDataWithNo() + { + var loginInfo = LoginUserInfo.Get(); + var data = stuScoreExperimentIBLL.GetLessonNoDataOfAll(loginInfo.account, loginInfo.Description); + foreach (var item in data) + { + item.text = string.Format("{0}({1})", item.text, item.value); + } + + return Success(data); + } + + /// + /// 班级下拉框信息 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetClassNoDataOfAll(string lessonNo) + { + var data = stuScoreExperimentIBLL.GetClassNoData("", "", lessonNo); + + return Success(data); + } + /// + /// 班级下拉框信息 + /// + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetClassNoData(string lessonNo) + { + var loginInfo = LoginUserInfo.Get(); + var data = stuScoreExperimentIBLL.GetClassNoData(loginInfo.account, loginInfo.Description, lessonNo); + + return Success(data); + } + + /// + /// 开始录入:占用成绩 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult StartInputScore(string queryJson) + { + var loginInfo = LoginUserInfo.Get(); + var name = loginInfo.account + "_" + loginInfo.realName + "_实训课成绩录入"; + stuScoreExperimentIBLL.StartInputScore(queryJson); + //添加任务 + var newDate = DateTime.Now.AddMinutes(30); + RecurringJob.AddOrUpdate(name, + () => SaveInputScoreStatus2(queryJson, name), + string.Format("{0} {1} * * *", newDate.Minute, newDate.Hour), TimeZoneInfo.Local); + return Success("操作成功"); + } + + /// + /// 续时 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult AddMinutes(string queryJson, int minutes) + { + var loginInfo = LoginUserInfo.Get(); + var name = loginInfo.account + "_" + loginInfo.realName + "_实训课成绩录入"; + //更新任务 + var newDate = DateTime.Now.AddMinutes(minutes); + RecurringJob.AddOrUpdate(name, + () => SaveInputScoreStatus2(queryJson, name), + string.Format("{0} {1} * * *", newDate.Minute, newDate.Hour), TimeZoneInfo.Local); + return Success("操作成功"); + } + + /// + /// 提交成绩 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult SaveInputScore(string data) + { + var list = JsonConvert.DeserializeObject>(data); + if (list.Any()) + { + stuScoreExperimentIBLL.SaveInputScore(list); + } + return Success("操作成功"); + } + /// + /// 提交成绩:取消占用 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult SaveInputScoreStatus(string queryJson) + { + var loginInfo = LoginUserInfo.Get(); + var name = loginInfo.account + "_" + loginInfo.realName + "_实训课成绩录入"; + + stuScoreExperimentIBLL.SaveInputScoreStatus(queryJson); + //删除任务 + RecurringJob.RemoveIfExists(name); + return Success("操作成功"); + } + /// + /// 提交成绩:取消占用【服务】 + /// + /// + public ActionResult SaveInputScoreStatus2(string queryJson, string name) + { + stuScoreExperimentIBLL.SaveInputScoreStatus2(queryJson, name); + //删除任务 + RecurringJob.RemoveIfExists(name); + + return Success("操作成功"); + } + + /// + /// 审核成绩 + /// + /// + /// 已审核:1;未审核:0; + /// + [HttpPost] + [AjaxOnly] + public ActionResult DoCheckScore(string queryJson, int checkMark) + { + stuScoreExperimentIBLL.DoCheckScore(queryJson, checkMark); + return Success("操作成功"); + } + + /// + /// 强制提交 + /// + /// + /// + /// + /// + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult Submit(string AcademicYearNo, string Semester, string LessonNo, string TeachClassNo, string EmpNo, string EditUserId) + { + stuScoreExperimentIBLL.SubmitStuScore(AcademicYearNo, Semester, LessonNo, TeachClassNo, EmpNo); + + var userEntity = userIBLL.GetEntityByAccount(EditUserId); + var name = EditUserId + "_" + userEntity?.F_RealName + "_实训课成绩录入"; + //删除任务 + RecurringJob.RemoveIfExists(name); + + return Success("操作成功!"); + } + + #endregion + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreExperiment/InputScoreIndex.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreExperiment/InputScoreIndex.cshtml new file mode 100644 index 000000000..a27dd2d68 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreExperiment/InputScoreIndex.cshtml @@ -0,0 +1,110 @@ +@{ + ViewBag.Title = "全院学生实训课成绩录入"; + Layout = "~/Views/Shared/_Index.cshtml"; +} + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+  查询 +
+
+ + +
+
+ +
提示:录入完成后,请务必点击“提交成绩”按钮,避免成绩丢失!
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuScoreExperiment/InputScoreIndex.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreExperiment/InputScoreIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreExperiment/InputScoreIndex.js new file mode 100644 index 000000000..8eef23684 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreExperiment/InputScoreIndex.js @@ -0,0 +1,487 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-11-05 15:25 + * 描 述:全院学生实训课成绩录入 + */ +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: 150, align: "left" }, + { label: '姓名', name: 'StuName', width: 100, align: "left" }, + { + label: "性别", name: "GenderNo", width: 40, align: "left", + formatter: function (cellvalue) { + return cellvalue == true ? "男" : "女"; + } + }, + { + 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: "ClassNo", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', + key: value, + keyId: 'classno', + callback: function (_data) { + callback(_data['classname']); + } + }); + } + }, + { label: "年级", name: "Grade", width: 40, align: "left" }, + { label: '学年', name: 'AcademicYearNo', width: 50, align: "left" }, + { label: '学期', name: 'Semester', width: 40, 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']); + } + }); + } + }, + ]; + headDataEdit = [ + { + label: '期末成绩', name: 'TermEndScore', width: 80, align: "left", + edit: { + type: 'input', + inputType: 'number', + change: function (row, rownum) { + row.Score = (parseFloat(row.TermEndScore || '0') * 1).toFixed(0); + $('#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/StuScoreExperiment/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/StuScoreExperiment/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/StuScoreExperiment/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/StuScoreExperiment/SaveInputScore', { data: JSON.stringify(rowdatas) }, function (res) { + if (res.code == 200) { + //提交成绩:取消占用 + learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuScoreExperiment/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/StuScoreExperiment/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/StuScoreExperiment/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/StuScoreExperiment/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/StuScoreExperiment/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/StuScoreExperiment/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/StuScoreExperiment/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/StuScoreExperiment/GetLessonNoDataOfAllWithNo', + value: 'value', + text: 'text', + select: function (item) { + if (!!item) { + $("#ClassNo").lrselectRefresh({ + url: top.$.rootUrl + '/EducationalAdministration/StuScoreExperiment/GetClassNoDataOfAll?lessonNo=' + item.value, + value: 'value', + text: 'text', + }); + } + } + }); + //班级 + $('#ClassNo').lrselect({ + placeholder: "请选择班级", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/StuScoreExperiment/GetClassNoDataOfAll', + 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').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/StuScoreExperiment/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/StuScoreExperiment/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 () { + 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.ClassNo == null || query.ClassNo == "") { + learun.alert.warning("请选择班级!"); + return false; + } + return query; + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreExperiment/Monitor.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreExperiment/Monitor.cshtml new file mode 100644 index 000000000..7cd07dbff --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreExperiment/Monitor.cshtml @@ -0,0 +1,38 @@ +@{ + ViewBag.Title = "实训课成绩录入监控管理"; + Layout = "~/Views/Shared/_Index.cshtml"; +} + +
+
+
+
+
+
+
+
+
+
+
+
+  查询 +
+
+
+
+ +
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuScoreExperiment/Monitor.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreExperiment/Monitor.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreExperiment/Monitor.js new file mode 100644 index 000000000..30e7fad21 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreExperiment/Monitor.js @@ -0,0 +1,158 @@ +/* * 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园(http://www.learun.cn) + * Copyright (c) 2013-2018 北京泉江科技有限公司 + * 创建人:超级管理员 + * 日 期:2019-11-05 15:25 + * 描 述:实训课成绩录入监控管理 + */ +var selectedRow; +var refreshGirdData; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.bind(); + page.initGird(); + }, + bind: function () { + //学年 + $('#AcademicYearNo').lrselect({ + width: '150px', + placeholder: "请选择学年", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/StuScoreExperiment/GetAcademicYearNoData', + value: 'value', + text: 'text' + }); + //学期 + $('#Semester').lrselect({ + width: '150px', + placeholder: "请选择学期", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/StuScore/GetSemesterData', + value: 'value', + text: 'text' + }); + // 查询 + $('#btn_Search').on('click', function () { + page.search({ AcademicYearNo: $('#AcademicYearNo').lrselectGet(), Semester: $('#Semester').lrselectGet() }); + }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + //强制提交 + $('#lr_submit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('TeachClassNo'); + if (learun.checkrow(keyValue)) { + var IsEditable = $('#gridtable').jfGridValue('IsEditable'); + if (IsEditable == "1") { + learun.alert.warning("当前项目无需提交!"); + return; + } + learun.layerConfirm('是否确认提交该项?未保存的成绩将会丢失!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/EducationalAdministration/StuScoreExperiment/Submit', + { + AcademicYearNo: $('#gridtable').jfGridValue('AcademicYearNo'), + Semester: $('#gridtable').jfGridValue('Semester'), + LessonNo: $('#gridtable').jfGridValue('LessonNo'), + TeachClassNo: $('#gridtable').jfGridValue('TeachClassNo'), + //EmpNo: $('#gridtable').jfGridValue('EmpNo'), + EditUserId: $('#gridtable').jfGridValue('EditUserId'), + }, + function () { + refreshGirdData(); + }); + } + }); + } + }); + }, + initGird: function () { + $('#gridtable').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/StuScoreExperiment/GetMonitorList', + headData: [ + { + label: "录入状态", name: "IsEditable", width: 80, align: "center", + formatter: function (cellvalue) { + return cellvalue == "1" ? "未占用" : "正在录入"; + } + }, + { label: '学年', name: 'AcademicYearNo', width: 100, align: "left" }, + { label: '学期', name: 'Semester', width: 80, align: "left" }, + { label: '课程编号', name: 'LessonNo', width: 100, align: "left" }, + { + label: '课程名称', name: 'LessonNo', width: 200, 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: "TeachClassNo", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', + key: value, + keyId: 'classno', + callback: function (_data) { + callback(_data['classname']); + } + }); + } + }, + { label: '代课教师编号', name: 'EmpNo', width: 100, align: "left" }, + { + label: '代课教师姓名', name: 'EmpNo', width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'TeacherInfo', + key: value, + keyId: 'f_account', + callback: function (_data) { + callback(_data['f_realname']); + } + }); + } + }, + { label: '占用教师编号', name: 'EditUserId', width: 100, align: "left" }, + { + label: '占用教师姓名', name: 'EditUserId', width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'TeacherInfo', + key: value, + keyId: 'f_account', + callback: function (_data) { + callback(_data['f_realname']); + } + }); + } + }, + { label: '开始录入日期', name: 'BeginModifyDate', width: 150, align: "left" }, + { label: '最后保存日期', name: 'ModifyDate', width: 150, align: "left" }, + + ], + //mainId: 'ScoreId', + isPage: false + }); + //page.search(); + }, + search: function (param) { + param = param || {}; + param.AcademicYearNo = $('#AcademicYearNo').lrselectGet(); + param.Semester = $('#Semester').lrselectGet(); + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + page.search(); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj index 9ae9f9ef1..1c788c0fa 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 @@ -320,6 +320,7 @@ + @@ -1364,6 +1365,8 @@ + + @@ -8165,6 +8168,8 @@ + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EADateArrange/EADateArrangeService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EADateArrange/EADateArrangeService.cs index 5db71ba07..659a9687d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EADateArrange/EADateArrangeService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EADateArrange/EADateArrangeService.cs @@ -436,6 +436,7 @@ and a.Academicyearno='" + entity.AcademicYearNo + "' and a.Semester='" + entity. TermEndScore = 0, OtherScore = 0, CheckMark = "0", + IsEditable="1", F_SchoolId = entity.F_SchoolId, }; if (StuScoreExperimentList.Count(x => x.F_SchoolId == insertData.F_SchoolId && x.AcademicYearNo == insertData.AcademicYearNo && diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreExperiment/StuScoreExperimentService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreExperiment/StuScoreExperimentService.cs index c17d78a93..678e508eb 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreExperiment/StuScoreExperimentService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreExperiment/StuScoreExperimentService.cs @@ -208,7 +208,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration // 虚拟参数 var dp = new DynamicParameters(new { }); var strSql = new StringBuilder(); - strSql.Append("select AcademicYearNo,Semester,lessonno,TeachClassNo,EmpNo,IsEditable,EditUserId,BeginModifyDate,ModifyDate from StuScoreExperiment where 1=1 "); + strSql.Append("select AcademicYearNo,Semester,lessonno,TeachClassNo,IsEditable,EditUserId,BeginModifyDate,ModifyDate from StuScoreExperiment where 1=1 "); if (!queryParam["AcademicYearNo"].IsEmpty()) { strSql.Append(" and AcademicYearNo = @AcademicYearNo "); @@ -219,7 +219,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration strSql.Append(" and Semester =@Semester "); dp.Add("Semester", "" + queryParam["Semester"].ToString() + "", DbType.String); } - strSql.Append(" group by AcademicYearNo,Semester,lessonno, TeachClassNo, EmpNo, IsEditable, EditUserId, BeginModifyDate, ModifyDate order by IsEditable, BeginModifyDate, edituserid "); + strSql.Append(" group by AcademicYearNo,Semester,lessonno, TeachClassNo, IsEditable, EditUserId, BeginModifyDate, ModifyDate order by IsEditable, BeginModifyDate, edituserid "); return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp); } catch (Exception ex) @@ -594,7 +594,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration this.BaseRepository("CollegeMIS").ExecuteBySql( @"update StuScoreExperiment set IsEditable=1,EditUserId=null,BeginModifyDate=null where AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and LessonNo='" + - LessonNo + "' and TeachClassNo='" + TeachClassNo + "' and EmpNo='" + EmpNo + "'"); + LessonNo + "' and TeachClassNo='" + TeachClassNo + "'"); } catch (Exception ex) {