From 390d93893fd13c85002244f0bfae29c431cf204a Mon Sep 17 00:00:00 2001 From: ndbs Date: Fri, 3 Feb 2023 14:10:54 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=97=E5=85=B8=E7=BB=91=E5=AE=9A=20?= =?UTF-8?q?=E5=88=86=E7=B1=BB=E7=BC=96=E5=8F=B7=20+=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/DataItemController.cs | 22 ++++++++-- .../SystemModule/DataItem/DataItemBLL.cs | 26 ++++++++++++ .../SystemModule/DataItem/DataItemIBLL.cs | 8 +++- .../SystemModule/DataItem/DataItemService.cs | 41 +++++++++++++++++-- 4 files changed, 90 insertions(+), 7 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_SystemModule/Controllers/DataItemController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_SystemModule/Controllers/DataItemController.cs index de0fe52d1..10a5c43df 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_SystemModule/Controllers/DataItemController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_SystemModule/Controllers/DataItemController.cs @@ -44,7 +44,8 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers /// /// [HttpGet] - public ActionResult ClassifyIndex() { + public ActionResult ClassifyIndex() + { return View(); } /// @@ -100,7 +101,8 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers [HttpPost] [ValidateAntiForgeryToken] [AjaxOnly] - public ActionResult SaveClassifyForm(string keyValue, DataItemEntity entity) { + public ActionResult SaveClassifyForm(string keyValue, DataItemEntity entity) + { dataItemIBLL.SaveClassifyEntity(keyValue, entity); return Success("保存成功!"); } @@ -111,7 +113,8 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers /// [HttpPost] [AjaxOnly] - public ActionResult DeleteClassifyForm(string keyValue) { + public ActionResult DeleteClassifyForm(string keyValue) + { dataItemIBLL.VirtualDeleteClassify(keyValue); return Success("删除成功!"); } @@ -173,6 +176,19 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers return JsonResult(data); } /// + /// 获取数据字典明显根据分类编号 +条件 + /// + /// + /// 条件 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetDetailList3(string itemCode, string strWhere) + { + var data = dataItemIBLL.GetDetailList3(itemCode, strWhere); + return JsonResult(data); + } + /// /// 获取数据字典明显树形数据 /// /// 分类编号 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Base/SystemModule/DataItem/DataItemBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Base/SystemModule/DataItem/DataItemBLL.cs index f4293a4d1..fd575ada8 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Base/SystemModule/DataItem/DataItemBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Base/SystemModule/DataItem/DataItemBLL.cs @@ -324,6 +324,32 @@ namespace Learun.Application.Base.SystemModule } } } + + /// + /// 获取数据字典明显根据分类编号 +条件 + /// + /// + /// + /// + public List GetDetailList3(string itemCode, string StrWhere) + { + try + { + List list = (List)dataItemService.GetDetailList3(itemCode, StrWhere); + return list; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } public IEnumerable GetAllDetailList() { try diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Base/SystemModule/DataItem/DataItemIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Base/SystemModule/DataItem/DataItemIBLL.cs index a6255d2a7..5663aa472 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Base/SystemModule/DataItem/DataItemIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Base/SystemModule/DataItem/DataItemIBLL.cs @@ -85,7 +85,13 @@ namespace Learun.Application.Base.SystemModule /// 关键词(名称/值) /// List GetDetailList2(string itemCode, string keyword); - + /// + /// 获取数据字典明显根据分类编号 +条件 + /// + /// + /// + /// + List GetDetailList3(string itemCode, string StrWhere); /// /// 获取数据字典详细映射数据 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Base/SystemModule/DataItem/DataItemService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Base/SystemModule/DataItem/DataItemService.cs index 2f965041b..84dae8858 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Base/SystemModule/DataItem/DataItemService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Base/SystemModule/DataItem/DataItemService.cs @@ -121,7 +121,8 @@ namespace Learun.Application.Base.SystemModule /// /// 主键 /// 实体 - public void SaveClassifyEntity(string keyValue, DataItemEntity entity) { + public void SaveClassifyEntity(string keyValue, DataItemEntity entity) + { try { if (string.IsNullOrEmpty(keyValue)) @@ -129,7 +130,8 @@ namespace Learun.Application.Base.SystemModule entity.Create(); this.BaseRepository().Insert(entity); } - else { + else + { entity.Modify(keyValue); this.BaseRepository().Update(entity); } @@ -238,11 +240,44 @@ namespace Learun.Application.Base.SystemModule } } /// + /// 获取数据字典明显根据分类编号 +条件 + /// + /// + /// + /// + public IEnumerable GetDetailList3(string itemCode, string strWhere) + { + try + { + StringBuilder strSql = new StringBuilder(); + strSql.Append(" SELECT " + detailFieldSql + @" FROM LR_Base_DataItemDetail t + INNER JOIN LR_Base_DataItem t2 ON t.F_ItemId = t2.F_ItemId + WHERE t2.F_ItemCode = @itemCode AND t.F_DeleteMark = 0 "); + if (!string.IsNullOrEmpty(strWhere)) + { + strSql.Append(strWhere); + } + return this.BaseRepository().FindList(strSql.ToString(), new { itemCode = itemCode }); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// /// 获取数据字典明细实体类 /// /// 主键 /// - public DataItemDetailEntity GetDetailEntity(string keyValue) { + public DataItemDetailEntity GetDetailEntity(string keyValue) + { try { return this.BaseRepository().FindEntity(keyValue);