From e618bd40db391ab925c762bdfe9f338c90c2ce4d Mon Sep 17 00:00:00 2001 From: ndbs Date: Thu, 17 Oct 2024 15:20:53 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=99=E5=B8=88=E5=9F=B9=E8=AE=AD=E7=AE=A1?= =?UTF-8?q?=E7=90=86/=E7=BB=A7=E7=BB=AD=E6=95=99=E8=82=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/TeacherTrainController.cs | 13 ++++ .../Views/TeacherTrain/Form.cshtml | 10 ++- .../Views/TeacherTrain/Form.js | 8 +-- .../Views/TeacherTrain/Index.cshtml | 22 ++++++ .../Views/TeacherTrain/Index.js | 72 ++++++++++++++++++- .../TeacherTrain/TeacherTrainBLL.cs | 23 ++++++ .../TeacherTrain/TeacherTrainEntity.cs | 14 ++++ .../TeacherTrain/TeacherTrainIBLL.cs | 7 ++ .../TeacherTrain/TeacherTrainService.cs | 65 +++++++++++++++++ 9 files changed, 223 insertions(+), 11 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/TeacherTrainController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/TeacherTrainController.cs index 1e8108dc7..bd12c8478 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/TeacherTrainController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/TeacherTrainController.cs @@ -120,6 +120,19 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers teacherTrainIBLL.SaveEntity(keyValue, entity); return Success("保存成功!"); } + + /// + /// 提交数据 + /// 主键 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult EnableDisableForm(string keyValue,string status) + { + teacherTrainIBLL.EnableDisable(keyValue,status); + return Success("操作成功!"); + } #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherTrain/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherTrain/Form.cshtml index b5017d1ee..206713e68 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherTrain/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherTrain/Form.cshtml @@ -9,7 +9,7 @@
教师姓名*
-
+
培训开始时间*
@@ -35,14 +35,18 @@
所获证书*
-
+
培训级别*
-
+
培训人数*
+
+
学时*
+ +
备注
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherTrain/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherTrain/Form.js index 38e530124..fcff96f9f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherTrain/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherTrain/Form.js @@ -15,12 +15,8 @@ var bootstrap = function ($, learun) { page.initData(); }, bind: function () { - $('#EID').lrformselect({ - layerUrl: top.$.rootUrl + '/LR_OrganizationModule/User/SelectOnlyForm', - layerUrlW: 400, - layerUrlH: 300, - dataUrl: top.$.rootUrl + '/LR_OrganizationModule/User/GetListByUserIds' - }); + $('#EID')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; + $('#EID').val(learun.clientdata.get(['userinfo']).realName); $("#TTLevel").lrDataItemSelect({ code: 'TrainLevel' }); $('#Path').lrUploader(); }, diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherTrain/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherTrain/Index.cshtml index 2d594f133..4d9d0a6b6 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherTrain/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherTrain/Index.cshtml @@ -10,10 +10,30 @@
+
+
培训单位
+ +
教师姓名
+
+
培训机构
+ +
+
+
培训方式
+ +
+
+
所获证书
+ +
+
+
培训级别
+
+
@@ -27,6 +47,8 @@  修改  删除  查看 +  审核 +  去审
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherTrain/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherTrain/Index.js index 08c1bf146..62f13dce4 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherTrain/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherTrain/Index.js @@ -16,7 +16,8 @@ var bootstrap = function ($, learun) { $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { page.search(queryJson); }, 220, 400); - $('#EID').lrUserSelect(0); + $('#EID').lrDataSourceSelect({ code: 'teacheruserdata', value: 'f_userid', text: 'f_realname' }); + $("#TTLevel").lrDataItemSelect({ code: 'TrainLevel' }); // 刷新 $('#lr_refresh').on('click', function () { location.reload(); @@ -38,6 +39,15 @@ var bootstrap = function ($, learun) { $('#lr_edit').on('click', function () { var keyValue = $('#gridtable').jfGridValue('TTID'); if (learun.checkrow(keyValue)) { + if (keyValue.indexOf(',') != -1) { + learun.alert.warning("只能选择一条记录进行编辑!"); + return; + } + var State = $('#gridtable').jfGridValue('State'); + if (State === "1") { + learun.alert.warning("当前项目已审核不能编辑!"); + return; + } learun.layerForm({ id: 'form', title: '编辑', @@ -53,6 +63,11 @@ var bootstrap = function ($, learun) { // 删除 $('#lr_delete').on('click', function () { var keyValue = $('#gridtable').jfGridValue('TTID'); + var State = $('#gridtable').jfGridValue('State'); + if (State.indexOf('1') != -1) { + learun.alert.warning("选中记录中包含已审核项目,已审核不能删除!"); + return; + } if (learun.checkrow(keyValue)) { learun.layerConfirm('是否确认删除该项!', function (res) { if (res) { @@ -66,6 +81,10 @@ var bootstrap = function ($, learun) { //查看 $('#lr_view').on('click', function () { var keyValue = $('#gridtable').jfGridValue('TTID'); + if (keyValue.indexOf(',') != -1) { + learun.alert.warning("只能选择一条记录进行查看!"); + return; + } if (learun.checkrow(keyValue)) { learun.layerForm({ id: 'formteachertrain', @@ -80,12 +99,59 @@ var bootstrap = function ($, learun) { }); } }); + //审核 + $('#lr_check').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('TTID'); + if (learun.checkrow(keyValue)) { + var State = $('#gridtable').jfGridValue('State'); + if (State.indexOf('1') != -1) { + learun.alert.warning("选中记录中包含已审核项目!"); + return; + } + learun.layerConfirm('是否确认审核该项?', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/PersonnelManagement/TeacherTrain/EnableDisableForm', { keyValue: keyValue, status: "1" }, function () { + refreshGirdData(); + }); + } + }); + } + }); + //去审 + $('#lr_uncheck').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('TTID'); + if (learun.checkrow(keyValue)) { + var State = $('#gridtable').jfGridValue('State'); + var StateArr = State.split(','); + if ($.inArray('0', StateArr) != -1 || $.inArray('', StateArr) != -1) { + learun.alert.warning("选中记录中包含未审核项目!"); + return; + } + learun.layerConfirm('是否确认取消审核该项?', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/PersonnelManagement/TeacherTrain/EnableDisableForm', { keyValue: keyValue, status: "0"}, function () { + refreshGirdData(); + }); + } + }); + } + }); }, // 初始化列表 initGird: function () { $('#gridtable').lrAuthorizeJfGrid({ url: top.$.rootUrl + '/PersonnelManagement/TeacherTrain/GetPageList', headData: [ + { + label: "状态", name: "State", width: 100, align: "left", + formatter: function (cellvalue, row) { + if (cellvalue === "1") { + return '已提交'; + } else { + return '草稿'; + } + } + }, { label: "培训组织单位", name: "TTUnit", width: 100, align: "left" }, { label: "教师姓名", name: "EID", width: 100, align: "left", @@ -104,6 +170,7 @@ var bootstrap = function ($, learun) { { label: "培训机构", name: "TTOrganization", width: 100, align: "left" }, { label: "培训方式", name: "TTWay", width: 100, align: "left" }, { label: "所获证书", name: "TTCertificates", width: 100, align: "left" }, + { label: "学时", name: "ClassHour", width: 100, align: "left" }, { label: "培训级别", name: "TTLevel", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { @@ -119,7 +186,8 @@ var bootstrap = function ($, learun) { { label: "备注", name: "TTComment", width: 100, align: "left" }, ], mainId: 'TTID', - isPage: true + isPage: true, + isMultiselect: true, }); page.search(); }, diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/TeacherTrain/TeacherTrainBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/TeacherTrain/TeacherTrainBLL.cs index afffb5738..cfb405755 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/TeacherTrain/TeacherTrainBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/TeacherTrain/TeacherTrainBLL.cs @@ -141,6 +141,29 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement } } + /// + /// 审核去审 + /// + /// + /// + public void EnableDisable(string keyValue, string status) + { + try + { + teacherTrainService.EnableDisable(keyValue, status); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/TeacherTrain/TeacherTrainEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/TeacherTrain/TeacherTrainEntity.cs index 493568919..8430accf3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/TeacherTrain/TeacherTrainEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/TeacherTrain/TeacherTrainEntity.cs @@ -89,6 +89,17 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement ///
[Column("PATH")] public string Path { get; set; } + /// + /// 学时 + /// + [Column("CLASSHOUR")] + public decimal? ClassHour { get; set; } + /// + /// 状态 + /// + [Column("STATE")] + public string State { get; set; } + #endregion #region 扩展操作 @@ -98,6 +109,8 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement public void Create() { this.TTID = Guid.NewGuid().ToString(); + this.EName = LoginUserInfo.Get().realName; + this.State = "0"; } /// /// 编辑调用 @@ -106,6 +119,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement public void Modify(string keyValue) { this.TTID = keyValue; + this.EName = LoginUserInfo.Get().realName; } #endregion #region 扩展字段 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/TeacherTrain/TeacherTrainIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/TeacherTrain/TeacherTrainIBLL.cs index d72a488ad..6935ef664 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/TeacherTrain/TeacherTrainIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/TeacherTrain/TeacherTrainIBLL.cs @@ -50,6 +50,13 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement /// /// void SaveEntity(string keyValue, TeacherTrainEntity entity); + + /// + /// 审核去审 + /// + /// + /// + void EnableDisable(string keyValue, string status); #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/TeacherTrain/TeacherTrainService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/TeacherTrain/TeacherTrainService.cs index 78b3cf34e..ee605448c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/TeacherTrain/TeacherTrainService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/TeacherTrain/TeacherTrainService.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; using System.Data; using System.Text; +using System.Linq; namespace Learun.Application.TwoDevelopment.PersonnelManagement { @@ -38,11 +39,37 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement var queryParam = queryJson.ToJObject(); // 虚拟参数 var dp = new DynamicParameters(new { }); + if (!queryParam["TTUnit"].IsEmpty()) + { + dp.Add("TTUnit", "%" + queryParam["TTUnit"].ToString() + "%", DbType.String); + strSql.Append(" AND t.TTUnit like @TTUnit "); + } if (!queryParam["EID"].IsEmpty()) { dp.Add("EID", queryParam["EID"].ToString(), DbType.String); strSql.Append(" AND t.EID = @EID "); } + if (!queryParam["TTWay"].IsEmpty()) + { + dp.Add("TTWay", "%" + queryParam["TTWay"].ToString() + "%", DbType.String); + strSql.Append(" AND t.TTWay like @TTWay "); + } + if (!queryParam["TTCertificates"].IsEmpty()) + { + dp.Add("TTCertificates", "%" + queryParam["TTCertificates"].ToString() + "%", DbType.String); + strSql.Append(" AND t.TTCertificates like @TTCertificates "); + } + if (!queryParam["TTLevel"].IsEmpty()) + { + dp.Add("TTLevel", queryParam["TTLevel"].ToString(), DbType.String); + strSql.Append(" AND t.TTLevel = @TTLevel "); + } + var user = LoginUserInfo.Get(); + if (!user.isSystem && !user.roleIds.Contains("e945769f-0db0-4ee7-8fc1-d343d4fe473b")) + { + strSql.Append(" AND t.EID = '" + user.userId + "' "); + } + return this.BaseRepository().FindList(strSql.ToString(), dp, pagination); } catch (Exception ex) @@ -177,6 +204,44 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement } } + /// + /// 审核去审 + /// + /// + /// + public void EnableDisable(string keyValue, string status) + { + var db = BaseRepository().BeginTrans(); + try + { + List Ids = keyValue.Split(',').ToList(); + List Entity = new List(); + foreach (var item in Ids) + { + var list = this.BaseRepository().FindEntity(x => x.TTID == item); + if (list != null) + { + list.State = status; + Entity.Add(list); + } + } + db.Update(Entity); + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion }