From e345dc28cd95aa8d5262dedfa2848c3636242ade Mon Sep 17 00:00:00 2001
From: zhangli <1109134334@qq.com>
Date: Wed, 20 Apr 2022 18:31:43 +0800
Subject: [PATCH] =?UTF-8?q?=E6=8E=92=E8=80=83=E8=AF=BE=E7=A8=8B=E5=AE=A1?=
=?UTF-8?q?=E6=A0=B8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../Exam_ExamPlanLessonController.cs | 13 +++-
.../Views/Exam_ExamPlanLesson/Index.cshtml | 1 +
.../Views/Exam_ExamPlanLesson/Index.js | 78 ++++++++++++++++++-
.../Exam_ExamPlanLessonBLL.cs | 4 +-
.../Exam_ExamPlanLessonIBLL.cs | 2 +-
.../Exam_ExamPlanLessonService.cs | 6 +-
6 files changed, 93 insertions(+), 11 deletions(-)
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamPlanLessonController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamPlanLessonController.cs
index e2942f2eb..9c83633d3 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamPlanLessonController.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamPlanLessonController.cs
@@ -191,9 +191,18 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
///
[HttpPost]
[AjaxOnly]
- public ActionResult Check(string keyValue)
+ public ActionResult Check(string keyValue, int ELCheckMark)
{
- exam_ExamPlanLessonIBLL.Check(keyValue);
+ if (ELCheckMark == 1)
+ {
+ var entity = exam_ExamPlanLessonIBLL.GetExam_ExamPlanLessonEntity(keyValue);
+ if (entity.SeatCount < entity.RealStuCount)
+ {
+ return Fail("考场座位数不足!");
+ }
+ }
+
+ exam_ExamPlanLessonIBLL.Check(keyValue, ELCheckMark);
return Success("审核成功!");
}
///
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/Index.cshtml
index 257c74879..3a9ba3fc7 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/Index.cshtml
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/Index.cshtml
@@ -51,6 +51,7 @@
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/Index.js
index e54256099..71a6b8002 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/Index.js
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/Index.js
@@ -9,6 +9,7 @@ var refreshGirdData;
var EPId = request('EPId');
//安排课程表Id
var EPLId;
+var ELCheckMark;
var bootstrap = function ($, learun) {
"use strict";
var page = {
@@ -23,8 +24,11 @@ var bootstrap = function ($, learun) {
nodeClick: function (item) {
//安排课程表ID(Exam_ExamPlanLesson)
EPLId = item.id;
+ //显示考试时间
page.show(EPLId);
page.search({ EPLId: item.id });
+
+ $('#titleinfo').html(item.text);
}
});
// 刷新
@@ -48,9 +52,43 @@ var bootstrap = function ($, learun) {
return learun.alert.warning("请选择考试课程!");
}
});
+ //审核
+ $('#lr_check').on('click', function () {
+ if (!!EPLId) {
+ if (ELCheckMark == 1) {
+ return learun.alert.warning('该项已审核!');
+ }
+ learun.layerConfirm('是否确认审核!', function (res) {
+ if (res) {
+ learun.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/Check', { keyValue: EPLId, ELCheckMark: 1 }, function () {
+ refreshGirdData();
+ });
+ }
+ });
+ } else {
+ return learun.alert.warning("请选择考试课程!");
+ }
+ });
+ //去审核
+ $('#lr_nocheck').on('click', function () {
+ if (!!EPLId) {
+ learun.layerConfirm('是否确认去审核!', function (res) {
+ if (res) {
+ learun.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/Check', { keyValue: EPLId, ELCheckMark: 0 }, function () {
+ refreshGirdData();
+ });
+ }
+ });
+ } else {
+ return learun.alert.warning("请选择考试课程!");
+ }
+ });
//班级 新增
$('#lr_add_Class').on('click', function () {
if (!!EPLId) {
+ if (ELCheckMark == 1) {
+ return learun.alert.warning("该项已审核!");
+ }
learun.layerForm({
id: 'formclass',
title: '新增班级',
@@ -69,6 +107,9 @@ var bootstrap = function ($, learun) {
$('#lr_delete_Class').on('click', function () {
var keyValue = $('#gridtable_Class').jfGridValue('EPCId');
if (learun.checkrow(keyValue)) {
+ if (ELCheckMark == 1) {
+ return learun.alert.warning("该项已审核!");
+ }
learun.layerConfirm('是否确认删除选中记录!', function (res) {
if (res) {
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/DeleteClass', { keyValue: keyValue }, function () {
@@ -78,10 +119,13 @@ var bootstrap = function ($, learun) {
});
}
});
-
+
//考场 新增
$('#lr_add_Room').on('click', function () {
if (!!EPLId) {
+ if (ELCheckMark == 1) {
+ return learun.alert.warning("该项已审核!");
+ }
learun.layerForm({
id: 'formroom',
title: '新增考场',
@@ -101,6 +145,9 @@ var bootstrap = function ($, learun) {
$('#lr_delete_Room').on('click', function () {
var keyValue = $('#gridtable_Room').jfGridValue('EPRId');
if (learun.checkrow(keyValue)) {
+ if (ELCheckMark == 1) {
+ return learun.alert.warning("该项已审核!");
+ }
learun.layerConfirm('是否确认删除选中记录!', function (res) {
if (res) {
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/DeleteRoom', { keyValue: keyValue }, function () {
@@ -158,8 +205,33 @@ var bootstrap = function ($, learun) {
var res = learun.httpGet(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/GetFormData?keyValue=' + EPLId);
var data = res.data.Exam_ExamPlanLesson;
- $('#examDate').html(learun.formatDate(data.ExamDate, 'yyyy-MM-dd'));
- $('#examTime').html(data.ExamTime);
+ ELCheckMark = data.ELCheckMark;
+ if (!!data.ExamDate) {
+ $('#examDate').html(learun.formatDate(data.ExamDate, 'yyyy-MM-dd'));
+ $('#examTime').html(data.ExamTime);
+ } else {
+ $('#examDate').html('');
+ $('#examTime').html('');
+ //未设置考试时间
+ learun.layerConfirm('请先设置考试时间!', function (res) {
+ if (res) {
+ if (!!EPLId) {
+ learun.layerForm({
+ id: 'form',
+ title: '设置考试时间',
+ url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/Form?keyValue=' + EPLId,
+ width: 600,
+ height: 400,
+ callBack: function (id) {
+ return top[id].acceptClick(refreshGirdData);
+ }
+ });
+ } else {
+ return learun.alert.warning("请选择考试课程!");
+ }
+ }
+ });
+ }
}
}
};
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonBLL.cs
index 5c09dda96..d21c1fc14 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonBLL.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonBLL.cs
@@ -137,11 +137,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// 审核
///
/// 主键
- public void Check(string keyValue)
+ public void Check(string keyValue,int ELCheckMark)
{
try
{
- exam_ExamPlanLessonService.Check(keyValue);
+ exam_ExamPlanLessonService.Check(keyValue, ELCheckMark);
}
catch (Exception ex)
{
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonIBLL.cs
index 5e3ba6060..575c23e50 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonIBLL.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonIBLL.cs
@@ -41,7 +41,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
///
/// 主键
void DeleteEntity(string keyValue);
- void Check(string keyValue);
+ void Check(string keyValue,int ELCheckMark);
void InitExamPlanLesson(string EPId);
///
/// 保存实体数据(新增、修改)
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonService.cs
index d0c278ce4..e5c4bbde7 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonService.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanLesson/Exam_ExamPlanLessonService.cs
@@ -141,12 +141,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// 审核
///
///
- public void Check(string keyValue)
+ public void Check(string keyValue, int ELCheckMark)
{
try
{
- //未完成
- //this.BaseRepository("CollegeMIS").Delete(t => t.EPLId == keyValue);
+ string sql = $"update Exam_ExamPlanLesson set ELCheckMark='{ELCheckMark}' where EPLId='{keyValue}'";
+ this.BaseRepository("CollegeMIS").ExecuteBySql(sql);
}
catch (Exception ex)
{