Browse Source

处理排考新增考场时监考老师重复选择问题和班级人数不正确,处理排考名单数据不正确

西昌缴费二期
zhangli 2 years ago
parent
commit
7086ccdf38
8 changed files with 32 additions and 26 deletions
  1. +2
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamLesson/Index.cshtml
  2. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormClass.js
  3. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamRoom/Index.cshtml
  4. +2
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamStudent/Index.cshtml
  5. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/Index.cshtml
  6. +15
    -10
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanService.cs
  7. +6
    -6
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanClass/Exam_ExamPlanClassService.cs
  8. +4
    -3
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherService.cs

+ 2
- 2
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamLesson/Index.cshtml View File

@@ -35,13 +35,13 @@
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> <a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a>
</div> </div>
<div class=" btn-group btn-group-sm" learun-authorize="yes"> <div class=" btn-group btn-group-sm" learun-authorize="yes">
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;新增</a>
@*<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;新增</a>*@
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i>&nbsp;编辑</a> <a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i>&nbsp;编辑</a>
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i>&nbsp;删除</a> <a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
<a id="lr_lock" class="btn btn-default"><i class="fa fa-lock"></i>&nbsp;启用</a> <a id="lr_lock" class="btn btn-default"><i class="fa fa-lock"></i>&nbsp;启用</a>
<a id="lr_unlock" class="btn btn-default"><i class="fa fa-unlock"></i>&nbsp;停用</a> <a id="lr_unlock" class="btn btn-default"><i class="fa fa-unlock"></i>&nbsp;停用</a>


<a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i>&nbsp;打印</a>
@*<a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i>&nbsp;打印</a>*@
</div> </div>
<div class=" btn-group btn-group-sm"> <div class=" btn-group btn-group-sm">
<a id="lr_importByBasic" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;从开课计划导入</a> <a id="lr_importByBasic" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;从开课计划导入</a>


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormClass.js View File

