Merge branch 'refs/heads/pr_74' into abp

# Conflicts:
#	Yi.Abp.Net8/module/rbac/Yi.Framework.Rbac.Application/Services/DictionaryService.cs
This commit is contained in:
chenchun
2024-10-25 17:31:01 +08:00
5 changed files with 11 additions and 10 deletions

View File

@@ -5,6 +5,7 @@ namespace Yi.Framework.Rbac.Application.Contracts.Dtos.Dictionary
/// </summary> /// </summary>
public class DictionaryCreateInputVo public class DictionaryCreateInputVo
{ {
public int OrderNum { get; set; }
public string? Remark { get; set; } public string? Remark { get; set; }
public string? ListClass { get; set; } public string? ListClass { get; set; }
public string? CssClass { 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 class DictionaryGetListOutputDto : EntityDto<Guid>
{ {
public int OrderNum { get; set; }
public DateTime CreationTime { get; set; } = DateTime.Now; public DateTime CreationTime { get; set; } = DateTime.Now;
public Guid? CreatorId { get; set; } public Guid? CreatorId { get; set; }
public string? Remark { 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 class DictionaryGetOutputDto : EntityDto<Guid>
{ {
public int OrderNum { get; set; }
public DateTime CreationTime { get; set; } = DateTime.Now; public DateTime CreationTime { get; set; } = DateTime.Now;
public Guid? CreatorId { get; set; } public Guid? CreatorId { get; set; }
public string? Remark { 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 class DictionaryUpdateInputVo
{ {
public int OrderNum { get; set; }
public string? Remark { get; set; } public string? Remark { get; set; }
public string? ListClass { get; set; } public string? ListClass { get; set; }
public string? CssClass { get; set; } public string? CssClass { get; set; }

View File

@@ -6,7 +6,6 @@ using Yi.Framework.Ddd.Application;
using Yi.Framework.Rbac.Application.Contracts.Dtos.Dictionary; using Yi.Framework.Rbac.Application.Contracts.Dtos.Dictionary;
using Yi.Framework.Rbac.Application.Contracts.IServices; using Yi.Framework.Rbac.Application.Contracts.IServices;
using Yi.Framework.Rbac.Domain.Entities; using Yi.Framework.Rbac.Domain.Entities;
using Yi.Framework.Rbac.Domain.Shared.Consts;
using Yi.Framework.SqlSugarCore.Abstractions; using Yi.Framework.SqlSugarCore.Abstractions;
@@ -15,29 +14,27 @@ namespace Yi.Framework.Rbac.Application.Services
/// <summary> /// <summary>
/// Dictionary服务实现 /// Dictionary服务实现
/// </summary> /// </summary>
public class DictionaryService : YiCrudAppService<DictionaryEntity, DictionaryGetOutputDto, public class DictionaryService : YiCrudAppService<DictionaryEntity, DictionaryGetOutputDto, DictionaryGetListOutputDto, Guid, DictionaryGetListInputVo, DictionaryCreateInputVo, DictionaryUpdateInputVo>,
DictionaryGetListOutputDto, Guid, DictionaryGetListInputVo, DictionaryCreateInputVo, IDictionaryService
DictionaryUpdateInputVo>,
IDictionaryService
{ {
private ISqlSugarRepository<DictionaryEntity, Guid> _repository; private ISqlSugarRepository<DictionaryEntity, Guid> _repository;
public DictionaryService(ISqlSugarRepository<DictionaryEntity, Guid> repository) : base(repository) public DictionaryService(ISqlSugarRepository<DictionaryEntity, Guid> repository) : base(repository)
{ {
_repository = repository; _repository= repository;
} }
/// <summary> /// <summary>
/// 查询 /// 查询
/// </summary> /// </summary>
public override async Task<PagedResultDto<DictionaryGetListOutputDto>> GetListAsync(
DictionaryGetListInputVo input) public override async Task<PagedResultDto<DictionaryGetListOutputDto>> GetListAsync(DictionaryGetListInputVo input)
{ {
RefAsync<int> total = 0; RefAsync<int> total = 0;
var entities = await _repository._DbQueryable var entities = await _repository._DbQueryable
.WhereIF(input.DictType is not null, x => x.DictType == input.DictType) .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.DictLabel is not null, x => x.DictLabel!.Contains(input.DictLabel!))
.WhereIF(input.State is not null, x => x.State == input.State) .WhereIF(input.State is not null, x => x.State == input.State)
.OrderByDescending(x => x.OrderNum)
.ToPageListAsync(input.SkipCount, input.MaxResultCount, total); .ToPageListAsync(input.SkipCount, input.MaxResultCount, total);
return new PagedResultDto<DictionaryGetListOutputDto> return new PagedResultDto<DictionaryGetListOutputDto>
{ {
@@ -60,4 +57,4 @@ namespace Yi.Framework.Rbac.Application.Services
return result; return result;
} }
} }
} }