diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TeacherServiceInfoController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TeacherServiceInfoController.cs index ce3763b16..69069a86f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TeacherServiceInfoController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TeacherServiceInfoController.cs @@ -102,6 +102,11 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public ActionResult SaveForm(string keyValue, string strEntity) { TeacherServiceInfoEntity entity = strEntity.ToObject(); + var model = teacherServiceInfoIBLL.GetTeacherServiceInfoEntityByYear(entity.AcademicYearNo, entity.Semester); + if (model != null && model.ID != keyValue) + { + return Fail("当前学年学期已有数据!"); + } teacherServiceInfoIBLL.SaveEntity(keyValue,entity); return Success("保存成功!"); } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeacherServiceInfo/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeacherServiceInfo/Form.cshtml index 7b1f4e32e..822705272 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeacherServiceInfo/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeacherServiceInfo/Form.cshtml @@ -4,19 +4,19 @@ }
-
学年
+
学年*
-
学期
+
学期*
-
+ @*
教学业务
-
+
*@
-
附件
+
附件*
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeacherServiceInfo/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeacherServiceInfo/Index.cshtml index d081d87fb..55c6cd291 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeacherServiceInfo/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeacherServiceInfo/Index.cshtml @@ -18,10 +18,10 @@
学期
-
+ @*
教学业务
-
+
*@
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeacherServiceInfo/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeacherServiceInfo/Index.js index f5c03064c..c39007c3b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeacherServiceInfo/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeacherServiceInfo/Index.js @@ -32,7 +32,7 @@ var bootstrap = function ($, learun) { value: 'value', text: 'text' }); - $('#ServiceType').lrDataItemSelect({ code: 'ServiceType' }); + //$('#ServiceType').lrDataItemSelect({ code: 'ServiceType' }); // 刷新 $('#lr_refresh').on('click', function () { location.reload(); @@ -87,18 +87,18 @@ var bootstrap = function ($, learun) { headData: [ { label: "学年", name: "AcademicYearNo", 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", 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'); } }, - //{ 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"}, ], mainId:'ID', - isPage: true + isPage: true, + sidx: 'AcademicYearNo desc,Semester desc', + sord:'desc' }); page.search(); }, diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeacherServiceInfo/TeacherServiceInfoBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeacherServiceInfo/TeacherServiceInfoBLL.cs index 3a24a7fd1..5b795cc84 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeacherServiceInfo/TeacherServiceInfoBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeacherServiceInfo/TeacherServiceInfoBLL.cs @@ -14,7 +14,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// public class TeacherServiceInfoBLL : TeacherServiceInfoIBLL { - private TeacherServiceInfoService teacherServiceInfoEntity = new TeacherServiceInfoService(); + private TeacherServiceInfoService teacherServiceInfoService = new TeacherServiceInfoService(); #region 获取数据 @@ -27,7 +27,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - return teacherServiceInfoEntity.GetPageList(pagination, queryJson); + return teacherServiceInfoService.GetPageList(pagination, queryJson); } catch (Exception ex) { @@ -51,7 +51,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - return teacherServiceInfoEntity.GetTeacherServiceInfoEntity(keyValue); + return teacherServiceInfoService.GetTeacherServiceInfoEntity(keyValue); } catch (Exception ex) { @@ -65,11 +65,31 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + /// - /// 获取ClassInfo表实体数据 - /// 班级编号 + /// 根据学年学期 获取登录用户的TeacherServiceInfo表实体数据 + /// 学年 + /// 学期 /// /// + 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 @@ -78,7 +98,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - teacherServiceInfoEntity.DeleteEntity(keyValue); + teacherServiceInfoService.DeleteEntity(keyValue); } catch (Exception ex) { @@ -102,7 +122,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - teacherServiceInfoEntity.SaveEntity(keyValue, entity); + teacherServiceInfoService.SaveEntity(keyValue, entity); } catch (Exception ex) { diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeacherServiceInfo/TeacherServiceInfoIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeacherServiceInfo/TeacherServiceInfoIBLL.cs index 7310660b5..e6d88ade3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeacherServiceInfo/TeacherServiceInfoIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeacherServiceInfo/TeacherServiceInfoIBLL.cs @@ -26,6 +26,15 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// /// TeacherServiceInfoEntity GetTeacherServiceInfoEntity(string keyValue); + + /// + /// 根据学年学期 获取登录用户的TeacherServiceInfo表实体数据 + /// 学年 + /// 学期 + /// + /// + TeacherServiceInfoEntity GetTeacherServiceInfoEntityByYear(string academicYearNo, string semester); + #endregion #region 提交数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeacherServiceInfo/TeacherServiceInfoService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeacherServiceInfo/TeacherServiceInfoService.cs index 095f2e970..215f065d5 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeacherServiceInfo/TeacherServiceInfoService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TeacherServiceInfo/TeacherServiceInfoService.cs @@ -91,6 +91,32 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } + + /// + /// 根据学年学期 获取登录用户的TeacherServiceInfo表实体数据 + /// 学年 + /// 学期 + /// + /// + public TeacherServiceInfoEntity GetTeacherServiceInfoEntityByYear(string academicYearNo, string semester) + { + try + { + var loginUserInfo = LoginUserInfo.Get(); + return this.BaseRepository("CollegeMIS").FindEntity(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 #region 提交数据