Kaynağa Gözat

【修改】数字字典:显示无效项;

长阳分支推送专用
dyy 2 yıl önce
ebeveyn
işleme
cc24ed41e7
5 değiştirilmiş dosya ile 124 ekleme ve 16 silme
  1. +13
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_SystemModule/Controllers/DataItemController.cs
  2. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_SystemModule/Views/DataItem/Index.js
  3. +75
    -15
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Base/SystemModule/DataItem/DataItemBLL.cs
  4. +7
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Base/SystemModule/DataItem/DataItemIBLL.cs
  5. +28
    -0
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Base/SystemModule/DataItem/DataItemService.cs

+ 13
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_SystemModule/Controllers/DataItemController.cs Dosyayı Görüntüle

@@ -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>


+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_SystemModule/Views/DataItem/Index.js Dosyayı Görüntüle

@@ -106,7 +106,7 @@ var bootstrap = function ($, learun) {
},
initGrid: function () {
$('#gridtable').jfGrid({
url: top.$.rootUrl + '/LR_SystemModule/DataItem/GetDetailList',
url: top.$.rootUrl + '/LR_SystemModule/DataItem/GetDetailList2',
headData: [
{
label: '标准编码', name: 'F_ItemCodeGB', width: 200, align: 'left'


+ 75
- 15
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Base/SystemModule/DataItem/DataItemBLL.cs Dosyayı Görüntüle

@@ -131,7 +131,8 @@ namespace Learun.Application.Base.SystemModule
/// <param name="keyValue">主键</param>
/// <param name="itemCode">编码</param>
/// <returns></returns>
public bool ExistItemCode(string keyValue, string itemCode) {
public bool ExistItemCode(string keyValue, string itemCode)
{
try
{
bool res = false;
@@ -199,7 +200,8 @@ namespace Learun.Application.Base.SystemModule
/// </summary>
/// <param name="keyValue">主键</param>
/// <param name="entity">实体</param>
public void SaveClassifyEntity(string keyValue, DataItemEntity entity) {
public void SaveClassifyEntity(string keyValue, DataItemEntity entity)
{
try
{
dataItemService.SaveClassifyEntity(keyValue, entity);
@@ -279,7 +281,7 @@ namespace Learun.Application.Base.SystemModule
try
{
List<DataItemDetailEntity> list = cache.Read<List<DataItemDetailEntity>>(cacheKeyDetail + itemCode, CacheId.dataItem);
if (list?.Count==0 || list==null)
if (list?.Count == 0 || list == null)
{
list = (List<DataItemDetailEntity>)dataItemService.GetDetailList(itemCode);
cache.Write<List<DataItemDetailEntity>>(cacheKeyDetail + itemCode, list, CacheId.dataItem);
@@ -298,12 +300,35 @@ 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();
return dataItemService.GetAllDetailList();
}
catch (Exception ex)
{
@@ -322,20 +347,24 @@ namespace Learun.Application.Base.SystemModule
/// 获取数据字典详细映射数据
/// </summary>
/// <returns></returns>
public Dictionary<string, Dictionary<string,DataItemModel>> GetModelMap()
public Dictionary<string, Dictionary<string, DataItemModel>> GetModelMap()
{
try
{
Dictionary<string, Dictionary<string,DataItemModel>> dic = cache.Read<Dictionary<string, Dictionary<string,DataItemModel>>>(cacheKeyDetail + "dic", CacheId.dataItem);
if (dic == null) {
dic = new Dictionary<string, Dictionary<string,DataItemModel>>();
Dictionary<string, Dictionary<string, DataItemModel>> dic = cache.Read<Dictionary<string, Dictionary<string, DataItemModel>>>(cacheKeyDetail + "dic", CacheId.dataItem);
if (dic == null)
{
dic = new Dictionary<string, Dictionary<string, DataItemModel>>();
var list = GetClassifyList();
foreach (var item in list) {
foreach (var item in list)
{
var detailList = GetDetailList(item.F_ItemCode);
if (!dic.ContainsKey(item.F_ItemCode)) {
dic.Add(item.F_ItemCode,new Dictionary<string,DataItemModel>());
if (!dic.ContainsKey(item.F_ItemCode))
{
dic.Add(item.F_ItemCode, new Dictionary<string, DataItemModel>());
}
foreach (var detailItem in detailList) {
foreach (var detailItem in detailList)
{
dic[item.F_ItemCode].Add(detailItem.F_ItemDetailId, new DataItemModel()
{
parentId = detailItem.F_ParentId,
@@ -373,7 +402,37 @@ namespace Learun.Application.Base.SystemModule
try
{
List<DataItemDetailEntity> list = GetDetailList(itemCode);
if (!string.IsNullOrEmpty(keyword)) {
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="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;
@@ -435,7 +494,8 @@ namespace Learun.Application.Base.SystemModule
{
List<DataItemDetailEntity> list = GetDetailList(itemCode);
List<TreeModel> treeList = new List<TreeModel>();
foreach (var item in list) {
foreach (var item in list)
{
TreeModel node = new TreeModel();
node.id = item.F_ItemDetailId;
node.text = item.F_ItemName;


+ 7
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Base/SystemModule/DataItem/DataItemIBLL.cs Dosyayı Görüntüle

@@ -78,6 +78,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>
/// 获取数据字典详细映射数据


+ 28
- 0
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.Base/SystemModule/DataItem/DataItemService.cs Dosyayı Görüntüle

@@ -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
{


Yükleniyor…
İptal
Kaydet