diff --git a/src/Shentun.Peis.Application/Nations/NationAppService.cs b/src/Shentun.Peis.Application/Nations/NationAppService.cs index a21ad2da..71821ecd 100644 --- a/src/Shentun.Peis.Application/Nations/NationAppService.cs +++ b/src/Shentun.Peis.Application/Nations/NationAppService.cs @@ -1,5 +1,6 @@ using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; +using Shentun.Peis.Books; using Shentun.Peis.GuideTypes; using Shentun.Peis.GuidTypes; using Shentun.Peis.HelperDto; @@ -11,6 +12,7 @@ using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; +using TencentCloud.Tci.V20190318.Models; using Volo.Abp.Application.Dtos; using Volo.Abp.Application.Services; using Volo.Abp.Domain.Repositories; @@ -57,6 +59,32 @@ namespace Shentun.Peis.Nations /// public async Task> GetListInFilterAsync(GetListInFilterDto input) { + + IQueryable queryable = await _repository.GetQueryableAsync(); + if (!string.IsNullOrEmpty(input.Filter)) + { + queryable = queryable.Where(o => o.DisplayName.Contains(input.Filter)); + } + + var query = from nation in queryable + join createUser in await _userRepository.GetQueryableAsync() on nation.CreatorId equals createUser.Id + join modifyUser in await _userRepository.GetQueryableAsync() on nation.LastModifierId equals modifyUser.Id + orderby nation.DisplayOrder + select new { nation, + CreatorName = createUser.UserName, + LastModifierName = modifyUser.UserName + }; + var queryResult = await AsyncExecuter.ToListAsync(query); ; + var entdto = queryResult.Select(x => + { + var nationDto = ObjectMapper.Map(x.nation); + nationDto.CreatorName = x.CreatorName; + nationDto.LastModifierName = x.LastModifierName; + return nationDto; + + }).ToList(); + + /* var entlist = (await _repository.GetListAsync()).OrderBy(o => o.DisplayOrder).ToList(); if (!string.IsNullOrEmpty(input.Filter)) @@ -76,7 +104,7 @@ namespace Shentun.Peis.Nations CreatorName = EntityHelper.GetUserName(_userRepository, s.CreatorId), LastModifierName = EntityHelper.GetUserName(_userRepository, s.LastModifierId) }).ToList(); - + */ return entdto; } diff --git a/src/Shentun.Peis.HttpApi.Host/Shentun.Peis.HttpApi.Host.csproj b/src/Shentun.Peis.HttpApi.Host/Shentun.Peis.HttpApi.Host.csproj index 97b59388..65bb6d36 100644 --- a/src/Shentun.Peis.HttpApi.Host/Shentun.Peis.HttpApi.Host.csproj +++ b/src/Shentun.Peis.HttpApi.Host/Shentun.Peis.HttpApi.Host.csproj @@ -41,4 +41,329 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +