排序号*
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/Index.js
index 9d045a9ec..df7a6bf32 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/Index.js
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlan/Index.js
@@ -55,6 +55,11 @@ var bootstrap = function ($, learun) {
$('#lr_edit').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('EPId');
if (learun.checkrow(keyValue)) {
+ //是否生成
+ var EPGenarate = $('#gridtable').jfGridValue('EPGenarate');
+ if (EPGenarate == true) {
+ return learun.alert.warning("已生成排考名单,不可编辑!");
+ }
learun.layerForm({
id: 'form',
title: '编辑',
@@ -71,6 +76,11 @@ var bootstrap = function ($, learun) {
$('#lr_delete').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('EPId');
if (learun.checkrow(keyValue)) {
+ //是否生成
+ var EPGenarate = $('#gridtable').jfGridValue('EPGenarate');
+ if (EPGenarate == true) {
+ return learun.alert.warning("已生成排考名单,不可删除!");
+ }
learun.layerConfirm('是否确认删除该项!', function (res) {
if (res) {
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/DeleteForm', { keyValue: keyValue }, function () {
@@ -114,7 +124,7 @@ var bootstrap = function ($, learun) {
$('#lr_cleardata').on('click', function () {
var keyValue = $('#gridtable').jfGridValue('EPId');
if (learun.checkrow(keyValue)) {
- learun.layerConfirm('是否确认清除排考所有记录!', function (res) {
+ learun.layerConfirm('是否确认清除所有排考记录!', function (res) {
if (res) {
learun.postForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/ClearGenerate', { keyValue: keyValue, type: 2 }, function () {
refreshGirdData();
@@ -159,7 +169,7 @@ var bootstrap = function ($, learun) {
{ label: "排考编号", name: "PlanCode", width: 100, align: "left" },
{ label: "排考总人数", name: "EPStuCount", width: 100, align: "left" },
{
- label: "生成座位", name: "EPRandom", width: 100, align: "left",
+ label: "是否随机座位", name: "EPRandom", width: 100, align: "left",
formatter: function (cellvalue) {
return cellvalue == true ? "是" : "否";
}
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormClass.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormClass.js
index 7b7d46cd6..b86d85b55 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormClass.js
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormClass.js
@@ -26,7 +26,7 @@ var bootstrap = function ($, learun) {
// 初始化列表
initGird: function () {
$('#gridtable').jfGrid({
- url: top.$.rootUrl + '/EducationalAdministration/ClassInfo/GetPageList',
+ url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/GetClassInfoPageList',
headData: [
{ label: "班级名称", name: "ClassName", width: 200, align: "left" },
{ label: "班级代码", name: "ClassNo", width: 100, align: "left" },
@@ -121,6 +121,9 @@ var bootstrap = function ($, learun) {
// 保存数据
acceptClick = function (callBack) {
var selectedRow = $('#gridtable').jfGridGet('rowdata');
+ if (selectedRow.length == 0) {
+ return learun.alert.warning("请选择班级!");
+ }
var list = [];
$.each(selectedRow,
function (i, item) {
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoom.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoom.js
index 9b4ec8238..6c2b15e78 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoom.js
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoom.js
@@ -75,32 +75,13 @@ var bootstrap = function ($, learun) {
// 保存数据
acceptClick = function (callBack) {
var selectedRow = $('#gridtable').jfGridGet('rowdata');
- learun.layerClose(window.name);
- callBack(selectedRow);
- //var list = [];
- //$.each(selectedRow,
- // function (i, item) {
- // var entity = {
- // ClassroomName: item.ClassroomName,
- // ClassroomNo: item.ClassroomNo,
- // SeatCount: item.SeatCount,
- // EPRId: learun.newGuid(),
- // EPLId: EPLId
- // }
- // list.push(entity);
-
- // });
- //$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/SaveRoom?EPLId=' + EPLId,
- // { list: list }), function (res) {
- // // 保存成功后才回调
- // if (!!callBack) {
- // callBack();
- // }
- // };
-
- //if (!!callBack) {
- // callBack();
- //}
+ if (!!selectedRow) {
+ learun.layerClose(window.name);
+ callBack(selectedRow);
+ } else {
+ return learun.alert.warning("请选择考场!");
+ }
+
};
page.init();
}
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoomTeacher.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoomTeacher.js
index 302f0a453..44863aeec 100644
--- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoomTeacher.js
+++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/Exam_ExamPlanLesson/FormRoomTeacher.js
@@ -106,18 +106,20 @@ var bootstrap = function ($, learun) {
};
refreshGirdData = function (temprow) {
//console.log('temprow', temprow);
- //求数组并集
- //两数组连接(包括重复值)
- var arr3 = tempdatra.concat(temprow);
- //var result = [];
- var obj = [];
- //去重
- tempdatra = arr3.reduce(function (prev, cur, index, arr) {
- //console.log(prev, cur);
- obj[cur.EmpNo] ? '' : obj[cur.EmpNo] = true && prev.push(cur);
- return prev;
- }, []);
- $('#Exam_ExamPlanTeacher').jfGridSet('refreshdata', tempdatra);
+ if (!!temprow) {
+ //求数组并集
+ //两数组连接(包括重复值)
+ var arr3 = tempdatra.concat(temprow);
+ //var result = [];
+ var obj = [];
+ //去重
+ tempdatra = arr3.reduce(function (prev, cur, index, arr) {
+ //console.log(prev, cur);
+ obj[cur.EmpNo] ? '' : obj[cur.EmpNo] = true && prev.push(cur);
+ return prev;
+ }, []);
+ $('#Exam_ExamPlanTeacher').jfGridSet('refreshdata', tempdatra);
+ }
};
refreshRoomData = function (temprow) {
// console.log('teacherRow', temprow);
@@ -146,18 +148,25 @@ var bootstrap = function ($, learun) {
};
// 保存数据
acceptClick = function (callBack, i) {
- var postData = {};
- var formData = $('[data-table="Exam_ExamPlanRoom"]').lrGetFormData();
- formData.EPLId = EPLId;
- postData.strEntity = JSON.stringify(formData);
- postData.Exam_ExamPlanTeacherList = JSON.stringify($('#Exam_ExamPlanTeacher').jfGridGet('rowdatas'));
-
- $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/SaveRoomAndTeacher?keyValue=' + keyValue, postData, function (res) {
- // 保存成功后才回调
- if (!!callBack) {
- callBack(res, formData, i);
+ var bool = validForm();
+ if (bool) {
+ var postData = {};
+ var formData = $('[data-table="Exam_ExamPlanRoom"]').lrGetFormData();
+ if (!formData.ClassroomName) {
+ return learun.alert.warning("请选择考场!");
}
- });
+ formData.EPLId = EPLId;
+ postData.strEntity = JSON.stringify(formData);
+ postData.Exam_ExamPlanTeacherList = JSON.stringify($('#Exam_ExamPlanTeacher').jfGridGet('rowdatas'));
+
+ $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlanLesson/SaveRoomAndTeacher?keyValue=' + keyValue, postData, function (res) {
+ // 保存成功后才回调
+ if (!!callBack) {
+ callBack(res, formData, i);
+ }
+ });
+ }
+
};
page.init();
}
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanService.cs
index ba209c059..290b07b5c 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanService.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanService.cs
@@ -189,6 +189,8 @@ delete from Exam_ExamPlanRoom where EPLId in ('{planLessonIds}');");
}
}
+ //修改排考记录表是否生成字段
+ db.ExecuteBySql($"update Exam_ExamPlan set EPGenarate=0 where EPId='{keyValue}'");
db.Commit();
}
catch (Exception ex)
@@ -215,6 +217,8 @@ delete from Exam_ExamPlanRoom where EPLId in ('{planLessonIds}');");
try
{
db.BeginTrans();
+ //排考记录表
+ var examPlan = db.FindEntity
(keyValue);
//排考安排课程已审核的数据
var planLessonData = db.FindList(x => x.EPId == keyValue && x.ELCheckMark == true);
@@ -263,6 +267,8 @@ delete from Exam_ExamPlanRoom where EPLId in ('{planLessonIds}');");
//生成考场随机数
var sealNumArr = getRanNum(planRoom.SeatCount.Value);
+ //删除考场明细
+ db.ExecuteBySql($"delete Exam_ArrangeExamTermItemNew where EPId='{keyValue}'");
for (int n = 0; n < sealNumArr.Count; n++)
{
//考场安排明细
@@ -286,23 +292,43 @@ delete from Exam_ExamPlanRoom where EPLId in ('{planLessonIds}');");
//排考安排班级
var planClassData = db.FindList(x => x.EPLId == planLesson.EPLId);
var classnos = string.Join("','", planClassData.Select(x => x.ClassNo).ToList());
- string stuSql = $"select * from StuInfoBasic where classno in ('{classnos}') and stuno not in (select StuNo from Exam_ArrangeExamTermItemNew where EPId='{keyValue}')";
+ string stuSql = $"select * from StuInfoBasic where checkMark='1' and classno in ('{classnos}') and stuno not in (select StuNo from Exam_ArrangeExamTermItemNew where EPId='{keyValue}')";
//所有考生
var stuInfoList = db.FindList(stuSql).ToList();
if (itemList.Count >= stuInfoList.Count())
{
- //为考生安排座位
- for (int i = 0; i < stuInfoList.Count; i++)
+ //随机安排座位
+ if (examPlan.EPRandom == true)
{
- itemList[i].StuNo = stuInfoList[i].StuNo;
- itemList[i].StuName = stuInfoList[i].StuName;
+ stuInfoList = stuInfoList.OrderBy(x => Guid.NewGuid()).ToList();
+ //为考生安排座位
+ for (int i = 0; i < stuInfoList.Count; i++)
+ {
+ itemList[i].StuNo = stuInfoList[i].StuNo;
+ itemList[i].StuName = stuInfoList[i].StuName;
+ }
+
+ db.Insert(itemList);
}
+ 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++)
+ {
+ itemList[i].StuNo = stuInfoList[i].StuNo;
+ itemList[i].StuName = stuInfoList[i].StuName;
+ }
- db.Insert(itemList);
+ db.Insert(itemList);
+ }
}
}
-
+ //修改排考记录表是否生成字段
+ db.ExecuteBySql($"update Exam_ExamPlan set EPGenarate=1 where EPId='{keyValue}'");
db.Commit();
}
catch (Exception ex)
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanClass/Exam_ExamPlanClassService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanClass/Exam_ExamPlanClassService.cs
index f8ddd5618..0d192394e 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanClass/Exam_ExamPlanClassService.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlanClass/Exam_ExamPlanClassService.cs
@@ -207,6 +207,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
{
try
{
+ var stuinfo = this.BaseRepository("CollegeMIS").FindList();
+ //计算班级人数
+ foreach (var entity in list)
+ {
+ entity.ClassStuNum = stuinfo.Count(x => x.ClassNo == entity.ClassNo);
+ }
this.BaseRepository("CollegeMIS").Insert(list);
//更新排考安排课程表实排班级数、实排人数
//排考安排课程表Id
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamRoom/Exam_ExamRoomService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamRoom/Exam_ExamRoomService.cs
index 956c32387..3c830ea23 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamRoom/Exam_ExamRoomService.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamRoom/Exam_ExamRoomService.cs
@@ -67,7 +67,7 @@ select EPId from Exam_ExamPlanLesson where EPLId='{queryParam["EPLId"].ToString(
strSql.Append($" AND t.AcademicYearNo = '{ELEntity.AcademicYearNo}' ");
strSql.Append($" AND t.Semester = '{ELEntity.Semester}' ");
}
-
+ strSql.Append($" AND t.ClassroomNo not in (select ClassroomNo from Exam_ExamPlanRoom where EPLId='{queryParam["EPLId"].ToString()}') ");
}
if (!queryParam["SqlParameter"].IsEmpty())