Parcourir la source

娄底排考系统考场设置几行几列,生成考场座位图设置座位无效

娄底高职分支
ndbs il y a 1 mois
Parent
révision
380bfadb17
7 fichiers modifiés avec 65 ajouts et 14 suppressions
  1. +4
    -4
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoom.js
  2. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoomTeacher.cshtml
  3. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoomTeacher.js
  4. +43
    -3
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanService.cs
  5. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomEntity.cs
  6. +9
    -6
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomService.cs
  7. +6
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamRoomDetail/Exam_ExamRoomDetailEntity.cs

+ 4
- 4
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoom.js Voir le fichier

@@ -44,10 +44,10 @@ var bootstrap = function ($, learun) {
{ label: "学期", name: "Semester", width: 100, align: "left" },
{ label: "考场编号", name: "ClassroomNo", width: 100, align: "left" },
{ label: "考场名称", name: "ClassroomName", width: 200, align: "left" },
{ label: "座位行数", name: "SeatRows", width: 100, align: "left" },
{ label: "座位列数", name: "SeatColumns", width: 100, align: "left" },
{ label: "考场座位数", name: "SeatCount", width: 100, align: "left" },
{ label: "可用座位数", name: "ActualNum", width: 100, align: "left" },
{ label: "座位行数", name: "SeatRows", width: 60, align: "left" },
{ label: "座位列数", name: "SeatColumns", width: 60, align: "left" },
{ label: "考场座位数", name: "SeatCount", width: 60, align: "left" },
{ label: "可用座位数", name: "ActualNum", width: 60, align: "left" },
//{
// label: "是否启用", name: "EREnabled", width: 100, align: "left",
// formatter: function (cellvalue) {


+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoomTeacher.cshtml Voir le fichier

@@ -15,6 +15,7 @@
<div class="col-xs-12 lr-form-item" data-table="Exam_ExamPlanRoom">
<div class="lr-form-item-title">考场座位数</div>
<input id="ActualNum" readonly="readonly" type="text" class="form-control">
<input id="SeatCount" hidden>
</div>
<div class="col-xs-12 lr-form-item">
<div class="lr-form-item-title">监考老师</div>


+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoomTeacher.js Voir le fichier

@@ -135,6 +135,7 @@ var bootstrap = function ($, learun) {
$("#ClassroomName").val(temprow.ClassroomName);
$('#ClassroomNo').val(temprow.ClassroomNo);
$('#ActualNum').val(temprow.ActualNum);
$('#SeatCount').val(temprow.SeatCount);
}
});
};


+ 43
- 3
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanService.cs Voir le fichier

