From 87ed6c455762d48bc7aa245cb0bc08d080784e39 Mon Sep 17 00:00:00 2001 From: dyy <807692433@qq.com> Date: Tue, 18 Jul 2023 15:50:40 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E6=95=99?= =?UTF-8?q?=E5=AD=A6=E4=B8=9A=E5=8A=A1=E6=A1=A3=E6=A1=88=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=AD=A6=E5=B9=B4=E5=AD=A6=E6=9C=9F=E5=A1=AB=E5=86=99=E4=B8=80?= =?UTF-8?q?=E6=AC=A1=E7=9A=84=E9=99=90=E5=88=B6=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TeacherServiceInfoController.cs | 5 +++ .../Views/TeacherServiceInfo/Form.cshtml | 10 +++--- .../Views/TeacherServiceInfo/Index.cshtml | 4 +-- .../Views/TeacherServiceInfo/Index.js | 36 +++++++++++-------- .../TeacherServiceInfoBLL.cs | 34 ++++++++++++++---- .../TeacherServiceInfoIBLL.cs | 9 +++++ .../TeacherServiceInfoService.cs | 26 ++++++++++++++ 7 files changed, 95 insertions(+), 29 deletions(-) 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 提交数据