@@ -357,6 +357,24 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
return Success("操作成功!"); | return Success("操作成功!"); | ||||
} | } | ||||
/// <summary> | |||||
/// 审核所有考试课程 | |||||
/// </summary> | |||||
/// <param name="keyValue"></param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult CheckAllPlanLesson(string keyValue) | |||||
{ | |||||
var res = exam_ExamPlanLessonIBLL.CheckAllPlanLesson(keyValue); | |||||
if (!res.flag) | |||||
{ | |||||
return Fail(res.str); | |||||
} | |||||
return Success("操作成功!"); | |||||
} | |||||
#endregion | #endregion | ||||
} | } | ||||
@@ -2,7 +2,7 @@ | |||||
ViewBag.Title = "考试记录表"; | ViewBag.Title = "考试记录表"; | ||||
Layout = "~/Views/Shared/_Index.cshtml"; | Layout = "~/Views/Shared/_Index.cshtml"; | ||||
} | } | ||||
<div class="lr-layout " > | |||||
<div class="lr-layout "> | |||||
<div class="lr-layout-center"> | <div class="lr-layout-center"> | ||||
<div class="lr-layout-wrap lr-layout-wrap-notitle "> | <div class="lr-layout-wrap lr-layout-wrap-notitle "> | ||||
<div class="lr-layout-tool"> | <div class="lr-layout-tool"> | ||||
@@ -72,6 +72,7 @@ | |||||
<li id="lr_examclass"><a><i></i> <span class="lrlt">一键安排班级</span></a></li> | <li id="lr_examclass"><a><i></i> <span class="lrlt">一键安排班级</span></a></li> | ||||
<li id="lr_examroom"><a><i></i> <span class="lrlt">一键安排考场</span></a></li> | <li id="lr_examroom"><a><i></i> <span class="lrlt">一键安排考场</span></a></li> | ||||
<li id="lr_examteacher"><a><i></i> <span class="lrlt">一键安排监考老师</span></a></li> | <li id="lr_examteacher"><a><i></i> <span class="lrlt">一键安排监考老师</span></a></li> | ||||
<li id="lr_checkAll"><a><i></i> <span class="lrlt">一键审核所有考试课程</span></a></li> | |||||
</ul> | </ul> | ||||
</div> | </div> | ||||
@@ -237,7 +237,21 @@ var bootstrap = function ($, learun) { | |||||
}); | }); | ||||
} | } | ||||
}); | }); | ||||
//一键审核所有考试课程 | |||||
$('#lr_checkAll').on('click', | |||||
function () { | |||||
var keyValue = $('#gridtable').jfGridValue('EPId'); | |||||
if (learun.checkrow(keyValue)) { | |||||
learun.layerConfirm('是否确认审核所有考试课程!', function (res) { | |||||
if (res) { | |||||
learun.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/CheckAllPlanLesson', { keyValue: keyValue }, function () { | |||||
refreshGirdData(); | |||||
}); | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
//老师时间管理 | //老师时间管理 | ||||
$('#lr_teacherTimeManage').on('click', function () { | $('#lr_teacherTimeManage').on('click', function () { | ||||
@@ -340,6 +340,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
public (bool flag, string str) CheckAllPlanLesson(string EPId) | |||||
{ | |||||
try | |||||
{ | |||||
return exam_ExamPlanLessonService.CheckAllPlanLesson(EPId); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | #endregion | ||||
} | } | ||||
@@ -57,6 +57,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
(bool flag, string msg) PlanLessonTimeByEPId(string keyValue); | (bool flag, string msg) PlanLessonTimeByEPId(string keyValue); | ||||
(bool flag, string str) IsAllowSave(Exam_ExamPlanLessonEntity entity); | (bool flag, string str) IsAllowSave(Exam_ExamPlanLessonEntity entity); | ||||
(bool flag, string lessonname) IsExamTimeClash(Exam_ExamPlanLessonEntity entity); | (bool flag, string lessonname) IsExamTimeClash(Exam_ExamPlanLessonEntity entity); | ||||
(bool flag, string str) CheckAllPlanLesson(string keyValue); | |||||
#endregion | #endregion | ||||
} | } | ||||
@@ -561,6 +561,7 @@ left join CdLessonType ltype on info.LessonTypeId=ltype.LTId | |||||
} | } | ||||
} | } | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
/// 自动生成考试课程排考时间 | /// 自动生成考试课程排考时间 | ||||
/// </summary> | /// </summary> | ||||
@@ -683,6 +684,40 @@ left join CdLessonType ltype on info.LessonTypeId=ltype.LTId | |||||
} | } | ||||
} | } | ||||
/// <summary> | |||||
/// 一键审核考试课程 | |||||
/// </summary> | |||||
/// <param name="EPId"></param> | |||||
/// <returns></returns> | |||||
public (bool flag, string str) CheckAllPlanLesson(string EPId) | |||||
{ | |||||
var db = this.BaseRepository("CollegeMIS"); | |||||
try | |||||
{ | |||||
db.BeginTrans(); | |||||
var list = db.FindList<Exam_ExamPlanLessonEntity>($"select * FROM Exam_ExamPlanLesson where epid='{EPId}' and examdate is not null and ExamTime is not null and SeatCount>0 and realstucount>0 and SeatCount>=realstucount"); | |||||
var EPLIds = string.Join("','", list.Select(x => x.EPLId).ToList()); | |||||
string sql = $"update Exam_ExamPlanLesson set ELCheckMark='1' where EPLId in ('{EPLIds}')"; | |||||
db.ExecuteBySql(sql); | |||||
//更新排考记录表是否生成字段 | |||||
string updsql = $"update Exam_ExamPlan set EPGenarate=0 where EPId='{EPId}'"; | |||||
db.ExecuteBySql(updsql); | |||||
db.Commit(); | |||||
return (true, ""); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
db.Rollback(); | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | #endregion | ||||
} | } | ||||