Browse Source

排考记录--一键安排考场

新疆影视学院高职
zhangli 2 years ago
parent
commit
93c79eaf99
5 changed files with 105 additions and 2 deletions
  1. +19
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamPlanController.cs
  2. +15
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/Index.js
  3. +20
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomBLL.cs
  4. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomIBLL.cs
  5. +50
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomService.cs

+ 19
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/Exam_ExamPlanController.cs View File

@@ -21,6 +21,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
private Exam_ExamPlanIBLL exam_ExamPlanIBLL = new Exam_ExamPlanBLL();
private Exam_ExamPlanLessonIBLL exam_ExamPlanLessonIBLL = new Exam_ExamPlanLessonBLL();
private Exam_ExamPlanClassIBLL exam_ExamPlanClassIBLL = new Exam_ExamPlanClassBLL();
private Exam_ExamPlanRoomIBLL exam_ExamPlanRoomIBLL = new Exam_ExamPlanRoomBLL();

#region 视图功能

@@ -321,6 +322,24 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers
return Success("操作成功!");
}

/// <summary>
/// 一键安排考场
/// </summary>
/// <param name="keyValue"></param>
/// <returns></returns>
[HttpPost]
[AjaxOnly]
public ActionResult PlanRoomByEPId(string keyValue)
{
var res = exam_ExamPlanRoomIBLL.PlanRoomByEPId(keyValue);
if (!res.flag)
{
return Fail(res.str);
}

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

#endregion

}


+ 15
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/Index.js View File

@@ -193,6 +193,21 @@ var bootstrap = function ($, learun) {
}
});

//一键安排考场
$('#lr_examroom').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/PlanRoomByEPId', { keyValue: keyValue }, function () {
refreshGirdData();
});
}
});
}
});

//自动生成排考时间
$('#lr_examlessontime').on('click',
function () {


+ 20
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomBLL.cs View File

@@ -130,7 +130,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
}

/// <summary>
/// 保存实体数据(新增、修改)
@@ -175,6 +175,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
}

public (bool flag, string str) PlanRoomByEPId(string EPId)
{
try
{
return exam_ExamPlanRoomService.PlanRoomByEPId(EPId);
}
catch (Exception ex)
{
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowBusinessException(ex);
}
}
}
#endregion

}


+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomIBLL.cs View File

@@ -47,6 +47,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// <param name="entity">实体</param>
void SaveEntity(string keyValue, Exam_ExamPlanRoomEntity entity);
void SaveList (List<Exam_ExamPlanRoomEntity> list);
(bool flag,string str) PlanRoomByEPId(string EPId);
#endregion

}


+ 50
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomService.cs View File

@@ -128,7 +128,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
{
try
{
return this.BaseRepository("CollegeMIS").FindList<Exam_ExamPlanRoomEntity>(x => x.EPLId == EPLId && x.ClassroomNo == ClassroomNo).Count() > 0 ? true : false;
return this.BaseRepository("CollegeMIS").FindList<Exam_ExamPlanRoomEntity>(x => x.EPLId == EPLId && x.ClassroomNo == ClassroomNo).Count() > 0 ? true : false;
}
catch (Exception ex)
{
@@ -269,6 +269,55 @@ where l.EPLId='{EPLId}'";
}
}
}

/// <summary>
/// 自动安排考场
/// </summary>
/// <param name="EPId">考试记录表Id</param>
/// <returns></returns>
public (bool flag, string str) PlanRoomByEPId(string EPId)
{
var db = this.BaseRepository("CollegeMIS");
try
{
db.BeginTrans();
/*
* 1.查询是否已添加考试课程和班级
* 2.查询是否生成课程排考时间
* 3.查询考试课程并循环,
* 根据考试课程的总班级人数和排考时间,随机安排考场(同一时间段考场不能重复)
*/
//考试记录表
var examPlan = db.FindEntity<Exam_ExamPlanEntity>(EPId);
//考试课程
var examLessonList = db.FindList<Exam_ExamPlanLessonEntity>(x => x.EPId == EPId).ToList();
if (examLessonList.Count() <= 0)
{
return (false, "请先添加考试课程!");
}
if (!examLessonList.Exists(x => x.ExamDate != null))
{
return (false, "请先设置排考时间!");
}
//考试班级


db.Commit();
}
catch (Exception ex)
{
db.Rollback();
if (ex is ExceptionEx)
{
throw;
}
else
{
throw ExceptionEx.ThrowServiceException(ex);
}
}
}
#endregion

}


Loading…
Cancel
Save