From 6378c69764e0609cf45078b1e56ce10bb189d61e Mon Sep 17 00:00:00 2001 From: hao <1308173842@qq.com> Date: Fri, 25 Oct 2024 14:41:08 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=97=E5=85=B8=E8=AF=A6=E6=83=85crud?= =?UTF-8?q?=E5=AE=9E=E4=BD=93=E5=A2=9E=E5=8A=A0OrderNum,=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E5=80=92=E5=BA=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Dtos/Dictionary/DictionaryCreateInputVo.cs | 1 + .../Dtos/Dictionary/DictionaryGetListOutputDto.cs | 1 + .../Dtos/Dictionary/DictionaryGetOutputDto.cs | 1 + .../Dtos/Dictionary/DictionaryUpdateInputVo.cs | 1 + .../Services/DictionaryService.cs | 10 ++++++---- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/Dtos/Dictionary/DictionaryCreateInputVo.cs b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/Dtos/Dictionary/DictionaryCreateInputVo.cs index f4d9f21f..1ccfda7a 100644 --- a/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/Dtos/Dictionary/DictionaryCreateInputVo.cs +++ b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/Dtos/Dictionary/DictionaryCreateInputVo.cs @@ -5,6 +5,7 @@ namespace Yi.Framework.Rbac.Application.Contracts.Dtos.Dictionary /// public class DictionaryCreateInputVo { + public int OrderNum { get; set; } public string? Remark { get; set; } public string? ListClass { get; set; } public string? CssClass { get; set; } diff --git a/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/Dtos/Dictionary/DictionaryGetListOutputDto.cs b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/Dtos/Dictionary/DictionaryGetListOutputDto.cs index a9479a82..328d943d 100644 --- a/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/Dtos/Dictionary/DictionaryGetListOutputDto.cs +++ b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/Dtos/Dictionary/DictionaryGetListOutputDto.cs @@ -4,6 +4,7 @@ namespace Yi.Framework.Rbac.Application.Contracts.Dtos.Dictionary { public class DictionaryGetListOutputDto : EntityDto { + public int OrderNum { get; set; } public DateTime CreationTime { get; set; } = DateTime.Now; public Guid? CreatorId { get; set; } public string? Remark { get; set; } diff --git a/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/Dtos/Dictionary/DictionaryGetOutputDto.cs b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/Dtos/Dictionary/DictionaryGetOutputDto.cs index 4171e9f3..9bbe9b71 100644 --- a/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/Dtos/Dictionary/DictionaryGetOutputDto.cs +++ b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/Dtos/Dictionary/DictionaryGetOutputDto.cs @@ -4,6 +4,7 @@ namespace Yi.Framework.Rbac.Application.Contracts.Dtos.Dictionary { public class DictionaryGetOutputDto : EntityDto { + public int OrderNum { get; set; } public DateTime CreationTime { get; set; } = DateTime.Now; public Guid? CreatorId { get; set; } public string? Remark { get; set; } diff --git a/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/Dtos/Dictionary/DictionaryUpdateInputVo.cs b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/Dtos/Dictionary/DictionaryUpdateInputVo.cs index 8c98c57b..3325264a 100644 --- a/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/Dtos/Dictionary/DictionaryUpdateInputVo.cs +++ b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application.Contracts/Dtos/Dictionary/DictionaryUpdateInputVo.cs @@ -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; } diff --git a/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application/Services/DictionaryService.cs b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application/Services/DictionaryService.cs index e31d7596..07ca18d0 100644 --- a/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application/Services/DictionaryService.cs +++ b/Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application/Services/DictionaryService.cs @@ -30,10 +30,12 @@ namespace Yi.Framework.Rbac.Application.Services public override async Task> GetListAsync(DictionaryGetListInputVo input) { RefAsync 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 { TotalCount = total,