@@ -159,6 +159,13 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||
} | |||
return Success("保存成功!"); | |||
} | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult SeatForm(string AcademicYearNo, string Semester,string Type) | |||
{ | |||
int res = exam_ExamRoomIBLL.SeatEntity(AcademicYearNo, Semester); | |||
return Success("清空" + res + "条数据!"); | |||
} | |||
/// <summary> | |||
/// 启用/停用 | |||
@@ -59,6 +59,11 @@ var bootstrap = function ($, learun) { | |||
learun.alert.warning("选中记录已启用!"); | |||
return false; | |||
} | |||
var IsEdit = $('#gridtable').jfGridValue('IsEdit'); | |||
if (IsEdit === "false") { | |||
learun.alert.warning("选中记录中包含已排考项目!"); | |||
return; | |||
} | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'form', | |||
@@ -87,7 +92,7 @@ var bootstrap = function ($, learun) { | |||
} | |||
}); | |||
}); | |||
// 按条件清空数据 | |||
$('#lr_emptyWhere').on('click', function () { | |||
learun.layerForm({ | |||
@@ -111,6 +116,11 @@ var bootstrap = function ($, learun) { | |||
learun.alert.warning("选中记录中包含已启用项目!"); | |||
return; | |||
} | |||
var IsEdit = $('#gridtable').jfGridValue('IsEdit'); | |||
if (IsEdit === "false") { | |||
learun.alert.warning("选中记录中包含已排考项目!"); | |||
return; | |||
} | |||
learun.layerConfirm('是否确认删除该项!', function (res) { | |||
if (res) { | |||
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamRoom/DeleteForm', { keyValue: keyValue }, function () { | |||
@@ -147,6 +157,11 @@ var bootstrap = function ($, learun) { | |||
learun.alert.warning("选中记录中包含已停用项目!"); | |||
return; | |||
} | |||
var IsEdit = $('#gridtable').jfGridValue('IsEdit'); | |||
if (IsEdit === "false") { | |||
learun.alert.warning("选中记录中包含已排考项目!"); | |||
return; | |||
} | |||
learun.layerConfirm('是否确认停用选中记录!', function (res) { | |||
if (res) { | |||
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/Exam_ExamRoom/Lock', { keyValue: keyValue, EREnabled: 0 }, function () { | |||
@@ -156,7 +171,7 @@ var bootstrap = function ($, learun) { | |||
}); | |||
} | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
@@ -176,6 +191,13 @@ var bootstrap = function ($, learun) { | |||
return cellvalue == 1 ? "<i class=\"fa fa-toggle-on\"></i>" : "<i class=\"fa fa-toggle-off\"></i>"; | |||
} | |||
}, | |||
{ | |||
label: "是否可编辑", name: "IsEdit", width: 100, align: "left", | |||
formatter: function (cellvalue) { | |||
return cellvalue == true ? "<span class=\"label label-success\">可编辑</span>" : "<span class=\"label label-danger\">不可编辑</span>"; | |||
} | |||
}, | |||
], | |||
mainId: 'ERId', | |||
isMultiselect: true, | |||
@@ -10,13 +10,13 @@ namespace Learun.Application.Mapping | |||
/// 日 期:2022-04-12 15:47 | |||
/// 描 述:考试课程表 | |||
/// </summary> | |||
public class Exam_ExamPlanRoomDetailMap : EntityTypeConfiguration<Exam_ExamPlanRoomDetailEntity> | |||
public class Exam_ExamRoomDetailMap : EntityTypeConfiguration<Exam_ExamRoomDetailEntity> | |||
{ | |||
public Exam_ExamPlanRoomDetailMap() | |||
public Exam_ExamRoomDetailMap() | |||
{ | |||
#region 表、主键 | |||
//表 | |||
this.ToTable("Exam_ExamPlanRoomDetail"); | |||
this.ToTable("Exam_ExamRoomDetail"); | |||
//主键 | |||
this.HasKey(t => t.ID); | |||
#endregion | |||
@@ -200,6 +200,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
} | |||
} | |||
public string SeatEntity(string AcademicYearNo, string Semester, int Type) | |||
{ | |||
try | |||
{ | |||
exam_ExamRoomService.SeatEntity(AcademicYearNo, Semester, Type); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
@@ -64,6 +64,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// </summary> | |||
[Column("ERENABLED")] | |||
public bool? EREnabled { get; set; } | |||
/// <summary> | |||
/// Isedit | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("ISEDIT")] | |||
public bool? IsEdit { get; set; } | |||
#endregion | |||
#region 扩展操作 | |||
@@ -73,6 +79,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
public void Create() | |||
{ | |||
this.ERId = Guid.NewGuid().ToString(); | |||
this.IsEdit = true; | |||
} | |||
/// <summary> | |||
/// 编辑调用 | |||
@@ -52,7 +52,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
int Import(string AcademicYearNo, string Semester, int SeatRows, int SeatColumns); | |||
int DeleteWhere(string AcademicYearNo, string Semester); | |||
string SeatEntity(string AcademicYearNo, string Semester, int Type); | |||
#endregion | |||
} | |||
@@ -296,8 +296,10 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
,[SeatColumns] | |||
,[SeatCount] | |||
,[EROrder] | |||
,[EREnabled]) | |||
select NEWID(),'{AcademicYearNo}','{Semester}',ClassroomName,[ClassroomNo],{SeatRows},{SeatColumns},{SeatRows}*{SeatColumns},0,1 from ClassroomInfo where CheckMark=1 | |||
,[EREnabled] | |||
,[IsEdit] | |||
) | |||
select NEWID(),'{AcademicYearNo}','{Semester}',ClassroomName,[ClassroomNo],{SeatRows},{SeatColumns},{SeatRows}*{SeatColumns},0,1,1 from ClassroomInfo where CheckMark=1 | |||
and [ClassroomNo] not in (select [ClassroomNo] from Exam_ExamRoom where AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' ) | |||
"; | |||
return this.BaseRepository("CollegeMIS").ExecuteBySql(sql); | |||
@@ -325,7 +327,7 @@ select NEWID(),'{AcademicYearNo}','{Semester}',ClassroomName,[ClassroomNo],{Seat | |||
{ | |||
try | |||
{ | |||
string sql = $"delete Exam_ExamRoom where AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}'"; | |||
string sql = $"delete Exam_ExamRoom where AcademicYearNo='{AcademicYearNo}' and Semester='{Semester}' and IsEdit = 'true'"; | |||
return this.BaseRepository("CollegeMIS").ExecuteBySql(sql); | |||
} | |||
catch (Exception ex) | |||
@@ -340,6 +342,61 @@ select NEWID(),'{AcademicYearNo}','{Semester}',ClassroomName,[ClassroomNo],{Seat | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 删除实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
public string SeatEntity(string AcademicYearNo, int Semester, int Type) | |||
{ | |||
var db = this.BaseRepository().BeginTrans(); | |||
try | |||
{ | |||
if (Type == 1) | |||
{ | |||
var room = db.FindList<Exam_ExamRoomEntity>().Where(x => x.AcademicYearNo == AcademicYearNo && x.Semester == Semester).ToList(); | |||
if (room.Count() > 0) | |||
{ | |||
Exam_ExamRoomDetailEntity entity = new Exam_ExamRoomDetailEntity(); | |||
for (int i = 0; i < room.Count(); i++) | |||
{ | |||
for (int j = 0; j < room[i].SeatCount; j++) | |||
{ | |||
entity.AcademicYearNo = AcademicYearNo; | |||
entity.Semester = Semester; | |||
entity.ClassRoomNo = room[j].ClassroomNo; | |||
entity.ClassRoomName = room[j].ClassroomName; | |||
entity.ECOrder = i + 1; | |||
entity.Create(); | |||
db.Insert(entity); | |||
} | |||
room[i].IsEdit = false;//修改为不可编辑 | |||
} | |||
} | |||
db.Update(room);//修改为不可编辑 | |||
} | |||
else | |||
{ | |||
var sql = "delete from Exam_ExamRoomDetail where AcademicYearNo ='" + AcademicYearNo + "' and Semester='"+ Semester + "'; update Exam_ExamRoom set IsEdit = 1 where AcademicYearNo ='" + AcademicYearNo + "' and Semester='; "; | |||
this.BaseRepository("CollegeMIS").ExecuteBySql(sql); | |||
} | |||
db.Commit(); | |||
} | |||
catch (Exception ex) | |||
{ | |||
db.Rollback(); | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
@@ -12,9 +12,9 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// 日 期:2022-04-15 15:03 | |||
/// 描 述:排考安排考场 | |||
/// </summary> | |||
public class Exam_ExamPlanRoomDetaiBLL : Exam_ExamPlanRoomDetailIBLL | |||
public class Exam_ExamRoomDetailBLL : Exam_ExamRoomDetailIBLL | |||
{ | |||
private Exam_ExamPlanRoomDetailService exam_ExamPlanRoomService = new Exam_ExamPlanRoomDetailService(); | |||
private Exam_ExamRoomDetailService exam_ExamRoomDetailService = new Exam_ExamRoomDetailService(); | |||
#region 获取数据 | |||
@@ -24,11 +24,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<Exam_ExamPlanRoomDetailEntity> GetPageList(Pagination pagination, string queryJson) | |||
public IEnumerable<Exam_ExamRoomDetailEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
return exam_ExamPlanRoomService.GetPageList(pagination, queryJson); | |||
return exam_ExamRoomDetailService.GetPageList(pagination, queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -43,11 +43,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
} | |||
} | |||
public IEnumerable<Exam_ExamPlanRoomDetailEntity> GetList(string queryJson) | |||
public IEnumerable<Exam_ExamRoomDetailEntity> GetList(string queryJson) | |||
{ | |||
try | |||
{ | |||
return exam_ExamPlanRoomService.GetList(queryJson); | |||
return exam_ExamRoomDetailService.GetList(queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -67,11 +67,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public Exam_ExamPlanRoomDetailEntity GetEntity(string keyValue) | |||
public Exam_ExamRoomDetailEntity GetEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return exam_ExamPlanRoomService.GetEntity(keyValue); | |||
return exam_ExamRoomDetailService.GetEntity(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -98,7 +98,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
{ | |||
try | |||
{ | |||
exam_ExamPlanRoomService.DeleteEntity(keyValue); | |||
exam_ExamRoomDetailService.DeleteEntity(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -120,11 +120,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
/// <returns></returns> | |||
public void SaveEntity(string keyValue, Exam_ExamPlanRoomDetailEntity entity) | |||
public void SaveEntity(string keyValue, Exam_ExamRoomDetailEntity entity) | |||
{ | |||
try | |||
{ | |||
exam_ExamPlanRoomService.SaveEntity(keyValue, entity); | |||
exam_ExamRoomDetailService.SaveEntity(keyValue, entity); | |||
} | |||
catch (Exception ex) | |||
{ |
@@ -11,7 +11,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// 日 期:2022-04-15 18:12 | |||
/// 描 述:排考安排考场表 | |||
/// </summary> | |||
public class Exam_ExamPlanRoomDetailEntity | |||
public class Exam_ExamRoomDetailEntity | |||
{ | |||
#region 实体成员 | |||
/// <summary> | |||
@@ -55,7 +55,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("Semester")] | |||
public string Semester { get; set; } | |||
public int? Semester { get; set; } | |||
/// <summary> | |||
/// StuNo | |||
/// </summary> | |||
@@ -97,7 +97,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// </summary> | |||
/// <returns></returns> | |||
[Column("ECENABLED")] | |||
public string ECEnabled { get; set; } | |||
public bool? ECEnabled { get; set; } | |||
#endregion | |||
#region 扩展操作 |
@@ -11,7 +11,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// 日 期:2022-04-15 15:03 | |||
/// 描 述:排考安排考场 | |||
/// </summary> | |||
public interface Exam_ExamPlanRoomDetailIBLL | |||
public interface Exam_ExamRoomDetailIBLL | |||
{ | |||
#region 获取数据 | |||
@@ -20,15 +20,15 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// </summary> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
IEnumerable<Exam_ExamPlanRoomDetailEntity> GetPageList(Pagination pagination, string queryJson); | |||
IEnumerable<Exam_ExamRoomDetailEntity> GetPageList(Pagination pagination, string queryJson); | |||
IEnumerable<Exam_ExamPlanRoomDetailEntity> GetList(string queryJson); | |||
IEnumerable<Exam_ExamRoomDetailEntity> GetList(string queryJson); | |||
/// <summary> | |||
/// 获取实体数据 | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
Exam_ExamPlanRoomDetailEntity GetEntity(string keyValue); | |||
Exam_ExamRoomDetailEntity GetEntity(string keyValue); | |||
#endregion | |||
@@ -44,7 +44,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
void SaveEntity(string keyValue, Exam_ExamPlanRoomDetailEntity entity); | |||
void SaveEntity(string keyValue, Exam_ExamRoomDetailEntity entity); | |||
#endregion | |||
@@ -16,7 +16,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// 日 期:2022-04-15 15:03 | |||
/// 描 述:排考安排考场 | |||
/// </summary> | |||
public class Exam_ExamPlanRoomDetailService : RepositoryFactory | |||
public class Exam_ExamRoomDetailService : RepositoryFactory | |||
{ | |||
#region 获取数据 | |||
@@ -26,7 +26,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// <param name="pagination">查询参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<Exam_ExamPlanRoomDetailEntity> GetPageList(Pagination pagination, string queryJson) | |||
public IEnumerable<Exam_ExamRoomDetailEntity> GetPageList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
@@ -35,7 +35,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
strSql.Append(@" | |||
t.* | |||
"); | |||
strSql.Append(" FROM Exam_ExamPlanRoomDetail t "); | |||
strSql.Append(" FROM Exam_ExamRoomDetail t "); | |||
strSql.Append(" WHERE 1=1 "); | |||
var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
@@ -45,7 +45,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
dp.Add("EPLId", queryParam["EPLId"].ToString(), DbType.String); | |||
strSql.Append(" AND t.EPLId = @EPLId "); | |||
} | |||
return this.BaseRepository("CollegeMIS").FindList<Exam_ExamPlanRoomDetailEntity>(strSql.ToString(), dp, pagination); | |||
return this.BaseRepository("CollegeMIS").FindList<Exam_ExamRoomDetailEntity>(strSql.ToString(), dp, pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -66,7 +66,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// <param name="pagination">查询参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<Exam_ExamPlanRoomDetailEntity> GetList(string queryJson) | |||
public IEnumerable<Exam_ExamRoomDetailEntity> GetList(string queryJson) | |||
{ | |||
try | |||
{ | |||
@@ -75,7 +75,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
strSql.Append(@" | |||
t.* | |||
"); | |||
strSql.Append(" FROM Exam_ExamPlanRoomDetail t "); | |||
strSql.Append(" FROM Exam_ExamRoomDetail t "); | |||
strSql.Append(" WHERE 1=1 "); | |||
var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
@@ -85,7 +85,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
dp.Add("EPLId", queryParam["EPLId"].ToString(), DbType.String); | |||
strSql.Append(" AND t.EPLId = @EPLId "); | |||
} | |||
return this.BaseRepository("CollegeMIS").FindList<Exam_ExamPlanRoomDetailEntity>(strSql.ToString(), dp); | |||
return this.BaseRepository("CollegeMIS").FindList<Exam_ExamRoomDetailEntity>(strSql.ToString(), dp); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -105,11 +105,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <returns></returns> | |||
public Exam_ExamPlanRoomDetailEntity GetEntity(string keyValue) | |||
public Exam_ExamRoomDetailEntity GetEntity(string keyValue) | |||
{ | |||
try | |||
{ | |||
return this.BaseRepository("CollegeMIS").FindEntity<Exam_ExamPlanRoomDetailEntity>(keyValue); | |||
return this.BaseRepository("CollegeMIS").FindEntity<Exam_ExamRoomDetailEntity>(keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -169,7 +169,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||
/// </summary> | |||
/// <param name="keyValue">主键</param> | |||
/// <param name="entity">实体</param> | |||
public void SaveEntity(string keyValue, Exam_ExamPlanRoomDetailEntity entity) | |||
public void SaveEntity(string keyValue, Exam_ExamRoomDetailEntity entity) | |||
{ | |||
try | |||
{ |
@@ -183,10 +183,10 @@ | |||
<Compile Include="EducationalAdministration\Exam_ExamPlanLesson\Exam_ExamPlanLessonEntity.cs" /> | |||
<Compile Include="EducationalAdministration\Exam_ExamPlanLesson\Exam_ExamPlanLessonIBLL.cs" /> | |||
<Compile Include="EducationalAdministration\Exam_ExamPlanLesson\Exam_ExamPlanLessonService.cs" /> | |||
<Compile Include="EducationalAdministration\Exam_ExamPlanRoomDetail\Exam_ExamPlanRoomDetailBLL.cs" /> | |||
<Compile Include="EducationalAdministration\Exam_ExamPlanRoomDetail\Exam_ExamPlanRoomDetailEntity.cs" /> | |||
<Compile Include="EducationalAdministration\Exam_ExamPlanRoomDetail\Exam_ExamPlanRoomDetailIBLL.cs" /> | |||
<Compile Include="EducationalAdministration\Exam_ExamPlanRoomDetail\Exam_ExamPlanRoomDetailService.cs" /> | |||
<Compile Include="EducationalAdministration\Exam_ExamRoomDetail\Exam_ExamRoomDetailBLL.cs" /> | |||
<Compile Include="EducationalAdministration\Exam_ExamRoomDetail\Exam_ExamRoomDetailEntity.cs" /> | |||
<Compile Include="EducationalAdministration\Exam_ExamRoomDetail\Exam_ExamRoomDetailIBLL.cs" /> | |||
<Compile Include="EducationalAdministration\Exam_ExamRoomDetail\Exam_ExamRoomDetailService.cs" /> | |||
<Compile Include="EducationalAdministration\Exam_ExamPlanRoom\Exam_ExamPlanRoomBLL.cs" /> | |||
<Compile Include="EducationalAdministration\Exam_ExamPlanRoom\Exam_ExamPlanRoomEntity.cs" /> | |||
<Compile Include="EducationalAdministration\Exam_ExamPlanRoom\Exam_ExamPlanRoomIBLL.cs" /> | |||