';
- html += '
顺序*
';
- html += '
';
+ html += '
';
+ html += '
';
+ html += '
';
+ html += '
';
+ html += '
';
+ //html += '
';
+ //html += '
';
+ //html += '
';
+ //html += '
';
+
$('#content1').append(html);
- $('#pro' + id).lrselect({
+
+ $('#ExamType' + id).lrselect({
allowSearch: true,
- url: top.$.rootUrl + '/LR_Desktop/FormulaMain/GetCalProject',
- param: { strWhere: "1=1 " },
- value: "id",
- text: "name",
+ url: top.$.rootUrl + '/LR_SystemModule/DataItem/GetDetailList',
+ param: { itemCode: 'ExamLessonType' },
+ value: 'F_ItemValue',
+ text: 'F_ItemName',
select:
function (item) {
if (item) {
var id = $(this).attr('id');
- var parId = id.replace('pro', '');
-
+ var parId = id.replace('ExamType', '');
arr.forEach(item => {
if (item.iid == parId) {
//如果存在删除
removeByValue(arr, 'iid', parId);
}
});
- arr.push({ iid: parId, ProjectId: item.id, ProjectName: item.name, Sort: $('#Sort' + parId).val() });
+ arr.push({ iid: parId, ExamType: $('#ExamType' + parId).val(), ExamDate: $('#ExamDate' + parId).val(), ExamTimeStart: $('#ExamTimeStart' + parId).val(), ExamTimeEnd: $('#ExamTimeEnd' + parId).val() });
+
+ //arr.sort(sortBy("Sort"));
+ //page.refreshRes();
- arr.sort(sortBy("Sort"));
- page.refreshRes();
}
}
});
-
- $('#pro' + id).lrselectSet(data[i].ProjectId);
+ $('#ExamType' + id).lrselectSet(data[i].ExamType);
}
} else {
@@ -156,53 +178,29 @@ var bootstrap = function ($, learun) {
function (item) {
if (item) {
var id = $(this).attr('id');
- var parId = id.replace('pro', '');
- //arr.forEach(item => {
- // if (item.iid == parId) {
- // //如果存在删除
- // removeByValue(arr, 'iid', parId);
- // }
- //});
- //arr.push({ iid: parId, ProjectId: item.id, ProjectName: item.name, Sort: $('#Sort' + parId).val() });
+ var parId = id.replace('ExamType', '');
+ arr.forEach(item => {
+ if (item.iid == parId) {
+ //如果存在删除
+ removeByValue(arr, 'iid', parId);
+ }
+ });
+ arr.push({ iid: parId, ExamType: $('#ExamType' + parId).val(), ExamDate: $('#ExamDate' + parId).val(), ExamTimeStart: $('#ExamTimeStart' + parId).val(), ExamTimeEnd: $('#ExamTimeEnd' + parId).val() });
//arr.sort(sortBy("Sort"));
//page.refreshRes();
+
}
}
});
- //$('#pro' + id).lrselect({
- // allowSearch: true,
- // url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/GetCalProject',
- // param: { strWhere: "1=1 " },
- // value: "id",
- // text: "name",
- // select:
- // function (item) {
- // if (item) {
- // var id = $(this).attr('id');
- // var parId = id.replace('pro', '');
- // arr.forEach(item => {
- // if (item.iid == parId) {
- // //如果存在删除
- // removeByValue(arr, 'iid', parId);
- // }
- // });
- // arr.push({ iid: parId, ProjectId: item.id, ProjectName: item.name, Sort: $('#Sort' + parId).val() });
-
- // arr.sort(sortBy("Sort"));
- // page.refreshRes();
- // }
- // }
- //});
-
},
refreshRes: function () {
- //页面显示公式结果
- var text = '';
- arr.forEach(m => {
- text += m.ProjectName;
- });
- $('#result').html(text);
+ ////页面显示公式结果
+ //var text = '';
+ //arr.forEach(m => {
+ // text += m.ProjectName;
+ //});
+ //$('#result').html(text);
}
};
// 保存数据
@@ -210,16 +208,18 @@ var bootstrap = function ($, learun) {
if (!$('body').lrValidform()) {
return false;
}
- var strEntity = JSON.stringify($('body').lrGetFormData());
-
- if (arr.length == 0) {
- return learun.alert.warning('请选择计算项目!');
+ var data = [];
+ arr.forEach(function (item, index, array) {
+ data.push({ ExamType: $('#ExamType' + item.iid).lrselectGet(), ExamDate: $('#ExamDate' + item.iid).val(), ExamTimeStart: $('#ExamTimeStart' + item.iid).val(), ExamTimeEnd: $('#ExamTimeEnd' + item.iid).val() });
+ });
+ if (data.length == 0) {
+ return learun.alert.warning('请安排考试时间!');
}
var postData = {
//mainEntity: strEntity,
- strEntity: arr
+ list: data
};
- $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/SaveList?MainId=' + keyValue, postData, function (res) {
+ $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/SavePlanTime?EPId=' + keyValue, postData, function (res) {
// 保存成功后才回调
if (!!callBack) {
callBack();
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 f37d5207c..6d00344ee 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
@@ -136,10 +136,11 @@ var bootstrap = function ($, learun) {
// 安排时间
$('#lr_examtime').on('click', function () {
+ var keyValue = $('#gridtable').jfGridValue('EPId');
learun.layerForm({
id: 'formtime',
title: '安排时间',
- url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/FormTime',
+ url: top.$.rootUrl + '/EducationalAdministration/Exam_ExamPlan/FormTime?keyValue=' + keyValue,
width: 850,
height: 550,
callBack: function (id) {
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/Exam_ExamPlanTimeMap.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/Exam_ExamPlanTimeMap.cs
new file mode 100644
index 000000000..019d4a77d
--- /dev/null
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/EducationalAdministration/Exam_ExamPlanTimeMap.cs
@@ -0,0 +1,29 @@
+using Learun.Application.TwoDevelopment.EducationalAdministration;
+using System.Data.Entity.ModelConfiguration;
+
+namespace Learun.Application.Mapping
+{
+ ///
+ /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架
+ /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司
+ /// 创 建:超级管理员
+ /// 日 期:2022-04-14 18:12
+ /// 描 述:考试记录表
+ ///
+ public class Exam_ExamPlanTimeMap : EntityTypeConfiguration
+ {
+ public Exam_ExamPlanTimeMap()
+ {
+ #region 表、主键
+ //表
+ this.ToTable("EXAM_EXAMPLANTIME");
+ //主键
+ this.HasKey(t => t.Id);
+ #endregion
+
+ #region 配置关系
+ #endregion
+ }
+ }
+}
+
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj
index 87566726f..8ae322117 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Mapping/Learun.Application.Mapping.csproj
@@ -86,6 +86,7 @@
+
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanBLL.cs
index da10ee0ec..f3298d883 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanBLL.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanBLL.cs
@@ -67,6 +67,24 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
+ public IEnumerable GetPlanTimeList(string EPId)
+ {
+ try
+ {
+ return exam_ExamPlanService.GetPlanTimeList(EPId);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
#endregion
#region 提交数据
@@ -131,6 +149,26 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
+
+ public void SavePlanTime(string EPId, List list)
+ {
+ try
+ {
+ exam_ExamPlanService.SavePlanTime(EPId, list);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowBusinessException(ex);
+ }
+ }
+ }
+
public bool IsGenerate(string keyValue)
{
try
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanIBLL.cs
index 5766e5ca7..fcf5be98c 100644
--- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanIBLL.cs
+++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/Exam_ExamPlan/Exam_ExamPlanIBLL.cs
@@ -27,6 +27,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
/// 主键
///
Exam_ExamPlanEntity GetExam_ExamPlanEntity(string keyValue);
+ IEnumerable GetPlanTimeList(string EPId);
#endregion
#region 提交数据
@@ -39,6 +40,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
void ClearGenerate(string keyValue, int type);
void Generate(string keyValue);
+ void SavePlanTime(string EPId, List list);
bool IsGenerate(string keyValue);
///
/// 保存实体数据(新增、修改)
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 b79689df8..a826690af 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
@@ -123,6 +123,24 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
+ public IEnumerable GetPlanTimeList(string EPId)
+ {
+ try
+ {
+ return this.BaseRepository("CollegeMIS").FindList(x => x.EPId == EPId);
+ }
+ catch (Exception ex)
+ {
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
#endregion
#region 提交数据
@@ -150,6 +168,40 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration
}
}
+ ///
+ /// 安排时间
+ ///
+ ///
+ ///
+ public void SavePlanTime(string EPId, List list)
+ {
+ var db = this.BaseRepository("CollegeMIS");
+ try
+ {
+ db.BeginTrans();
+ foreach (var entity in list)
+ {
+ entity.Create();
+ entity.EPId = EPId;
+ db.Insert(entity);
+ }
+ db.Commit();
+ //this.BaseRepository("CollegeMIS").Delete(t => t.EPId == keyValue);
+ }
+ catch (Exception ex)
+ {
+ db.Rollback();
+ if (ex is ExceptionEx)
+ {
+ throw;
+ }
+ else
+ {
+ throw ExceptionEx.ThrowServiceException(ex);
+ }
+ }
+ }
+
///
/// 清除排考名单/清除所有排考记录
///
@@ -272,7 +324,7 @@ delete from Exam_ExamPlanRoom where EPLId in ('{planLessonIds}');");
db.ExecuteBySql($"delete Exam_ArrangeExamTermNew where EPId='{keyValue}'");
//删除考场明细
db.ExecuteBySql($"delete Exam_ArrangeExamTermItemNew where EPId='{keyValue}'");
-
+
foreach (var planLesson in planLessonData)
{
//排考安排明细数据
@@ -329,7 +381,7 @@ delete from Exam_ExamPlanRoom where EPLId in ('{planLessonIds}');");
//所有考生
var stuInfoList = db.FindList(stuSql).ToList();
var classInfo = db.FindList();
-
+
itemList = itemList.OrderBy(x => x.SitNumber).OrderBy(x => x.ClassroomNo).ToList();
if (itemList.Count >= stuInfoList.Count())
{