字典详情crud实体增加OrderNum,列表增加倒序

This commit is contained in:
hao
2024-10-25 14:41:08 +08:00
parent 099581dddc
commit 6378c69764
5 changed files with 10 additions and 4 deletions

View File

@@ -5,6 +5,7 @@ namespace Yi.Framework.Rbac.Application.Contracts.Dtos.Dictionary
/// </summary>
public class DictionaryCreateInputVo
{
public int OrderNum { get; set; }
public string? Remark { get; set; }
public string? ListClass { get; set; }
public string? CssClass { get; set; }

View File

@@ -4,6 +4,7 @@ namespace Yi.Framework.Rbac.Application.Contracts.Dtos.Dictionary
{
public class DictionaryGetListOutputDto : EntityDto<Guid>
{
public int OrderNum { get; set; }
public DateTime CreationTime { get; set; } = DateTime.Now;
public Guid? CreatorId { get; set; }
public string? Remark { get; set; }

View File

@@ -4,6 +4,7 @@ namespace Yi.Framework.Rbac.Application.Contracts.Dtos.Dictionary
{
public class DictionaryGetOutputDto : EntityDto<Guid>
{
public int OrderNum { get; set; }
public DateTime CreationTime { get; set; } = DateTime.Now;
public Guid? CreatorId { get; set; }
public string? Remark { get; set; }

View File

@@ -2,6 +2,7 @@ namespace Yi.Framework.Rbac.Application.Contracts.Dtos.Dictionary
{
public class DictionaryUpdateInputVo
{
public int OrderNum { get; set; }
public string? Remark { get; set; }
public string? ListClass { get; set; }
public string? CssClass { get; set; }

View File

@@ -30,10 +30,12 @@ namespace Yi.Framework.Rbac.Application.Services
public override async Task<PagedResultDto<DictionaryGetListOutputDto>> GetListAsync(DictionaryGetListInputVo input)
{
RefAsync<int> total = 0;
var entities = await _repository._DbQueryable.WhereIF(input.DictType is not null, x => x.DictType == input.DictType)
.WhereIF(input.DictLabel is not null, x => x.DictLabel!.Contains(input.DictLabel!))
.WhereIF(input.State is not null, x => x.State == input.State)
.ToPageListAsync(input.SkipCount, input.MaxResultCount, total);
var entities = await _repository._DbQueryable
.WhereIF(input.DictType is not null, x => x.DictType == input.DictType)
.WhereIF(input.DictLabel is not null, x => x.DictLabel!.Contains(input.DictLabel!))
.WhereIF(input.State is not null, x => x.State == input.State)
.OrderByDescending(x => x.OrderNum)
.ToPageListAsync(input.SkipCount, input.MaxResultCount, total);
return new PagedResultDto<DictionaryGetListOutputDto>
{
TotalCount = total,