Sfoglia il codice sorgente

生成排考名单只为已启用的学生生成;随机安排座位时座位号按顺序排

西昌缴费二期
zhangli 2 anni fa
parent
commit
a071bf5723
4 ha cambiato i file con 24 aggiunte e 19 eliminazioni
  1. +13
    -12
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormClass.js
  2. +3
    -2
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanService.cs
  3. +2
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentEntity.cs
  4. +6
    -5
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentService.cs

+ 13
- 12
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormClass.js Vedi File

@@ -30,18 +30,19 @@ var bootstrap = function ($, learun) {
headData: [
{ label: "学年", name: "AcademicYearNo", 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: "StuNum", width: 80, align: "left" },
//{


+ 3
- 2
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanService.cs Vedi File

@@ -325,10 +325,12 @@ 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 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 classInfo = db.FindList<ClassInfoEntity>();
itemList = itemList.OrderBy(x => x.SitNumber).OrderBy(x => x.ClassroomNo).ToList();
if (itemList.Count >= stuInfoList.Count())
{
//随机安排座位
@@ -350,7 +352,6 @@ delete from Exam_ExamPlanRoom where EPLId in ('{planLessonIds}');");
else
{
//不随机安排座位
itemList = itemList.OrderBy(x => x.SitNumber).OrderBy(x => x.ClassroomNo).ToList();
stuInfoList = stuInfoList.OrderBy(x => x.StuNo).OrderBy(x => x.ClassNo).ToList();
//为考生安排座位
for (int i = 0; i < stuInfoList.Count; i++)


+ 2
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentEntity.cs Vedi File

@@ -81,6 +81,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
#region 扩展字段
[NotMapped]
public int StuNum { get; set; }
[NotMapped]
public string ClassName { get; set; }

#endregion
}


+ 6
- 5
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamStudent/Exam_ExamStudentService.cs Vedi File

@@ -91,9 +91,10 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
{
var strSql = new StringBuilder();
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(" 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 dp = new DynamicParameters(new { });
@@ -115,7 +116,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
if (!queryParam["ClassName"].IsEmpty())
{
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())
{
@@ -139,7 +140,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
//排考安排课程表Id
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
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(" 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);
}
catch (Exception ex)


Caricamento…
Annulla
Salva