物料清单
This commit is contained in:
@@ -24,4 +24,11 @@ public interface IDictionaryDataService
|
||||
/// <param name="id">主键id.</param>
|
||||
/// <returns></returns>
|
||||
Task<DictionaryDataEntity> GetInfo(string id);
|
||||
|
||||
/// <summary>
|
||||
/// 根据key获取字典
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
Task<Dictionary<string, object>> GetDicByKey(string key);
|
||||
}
|
||||
@@ -327,6 +327,15 @@ public class DictionaryDataService : IDictionaryDataService, IDynamicApiControll
|
||||
{
|
||||
return await _repository.GetFirstAsync(x => x.Id == id && x.DeleteMark == null);
|
||||
}
|
||||
|
||||
public async Task<Dictionary<string, object>> GetDicByKey(string key)
|
||||
{
|
||||
return await _repository.AsSugarClient().Queryable<DictionaryDataEntity>()
|
||||
.LeftJoin<DictionaryTypeEntity>((a, b) => a.DictionaryTypeId == b.Id)
|
||||
.Where((a, b) => b.EnCode == key && b.DeleteMark == null)
|
||||
.ToDictionaryAsync((it)=>it.EnCode,it=>it.FullName);
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region PrivateMethod
|
||||
|
||||
Reference in New Issue
Block a user