@@ -153,6 +153,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
{
try
{
var Entity = this.BaseRepository("CollegeMIS").FindEntity<Exam_ExamPlanEntity>(keyValue);
this.BaseRepository("CollegeMIS").ExecuteBySql($"update Exam_ExamRoom set isedit =1 where AcademicYearNo='{Entity.AcademicYearNo}' and Semester='{Entity.Semester}' ");
this.BaseRepository("CollegeMIS").Delete<Exam_ExamPlanEntity>(t => t.EPId == keyValue);
}
catch (Exception ex)
@@ -349,7 +351,17 @@ delete from Exam_ExamPlanRoom where EPLId in ('{planLessonIds}');");

//排考安排考场
var planRoomData = db.FindList<Exam_ExamPlanRoomEntity>(x => x.EPLId == planLesson.EPLId).ToList();

#region 允许有空的考场
var newclassroomno = new List<Exam_ExamPlanRoomEntity>();
foreach (var item in planRoomData)
{
if (item.SeatCount != item.ActualNum)
{
newclassroomno.Add(item);
}
}
var ClassroomNoDisable = string.Join("','", newclassroomno.Select(x => x.ClassroomNo));
#endregion
//添加排考安排数据
foreach (var planRoom in planRoomData)
{
@@ -384,7 +396,7 @@ delete from Exam_ExamPlanRoom where EPLId in ('{planLessonIds}');");
item.EmpNo = planRoom.EmpNo;
item.ClassroomName = planRoom.ClassroomName;
item.ClassroomNo = planRoom.ClassroomNo;
item.F_SchoolId = LoginUserInfo.Get().userId;
item.F_SchoolId = LoginUserInfo.Get().companyId;
item.SitNumber = sealNumArr[n].ToString().PadLeft(3, '0');
itemList.Add(item);
}
@@ -396,8 +408,35 @@ delete from Exam_ExamPlanRoom where EPLId in ('{planLessonIds}');");
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 DisableNumber = db.FindList<Exam_ExamRoomDetailEntity>
(x => x.ECEnabled == true && x.AcademicYearNo == examPlan.AcademicYearNo && x.Semester == examPlan.Semester && ClassroomNoDisable.Contains(x.ClassRoomNo)).ToList();
foreach (var item in DisableNumber)
{
item.ECSOrder = item.ECOrder.ToString().PadLeft(3, '0');
}
itemList = itemList.OrderBy(x => x.SitNumber).OrderBy(x => x.ClassroomNo).ToList();
List<Exam_ArrangeExamTermItemNewEntity> newitemList = itemList.Where(x => ClassroomNoDisable.Contains(x.ClassroomNo)).ToList();
foreach (var item in newitemList)
{
itemList.Remove(item);
}
int s = 0;
if (itemList.Count() > 0)
{
for (int i = 0; i < DisableNumber.Count(); i++)
{
for (int j = 0; j < newitemList.Count(); j++)
{
if (DisableNumber[i].ECSOrder == newitemList[j].SitNumber && DisableNumber[i].ClassRoomNo == newitemList[j].ClassroomNo)
{
itemList.Add(newitemList[j]);
s = s + 1;
}
}
}
}
var a = s;
if (itemList.Count >= stuInfoList.Count())
{
//随机安排座位
@@ -507,6 +546,7 @@ delete from Exam_ExamPlanRoom where EPLId in ('{planLessonIds}');");
entity.EPStuCount = 0;
this.BaseRepository("CollegeMIS").Insert(entity);
}
this.BaseRepository("CollegeMIS").ExecuteBySql($"update Exam_ExamRoom set isedit =0 where AcademicYearNo='{entity.AcademicYearNo}' and Semester='{entity.Semester}' ");
}
catch (Exception ex)
{


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomEntity.cs Voir le fichier

@@ -61,7 +61,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// </summary>
/// <returns></returns>
[Column("ACTUALNUM")]
public string ActualNum { get; set; }
public int? ActualNum { get; set; }
#endregion

#region 扩展操作


+ 9
- 6
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanRoom/Exam_ExamPlanRoomService.cs Voir le fichier

@@ -341,8 +341,9 @@ where l.EPLId='{EPLId}'";
}

//考场座位数
int? seatCount = 0;
var roomListSql =
int? seatCount = 0;
int? ActualNum = 0;
var roomListSql =
$"select * from Exam_ExamRoom where AcademicYearNo='{examPlan.AcademicYearNo}' and Semester='{examPlan.Semester}' and EREnabled=1 ";
if (conflictRoom.Count() > 0)
{
@@ -364,18 +365,20 @@ where l.EPLId='{EPLId}'";
EPRoom.EPLId = examLesson.EPLId;
EPRoom.ClassroomName = room.ClassroomName;
EPRoom.ClassroomNo = room.ClassroomNo;
EPRoom.SeatCount = room.ActualNum;
EPRoom.SeatCount = room.SeatCount;
EPRoom.ActualNum = room.ActualNum;
db.Insert(EPRoom);
seatCount += room.ActualNum;
seatCount += room.SeatCount;
ActualNum += room.ActualNum;
room.IsEdit = false;
if (seatCount >= examLesson.RealStuCount)
if (ActualNum >= examLesson.RealStuCount)
{
break;
}
}
db.Update(examRoomList);
db.ExecuteBySql(
$"update Exam_ExamPlanLesson set SeatCount='{seatCount}' where EPLId='{examLesson.EPLId}'");
$"update Exam_ExamPlanLesson set SeatCount='{seatCount}',SeatCount='{seatCount}'ActualNum='{ActualNum}' where EPLId='{examLesson.EPLId}'");
}

}


+ 6
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamRoomDetail/Exam_ExamRoomDetailEntity.cs Voir le fichier

@@ -127,6 +127,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// </summary>
[NotMapped]
public string ExamTime { get; set; }

/// <summary>
/// ECSOrder
/// </summary>
[NotMapped]
public string ECSOrder { get; set; }
}
}


Chargement…
Annuler
Enregistrer