@@ -19,8 +19,8 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
{ | |||
private Exam_ExamPlanLessonIBLL exam_ExamPlanLessonIBLL = new Exam_ExamPlanLessonBLL(); | |||
private Exam_ExamPlanClassIBLL exam_ExamPlanClassIBLL = new Exam_ExamPlanClassBLL(); | |||
private Exam_ExamStudentIBLL exam_ExamStudentIBLL = new Exam_ExamStudentBLL(); | |||
private Exam_ExamPlanRoomIBLL exam_ExamPlanRoomIBLL = new Exam_ExamPlanRoomBLL(); | |||
private ClassInfoIBLL classInfoIBLL = new ClassInfoBLL(); | |||
private StuInfoBasicIBLL StuInfoBasicIBLL = new StuInfoBasicBLL(); | |||
#region 视图功能 | |||
@@ -82,12 +82,12 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
public ActionResult GetClassInfoPageList(string pagination, string queryJson) | |||
{ | |||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||
var data = classInfoIBLL.GetPageList(paginationobj, queryJson); | |||
var stuList = StuInfoBasicIBLL.GetAllList(); | |||
foreach (var item in data) | |||
{ | |||
item.StuNum = stuList.Count(x => x.ClassNo == item.ClassNo); | |||
} | |||
var data = exam_ExamStudentIBLL.GetPageListForExam(paginationobj, queryJson); | |||
//var stuList = StuInfoBasicIBLL.GetAllList(); | |||
//foreach (var item in data) | |||
//{ | |||
// item.StuNum = stuList.Count(x => x.ClassNo == item.ClassNo); | |||
//} | |||
var jsonData = new | |||
{ | |||
rows = data, | |||
@@ -307,8 +307,9 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
[HttpPost] | |||
[ValidateAntiForgeryToken] | |||
[AjaxOnly] | |||
public ActionResult SaveClass(string EPLId, List<Exam_ExamPlanClassEntity> list) | |||
public ActionResult SaveClass(string EPLId, string strEntity) | |||
{ | |||
var list = strEntity.ToObject<List<Exam_ExamPlanClassEntity>>(); | |||
exam_ExamPlanClassIBLL.SaveList(list); | |||
return Success("保存成功!"); | |||
} | |||
@@ -55,6 +55,11 @@ var bootstrap = function ($, learun) { | |||
return false; | |||
} | |||
if (learun.checkrow(keyValue)) { | |||
var ELEnabled = $('#gridtable').jfGridValue('ELEnabled'); | |||
if (ELEnabled.indexOf('true') != -1) { | |||
learun.alert.warning("选中记录已启用!"); | |||
return; | |||
} | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '编辑', | |||
@@ -101,6 +106,11 @@ var bootstrap = function ($, learun) { | |||
$('#lr_delete').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ELId'); | |||
if (learun.checkrow(keyValue)) { | |||
var ELEnabled = $('#gridtable').jfGridValue('ELEnabled'); | |||
if (ELEnabled.indexOf('true') != -1) { | |||
learun.alert.warning("选中记录中包含已启用项目!"); | |||
return; | |||
} | |||
learun.layerConfirm('是否确认删除该项!', function (res) { | |||
if (res) { | |||
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamLesson/DeleteForm', { keyValue: keyValue }, function () { | |||
@@ -176,7 +186,7 @@ var bootstrap = function ($, learun) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', | |||
key: value, | |||
keyId: 'id', | |||
keyId: 'majorno', | |||
callback: function (_data) { | |||
callback(_data['majorname']); | |||
} | |||
@@ -10,22 +10,22 @@ | |||
<div class="lr-layout-tool-item"> | |||
<div id="multiple_condition_query"> | |||
<div class="lr-query-formcontent"> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">班级名称</div> | |||
<input id="ClassName" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">班级代码</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">班级编号</div> | |||
<input id="ClassNo" type="text" class="form-control" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
@*<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">系部</div> | |||
<div id="DeptNo"></div> | |||
</div> | |||
<div class="col-xs-6 lr-form-item"> | |||
<div class="lr-form-item-title">专业</div> | |||
<div id="MajorNo"></div> | |||
</div> | |||
</div>*@ | |||
</div> | |||
</div> | |||
</div> | |||
@@ -28,78 +28,50 @@ var bootstrap = function ($, learun) { | |||
$('#gridtable').jfGrid({ | |||
url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/GetClassInfoPageList', | |||
headData: [ | |||
{ label: "班级名称", name: "ClassName", width: 200, align: "left" }, | |||
{ label: "班级代码", name: "ClassNo", width: 100, align: "left" }, | |||
{ label: "学年", name: "AcademicYearNo", width: 100, align: "left" }, | |||
{ label: "学期", name: "Semester", width: 100, align: "left" }, | |||
{ | |||
label: "系部", name: "DeptNo", width: 200, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
label: "班级名称", name: "ClassName", width: 200, align: "left", formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', | |||
key: value, | |||
keyId: 'deptno', | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', | |||
key: row.ClassNo, | |||
keyId: 'classno', | |||
callback: function (_data) { | |||
callback(_data['deptname']); | |||
callback(_data['classname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "专业", name: "MajorNo", width: 200, 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: "SerialNum", width: 100, align: "left" }, | |||
{ | |||
label: "班级类型", name: "ClassType", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('dataItem', { | |||
key: value, | |||
code: 'ClassType', | |||
callback: function (_data) { | |||
callback(_data.text); | |||
} | |||
}); | |||
} | |||
}, | |||
{ label: "年级", name: "Grade", width: 80, align: "center" }, | |||
{ label: "班级编号", name: "ClassNo", width: 100, align: "left" }, | |||
{ label: "学生人数", name: "StuNum", width: 80, align: "left" }, | |||
{ | |||
label: "班主任", name: "ClassDiredctorNo", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata', | |||
key: value, | |||
keyId: 'f_encode', | |||
callback: function (_data) { | |||
callback(_data['f_realname']); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "辅导员", name: "ClassTutorNo", width: 100, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('custmerData', { | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata', | |||
key: value, | |||
keyId: 'f_encode', | |||
callback: function (_data) { | |||
callback(_data['f_realname']); | |||
} | |||
}); | |||
} | |||
}, | |||
//{ | |||
// label: "班主任", name: "ClassDiredctorNo", width: 100, align: "left", | |||
// formatterAsync: function (callback, value, row, op, $cell) { | |||
// learun.clientdata.getAsync('custmerData', { | |||
// url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata', | |||
// key: value, | |||
// keyId: 'f_encode', | |||
// callback: function (_data) { | |||
// callback(_data['f_realname']); | |||
// } | |||
// }); | |||
// } | |||
//}, | |||
//{ | |||
// label: "辅导员", name: "ClassTutorNo", width: 100, align: "left", | |||
// formatterAsync: function (callback, value, row, op, $cell) { | |||
// learun.clientdata.getAsync('custmerData', { | |||
// url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata', | |||
// key: value, | |||
// keyId: 'f_encode', | |||
// callback: function (_data) { | |||
// callback(_data['f_realname']); | |||
// } | |||
// }); | |||
// } | |||
//}, | |||
], | |||
mainId: 'ClassId', | |||
mainId: 'ESId', | |||
isPage: true, | |||
isMultiselect: true, | |||
sidx: 'ClassNo', | |||
@@ -111,7 +83,7 @@ var bootstrap = function ($, learun) { | |||
param = param || {}; | |||
//考试安排课程表Id | |||
param.EPLId = EPLId; | |||
param.SqlParameter = " and CheckMark=1"; | |||
param.EPId = EPId; | |||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
@@ -119,7 +91,7 @@ var bootstrap = function ($, learun) { | |||
page.search(); | |||
}; | |||
// 保存数据 | |||
acceptClick = function (callBack) { | |||
acceptClick = function (callBack,i) { | |||
var selectedRow = $('#gridtable').jfGridGet('rowdata'); | |||
if (selectedRow.length == 0) { | |||
return learun.alert.warning("请选择班级!"); | |||
@@ -127,8 +99,21 @@ var bootstrap = function ($, learun) { | |||
var list = []; | |||
$.each(selectedRow, | |||
function (i, item) { | |||
var name = ''; | |||
if (!!item.ClassNo) { | |||
learun.clientdata.getAsync('custmerData', | |||
{ | |||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', | |||
key: item.ClassNo, | |||
keyId: 'classno', | |||
callback: function (_data) { | |||
name = _data['classname']; | |||
} | |||
}); | |||
} | |||
var entity = { | |||
ClassName: item.ClassName, | |||
ClassName: name, | |||
ClassNo: item.ClassNo, | |||
ClassStuNum: item.StuNum, | |||
EPCId: learun.newGuid(), | |||
@@ -137,16 +122,15 @@ var bootstrap = function ($, learun) { | |||
list.push(entity); | |||
}); | |||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/SaveClass?EPLId=' + EPLId, | |||
{ list: list }), function (res) { | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
}; | |||
if (!!callBack) { | |||
callBack(); | |||
} | |||
var postData = {}; | |||
postData.strEntity = JSON.stringify(list); | |||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/SaveClass?EPLId=' + EPLId, postData, function (res) { | |||
console.log(res); | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(res, '', i); | |||
} | |||
}); | |||
}; | |||
page.init(); | |||
} |
@@ -160,6 +160,7 @@ var bootstrap = function ($, learun) { | |||
postData.Exam_ExamPlanTeacherList = JSON.stringify($('#Exam_ExamPlanTeacher').jfGridGet('rowdatas')); | |||
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/SaveRoomAndTeacher?keyValue=' + keyValue, postData, function (res) { | |||
console.log(res); | |||
// 保存成功后才回调 | |||
if (!!callBack) { | |||
callBack(res, formData, i); | |||
@@ -260,10 +260,10 @@ var bootstrap = function ($, learun) { | |||
}; | |||
refreshGirdData = function () { | |||
if (!!EPLId) { | |||
$('#gridtable_Class').jfGridSet('reload'); | |||
$('#gridtable_Room').jfGridSet('reload'); | |||
$('#gridtable_Class').jfGridSet('reload'); | |||
page.show(); | |||
} | |||
} | |||
}; | |||
page.init(); | |||
} |
@@ -153,7 +153,7 @@ var bootstrap = function ($, learun) { | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').lrAuthorizeJfGrid({ | |||
$('#gridtable').jfGrid({ | |||
url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamStudent/GetPageList', | |||
headData: [ | |||
{ label: "学年", name: "AcademicYearNo", width: 100, align: "left" }, | |||
@@ -56,6 +56,11 @@ var bootstrap = function ($, learun) { | |||
function () { | |||
var keyValue = $('#gridtable').jfGridValue('ITId'); | |||
if (learun.checkrow(keyValue)) { | |||
var ITEnabled = $('#gridtable').jfGridValue('ITEnabled'); | |||
if (ITEnabled.indexOf('true') != -1) { | |||
learun.alert.warning("选中记录已启用!"); | |||
return; | |||
} | |||
learun.layerForm({ | |||
id: 'form', | |||
title: '编辑', | |||
@@ -75,6 +80,11 @@ var bootstrap = function ($, learun) { | |||
function () { | |||
var keyValue = $('#gridtable').jfGridValue('ITId'); | |||
if (learun.checkrow(keyValue)) { | |||
var ITEnabled = $('#gridtable').jfGridValue('ITEnabled'); | |||
if (ITEnabled.indexOf('true') != -1) { | |||
learun.alert.warning("选中记录已启用!"); | |||
return; | |||
} | |||
learun.layerConfirm('是否确认删除该项!', | |||
function (res) { | |||
if (res) { | |||
@@ -98,8 +108,8 @@ var bootstrap = function ($, learun) { | |||
function () { | |||
var keyValue = $('#gridtable').jfGridValue('ITId'); | |||
if (learun.checkrow(keyValue)) { | |||
var ELEnabled = $('#gridtable').jfGridValue('ITEnabled'); | |||
if (ELEnabled.indexOf('true') != -1) { | |||
var ITEnabled = $('#gridtable').jfGridValue('ITEnabled'); | |||
if (ITEnabled.indexOf('true') != -1) { | |||
learun.alert.warning("选中记录中包含已启用项目!"); | |||
return; | |||
} | |||
@@ -75,18 +75,6 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
strSql.Append(queryParam["SqlParameter"].ToString()); | |||
} | |||
if (!queryParam["EPLId"].IsEmpty()) | |||
{ | |||
var elSql = | |||
$"select * from Exam_ExamLesson where ELId=(select ELId from Exam_ExamPlanLesson where EPLId='{queryParam["EPLId"].ToString()}')"; | |||
var entity = this.BaseRepository("CollegeMIS").FindList<Exam_ExamLessonEntity>(elSql).FirstOrDefault(); | |||
if (entity != null) | |||
{ | |||
strSql.Append($" and deptno='{entity.DeptNo}' and majorno='{entity.MajorNo}' and grade='{entity.Grade}'"); | |||
strSql.Append($" and classno not in (select ClassNo from Exam_ExamPlanClass where EPLId='{queryParam["EPLId"].ToString()}')"); | |||
} | |||
} | |||
return this.BaseRepository("CollegeMIS").FindList<ClassInfoEntity>(strSql.ToString(), dp, pagination); | |||
} | |||
catch (Exception ex) | |||
@@ -233,37 +233,24 @@ delete from Exam_ExamPlanRoom where EPLId in ('{planLessonIds}');"); | |||
//添加排考安排数据 | |||
foreach (var planRoom in planRoomData) | |||
{ | |||
var ExamTermEntity = db.FindEntity<Exam_ArrangeExamTermNewEntity>(x => x.ClassroomNo == planRoom.ClassroomNo); | |||
//删除 | |||
db.ExecuteBySql($"delete Exam_ArrangeExamTermNew where EPId='{keyValue}'"); | |||
//排考安排表 | |||
if (ExamTermEntity == null) | |||
{ | |||
Exam_ArrangeExamTermNewEntity ExamTermNewEntity = new Exam_ArrangeExamTermNewEntity(); | |||
ExamTermNewEntity.Create(); | |||
ExamTermNewEntity.EPId = keyValue; | |||
ExamTermNewEntity.LessonName = planLesson.LessonName; | |||
ExamTermNewEntity.LessonNo = planLesson.LessonNo; | |||
ExamTermNewEntity.ExamDate = planLesson.ExamDate; | |||
ExamTermNewEntity.ExamTime = planLesson.ExamTime; | |||
ExamTermNewEntity.EmpName = planRoom.EmpName; | |||
ExamTermNewEntity.EmpNo = planRoom.EmpNo; | |||
ExamTermNewEntity.ClassroomName = planRoom.ClassroomName; | |||
ExamTermNewEntity.ClassroomNo = planRoom.ClassroomNo; | |||
ExamTermNewEntity.F_SchoolId = LoginUserInfo.Get().companyId; | |||
db.Insert(ExamTermNewEntity); | |||
} | |||
else | |||
{ | |||
//修改 | |||
ExamTermEntity.LessonName = planLesson.LessonName; | |||
ExamTermEntity.LessonNo = planLesson.LessonNo; | |||
ExamTermEntity.ExamDate = planLesson.ExamDate; | |||
ExamTermEntity.ExamTime = planLesson.ExamTime; | |||
ExamTermEntity.EmpName = planRoom.EmpName; | |||
ExamTermEntity.EmpNo = planRoom.EmpNo; | |||
ExamTermEntity.ClassroomName = planRoom.ClassroomName; | |||
ExamTermEntity.ClassroomNo = planRoom.ClassroomNo; | |||
db.Update(ExamTermEntity); | |||
} | |||
Exam_ArrangeExamTermNewEntity ExamTermNewEntity = new Exam_ArrangeExamTermNewEntity(); | |||
ExamTermNewEntity.Create(); | |||
ExamTermNewEntity.EPId = keyValue; | |||
ExamTermNewEntity.LessonName = planLesson.LessonName; | |||
ExamTermNewEntity.LessonNo = planLesson.LessonNo; | |||
ExamTermNewEntity.ExamDate = planLesson.ExamDate; | |||
ExamTermNewEntity.ExamTime = planLesson.ExamTime; | |||
ExamTermNewEntity.EmpName = planRoom.EmpName; | |||
ExamTermNewEntity.EmpNo = planRoom.EmpNo; | |||
ExamTermNewEntity.ClassroomName = planRoom.ClassroomName; | |||
ExamTermNewEntity.ClassroomNo = planRoom.ClassroomNo; | |||
ExamTermNewEntity.F_SchoolId = LoginUserInfo.Get().companyId; | |||
db.Insert(ExamTermNewEntity); | |||
//生成考场随机数 | |||
var sealNumArr = getRanNum(planRoom.SeatCount.Value); | |||
@@ -292,9 +279,9 @@ delete from Exam_ExamPlanRoom where EPLId in ('{planLessonIds}');"); | |||
//排考安排班级 | |||
var planClassData = db.FindList<Exam_ExamPlanClassEntity>(x => x.EPLId == planLesson.EPLId); | |||
var classnos = string.Join("','", planClassData.Select(x => x.ClassNo).ToList()); | |||
string stuSql = $"select * from StuInfoBasic where checkMark='1' and classno in ('{classnos}') and stuno not in (select StuNo from Exam_ArrangeExamTermItemNew where EPId='{keyValue}')"; | |||
string stuSql = $"select * from Exam_ExamStudent where AcademicYearNo='{examPlan.AcademicYearNo}' and Semester='{examPlan.Semester}' and ESType='{examPlan.PlanType}' and classno in ('{classnos}') and stuno not in (select StuNo from Exam_ArrangeExamTermItemNew where EPId='{keyValue}')"; | |||
//所有考生 | |||
var stuInfoList = db.FindList<StuInfoBasicEntity>(stuSql).ToList(); | |||
var stuInfoList = db.FindList<Exam_ExamStudentEntity>(stuSql).ToList(); | |||
var classInfo = db.FindList<ClassInfoEntity>(); | |||
if (itemList.Count >= stuInfoList.Count()) | |||
{ | |||
@@ -318,7 +305,7 @@ delete from Exam_ExamPlanRoom where EPLId in ('{planLessonIds}');"); | |||
{ | |||
//不随机安排座位 | |||
itemList = itemList.OrderBy(x => x.SitNumber).OrderBy(x => x.ClassroomNo).ToList(); | |||
stuInfoList = stuInfoList.OrderBy(x =>x.StuNo).OrderBy(x=>x.ClassNo).ToList(); | |||
stuInfoList = stuInfoList.OrderBy(x => x.StuNo).OrderBy(x => x.ClassNo).ToList(); | |||
//为考生安排座位 | |||
for (int i = 0; i < stuInfoList.Count; i++) | |||
{ | |||
@@ -43,6 +43,24 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
} | |||
public IEnumerable<Exam_ExamStudentEntity> GetPageListForExam(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
return exam_ExamStudentService.GetPageListForExam(pagination, queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取Exam_ExamStudent表实体数据 | |||
/// </summary> | |||
@@ -79,6 +79,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
#endregion | |||
#region 扩展字段 | |||
[NotMapped] | |||
public int StuNum { get; set; } | |||
#endregion | |||
} | |||
} | |||
@@ -21,6 +21,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
IEnumerable<Exam_ExamStudentEntity> GetPageList(Pagination pagination, string queryJson); | |||
IEnumerable<Exam_ExamStudentEntity> GetPageListForExam(Pagination pagination, string queryJson); | |||
/// <summary> | |||
/// 获取Exam_ExamStudent表实体数据 | |||
/// </summary> | |||
@@ -84,6 +84,79 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
} | |||
public IEnumerable<Exam_ExamStudentEntity> GetPageListForExam(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT "); | |||
strSql.Append(@" ClassNo,count(1) as StuNum,AcademicYearNo,Semester,ESType "); | |||
strSql.Append(" FROM Exam_ExamStudent t "); | |||
strSql.Append(" WHERE 1=1 "); | |||
var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
var dp = new DynamicParameters(new { }); | |||
if (!queryParam["AcademicYearNo"].IsEmpty()) | |||
{ | |||
dp.Add("AcademicYearNo", queryParam["AcademicYearNo"].ToString(), DbType.String); | |||
strSql.Append(" AND t.AcademicYearNo = @AcademicYearNo "); | |||
} | |||
if (!queryParam["Semester"].IsEmpty()) | |||
{ | |||
dp.Add("Semester", queryParam["Semester"].ToString(), DbType.String); | |||
strSql.Append(" AND t.Semester = @Semester "); | |||
} | |||
if (!queryParam["ClassNo"].IsEmpty()) | |||
{ | |||
dp.Add("ClassNo", queryParam["ClassNo"].ToString(), DbType.String); | |||
strSql.Append(" AND t.ClassNo = @ClassNo "); | |||
} | |||
if (!queryParam["StuNo"].IsEmpty()) | |||
{ | |||
dp.Add("StuNo", "%" + queryParam["StuNo"].ToString() + "%", DbType.String); | |||
strSql.Append(" AND t.StuNo Like @StuNo "); | |||
} | |||
if (!queryParam["StuName"].IsEmpty()) | |||
{ | |||
dp.Add("StuName", "%" + queryParam["StuName"].ToString() + "%", DbType.String); | |||
strSql.Append(" AND t.StuName Like @StuName "); | |||
} | |||
if (!queryParam["ESType"].IsEmpty()) | |||
{ | |||
dp.Add("ESType", queryParam["ESType"].ToString(), DbType.String); | |||
strSql.Append(" AND t.ESType = @ESType "); | |||
} | |||
if (!queryParam["SqlParameter"].IsEmpty()) | |||
{ | |||
strSql.Append(queryParam["SqlParameter"].ToString()); | |||
} | |||
//排考安排课程表Id | |||
if (!queryParam["EPLId"].IsEmpty()) | |||
{ | |||
strSql.Append($" and classno not in (select ClassNo from Exam_ExamPlanClass where EPLId='{queryParam["EPLId"].ToString()}')"); | |||
} | |||
//排考记录表Id | |||
if (!queryParam["EPId"].IsEmpty()) | |||
{ | |||
var examPlan = this.BaseRepository("CollegeMIS").FindEntity<Exam_ExamPlanEntity>(queryParam["EPId"].ToString()); | |||
strSql.Append($" AND t.AcademicYearNo = '{examPlan.AcademicYearNo}' AND t.Semester = '{examPlan.Semester}' AND t.ESType = '{examPlan.PlanType}' "); | |||
} | |||
strSql.Append(" group by ClassNo,AcademicYearNo,Semester,ESType "); | |||
return this.BaseRepository("CollegeMIS").FindList<Exam_ExamStudentEntity>(strSql.ToString(), dp, pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取Exam_ExamStudent表实体数据 | |||
/// </summary> | |||