@@ -160,6 +160,19 @@ namespace Learun.Application.Web.Areas.LR_SystemModule.Controllers | |||
return JsonResult(data); | |||
} | |||
/// <summary> | |||
/// 获取数据字典明显根据分类编号 | |||
/// </summary> | |||
/// <param name="itemCode">分类编号</param> | |||
/// <param name="keyword">查询条件</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetDetailList2(string itemCode, string keyword) | |||
{ | |||
var data = dataItemIBLL.GetDetailList2(itemCode, keyword); | |||
return JsonResult(data); | |||
} | |||
/// <summary> | |||
/// 获取数据字典明显树形数据 | |||
/// </summary> | |||
/// <param name="itemCode">分类编号</param> | |||
@@ -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' }, | |||
@@ -300,6 +300,48 @@ namespace Learun.Application.Base.SystemModule | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取数据字典明显 | |||
/// </summary> | |||
/// <param name="itemCode">分类编码</param> | |||
/// <returns></returns> | |||
public List<DataItemDetailEntity> GetDetailList2(string itemCode) | |||
{ | |||
try | |||
{ | |||
List<DataItemDetailEntity> list = (List<DataItemDetailEntity>)dataItemService.GetDetailList2(itemCode); | |||
return list; | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
public IEnumerable<DataItemDetailEntity> GetAllDetailList() | |||
{ | |||
try | |||
{ | |||
return dataItemService.GetAllDetailList(); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取数据字典详细映射数据 | |||
@@ -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 | |||
/// <summary> | |||
/// 获取数据字典明显 | |||
/// </summary> | |||
/// <param name="itemCode">分类编码</param> | |||
/// <param name="keyword">关键词(名称/值)</param> | |||
/// <returns></returns> | |||
public List<DataItemDetailEntity> GetDetailList2(string itemCode, string keyword) | |||
{ | |||
try | |||
{ | |||
List<DataItemDetailEntity> 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); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取数据字典明显 | |||
/// </summary> | |||
/// <param name="itemCode">分类编号</param> | |||
/// <param name="parentId">父级主键</param> | |||
/// <returns></returns> | |||
@@ -77,6 +77,13 @@ namespace Learun.Application.Base.SystemModule | |||
/// <param name="keyword">关键词(名称/值)</param> | |||
/// <returns></returns> | |||
List<DataItemDetailEntity> GetDetailList(string itemCode, string keyword); | |||
/// <summary> | |||
/// 获取数据字典明显 | |||
/// </summary> | |||
/// <param name="itemCode">分类编码</param> | |||
/// <param name="keyword">关键词(名称/值)</param> | |||
/// <returns></returns> | |||
List<DataItemDetailEntity> GetDetailList2(string itemCode, string keyword); | |||
/// <summary> | |||
/// 获取数据字典详细映射数据 | |||
@@ -187,6 +187,34 @@ namespace Learun.Application.Base.SystemModule | |||
/// <param name="itemCode">分类编号</param> | |||
/// <returns></returns> | |||
public IEnumerable<DataItemDetailEntity> 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<DataItemDetailEntity>(strSql.ToString(), new { itemCode = itemCode }); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取数据字典明显根据分类编号 | |||
/// </summary> | |||
/// <param name="itemCode">分类编号</param> | |||
/// <returns></returns> | |||
public IEnumerable<DataItemDetailEntity> GetDetailList2(string itemCode) | |||
{ | |||
try | |||
{ | |||