From ae636fdb308250a59e759568d8b463af23d8fd94 Mon Sep 17 00:00:00 2001 From: dyy <18335927079@163.com> Date: Tue, 2 Mar 2021 16:42:25 +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=B8=88=E8=81=8C=E7=A7=B0=E7=AE=A1=E7=90=86=EF=BC=9A=E5=85=B3?= =?UTF-8?q?=E8=81=94=E5=88=B0=E6=95=99=E5=B8=88=E4=BF=A1=E6=81=AF=E7=AE=A1?= =?UTF-8?q?=E7=90=86=EF=BC=9B=E6=95=99=E5=B8=88=E4=BF=A1=E6=81=AF=E7=AE=A1?= =?UTF-8?q?=E7=90=86=EF=BC=9A=E5=A2=9E=E5=8A=A0=E5=91=98=E5=B7=A5=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E6=97=B6=E9=97=B4=E5=AD=97=E6=AE=B5=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/EmpInfoController.cs | 14 ++++ .../Views/EmpInfo/Index.js | 1 + .../TeacherTitleEvaluationController.cs | 13 ++++ .../Views/TeacherTitleEvaluation/Form.js | 11 +-- .../Views/TeacherTitleEvaluation/Index.cshtml | 6 +- .../Views/TeacherTitleEvaluation/Index.js | 77 ++++++++++++++++--- .../EmpInfo/EmpInfoEntity.cs | 5 ++ .../TeacherTitleEvaluationBLL.cs | 23 ++++++ .../TeacherTitleEvaluationEntity.cs | 25 +++++- .../TeacherTitleEvaluationIBLL.cs | 7 ++ .../TeacherTitleEvaluationService.cs | 62 ++++++++++++--- 11 files changed, 213 insertions(+), 31 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/EmpInfoController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/EmpInfoController.cs index 8cbe88777..809dbfab6 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/EmpInfoController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/EmpInfoController.cs @@ -308,6 +308,11 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { return Fail("职工编号已存在!"); } + //员工状态时间 + if (!string.IsNullOrEmpty(entity.IsInActiveStatus)) + { + entity.IsInActiveTime = DateTime.Now; + } } else { @@ -326,6 +331,15 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { entity.SyncFlag = false; } + //员工状态时间 + var preEntity = empInfoIBLL.GetEmpInfoEntity(keyValue); + if (preEntity != null) + { + if (entity.IsInActiveStatus != preEntity.IsInActiveStatus) + { + entity.IsInActiveTime = DateTime.Now; + } + } } empInfoIBLL.SaveEntity(keyValue, entity); return Success("保存成功!"); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/EmpInfo/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/EmpInfo/Index.js index 16e0037fd..b9e75f443 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/EmpInfo/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/EmpInfo/Index.js @@ -419,6 +419,7 @@ var bootstrap = function ($, learun) { }); } }, + { label: "员工状态时间", name: "IsInActiveTime", width: 100, align: "left"}, { label: "人员身份", name: "CompilationCategory", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/TeacherTitleEvaluationController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/TeacherTitleEvaluationController.cs index 3534c9c28..cfbc5ea54 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/TeacherTitleEvaluationController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/TeacherTitleEvaluationController.cs @@ -105,6 +105,19 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers teacherTitleEvaluationIBLL.SaveEntity(keyValue,entity); return Success("保存成功!"); } + + /// + /// 审核实体数据 + /// 主键 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult DoCheck(string keyValue, string status) + { + teacherTitleEvaluationIBLL.DoCheck(keyValue, status); + return Success("操作成功!"); + } #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherTitleEvaluation/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherTitleEvaluation/Form.js index 14b95cfb4..343622896 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherTitleEvaluation/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherTitleEvaluation/Form.js @@ -15,11 +15,12 @@ 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').lrselect({ + allowSearch: true, + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=EmpInfo', + param: { strWhere: "1=1 " }, + value: "empid", + text: "empname" }); $('#TTTitlesID').lrDataItemSelect({ code: 'jszc' }); $('#TTTitlesPostLevel').lrDataItemSelect({ code: 'TeacherTitlePostLevel' }); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherTitleEvaluation/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherTitleEvaluation/Index.cshtml index fd7dacbd5..9f447300a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherTitleEvaluation/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherTitleEvaluation/Index.cshtml @@ -7,9 +7,9 @@
-
+ @*
-
+
*@ diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherTitleEvaluation/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherTitleEvaluation/Index.js index e81dce59b..1753e738e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherTitleEvaluation/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/TeacherTitleEvaluation/Index.js @@ -45,7 +45,13 @@ var bootstrap = function ($, learun) { $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { page.search(queryJson); }, 220, 400); - $('#EID').lrUserSelect(0); + $('#EID').lrselect({ + allowSearch: true, + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=EmpInfo', + param: { strWhere: "1=1 " }, + value: "empid", + text: "empname" + }); // 刷新 $('#lr_refresh').on('click', function () { location.reload(); @@ -67,6 +73,11 @@ var bootstrap = function ($, learun) { $('#lr_edit').on('click', function () { var keyValue = $('#gridtable').jfGridValue('TTID'); if (learun.checkrow(keyValue)) { + var CheckStatus = $('#gridtable').jfGridValue('CheckStatus'); + if (CheckStatus == "1" || CheckStatus == "2") { + learun.alert.warning("当前项已审核!"); + return false; + } learun.layerForm({ id: 'form', title: '编辑', @@ -83,6 +94,11 @@ var bootstrap = function ($, learun) { $('#lr_delete').on('click', function () { var keyValue = $('#gridtable').jfGridValue('TTID'); if (learun.checkrow(keyValue)) { + var CheckStatus = $('#gridtable').jfGridValue('CheckStatus'); + if (CheckStatus == "1" || CheckStatus == "2") { + learun.alert.warning("当前项已审核!"); + return false; + } learun.layerConfirm('是否确认删除该项!', function (res) { if (res) { learun.deleteForm(top.$.rootUrl + '/PersonnelManagement/TeacherTitleEvaluation/DeleteForm', { keyValue: keyValue }, function () { @@ -92,6 +108,43 @@ var bootstrap = function ($, learun) { }); } }); + + // 审核通过 + $('#lr_checkYes').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('TTID'); + if (learun.checkrow(keyValue)) { + var CheckStatus = $('#gridtable').jfGridValue('CheckStatus'); + if (CheckStatus == "1" || CheckStatus == "2") { + learun.alert.warning("当前项已审核!"); + return false; + } + learun.layerConfirm('是否确认审核通过该项!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/PersonnelManagement/TeacherTitleEvaluation/DoCheck', { keyValue: keyValue, status: "1" }, function () { + refreshGirdData(); + }); + } + }); + } + }); + // 审核不通过 + $('#lr_checkNo').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('TTID'); + if (learun.checkrow(keyValue)) { + var CheckStatus = $('#gridtable').jfGridValue('CheckStatus'); + if (CheckStatus == "1" || CheckStatus == "2") { + learun.alert.warning("当前项已审核!"); + return false; + } + learun.layerConfirm('是否确认审核不通过该项!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/PersonnelManagement/TeacherTitleEvaluation/DoCheck', { keyValue: keyValue, status: "2" }, function () { + refreshGirdData(); + }); + } + }); + } + }); }, // 初始化列表 initGird: function () { @@ -104,10 +157,12 @@ var bootstrap = function ($, learun) { { label: "教师姓名", name: "EID", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('user', { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'EmpInfo', key: value, + keyId: 'empid', callback: function (_data) { - callback(_data.name); + callback(_data['empname']); } }); } @@ -117,10 +172,8 @@ var bootstrap = function ($, learun) { return cellvalue == 1 ? "男" : "女" } }, - { - label: "出生年月", name: "Birthday", width: 100, align: "left" - }, - { label: "评定时间", name: "TTTime", width: 100, align: "left" }, + { label: "出生日期", name: "Birthday", width: 120, align: "left" }, + { label: "评定时间", name: "TTTime", width: 120, align: "left" }, { label: "评定职称", name: "TTTitlesID", width: 100, align: "left", formatterAsync: function (callback, value, row, op, $cell) { @@ -146,15 +199,21 @@ var bootstrap = function ($, learun) { } }, { label: "备注", name: "TTRemark", width: 100, align: "left" }, + { + label: "审核状态", name: "CheckStatus", width: 100, align: "left", formatter: function (cellvalue) { + return cellvalue == "1" ? "已通过" : cellvalue == "2" ? "未通过" : "未审核"; + } + }, ], mainId: 'TTID', isPage: true }); + page.search(); }, search: function (param) { param = param || {}; - param.StartTime = startTime; - param.EndTime = endTime; + //param.StartTime = startTime; + //param.EndTime = endTime; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoEntity.cs index 82581f20b..acdf9eba4 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/EmpInfo/EmpInfoEntity.cs @@ -579,6 +579,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration ///
[Column("PROFESSIONALTITLEGETTIME")] public DateTime? ProfessionalTitleGetTime { get; set; } + /// + /// 员工状态时间 + /// + [Column("ISINACTIVETIME")] + public DateTime? IsInActiveTime { get; set; } #endregion diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/TeacherTitleEvaluation/TeacherTitleEvaluationBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/TeacherTitleEvaluation/TeacherTitleEvaluationBLL.cs index 22281a470..1ddd30678 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/TeacherTitleEvaluation/TeacherTitleEvaluationBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/TeacherTitleEvaluation/TeacherTitleEvaluationBLL.cs @@ -118,6 +118,29 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement } } + /// + /// 审核实体数据 + /// 主键 + /// + /// + public void DoCheck(string keyValue, string status) + { + try + { + teacherTitleEvaluationService.DoCheck(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/TeacherTitleEvaluation/TeacherTitleEvaluationEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/TeacherTitleEvaluation/TeacherTitleEvaluationEntity.cs index 956858753..f6ab38f65 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/TeacherTitleEvaluation/TeacherTitleEvaluationEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/TeacherTitleEvaluation/TeacherTitleEvaluationEntity.cs @@ -20,7 +20,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement [Column("TTID")] public string TTID { get; set; } /// - /// EID + /// 教师信息管理Id /// [Column("EID")] public string EID { get; set; } @@ -35,12 +35,12 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement [Column("TTTITLES")] public string TTTitles { get; set; } /// - /// TTTitlesID + /// 评定职称 /// [Column("TTTITLESID")] public string TTTitlesID { get; set; } /// - /// TTTime + /// 评定时间 /// [Column("TTTIME")] public DateTime? TTTime { get; set; } @@ -74,6 +74,23 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement /// [Column("WINNINGFILE")] public string WinningFile { get; set; } + + /// + /// 审核状态(0未审核,1审核通过,2审核不通过) + /// + [Column("CHECKSTATUS")] + public string CheckStatus { get; set; } + /// + /// 审核时间 + /// + [Column("CHECKTIME")] + public DateTime? CheckTime { get; set; } + /// + /// 审核人 + /// + [Column("CHECKUSER")] + public string CheckUser { get; set; } + #endregion #region 扩展操作 @@ -103,7 +120,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement /// 性别 /// [NotMapped] - public int? Sex { get; set; } + public bool? Sex { get; set; } /// /// 出生年月 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/TeacherTitleEvaluation/TeacherTitleEvaluationIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/TeacherTitleEvaluation/TeacherTitleEvaluationIBLL.cs index 86f6b5622..2069bac42 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/TeacherTitleEvaluation/TeacherTitleEvaluationIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/TeacherTitleEvaluation/TeacherTitleEvaluationIBLL.cs @@ -43,6 +43,13 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement /// /// void SaveEntity(string keyValue, TeacherTitleEvaluationEntity entity); + + /// + /// 审核实体数据 + /// 主键 + /// + /// + void DoCheck(string keyValue, string status); #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/TeacherTitleEvaluation/TeacherTitleEvaluationService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/TeacherTitleEvaluation/TeacherTitleEvaluationService.cs index da2a63b6c..9ebd06c9f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/TeacherTitleEvaluation/TeacherTitleEvaluationService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/TeacherTitleEvaluation/TeacherTitleEvaluationService.cs @@ -1,4 +1,5 @@ using Dapper; +using Learun.Application.TwoDevelopment.EducationalAdministration; using Learun.DataBase.Repository; using Learun.Util; using System; @@ -28,15 +29,12 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement { try { + //取库名 + var misdbname = BaseRepository("CollegeMIS").getDbConnection().Database; + var strSql = new StringBuilder(); - strSql.Append("SELECT "); - strSql.Append(@" - t.*, - u.F_EnCode as Encode, - u.F_Gender as Sex, - u.F_Birthday as Birthday - "); - strSql.Append(" FROM TeacherTitleEvaluation t left join LR_Base_User u on t.EID=u.F_UserId "); + strSql.Append("SELECT t.*,e.EmpNo as Encode,e.GenderNo as Sex,e.Birthday as Birthday "); + strSql.Append(" FROM TeacherTitleEvaluation t left join " + misdbname + ".dbo.EmpInfo e on t.EID=e.EmpId "); strSql.Append(" WHERE 1=1 "); var queryParam = queryJson.ToJObject(); // 虚拟参数 @@ -49,10 +47,10 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement } if (!queryParam["EID"].IsEmpty()) { - dp.Add("EID",queryParam["EID"].ToString(), DbType.String); + dp.Add("EID", queryParam["EID"].ToString(), DbType.String); strSql.Append(" AND t.EID = @EID "); } - return this.BaseRepository().FindList(strSql.ToString(),dp, pagination); + return this.BaseRepository().FindList(strSql.ToString(), dp, pagination); } catch (Exception ex) { @@ -104,7 +102,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement { try { - this.BaseRepository().Delete(t=>t.TTID == keyValue); + this.BaseRepository().Delete(t => t.TTID == keyValue); } catch (Exception ex) { @@ -152,6 +150,48 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement } } + /// + /// 审核实体数据 + /// 主键 + /// + /// + public void DoCheck(string keyValue, string status) + { + try + { + var userInfo = LoginUserInfo.Get(); + if (status == "1") + { + this.BaseRepository().ExecuteBySql("update TeacherTitleEvaluation set CheckStatus='" + status + "',CheckTime='" + DateTime.Now + "',CheckUser='" + userInfo.userId + "' where TTID='" + keyValue + "' "); + //修改教师信息管理表中职称相关字段 + var entity = this.BaseRepository().FindEntity(keyValue); + var empInfoEntity = this.BaseRepository("CollegeMIS").FindEntity(x => x.EmpId == entity.EID); + if (empInfoEntity != null) + { + empInfoEntity.ProfessionalTitle = entity?.TTTitlesID; + empInfoEntity.ProfessionalTitleLevel = entity?.TTTitlesPostLevel; + empInfoEntity.ProfessionalTitleGetTime = entity?.TTTime; + this.BaseRepository("CollegeMIS").Update(empInfoEntity); + } + } + else if (status == "2") + { + this.BaseRepository().ExecuteBySql("update TeacherTitleEvaluation set CheckStatus='" + status + "',CheckTime=null,CheckUser=null where TTID='" + keyValue + "' "); + } + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + #endregion }