From 7e0ef9b48ad50f027aa8634a7682c769cdf58ca1 Mon Sep 17 00:00:00 2001 From: dyy <807692433@qq.com> Date: Mon, 17 Oct 2022 16:49:50 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E4=BF=AE=E6=94=B9=E3=80=91=E6=95=B0?= =?UTF-8?q?=E5=AD=97=E5=AD=97=E5=85=B8=EF=BC=9A=E6=98=BE=E7=A4=BA=E6=97=A0?= =?UTF-8?q?=E6=95=88=E9=A1=B9=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/DataItemController.cs | 13 +++ .../LR_SystemModule/Views/DataItem/Index.js | 4 +- .../SystemModule/DataItem/DataItemBLL.cs | 85 +++++++++++++++++-- .../SystemModule/DataItem/DataItemIBLL.cs | 7 ++ .../SystemModule/DataItem/DataItemService.cs | 28 ++++++ 5 files changed, 126 insertions(+), 11 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 9ee6b61a1..de0fe52d1 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 @@ -160,6 +160,19 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers return JsonResult(data); } /// + /// 获取数据字典明显根据分类编号 + /// + /// 分类编号 + /// 查询条件 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetDetailList2(string itemCode, string keyword) + { + var data = dataItemIBLL.GetDetailList2(itemCode, keyword); + return JsonResult(data); + } + /// /// 获取数据字典明显树形数据 /// /// 分类编号 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_SystemModule/Views/DataItem/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_SystemModule/Views/DataItem/Index.js index 06a97743c..7718cbfea 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_SystemModule/Views/DataItem/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_SystemModule/Views/DataItem/Index.js @@ -105,8 +105,8 @@ var bootstrap = function ($, learun) { }); }, initGrid: function () { - $('#gridtable').lrAuthorizeJfGrid({ - url: top.$.rootUrl + '/LR_SystemModule/DataItem/GetDetailList', + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/LR_SystemModule/DataItem/GetDetailList2', headData: [ { label: '项目名', name: 'F_ItemName', width: 200, align: 'left' }, { label: '项目值', name: 'F_ItemValue', width: 200, align: 'left' }, 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 a39e1d427..f4293a4d1 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 @@ -300,6 +300,48 @@ namespace Learun.Application.Base.SystemModule } } } + /// + /// 获取数据字典明显 + /// + /// 分类编码 + /// + public List GetDetailList2(string itemCode) + { + try + { + List list = (List)dataItemService.GetDetailList2(itemCode); + return list; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + public IEnumerable GetAllDetailList() + { + try + { + return dataItemService.GetAllDetailList(); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } /// /// 获取数据字典详细映射数据 @@ -323,16 +365,12 @@ namespace Learun.Application.Base.SystemModule } foreach (var detailItem in detailList) { - if (!dic[item.F_ItemCode].ContainsKey(detailItem.F_ItemDetailId)) + dic[item.F_ItemCode].Add(detailItem.F_ItemDetailId, new DataItemModel() { - dic[item.F_ItemCode].Add(detailItem.F_ItemDetailId, new DataItemModel() - { - parentId = detailItem.F_ParentId, - text = detailItem.F_ItemName, - value = detailItem.F_ItemValue - }); - } - + parentId = detailItem.F_ParentId, + text = detailItem.F_ItemName, + value = detailItem.F_ItemValue + }); } } cache.Write(cacheKeyDetail + "dic", dic, CacheId.dataItem); @@ -385,6 +423,35 @@ namespace Learun.Application.Base.SystemModule /// /// 获取数据字典明显 /// + /// 分类编码 + /// 关键词(名称/值) + /// + public List GetDetailList2(string itemCode, string keyword) + { + try + { + List list = GetDetailList2(itemCode); + if (!string.IsNullOrEmpty(keyword)) + { + list = list.FindAll(t => t.F_ItemName.Contains(keyword) || t.F_ItemValue.Contains(keyword)); + } + return list; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// + /// 获取数据字典明显 + /// /// 分类编号 /// 父级主键 /// 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 4dcc185ca..96feda965 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 @@ -77,6 +77,13 @@ namespace Learun.Application.Base.SystemModule /// 关键词(名称/值) /// List GetDetailList(string itemCode, string keyword); + /// + /// 获取数据字典明显 + /// + /// 分类编码 + /// 关键词(名称/值) + /// + List GetDetailList2(string itemCode, string keyword); /// /// 获取数据字典详细映射数据 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 2573255e1..2f965041b 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 @@ -187,6 +187,34 @@ namespace Learun.Application.Base.SystemModule /// 分类编号 /// public IEnumerable GetDetailList(string itemCode) + { + 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 and t.F_EnabledMark=1 Order By t.F_SortCode + "); + return this.BaseRepository().FindList(strSql.ToString(), new { itemCode = itemCode }); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// + /// 获取数据字典明显根据分类编号 + /// + /// 分类编号 + /// + public IEnumerable GetDetailList2(string itemCode) { try {