From 0fa43fb06eb4a79ddcbdf0011199c39acba329d0 Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Tue, 29 Jun 2021 10:05:10 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E7=BC=96=E8=BE=91=E5=88=A0?= =?UTF-8?q?=E9=99=A4=E6=93=8D=E4=BD=9C=E5=90=8C=E6=97=B6=E4=BF=AE=E6=94=B9?= =?UTF-8?q?=E4=B8=8A=E6=8A=A5=E6=95=B0=E6=8D=AE=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/QualityReportController.cs | 5 +- .../QualityReportMain/QualityReportMainBLL.cs | 63 +++++++++++++--- .../QualityReportMainIBLL.cs | 13 ++++ .../QualityReportMainService.cs | 71 ++++++++++++++++++- 4 files changed, 140 insertions(+), 12 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/QualityReportController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/QualityReportController.cs index ffe5b7396..176e1cef1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/QualityReportController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Controllers/QualityReportController.cs @@ -58,9 +58,9 @@ namespace Learun.Application.Web.Areas.LR_Desktop.Controllers { return View(); } - - #endregion + #endregion + #region 获取数据 /// /// 获取页面显示列表数据 @@ -74,6 +74,7 @@ namespace Learun.Application.Web.Areas.LR_Desktop.Controllers { Pagination paginationobj = pagination.ToObject(); var data = fualityReportMainIBLL.GetPageList(paginationobj, queryJson); + var jsonData = new { rows = data, diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportMain/QualityReportMainBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportMain/QualityReportMainBLL.cs index 10bf9f59e..4258d6383 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportMain/QualityReportMainBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportMain/QualityReportMainBLL.cs @@ -19,11 +19,11 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop #region 获取数据 /// -         /// 获取页面显示列表数据 -         /// -         /// 分页参数 -         /// 查询参数 -         /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// public IEnumerable GetPageList(Pagination pagination, string queryJson) { try @@ -44,10 +44,10 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop } /// -         /// 获取QualityReportMain表实体数据 -         /// -         /// 主键 -         /// + /// 获取QualityReportMain表实体数据 + /// + /// 主键 + /// public QualityReportMainEntity GetQualityReportMainEntity(string keyValue) { try @@ -119,6 +119,51 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop } } + /// + /// 项目删除,将状态改为作废 + /// + /// 项目Id + public void DelProjectByFId(string FillinFromId) + { + try + { + qualityReportMainService.DelProjectByFId(FillinFromId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + + /// + /// 项目删除,将状态改为作废 + /// + /// 项目Id + public void EditProjectByFId(string FillinFromId) + { + try + { + qualityReportMainService.EditProjectByFId(FillinFromId); + } + 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/LR_Desktop/QualityReportMain/QualityReportMainIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportMain/QualityReportMainIBLL.cs index 968edd201..8c5e0448a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportMain/QualityReportMainIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportMain/QualityReportMainIBLL.cs @@ -42,6 +42,19 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop /// 主键 /// 实体 void SaveEntity(string keyValue, QualityReportMainEntity entity); + + /// + /// 项目删除,将状态改为作废 + /// + /// + void DelProjectByFId(string FillinFromId); + + /// + /// 项目编辑,将状态改为草稿 + /// + /// + void EditProjectByFId(string FillinFromId); + #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportMain/QualityReportMainService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportMain/QualityReportMainService.cs index 955d3d281..e8817cabe 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportMain/QualityReportMainService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportMain/QualityReportMainService.cs @@ -32,7 +32,7 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop var strSql = new StringBuilder(); strSql.Append(@"select b.WorderModule,b.ProjectName,b.FillingDept,b.Id as fid,a.Id,a.ReportTime,a.Status,a.Result,a.CreateUserName from QualityReportMain a join FillinFrom b on a.FillinFromId=b.Id "); - + strSql.Append("  WHERE 1=1 "); var queryParam = queryJson.ToJObject(); // 虚拟参数 @@ -136,6 +136,75 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop } } + + /// + /// 项目删除,将状态改为作废 + /// + /// 项目Id + public void DelProjectByFId(string FillinFromId) + { + try + { + UpdateStatusByFId(FillinFromId, 99); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// + /// 项目编辑,将状态改为草稿 + /// + /// 项目Id + public void EditProjectByFId(string FillinFromId) + { + try + { + UpdateStatusByFId(FillinFromId, 0); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// + /// 修改上报记录为作废状态 + /// + /// 项目Id + private void UpdateStatusByFId(string FillinFromId,int Status) + { + try + { + string sql = $"update QualityReportMain set [Status]='{Status}' where FillinFromId='{FillinFromId}'"; + this.BaseRepository("CollegeMIS").ExecuteBySql(sql); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } #endregion }