From cb2e8d2f2c82b1858583ce450b2b1fdb7492fee8 Mon Sep 17 00:00:00 2001 From: ndbs Date: Fri, 3 Jan 2025 09:16:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=99=E5=B8=88=E5=9F=B9=E8=AE=AD=E5=92=8C?= =?UTF-8?q?=E6=95=99=E7=A7=91=E7=A0=94=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/ResearchResultController.cs | 13 +++ .../Views/ResearchResult/Index.cshtml | 5 +- .../Views/ResearchResult/Index.js | 79 ++++++++++++------- .../Views/TeacherTrain/Index.cshtml | 2 +- .../Views/TeacherTrain/Index.js | 14 ++-- .../ResearchResult/ResearchResultBLL.cs | 24 ++++++ .../ResearchResult/ResearchResultIBLL.cs | 7 +- .../ResearchResult/ResearchResultService.cs | 51 +++++++++++- .../TeacherTrain/TeacherTrainService.cs | 20 ++++- 9 files changed, 172 insertions(+), 43 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/ResearchResultController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/ResearchResultController.cs index d81bdd45e..7eccfb2b0 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/ResearchResultController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/ResearchResultController.cs @@ -151,6 +151,19 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers researchResultIBLL.SubmitEntity(keyValue); return Success("提交成功!"); } + + /// + /// 提交数据 + /// 主键 + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult EnableDisableForm(string keyValue, int? status) + { + researchResultIBLL.EnableDisable(keyValue, status); + return Success("操作成功!"); + } #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ResearchResult/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ResearchResult/Index.cshtml index 8f499c495..da3141af8 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ResearchResult/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ResearchResult/Index.cshtml @@ -50,8 +50,9 @@  查看 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ResearchResult/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ResearchResult/Index.js index 72ec18bbc..094143716 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ResearchResult/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/ResearchResult/Index.js @@ -52,6 +52,10 @@ var bootstrap = function ($, learun) { learun.alert.warning("当前项目已提交,不可编辑!"); return; } + if (keyValue.indexOf(',') != -1) { + learun.alert.warning("只能选择一条记录进行编辑!"); + return; + } if (learun.checkrow(keyValue)) { learun.layerForm({ id: 'form', @@ -69,8 +73,8 @@ var bootstrap = function ($, learun) { $('#lr_delete').on('click', function () { var keyValue = $('#gridtable').jfGridValue('ID'); var Status = $('#gridtable').jfGridValue('StatusMark'); - if (Status != 0) { - learun.alert.warning("当前项目已提交,不可删除!"); + if (Status.indexOf('1') != -1) { + learun.alert.warning("选中项包含已提交项,不可删除!"); return; } if (learun.checkrow(keyValue)) { @@ -86,6 +90,10 @@ var bootstrap = function ($, learun) { //查看 $('#lr_view').on('click', function () { var keyValue = $('#gridtable').jfGridValue('ID'); + if (keyValue.indexOf(',') != -1) { + learun.alert.warning("只能选择一条记录进行查看!"); + return; + } if (learun.checkrow(keyValue)) { learun.layerForm({ id: 'FormView', @@ -105,40 +113,56 @@ var bootstrap = function ($, learun) { // $('#gridtable').jqprintTable(); //}); //  提交 - $('#lr_submit').on('click', function () { + //$('#lr_submit').on('click', function () { + // var keyValue = $('#gridtable').jfGridValue('ID'); + // if (learun.checkrow(keyValue)) { + // var Status = $('#gridtable').jfGridValue('StatusMark'); + // if (Status != 0) { + // learun.alert.warning("当前项目已提交请勿进行重复提交!"); + // return; + // } + // learun.layerConfirm('是否确认提交该项!', function (res) { + // if (res) { + // learun.postForm(top.$.rootUrl + '/PersonnelManagement/ResearchResult/SubmitForm', { keyValue: keyValue }, function () { + // refreshGirdData(); + // }); + // } + // }); + // } + //}); + //提交 + $('#lr_check').on('click', function () { var keyValue = $('#gridtable').jfGridValue('ID'); if (learun.checkrow(keyValue)) { - var Status = $('#gridtable').jfGridValue('StatusMark'); - if (Status != 0) { - learun.alert.warning("当前项目已提交请勿进行重复提交!"); + var StatusMark = $('#gridtable').jfGridValue('StatusMark'); + if (StatusMark.indexOf('1') != -1) { + learun.alert.warning("选中记录中包含已提交项目!"); return; } - learun.layerConfirm('是否确认提交该项!', function (res) { + learun.layerConfirm('是否确认提交该项?', function (res) { if (res) { - learun.postForm(top.$.rootUrl + '/PersonnelManagement/ResearchResult/SubmitForm', { keyValue: keyValue }, function () { + learun.postForm(top.$.rootUrl + '/PersonnelManagement/ResearchResult/EnableDisableForm', { keyValue: keyValue, status: "1" }, function () { refreshGirdData(); }); } }); } }); - //  审核 - $('#lr_check').on('click', function () { + //去审 + $('#lr_uncheck').on('click', function () { var keyValue = $('#gridtable').jfGridValue('ID'); - var Status = $('#gridtable').jfGridValue('StatusMark'); - if (Status != 1) { - learun.alert.warning("当前项目已通过审核!"); - return; - } if (learun.checkrow(keyValue)) { - learun.layerForm({ - id: 'FormCheck', - title: '查看', - url: top.$.rootUrl + '/PersonnelManagement/ResearchResult/FormCheck?keyValue=' + keyValue, - width: 600, - height: 660, - callBack: function (id) { - return top[id].acceptClick(refreshGirdData); + var StatusMark = $('#gridtable').jfGridValue('StatusMark'); + var StatusMarkArr = StatusMark.split(','); + if ($.inArray('0', StatusMarkArr) != -1 ) { + learun.alert.warning("选中记录中未包含提交项!"); + return; + } + learun.layerConfirm('是否确认取消提交该项?', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/PersonnelManagement/ResearchResult/EnableDisableForm', { keyValue: keyValue, status: "0" }, function () { + refreshGirdData(); + }); } }); } @@ -153,9 +177,7 @@ var bootstrap = function ($, learun) { label: "状态", name: "StatusMark", width: 80, align: "left", formatter: function (cellvalue, row) { if (cellvalue == "1") { - return '审批中'; - } else if (cellvalue == "2") { - return '通过'; + return '已提交'; } else { return '草稿'; } @@ -237,7 +259,7 @@ var bootstrap = function ($, learun) { } }); } - }, + }, { label: "发证单位(主管单位)", name: "CompetentUnit", width: 100, align: "left" }, { label: "年度", name: "Year", width: 50, align: "left", @@ -253,7 +275,8 @@ var bootstrap = function ($, learun) { mainId: 'ID', isPage: true, sidx: " Createdate ,StatusMark", - sord: 'desc' + sord: 'desc', + isMultiselect: true, }); page.search(); }, 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 4d9d0a6b6..33ced306a 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 @@ -47,7 +47,7 @@  修改  删除  查看 -  审核 +  提交  去审 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 d1ba27d8f..dc4571ba3 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 @@ -45,7 +45,7 @@ var bootstrap = function ($, learun) { } var State = $('#gridtable').jfGridValue('State'); if (State === "1") { - learun.alert.warning("当前项目已审核不能编辑!"); + learun.alert.warning("当前项目已提交不可编辑!"); return; } learun.layerForm({ @@ -65,7 +65,7 @@ var bootstrap = function ($, learun) { var keyValue = $('#gridtable').jfGridValue('TTID'); var State = $('#gridtable').jfGridValue('State'); if (State.indexOf('1') != -1) { - learun.alert.warning("选中记录中包含已审核项目,已审核不能删除!"); + learun.alert.warning("选中记录中包含已提交项目,已提交项目不可删除!"); return; } if (learun.checkrow(keyValue)) { @@ -99,16 +99,16 @@ 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("选中记录中包含已审核项目!"); + learun.alert.warning("选中记录中包含已提交项目!"); return; } - learun.layerConfirm('是否确认审核该项?', function (res) { + learun.layerConfirm('是否确认提交该项?', function (res) { if (res) { learun.postForm(top.$.rootUrl + '/PersonnelManagement/TeacherTrain/EnableDisableForm', { keyValue: keyValue, status: "1" }, function () { refreshGirdData(); @@ -124,10 +124,10 @@ var bootstrap = function ($, learun) { var State = $('#gridtable').jfGridValue('State'); var StateArr = State.split(','); if ($.inArray('0', StateArr) != -1 || $.inArray('', StateArr) != -1) { - learun.alert.warning("选中记录中包含未审核项目!"); + learun.alert.warning("选中记录中包含提交项目!"); return; } - learun.layerConfirm('是否确认取消审核该项?', function (res) { + learun.layerConfirm('是否确认取消提交该项?', function (res) { if (res) { learun.postForm(top.$.rootUrl + '/PersonnelManagement/TeacherTrain/EnableDisableForm', { keyValue: keyValue, status: "0"}, function () { refreshGirdData(); diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ResearchResult/ResearchResultBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ResearchResult/ResearchResultBLL.cs index d0a6a44fb..132c90dd0 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ResearchResult/ResearchResultBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ResearchResult/ResearchResultBLL.cs @@ -162,6 +162,30 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement } } } + + /// + /// 审核去审 + /// + /// + /// + public void EnableDisable(string keyValue, int? status) + { + try + { + researchResultService.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/ResearchResult/ResearchResultIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ResearchResult/ResearchResultIBLL.cs index c838ff126..fd80c98f9 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ResearchResult/ResearchResultIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ResearchResult/ResearchResultIBLL.cs @@ -45,7 +45,12 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement void SubmitEntity(string keyValue); void CheckEntity(string keyValue,int? StatusMark); - + /// + /// 审核去审 + /// + /// + /// + void EnableDisable(string keyValue, int? status); #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ResearchResult/ResearchResultService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ResearchResult/ResearchResultService.cs index df34dbd15..cb1874e8c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ResearchResult/ResearchResultService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/ResearchResult/ResearchResultService.cs @@ -4,6 +4,7 @@ using Learun.Util; using System; using System.Collections.Generic; using System.Data; +using System.Linq; using System.Text; namespace Learun.Application.TwoDevelopment.PersonnelManagement @@ -76,8 +77,16 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement } else { - strSql.Append(" AND (StatusMark ='1' or StatusMark='2' ) or CreateUser ='" + log.userId + "'"); + if (!queryParam["ProductPerson"].IsEmpty()) + { + strSql.Append(" AND (StatusMark ='1' or StatusMark='2' )"); + } + else + { + strSql.Append(" AND (StatusMark ='1' or StatusMark='2' ) or CreateUser ='" + log.userId + "'"); + } } + } return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); } @@ -239,6 +248,46 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement } } } + + + /// + /// 审核去审 + /// + /// + /// + public void EnableDisable(string keyValue, int? status) + { + var db = BaseRepository("CollegeMIS").BeginTrans(); + try + { + List Ids = keyValue.Split(',').ToList(); + List Entity = new List(); + foreach (var item in Ids) + { + var list = db.FindEntity(x => x.ID == item); + if (list != null) + { + list.StatusMark = 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 } 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 ee605448c..77cb18954 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 @@ -65,9 +65,23 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement strSql.Append(" AND t.TTLevel = @TTLevel "); } var user = LoginUserInfo.Get(); - if (!user.isSystem && !user.roleIds.Contains("e945769f-0db0-4ee7-8fc1-d343d4fe473b")) + if (!user.isSystem) { - strSql.Append(" AND t.EID = '" + user.userId + "' "); + if (!user.roleIds.Contains("ecfc5e9b-2de2-4bfe-8ff1-f349d7766bef")) + { + strSql.Append(" AND CreateUser ='" + user.userId + "'"); + } + else + { + if (!queryParam["ProductPerson"].IsEmpty()) + { + strSql.Append(" AND (StatusMark ='1' or StatusMark='2' )"); + } + else + { + strSql.Append(" AND (StatusMark ='1' or StatusMark='2' ) or CreateUser ='" + user.userId + "'"); + } + } } return this.BaseRepository().FindList(strSql.ToString(), dp, pagination); @@ -218,7 +232,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement List Entity = new List(); foreach (var item in Ids) { - var list = this.BaseRepository().FindEntity(x => x.TTID == item); + var list = db.FindEntity(x => x.TTID == item); if (list != null) { list.State = status;