Преглед изворни кода

【增加】实训课成绩录入、成绩录入监控;

怀来职教中心中职
dyy пре 1 година
родитељ
комит
08bc0715e6
8 измењених фајлова са 1167 додато и 3 уклоњено
  1. +365
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuScoreExperimentController.cs
  2. +110
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreExperiment/InputScoreIndex.cshtml
  3. +487
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreExperiment/InputScoreIndex.js
  4. +38
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreExperiment/Monitor.cshtml
  5. +158
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreExperiment/Monitor.js
  6. +5
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj
  7. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EADateArrange/EADateArrangeService.cs
  8. +3
    -3
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/StuScoreExperiment/StuScoreExperimentService.cs

+ 365
- 0
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
{
/// <summary>
/// 版 本 Learun-ADMS-Ultimate V7.0.0 数字化智慧校园
/// Copyright (c) 2013-2018 北京泉江科技有限公司
/// 创 建:超级管理员
/// 日 期:2019-11-05 15:25
/// 描 述:全院学生实训课成绩录入
/// </summary>
public class StuScoreExperimentController : MvcControllerBase
{
private StuScoreExperimentIBLL stuScoreExperimentIBLL = new StuScoreExperimentBLL();
private UserIBLL userIBLL = new UserBLL();

#region 视图功能

/// <summary>
/// 主页面
/// <summary>
/// <returns></returns>
[HttpGet]
public ActionResult Index()
{
return View();
}
/// <summary>
/// 表单页
/// <summary>
/// <returns></returns>
[HttpGet]
public ActionResult Form()
{
return View();
}

/// <summary>
/// 全院学生实训课成绩录入
/// <summary>
/// <returns></returns>
[HttpGet]
public ActionResult InputScoreIndex()
{
return View();
}
/// <summary>
/// 成绩录入监控管理
/// </summary>
/// <returns></returns>
[HttpGet]
public ActionResult Monitor()
{
return View();
}

#endregion

#region 获取数据

/// <summary>
/// 获取列表数据
/// <summary>
/// <returns></returns>
[HttpGet]
[AjaxOnly]
public ActionResult GetList(string queryJson)
{
var data = stuScoreExperimentIBLL.GetList(queryJson).OrderBy(x => x.StuNo);
return Success(data);
}
/// <summary>
/// 获取列表分页数据
/// <param name="pagination">分页参数</param>
/// <summary>
/// <returns></returns>
[HttpGet]
[AjaxOnly]
public ActionResult GetPageList(string pagination, string queryJson)
{
Pagination paginationobj = pagination.ToObject<Pagination>();
var data = stuScoreExperimentIBLL.GetPageList(paginationobj, queryJson);
var jsonData = new
{
rows = data,
total = paginationobj.total,
page = paginationobj.page,
records = paginationobj.records
};
return Success(jsonData);
}

/// <summary>
/// 获取表单数据
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
[HttpGet]
[AjaxOnly]
public ActionResult GetFormData(string keyValue)
{
var data = stuScoreExperimentIBLL.GetEntity(keyValue);
return Success(data);
}

/// <summary>
/// 获取列表数据
/// <summary>
/// <returns></returns>
[HttpGet]
[AjaxOnly]
public ActionResult GetEntityByJson(string queryJson)
{
var data = stuScoreExperimentIBLL.GetEntityByJson(queryJson);
return Success(data);
}
/// <summary>
/// 获取监控管理列表
/// </summary>
/// <param name="queryJson"></param>
/// <returns></returns>
[HttpGet]
[AjaxOnly]
public ActionResult GetMonitorList(string queryJson)
{
var data = stuScoreExperimentIBLL.GetMonitorList(queryJson);
return Success(data);
}
#endregion

#region 提交数据

/// <summary>
/// 删除实体数据
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
[HttpPost]
[AjaxOnly]
public ActionResult DeleteForm(string keyValue)
{
stuScoreExperimentIBLL.DeleteEntity(keyValue);
return Success("删除成功!");
}
/// <summary>
/// 保存实体数据(新增、修改)
/// <param name="keyValue">主键</param>
/// <summary>
/// <returns></returns>
[HttpPost]
[ValidateAntiForgeryToken]
[AjaxOnly]
public ActionResult SaveForm(string keyValue, StuScoreExperimentEntity entity)
{
stuScoreExperimentIBLL.SaveEntity(keyValue, entity);
return Success("保存成功!");
}
#endregion

#region 扩展数据

/// <summary>
/// 学年下拉框信息
/// </summary>
/// <returns></returns>
[HttpGet]
[AjaxOnly]
public ActionResult GetAcademicYearNoData()
{
var data = stuScoreExperimentIBLL.GetAcademicYearNoData();

return Success(data);
}

/// <summary>
/// 课程下拉框 带编号
/// </summary>
/// <returns></returns>
[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);
}
/// <summary>
/// 课程下拉框 带编号
/// </summary>
/// <returns></returns>
[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);
}

