用户列表部门岗位角色信息

This commit is contained in:
陈淳
2022-09-13 19:04:41 +08:00
parent 89762cad78
commit e78e9d8e55
5 changed files with 28 additions and 10 deletions

View File

@@ -135,7 +135,7 @@ ServiceLocator.Instance = app.Services;
#region
//<2F><><EFBFBD><EFBFBD>ץȡ<D7A5><C8A1><EFBFBD><EFBFBD>ע<EFBFBD><D7A2>
#endregion
app.UseErrorHandlingService();
//app.UseErrorHandlingService();
#region
//<2F><>̬<EFBFBD>ļ<EFBFBD>ע<EFBFBD><D7A2>
#endregion

View File

@@ -14,6 +14,11 @@ namespace Yi.Framework.Model.Models
[Navigate(typeof(UserRoleEntity), nameof(UserRoleEntity.UserId), nameof(UserRoleEntity.RoleId))]
public List<RoleEntity> Roles { get; set; }
[Navigate(typeof(UserPostEntity), nameof(UserPostEntity.UserId), nameof(UserPostEntity.PostId))]
public List<PostEntity> Posts { get; set; }
[Navigate( NavigateType.OneToOne,nameof(DeptId))]
public DeptEntity Dept { get; set; }
/// <summary>
/// 构建密码MD5盐值加密

View File

@@ -131,7 +131,7 @@ namespace Yi.Framework.Service
public async Task<UserEntity> GetInfoById(long userId)
{
return await _repository._DbQueryable.Includes(u => u.Roles).InSingleAsync(userId);
return await _repository._DbQueryable.Includes(u => u.Roles).Includes(u=>u.Posts).Includes(u=>u.Dept).InSingleAsync(userId);
}
public async Task<UserRoleMenuDto> GetUserAllInfo(long userId)
@@ -194,6 +194,8 @@ namespace Yi.Framework.Service
.WhereIF(page.StartTime.IsNotNull() && page.EndTime.IsNotNull(), u => u.CreateTime >= page.StartTime && u.CreateTime <= page.EndTime)
.WhereIF(user.IsDeleted.IsNotNull(),u => u.IsDeleted == user.IsDeleted)
.Includes(u => u.Roles)
.Includes(u=>u.Posts)
.Includes(u=>u.Dept)
.OrderBy(u => u.OrderNum, OrderByType.Desc)
.ToPageListAsync(page.PageNum, page.PageSize, total);