Exemple #1
0
        public async Task <IActionResult> GetDictionaryTreeAsync([FromBody] GetDictionaryTreeRequestDto request)
        {
            var entityList = await new DictionaryBiz().GetListAsync();

            if (!string.IsNullOrWhiteSpace(request.Name))
            {
                entityList = entityList.Where(a => a.ConfigName.Contains(request.Name) || a.TypeName.Contains(request.Name));
            }
            var response = entityList.GetTree(request.Matedata, a => a.ParentGuid, a => a.DicGuid, a => new GetDictionaryTreeResponseDto
            {
                ConfigCode     = a.ConfigCode,
                ConfigName     = a.ConfigName,
                ExtensionField = a.ExtensionField,
                ParentGuid     = a.ParentGuid,
                TypeCode       = a.TypeCode,
                TypeName       = a.TypeName,
                ValueRange     = a.ValueRange,
                ValueType      = a.ValueType,
                Enable         = a.Enable,
                Sort           = a.Sort,
                CreationDate   = a.CreationDate,
                DicGuid        = a.DicGuid
            });

            return(Success(response));
        }
Exemple #2
0
        public async Task <IActionResult> GetBusinessScopePageAsync([FromBody] GetDictionaryTreeRequestDto request)
        {
            request.Matedata = DictionaryType.BusinessScopeDic;
            var response = await GetDictionaryTreeAsync(request);

            return(response);
        }
Exemple #3
0
        public IActionResult GetDictionaryMatedata([FromBody] GetDictionaryTreeRequestDto request)
        {
            var list = new DictionaryBiz().GetDictionaryMatedata();

            var response = list.Select(a => new GetDictionaryItemDto
            {
                Code = a.ConfigCode,
                Name = a.ConfigName,
                Guid = a.DicGuid
            });

            return(Success(response));
        }