用户编辑界面

This commit is contained in:
chenchun
2022-09-11 02:39:33 +08:00
parent 0dca7acee6
commit d001a0de15
12 changed files with 445 additions and 607 deletions

View File

@@ -16,6 +16,10 @@ namespace Yi.Framework.Service
{
public partial class UserService
{
public async Task<List<UserEntity>> GetListInRole()
{
return await _repository._DbQueryable.Includes(u => u.Roles).ToListAsync();
}
public async Task<List<UserEntity>> DbTest()
{
return await _repository._Db.Queryable<UserEntity>().ToListAsync();
@@ -64,23 +68,12 @@ namespace Yi.Framework.Service
{
user.UserName = userEntity.UserName;
user.BuildPassword();
//等待老杰哥更新杰哥漏了雪花id呀嘿嘿
//var entity = await _repository.InsertReturnSnowflakeEntityAsync(user);
//userAction.Invoke(await _repository.GetByIdAsync(entity));
//await _repository.InsertReturnSnowflakeEntityAsync(user);
//userAction.Invoke(await _repository.GetByIdAsync(user));
userAction.Invoke(await _repository.InsertReturnEntityAsync(user));
return true;
}
return false;
}
public async Task<List<UserEntity>> GetListInRole()
{
return await _repository._DbQueryable.Includes(u => u.Roles).ToListAsync();
}
public async Task<bool> GiveUserSetRole(List<long> userIds, List<long> roleIds)
{
var _repositoryUserRole = _repository.ChangeRepository<Repository<UserRoleEntity>>();
@@ -109,9 +102,9 @@ namespace Yi.Framework.Service
}
public async Task<List<RoleEntity>> GetRoleListByUserId(long userId)
public async Task<UserEntity> GetInfoById(long userId)
{
return (await _repository._DbQueryable.Includes(u => u.Roles).InSingleAsync(userId)).Roles;
return await _repository._DbQueryable.Includes(u => u.Roles).InSingleAsync(userId);
}
public async Task<UserRoleMenuDto> GetUserAllInfo(long userId)
@@ -179,7 +172,8 @@ namespace Yi.Framework.Service
.WhereIF(!string.IsNullOrEmpty(user.Name), u => u.Name.Contains(user.Name))
.WhereIF(!string.IsNullOrEmpty(user.Phone), u => u.Phone.Contains(user.Phone))
.WhereIF(page.StartTime.IsNotNull() && page.EndTime.IsNotNull(), u => u.CreateTime >= page.StartTime && u.CreateTime <= page.EndTime)
.Where(u => u.IsDeleted == false)
.Where(u => u.IsDeleted == user.IsDeleted)
.Includes(u => u.Roles)
.OrderBy(u => u.OrderNum, OrderByType.Desc)
.ToPageListAsync(page.PageNum, page.PageSize, total);