/// <summary>
/// 班级下拉框信息
/// </summary>
/// <returns></returns>
[HttpGet]
[AjaxOnly]
public ActionResult GetClassNoDataOfAll(string lessonNo)
{
var data = stuScoreExperimentIBLL.GetClassNoData("", "", lessonNo);

return Success(data);
}
/// <summary>
/// 班级下拉框信息
/// </summary>
/// <returns></returns>
[HttpGet]
[AjaxOnly]
public ActionResult GetClassNoData(string lessonNo)
{
var loginInfo = LoginUserInfo.Get();
var data = stuScoreExperimentIBLL.GetClassNoData(loginInfo.account, loginInfo.Description, lessonNo);

return Success(data);
}

/// <summary>
/// 开始录入:占用成绩
/// <summary>
/// <returns></returns>
[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("操作成功");
}

/// <summary>
/// 续时
/// <summary>
/// <returns></returns>
[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("操作成功");
}

/// <summary>
/// 提交成绩
/// <summary>
/// <returns></returns>
[HttpPost]
[AjaxOnly]
public ActionResult SaveInputScore(string data)
{
var list = JsonConvert.DeserializeObject<List<StuScoreExperimentEntity>>(data);
if (list.Any())
{
stuScoreExperimentIBLL.SaveInputScore(list);
}
return Success("操作成功");
}
/// <summary>
/// 提交成绩:取消占用
/// </summary>
/// <returns></returns>
[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("操作成功");
}
/// <summary>
/// 提交成绩:取消占用【服务】
/// <summary>
/// <returns></returns>
public ActionResult SaveInputScoreStatus2(string queryJson, string name)
{
stuScoreExperimentIBLL.SaveInputScoreStatus2(queryJson, name);
//删除任务
RecurringJob.RemoveIfExists(name);

return Success("操作成功");
}

/// <summary>
/// 审核成绩
/// </summary>
/// <param name="queryJson"></param>
/// <param name="checkMark">已审核:1;未审核:0;</param>
/// <returns></returns>
[HttpPost]
[AjaxOnly]
public ActionResult DoCheckScore(string queryJson, int checkMark)
{
stuScoreExperimentIBLL.DoCheckScore(queryJson, checkMark);
return Success("操作成功");
}

/// <summary>
/// 强制提交
/// </summary>
/// <param name="AcademicYearNo"></param>
/// <param name="Semester"></param>
/// <param name="LessonNo"></param>
/// <param name="TeachClassNo"></param>
/// <param name="EmpNo"></param>
/// <returns></returns>
[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
}
}

+ 110
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreExperiment/InputScoreIndex.cshtml Прегледај датотеку

@@ -0,0 +1,110 @@
@{
ViewBag.Title = "全院学生实训课成绩录入";
Layout = "~/Views/Shared/_Index.cshtml";
}
<style>
.lr-select {
width: 150px;
}
#LessonNo {
width: 180px;
}

.lr-selectLittle {
width: 80px;
}
.lr-layout-tool {
height: 80px;
}

.lr-layout-center .lr-layout-wrap.lr-layout-wrap-notitle {
padding-top: 80px;
}

.divRow {
position: absolute;
width: 100%;
height: 55px;
top: 0;
left: 0;
}

.scaleRow {
top: 55px;
padding: 2px 10px;
height: 25px;
}

.scaleRow .timeBox {
float: right;
padding-right: 30px;
}

.scaleRow .tipBox {
display: inline-block;
color: #ff0000;
margin-left: 10px;
}
#addMinutesBtn {
display: inline-block;
cursor: pointer;
background-color: blue;
color: #fff;
padding: 1px 5px;
border-radius: 4px;
}
</style>
<div class="lr-layout">
<div class="lr-layout-center">
<div class="lr-layout-wrap lr-layout-wrap-notitle ">
<div class="lr-layout-tool">
<div class="selectRow divRow">
<div class="lr-layout-tool-left">
<div class="lr-layout-tool-item">
<div id="F_SchoolId" type="lrselect" class="lr-select"></div>
</div>
<div class="lr-layout-tool-item">
<div id="AcademicYearNo" type="lrselect" class="lr-select lr-selectLittle"></div>
</div>
<div class="lr-layout-tool-item">
<div id="Semester" type="lrselect" class="lr-select lr-selectLittle"></div>
</div>
<div class="lr-layout-tool-item">
<div id="LessonNo" type="lrselect" class="lr-select"></div>
</div>
<div class="lr-layout-tool-item">
<div id="ClassNo" type="lrselect" class="lr-select"></div>
</div>

<div class="lr-layout-tool-item">
<a id="btn_Search" class="btn btn-primary btn-sm"><i class="fa fa-search"></i>&nbsp;查询</a>
</div>
</div>
<div class="lr-layout-tool-right">
<div class="btn-group btn-group-sm">
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a>
</div>
<div class=" btn-group btn-group-sm" learun-authorize="yes">
<a id="lr_input" class="btn btn-default"><i class="fa fa-edit">&nbsp;开始录入</i></a>
<a id="lr_save" class="btn btn-default" style="display:none;"><i class="fa fa-edit">&nbsp;提交成绩</i></a>
<a id="lr_check" class="btn btn-default"><i class="fa fa-lock">&nbsp;提交教务处</i></a>
<a id="lr_uncheck" class="btn btn-default"><i class="fa fa-lock">&nbsp;去审核成绩</i></a>
</div>
</div>

</div>
<div class="scaleRow divRow">

<div class="tipBox">提示:录入完成后,请务必点击“提交成绩”按钮,避免成绩丢失!</div>
<div class="timeBox" style="display:none;">
倒计时:
<span id="minutes" data-minutes="30"></span>分钟(<span id="seconds" data-seconds="60"></span>秒)
<div id="addMinutesBtn" data-minutes="30">续时</div>
</div>
</div>
</div>
<div class="lr-layout-body" id="gridtable"></div>
</div>
</div>
</div>
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuScoreExperiment/InputScoreIndex.js")

+ 487
- 0
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" ? "<span class=\"label label-success\">已审核</span>" : "<span class=\"label label-danger\">未审核</span>";
}
},
{ 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();
}

+ 38
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuScoreExperiment/Monitor.cshtml Прегледај датотеку

@@ -0,0 +1,38 @@
@{
ViewBag.Title = "实训课成绩录入监控管理";
Layout = "~/Views/Shared/_Index.cshtml";
}
<style>
.lr-select {
width: 150px;
}
</style>
<div class="lr-layout">
<div class="lr-layout-center">
<div class="lr-layout-wrap lr-layout-wrap-notitle ">
<div class="lr-layout-tool">
<div class="lr-layout-tool-left">
<div class="lr-layout-tool-item">
<div id="AcademicYearNo" type="lrselect" class="lr-select"></div>
</div>
<div class="lr-layout-tool-item">
<div id="Semester" type="lrselect" class="lr-select"></div>
</div>
<div class="lr-layout-tool-item">
<a id="btn_Search" class="btn btn-primary btn-sm"><i class="fa fa-search"></i>&nbsp;查询</a>
</div>
</div>
<div class="lr-layout-tool-right">
<div class=" btn-group btn-group-sm">
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a>
</div>
<div class=" btn-group btn-group-sm" learun-authorize="yes">
<a id="lr_submit" class="btn btn-default"><i class="fa fa-lock"></i>&nbsp;强制提交</a>
</div>
</div>
</div>
<div class="lr-layout-body" id="gridtable"></div>
</div>
</div>
</div>
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/StuScoreExperiment/Monitor.js")

+ 158
- 0
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" ? "<span class=\"label label-success\">未占用</span>" : "<span class=\"label label-danger\">正在录入</span>";
}
},
{ 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();
}

+ 5
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj Прегледај датотеку

@@ -320,6 +320,7 @@
<Compile Include="Areas\EducationalAdministration\Controllers\ArrangeLessonTermAttemperController.cs" /> <Compile Include="Areas\EducationalAdministration\Controllers\ArrangeLessonTermAttemperController.cs" />
<Compile Include="Areas\EducationalAdministration\Controllers\AwardAndPunishmentController.cs" /> <Compile Include="Areas\EducationalAdministration\Controllers\AwardAndPunishmentController.cs" />
<Compile Include="Areas\EducationalAdministration\Controllers\AwardPunishInfoController.cs" /> <Compile Include="Areas\EducationalAdministration\Controllers\AwardPunishInfoController.cs" />
<Compile Include="Areas\EducationalAdministration\Controllers\StuScoreExperimentController.cs" />
<Compile Include="Areas\EducationalAdministration\Controllers\TeacherServiceInfoController.cs" /> <Compile Include="Areas\EducationalAdministration\Controllers\TeacherServiceInfoController.cs" />
<Compile Include="Areas\EducationalAdministration\Controllers\BookPutInController.cs" /> <Compile Include="Areas\EducationalAdministration\Controllers\BookPutInController.cs" />
<Compile Include="Areas\EducationalAdministration\Controllers\BookReturnController.cs" /> <Compile Include="Areas\EducationalAdministration\Controllers\BookReturnController.cs" />
@@ -1364,6 +1365,8 @@
<Content Include="Areas\EducationalAdministration\Views\StuPunishment\DeptIndex.js" /> <Content Include="Areas\EducationalAdministration\Views\StuPunishment\DeptIndex.js" />
<Content Include="Areas\EducationalAdministration\Views\StuPunishment\MajorIndex.js" /> <Content Include="Areas\EducationalAdministration\Views\StuPunishment\MajorIndex.js" />
<Content Include="Areas\EducationalAdministration\Views\StuPunishment\StuIndex.js" /> <Content Include="Areas\EducationalAdministration\Views\StuPunishment\StuIndex.js" />
<Content Include="Areas\EducationalAdministration\Views\StuScoreExperiment\InputScoreIndex.js" />
<Content Include="Areas\EducationalAdministration\Views\StuScoreExperiment\Monitor.js" />
<Content Include="Areas\EducationalAdministration\Views\StuScoreNotPassTwo\IndexUnpassTwo.js" /> <Content Include="Areas\EducationalAdministration\Views\StuScoreNotPassTwo\IndexUnpassTwo.js" />
<Content Include="Areas\EducationalAdministration\Views\StuScoreNotPassTwo\InputScoreIndexInTeacher.js" /> <Content Include="Areas\EducationalAdministration\Views\StuScoreNotPassTwo\InputScoreIndexInTeacher.js" />
<Content Include="Areas\EducationalAdministration\Views\StuScoreNotPassTwo\InputScoreIndex.js" /> <Content Include="Areas\EducationalAdministration\Views\StuScoreNotPassTwo\InputScoreIndex.js" />
@@ -8165,6 +8168,8 @@
<Content Include="Areas\PersonnelManagement\Views\SRPaper\FormDeptSchool.cshtml" /> <Content Include="Areas\PersonnelManagement\Views\SRPaper\FormDeptSchool.cshtml" />
<Content Include="Areas\PersonnelManagement\Views\SRProject\FormDeptSchool.cshtml" /> <Content Include="Areas\PersonnelManagement\Views\SRProject\FormDeptSchool.cshtml" />
<Content Include="Areas\PersonnelManagement\Views\SRWork\FormDeptSchool.cshtml" /> <Content Include="Areas\PersonnelManagement\Views\SRWork\FormDeptSchool.cshtml" />
<Content Include="Areas\EducationalAdministration\Views\StuScoreExperiment\InputScoreIndex.cshtml" />
<Content Include="Areas\EducationalAdministration\Views\StuScoreExperiment\Monitor.cshtml" />
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" /> <None Include="Properties\PublishProfiles\CustomProfile.pubxml" />
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" /> <None Include="Properties\PublishProfiles\FolderProfile.pubxml" />
<Content Include="Views\Login\Default-beifen.cshtml" /> <Content Include="Views\Login\Default-beifen.cshtml" />


+ 1
- 0
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, TermEndScore = 0,
OtherScore = 0, OtherScore = 0,
CheckMark = "0", CheckMark = "0",
IsEditable="1",
F_SchoolId = entity.F_SchoolId, F_SchoolId = entity.F_SchoolId,
}; };
if (StuScoreExperimentList.Count(x => x.F_SchoolId == insertData.F_SchoolId && x.AcademicYearNo == insertData.AcademicYearNo && if (StuScoreExperimentList.Count(x => x.F_SchoolId == insertData.F_SchoolId && x.AcademicYearNo == insertData.AcademicYearNo &&


+ 3
- 3
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 dp = new DynamicParameters(new { });
var strSql = new StringBuilder(); 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()) if (!queryParam["AcademicYearNo"].IsEmpty())
{ {
strSql.Append(" and AcademicYearNo = @AcademicYearNo "); strSql.Append(" and AcademicYearNo = @AcademicYearNo ");
@@ -219,7 +219,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
strSql.Append(" and Semester =@Semester "); strSql.Append(" and Semester =@Semester ");
dp.Add("Semester", "" + queryParam["Semester"].ToString() + "", DbType.String); 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<StuScoreExperimentEntity>(strSql.ToString(), dp); return this.BaseRepository("CollegeMIS").FindList<StuScoreExperimentEntity>(strSql.ToString(), dp);
} }
catch (Exception ex) catch (Exception ex)
@@ -594,7 +594,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
this.BaseRepository("CollegeMIS").ExecuteBySql( this.BaseRepository("CollegeMIS").ExecuteBySql(
@"update StuScoreExperiment set IsEditable=1,EditUserId=null,BeginModifyDate=null @"update StuScoreExperiment set IsEditable=1,EditUserId=null,BeginModifyDate=null
where AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and LessonNo='" + where AcademicYearNo='" + AcademicYearNo + "' and Semester='" + Semester + "' and LessonNo='" +
LessonNo + "' and TeachClassNo='" + TeachClassNo + "' and EmpNo='" + EmpNo + "'");
LessonNo + "' and TeachClassNo='" + TeachClassNo + "'");
} }
catch (Exception ex) catch (Exception ex)
{ {


Loading…
Откажи
Сачувај