@@ -125,7 +125,7 @@ var bootstrap = function ($, learun) {
var postData = {}; var postData = {};
postData.strEntity = JSON.stringify(list); postData.strEntity = JSON.stringify(list);
$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/SaveClass?EPLId=' + EPLId, postData, function (res) { $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/SaveClass?EPLId=' + EPLId, postData, function (res) {
console.log(res);
//console.log(res);
// 保存成功后才回调 // 保存成功后才回调
if (!!callBack) { if (!!callBack) {
callBack(res, '', i); callBack(res, '', i);


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamRoom/Index.cshtml View File

@@ -35,7 +35,7 @@
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> <a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a>
</div> </div>
<div class=" btn-group btn-group-sm"> <div class=" btn-group btn-group-sm">
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;新增</a>
@*<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;新增</a>*@
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i>&nbsp;编辑</a> <a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i>&nbsp;编辑</a>
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i>&nbsp;删除</a> <a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
<a id="lr_lock" class="btn btn-default"><i class="fa fa-lock"></i>&nbsp;启用</a> <a id="lr_lock" class="btn btn-default"><i class="fa fa-lock"></i>&nbsp;启用</a>


+ 2
- 2
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamStudent/Index.cshtml View File

@@ -43,12 +43,12 @@
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> <a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a>
</div> </div>
<div class=" btn-group btn-group-sm" learun-authorize="yes"> <div class=" btn-group btn-group-sm" learun-authorize="yes">
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;新增</a>
@*<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;新增</a>*@
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i>&nbsp;编辑</a> <a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i>&nbsp;编辑</a>
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i>&nbsp;删除</a> <a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
<a id="lr_lock" class="btn btn-default"><i class="fa fa-lock"></i>&nbsp;启用</a> <a id="lr_lock" class="btn btn-default"><i class="fa fa-lock"></i>&nbsp;启用</a>
<a id="lr_unlock" class="btn btn-default"><i class="fa fa-unlock"></i>&nbsp;停用</a> <a id="lr_unlock" class="btn btn-default"><i class="fa fa-unlock"></i>&nbsp;停用</a>
<a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i>&nbsp;打印</a>
@*<a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i>&nbsp;打印</a>*@
</div> </div>
<div class=" btn-group btn-group-sm"> <div class=" btn-group btn-group-sm">
<a id="lr_importBy" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;一键生成考试信息</a> <a id="lr_importBy" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;一键生成考试信息</a>


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_InvigilateTeacher/Index.cshtml View File

@@ -35,7 +35,7 @@
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> <a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a>
</div> </div>
<div class=" btn-group btn-group-sm" learun-authorize="yes"> <div class=" btn-group btn-group-sm" learun-authorize="yes">
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;新增</a>
@*<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;新增</a>*@
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i>&nbsp;编辑</a> <a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i>&nbsp;编辑</a>
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i>&nbsp;删除</a> <a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
<a id="lr_lock" class="btn btn-default"><i class="fa fa-lock"></i>&nbsp;启用</a> <a id="lr_lock" class="btn btn-default"><i class="fa fa-lock"></i>&nbsp;启用</a>


+ 15
- 10
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanService.cs View File

@@ -224,17 +224,20 @@ delete from Exam_ExamPlanRoom where EPLId in ('{planLessonIds}');");
{ {
return false; return false;
} }

foreach (var planLesson in planLessonData)
else
{ {
var planClassData = this.BaseRepository("CollegeMIS").FindList<Exam_ExamPlanClassEntity>(x => x.EPLId == planLesson.EPLId);
var planRoomData = this.BaseRepository("CollegeMIS").FindList<Exam_ExamPlanRoomEntity>(x => x.EPLId == planLesson.EPLId);
if (planClassData.Count() <= 0 || planRoomData.Count() <= 0)
foreach (var planLesson in planLessonData)
{ {
return false;
var planClassData = this.BaseRepository("CollegeMIS").FindList<Exam_ExamPlanClassEntity>(x => x.EPLId == planLesson.EPLId);
var planRoomData = this.BaseRepository("CollegeMIS").FindList<Exam_ExamPlanRoomEntity>(x => x.EPLId == planLesson.EPLId);
if (planClassData.Count() <= 0 || planRoomData.Count() <= 0)
{
return false;
}
} }
} }



return true; return true;
} }
catch (Exception ex) catch (Exception ex)
@@ -269,14 +272,16 @@ delete from Exam_ExamPlanRoom where EPLId in ('{planLessonIds}');");
db.ExecuteBySql($"delete Exam_ArrangeExamTermNew where EPId='{keyValue}'"); db.ExecuteBySql($"delete Exam_ArrangeExamTermNew where EPId='{keyValue}'");
//删除考场明细 //删除考场明细
db.ExecuteBySql($"delete Exam_ArrangeExamTermItemNew where EPId='{keyValue}'"); db.ExecuteBySql($"delete Exam_ArrangeExamTermItemNew where EPId='{keyValue}'");
//排考安排明细数据
List<Exam_ArrangeExamTermItemNewEntity> itemList = new List<Exam_ArrangeExamTermItemNewEntity>();
foreach (var planLesson in planLessonData) foreach (var planLesson in planLessonData)
{ {
//排考安排明细数据
List<Exam_ArrangeExamTermItemNewEntity> itemList = new List<Exam_ArrangeExamTermItemNewEntity>();

//排考安排考场 //排考安排考场
var planRoomData = db.FindList<Exam_ExamPlanRoomEntity>(x => x.EPLId == planLesson.EPLId).ToList(); var planRoomData = db.FindList<Exam_ExamPlanRoomEntity>(x => x.EPLId == planLesson.EPLId).ToList();
//考场数 //考场数
int planRoomCount = planRoomData.Count();
//int planRoomCount = planRoomData.Count();
//添加排考安排数据 //添加排考安排数据
foreach (var planRoom in planRoomData) foreach (var planRoom in planRoomData)
{ {
@@ -320,7 +325,7 @@ 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}')";
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}')";
//所有考生 //所有考生
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>();


+ 6
- 6
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanClass/Exam_ExamPlanClassService.cs View File

@@ -207,12 +207,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
{ {
try try
{ {
var stuinfo = this.BaseRepository("CollegeMIS").FindList<StuInfoBasicEntity>();
//计算班级人数
foreach (var entity in list)
{
entity.ClassStuNum = stuinfo.Count(x => x.ClassNo == entity.ClassNo);
}
//var stuinfo = this.BaseRepository("CollegeMIS").FindList<StuInfoBasicEntity>();
////计算班级人数
//foreach (var entity in list)
//{
// entity.ClassStuNum = stuinfo.Count(x => x.ClassNo == entity.ClassNo);
//}
this.BaseRepository("CollegeMIS").Insert(list); this.BaseRepository("CollegeMIS").Insert(list);
//更新排考安排课程表实排班级数、实排人数 //更新排考安排课程表实排班级数、实排人数
//排考安排课程表Id //排考安排课程表Id


+ 4
- 3
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_InvigilateTeacher/Exam_InvigilateTeacherService.cs View File

@@ -71,16 +71,17 @@ select EPId from Exam_ExamPlanLesson where EPLId='{queryParam["EPLId"].ToString(
strSql.Append($" AND t.Semester = '{ELEntity.Semester}' "); strSql.Append($" AND t.Semester = '{ELEntity.Semester}' ");
} }


var empSql = $"select EmpNo from Exam_ExamPlanRoom where EPLId='{queryParam["EPLId"].ToString()}'";
var empSql = $@"SELECT DISTINCT EPLId, STUFF( (SELECT ',' + empno FROM Exam_ExamPlanRoom WHERE EPLId = T.EPLId FOR XML PATH('') ), 1, 1, '') AS empno FROM Exam_ExamPlanRoom AS T
where EPLId ='{queryParam["EPLId"].ToString()}'";
if (!queryParam["EPRId"].IsEmpty()) if (!queryParam["EPRId"].IsEmpty())
{ {
empSql += $" and EPRId<>'{queryParam["EPRId"].ToString()}'"; empSql += $" and EPRId<>'{queryParam["EPRId"].ToString()}'";
} }


var obj = this.BaseRepository("CollegeMIS").FindObject(empSql);
var obj = this.BaseRepository("CollegeMIS").FindList<Exam_ExamPlanRoomEntity>(empSql).Select(x=>x.EmpNo).Distinct().ToList();
if (obj != null) if (obj != null)
{ {
var empNo = string.Join("','", obj.ToString().Split(','));
var empNo = string.Join("','", obj[0].ToString().Split(',').Distinct());
strSql.Append($" AND t.EmpNo not in ('{empNo}')"); strSql.Append($" AND t.EmpNo not in ('{empNo}')");
} }
} }


Loading…
Cancel
Save