@@ -30,18 +30,19 @@ var bootstrap = function ($, learun) { | |||||
headData: [ | headData: [ | ||||
{ label: "学年", name: "AcademicYearNo", width: 100, align: "left" }, | { label: "学年", name: "AcademicYearNo", width: 100, align: "left" }, | ||||
{ label: "学期", name: "Semester", width: 100, align: "left" }, | { label: "学期", name: "Semester", width: 100, align: "left" }, | ||||
{ | |||||
label: "班级名称", name: "ClassName", width: 200, align: "left", formatterAsync: function (callback, value, row, op, $cell) { | |||||
learun.clientdata.getAsync('custmerData', { | |||||
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', | |||||
key: row.ClassNo, | |||||
keyId: 'classno', | |||||
callback: function (_data) { | |||||
callback(_data['classname']); | |||||
} | |||||
}); | |||||
} | |||||
}, | |||||
//{ | |||||
// label: "班级名称", name: "ClassName", width: 200, align: "left", formatterAsync: function (callback, value, row, op, $cell) { | |||||
// learun.clientdata.getAsync('custmerData', { | |||||
// url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', | |||||
// key: row.ClassNo, | |||||
// keyId: 'classno', | |||||
// callback: function (_data) { | |||||
// callback(_data['classname']); | |||||
// } | |||||
// }); | |||||
// } | |||||
//}, | |||||
{ label: "班级名称", name: "ClassName", width: 100, align: "left" }, | |||||
{ label: "班级编号", name: "ClassNo", width: 100, align: "left" }, | { label: "班级编号", name: "ClassNo", width: 100, align: "left" }, | ||||
{ label: "学生人数", name: "StuNum", width: 80, align: "left" }, | { label: "学生人数", name: "StuNum", width: 80, align: "left" }, | ||||
//{ | //{ | ||||
@@ -325,10 +325,12 @@ delete from Exam_ExamPlanRoom where EPLId in ('{planLessonIds}');"); | |||||
//排考安排班级 | //排考安排班级 | ||||
var planClassData = db.FindList<Exam_ExamPlanClassEntity>(x => x.EPLId == planLesson.EPLId); | var planClassData = db.FindList<Exam_ExamPlanClassEntity>(x => x.EPLId == planLesson.EPLId); | ||||
var classnos = string.Join("','", planClassData.Select(x => x.ClassNo).ToList()); | var classnos = string.Join("','", planClassData.Select(x => x.ClassNo).ToList()); | ||||
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}' and LessonNo='{planLesson.LessonNo}')"; | |||||
string stuSql = $"select * from Exam_ExamStudent where ESEnabled=1 and 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}' and LessonNo='{planLesson.LessonNo}')"; | |||||
//所有考生 | //所有考生 | ||||
var stuInfoList = db.FindList<Exam_ExamStudentEntity>(stuSql).ToList(); | var stuInfoList = db.FindList<Exam_ExamStudentEntity>(stuSql).ToList(); | ||||
var classInfo = db.FindList<ClassInfoEntity>(); | var classInfo = db.FindList<ClassInfoEntity>(); | ||||
itemList = itemList.OrderBy(x => x.SitNumber).OrderBy(x => x.ClassroomNo).ToList(); | |||||
if (itemList.Count >= stuInfoList.Count()) | if (itemList.Count >= stuInfoList.Count()) | ||||
{ | { | ||||
//随机安排座位 | //随机安排座位 | ||||
@@ -350,7 +352,6 @@ delete from Exam_ExamPlanRoom where EPLId in ('{planLessonIds}');"); | |||||
else | else | ||||
{ | { | ||||
//不随机安排座位 | //不随机安排座位 | ||||
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++) | for (int i = 0; i < stuInfoList.Count; i++) | ||||
@@ -81,6 +81,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
#region 扩展字段 | #region 扩展字段 | ||||
[NotMapped] | [NotMapped] | ||||
public int StuNum { get; set; } | public int StuNum { get; set; } | ||||
[NotMapped] | |||||
public string ClassName { get; set; } | |||||
#endregion | #endregion | ||||
} | } | ||||
@@ -91,9 +91,10 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
{ | { | ||||
var strSql = new StringBuilder(); | var strSql = new StringBuilder(); | ||||
strSql.Append("SELECT "); | strSql.Append("SELECT "); | ||||
strSql.Append(@" ClassNo,count(1) as StuNum,AcademicYearNo,Semester,ESType "); | |||||
strSql.Append(@" t.ClassNo,count(1) as StuNum,t.AcademicYearNo,t.Semester,t.ESType,c.ClassName "); | |||||
strSql.Append(" FROM Exam_ExamStudent t "); | strSql.Append(" FROM Exam_ExamStudent t "); | ||||
strSql.Append(" WHERE ESEnabled=1 "); | |||||
strSql.Append(" left join classinfo c on t.ClassNo=c.ClassNo "); | |||||
strSql.Append(" WHERE t.ESEnabled=1 "); | |||||
var queryParam = queryJson.ToJObject(); | var queryParam = queryJson.ToJObject(); | ||||
// 虚拟参数 | // 虚拟参数 | ||||
var dp = new DynamicParameters(new { }); | var dp = new DynamicParameters(new { }); | ||||
@@ -115,7 +116,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
if (!queryParam["ClassName"].IsEmpty()) | if (!queryParam["ClassName"].IsEmpty()) | ||||
{ | { | ||||
dp.Add("ClassName", "%" + queryParam["ClassName"].ToString() + "%", DbType.String); | dp.Add("ClassName", "%" + queryParam["ClassName"].ToString() + "%", DbType.String); | ||||
strSql.Append(" AND t.ClassName Like @ClassName "); | |||||
strSql.Append(" AND c.ClassName Like @ClassName "); | |||||
} | } | ||||
if (!queryParam["StuNo"].IsEmpty()) | if (!queryParam["StuNo"].IsEmpty()) | ||||
{ | { | ||||
@@ -139,7 +140,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
//排考安排课程表Id | //排考安排课程表Id | ||||
if (!queryParam["EPLId"].IsEmpty()) | if (!queryParam["EPLId"].IsEmpty()) | ||||
{ | { | ||||
strSql.Append($" and classno not in (select ClassNo from Exam_ExamPlanClass where EPLId='{queryParam["EPLId"].ToString()}')"); | |||||
strSql.Append($" and t.classno not in (select ClassNo from Exam_ExamPlanClass where EPLId='{queryParam["EPLId"].ToString()}')"); | |||||
} | } | ||||
//排考记录表Id | //排考记录表Id | ||||
if (!queryParam["EPId"].IsEmpty()) | if (!queryParam["EPId"].IsEmpty()) | ||||
@@ -150,7 +151,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
strSql.Append($" AND t.AcademicYearNo = '{examPlan.AcademicYearNo}' AND t.Semester = '{examPlan.Semester}' AND t.ESType = '{examPlan.PlanType}' "); | 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 "); | |||||
strSql.Append(" group by t.ClassNo,t.AcademicYearNo,t.Semester,t.ESType,c.ClassName "); | |||||
return this.BaseRepository("CollegeMIS").FindList<Exam_ExamStudentEntity>(strSql.ToString(), dp, pagination); | return this.BaseRepository("CollegeMIS").FindList<Exam_ExamStudentEntity>(strSql.ToString(), dp, pagination); | ||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||