@@ -102,6 +102,11 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
public ActionResult SaveForm(string keyValue, string strEntity) | public ActionResult SaveForm(string keyValue, string strEntity) | ||||
{ | { | ||||
TeacherServiceInfoEntity entity = strEntity.ToObject<TeacherServiceInfoEntity>(); | TeacherServiceInfoEntity entity = strEntity.ToObject<TeacherServiceInfoEntity>(); | ||||
var model = teacherServiceInfoIBLL.GetTeacherServiceInfoEntityByYear(entity.AcademicYearNo, entity.Semester); | |||||
if (model != null && model.ID != keyValue) | |||||
{ | |||||
return Fail("当前学年学期已有数据!"); | |||||
} | |||||
teacherServiceInfoIBLL.SaveEntity(keyValue,entity); | teacherServiceInfoIBLL.SaveEntity(keyValue,entity); | ||||
return Success("保存成功!"); | return Success("保存成功!"); | ||||
} | } | ||||
@@ -4,19 +4,19 @@ | |||||
} | } | ||||
<div class="lr-form-wrap"> | <div class="lr-form-wrap"> | ||||
<div class="col-xs-6 lr-form-item" data-table="TeacherServiceInfo"> | <div class="col-xs-6 lr-form-item" data-table="TeacherServiceInfo"> | ||||
<div class="lr-form-item-title">学年</div> | |||||
<div class="lr-form-item-title">学年<font face="宋体">*</font></div> | |||||
<div id="AcademicYearNo" isvalid="yes" checkexpession="NotNull"></div> | <div id="AcademicYearNo" isvalid="yes" checkexpession="NotNull"></div> | ||||
</div> | </div> | ||||
<div class="col-xs-6 lr-form-item" data-table="TeacherServiceInfo"> | <div class="col-xs-6 lr-form-item" data-table="TeacherServiceInfo"> | ||||
<div class="lr-form-item-title">学期</div> | |||||
<div class="lr-form-item-title">学期<font face="宋体">*</font></div> | |||||
<div id="Semester" isvalid="yes" checkexpession="NotNull"></div> | <div id="Semester" isvalid="yes" checkexpession="NotNull"></div> | ||||
</div> | </div> | ||||
<div class="col-xs-12 lr-form-item" data-table="TeacherServiceInfo"> | |||||
@*<div class="col-xs-12 lr-form-item" data-table="TeacherServiceInfo"> | |||||
<div class="lr-form-item-title">教学业务</div> | <div class="lr-form-item-title">教学业务</div> | ||||
<div id="ServiceType" isvalid="yes" checkexpession="NotNull"></div> | <div id="ServiceType" isvalid="yes" checkexpession="NotNull"></div> | ||||
</div> | |||||
</div>*@ | |||||
<div class="col-xs-12 lr-form-item" data-table="TeacherServiceInfo"> | <div class="col-xs-12 lr-form-item" data-table="TeacherServiceInfo"> | ||||
<div class="lr-form-item-title">附件</div> | |||||
<div class="lr-form-item-title">附件<font face="宋体">*</font></div> | |||||
<div id="Path" isvalid="yes" checkexpession="NotNull"></div> | <div id="Path" isvalid="yes" checkexpession="NotNull"></div> | ||||
</div> | </div> | ||||
<div class="col-xs-12 lr-form-item" data-table="TeacherServiceInfo"> | <div class="col-xs-12 lr-form-item" data-table="TeacherServiceInfo"> | ||||
@@ -18,10 +18,10 @@ | |||||
<div class="lr-form-item-title">学期</div> | <div class="lr-form-item-title">学期</div> | ||||
<div id="Semester"></div> | <div id="Semester"></div> | ||||
</div> | </div> | ||||
<div class="col-xs-12 lr-form-item"> | |||||
@*<div class="col-xs-12 lr-form-item"> | |||||
<div class="lr-form-item-title">教学业务</div> | <div class="lr-form-item-title">教学业务</div> | ||||
<div id="ServiceType"></div> | <div id="ServiceType"></div> | ||||
</div> | |||||
</div>*@ | |||||
</div> | </div> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
@@ -32,7 +32,7 @@ var bootstrap = function ($, learun) { | |||||
value: 'value', | value: 'value', | ||||
text: 'text' | text: 'text' | ||||
}); | }); | ||||
$('#ServiceType').lrDataItemSelect({ code: 'ServiceType' }); | |||||
//$('#ServiceType').lrDataItemSelect({ code: 'ServiceType' }); | |||||
// 刷新 | // 刷新 | ||||
$('#lr_refresh').on('click', function () { | $('#lr_refresh').on('click', function () { | ||||
location.reload(); | location.reload(); | ||||
@@ -87,18 +87,18 @@ var bootstrap = function ($, learun) { | |||||
headData: [ | headData: [ | ||||
{ label: "学年", name: "AcademicYearNo", width: 100, align: "left"}, | { label: "学年", name: "AcademicYearNo", width: 100, align: "left"}, | ||||
{ label: "学期", name: "Semester", width: 100, align: "left" }, | { label: "学期", name: "Semester", width: 100, align: "left" }, | ||||
{ | |||||
label: "教学业务", name: "ServiceType", width: 200, align: "left", | |||||
formatterAsync: function (callback, value) { | |||||
learun.clientdata.getAsync('dataItem', { | |||||
key: value, | |||||
code: 'ServiceType', | |||||
callback: function (_data) { | |||||
callback(_data.text); | |||||
} | |||||
}); | |||||
} | |||||
}, | |||||
//{ | |||||
// label: "教学业务", name: "ServiceType", width: 200, align: "left", | |||||
// formatterAsync: function (callback, value) { | |||||
// learun.clientdata.getAsync('dataItem', { | |||||
// key: value, | |||||
// code: 'ServiceType', | |||||
// callback: function (_data) { | |||||
// callback(_data.text); | |||||
// } | |||||
// }); | |||||
// } | |||||
//}, | |||||
{ | { | ||||
label: "创建用户", name: "CreateUser", width: 100, align: "left", | label: "创建用户", name: "CreateUser", width: 100, align: "left", | ||||
formatterAsync: function (callback, value, row, op, $cell) { | formatterAsync: function (callback, value, row, op, $cell) { | ||||
@@ -116,11 +116,17 @@ var bootstrap = function ($, learun) { | |||||
return learun.formatDate(cellvalue, 'yyyy-MM-dd hh:mm:ss'); | return learun.formatDate(cellvalue, 'yyyy-MM-dd hh:mm:ss'); | ||||
} | } | ||||
}, | }, | ||||
//{ label: "文件", name: "Path", width: 100, align: "left" }, | |||||
{ | |||||
label: "附件", name: "Path", width: 100, align: "left", formatter: function (cellvalue) { | |||||
return !!cellvalue ? "已上传" : "未上传"; | |||||
} | |||||
}, | |||||
{ label: "备注", name: "Remark", width: 100, align: "left"}, | { label: "备注", name: "Remark", width: 100, align: "left"}, | ||||
], | ], | ||||
mainId:'ID', | mainId:'ID', | ||||
isPage: true | |||||
isPage: true, | |||||
sidx: 'AcademicYearNo desc,Semester desc', | |||||
sord:'desc' | |||||
}); | }); | ||||
page.search(); | page.search(); | ||||
}, | }, | ||||
@@ -14,7 +14,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
/// </summary> | /// </summary> | ||||
public class TeacherServiceInfoBLL : TeacherServiceInfoIBLL | public class TeacherServiceInfoBLL : TeacherServiceInfoIBLL | ||||
{ | { | ||||
private TeacherServiceInfoService teacherServiceInfoEntity = new TeacherServiceInfoService(); | |||||
private TeacherServiceInfoService teacherServiceInfoService = new TeacherServiceInfoService(); | |||||
#region 获取数据 | #region 获取数据 | ||||
@@ -27,7 +27,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
return teacherServiceInfoEntity.GetPageList(pagination, queryJson); | |||||
return teacherServiceInfoService.GetPageList(pagination, queryJson); | |||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||
{ | { | ||||
@@ -51,7 +51,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
return teacherServiceInfoEntity.GetTeacherServiceInfoEntity(keyValue); | |||||
return teacherServiceInfoService.GetTeacherServiceInfoEntity(keyValue); | |||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||
{ | { | ||||
@@ -65,11 +65,31 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
/// 获取ClassInfo表实体数据 | |||||
/// <param name="classNo">班级编号</param> | |||||
/// 根据学年学期 获取登录用户的TeacherServiceInfo表实体数据 | |||||
/// <param name="academicYearNo">学年</param> | |||||
/// <param name="semester">学期</param> | |||||
/// <summary> | /// <summary> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
public TeacherServiceInfoEntity GetTeacherServiceInfoEntityByYear(string academicYearNo, string semester) | |||||
{ | |||||
try | |||||
{ | |||||
return teacherServiceInfoService.GetTeacherServiceInfoEntityByYear(academicYearNo, semester); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | #endregion | ||||
@@ -78,7 +98,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
teacherServiceInfoEntity.DeleteEntity(keyValue); | |||||
teacherServiceInfoService.DeleteEntity(keyValue); | |||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||
{ | { | ||||
@@ -102,7 +122,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
{ | { | ||||
try | try | ||||
{ | { | ||||
teacherServiceInfoEntity.SaveEntity(keyValue, entity); | |||||
teacherServiceInfoService.SaveEntity(keyValue, entity); | |||||
} | } | ||||
catch (Exception ex) | catch (Exception ex) | ||||
{ | { | ||||
@@ -26,6 +26,15 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
/// <summary> | /// <summary> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
TeacherServiceInfoEntity GetTeacherServiceInfoEntity(string keyValue); | TeacherServiceInfoEntity GetTeacherServiceInfoEntity(string keyValue); | ||||
/// <summary> | |||||
/// 根据学年学期 获取登录用户的TeacherServiceInfo表实体数据 | |||||
/// <param name="academicYearNo">学年</param> | |||||
/// <param name="semester">学期</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
TeacherServiceInfoEntity GetTeacherServiceInfoEntityByYear(string academicYearNo, string semester); | |||||
#endregion | #endregion | ||||
#region 提交数据 | #region 提交数据 | ||||
@@ -91,6 +91,32 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
} | } | ||||
/// <summary> | |||||
/// 根据学年学期 获取登录用户的TeacherServiceInfo表实体数据 | |||||
/// <param name="academicYearNo">学年</param> | |||||
/// <param name="semester">学期</param> | |||||
/// <summary> | |||||
/// <returns></returns> | |||||
public TeacherServiceInfoEntity GetTeacherServiceInfoEntityByYear(string academicYearNo, string semester) | |||||
{ | |||||
try | |||||
{ | |||||
var loginUserInfo = LoginUserInfo.Get(); | |||||
return this.BaseRepository("CollegeMIS").FindEntity<TeacherServiceInfoEntity>(x => x.AcademicYearNo == academicYearNo && x.Semester == semester && x.CreateUser == loginUserInfo.userId); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | #endregion | ||||
#region 提交数据 | #region 提交数据 | ||||