add version 0.2.5.1
parent
f9536548f6
commit
648d4b009d
|
@ -6,8 +6,8 @@
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
|
||||||
<DockerComposeProjectPath>..\docker-compose.dcproj</DockerComposeProjectPath>
|
<DockerComposeProjectPath>..\docker-compose.dcproj</DockerComposeProjectPath>
|
||||||
<AssemblyVersion>0.2.3.2</AssemblyVersion>
|
<AssemblyVersion>0.2.5.1</AssemblyVersion>
|
||||||
<FileVersion>0.2.3.2</FileVersion>
|
<FileVersion>0.2.5.1</FileVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
|
|
@ -140,8 +140,7 @@ public class ActivityService : IActivityService
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public async Task<bool> CreateActivitiesByShiftPlan(Guid shiftPlanId, CancellationToken cancellationToken)
|
public async Task<bool> CreateActivitiesByShiftPlan(Guid shiftPlanId, CancellationToken cancellationToken) {
|
||||||
{
|
|
||||||
var shiftPlan = await _mediator.Send(new GetShiftPlanQuery(shiftPlanId), cancellationToken);
|
var shiftPlan = await _mediator.Send(new GetShiftPlanQuery(shiftPlanId), cancellationToken);
|
||||||
if (shiftPlan.Id == Guid.Empty)
|
if (shiftPlan.Id == Guid.Empty)
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
using System.Security.Claims;
|
using System.Security.Claims;
|
||||||
using Brizco.Domain.CommandQueries.Queries;
|
using Brizco.Domain.CommandQueries.Queries;
|
||||||
using Brizco.Domain.Entities.Complex;
|
|
||||||
using Brizco.Domain.Mappers;
|
using Brizco.Domain.Mappers;
|
||||||
using Mapster;
|
using Mapster;
|
||||||
|
|
||||||
|
@ -201,6 +200,8 @@ public class UserService : IUserService
|
||||||
if (user == null)
|
if (user == null)
|
||||||
throw new AppException("User not found", ApiResultStatusCode.NotFound);
|
throw new AppException("User not found", ApiResultStatusCode.NotFound);
|
||||||
var dto = user.AdaptToSDto();
|
var dto = user.AdaptToSDto();
|
||||||
|
if (_currentUserService.ComplexId == null || !Guid.TryParse(_currentUserService.ComplexId, out Guid complexId))
|
||||||
|
{
|
||||||
var roles = await _userManager.GetRolesAsync(user);
|
var roles = await _userManager.GetRolesAsync(user);
|
||||||
foreach (var roleName in roles)
|
foreach (var roleName in roles)
|
||||||
{
|
{
|
||||||
|
@ -208,6 +209,24 @@ public class UserService : IUserService
|
||||||
if (role != null)
|
if (role != null)
|
||||||
dto.RoleIds.Add(role.Id);
|
dto.RoleIds.Add(role.Id);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var complexUser = await _repositoryWrapper.SetRepository<ComplexUser>().TableNoTracking
|
||||||
|
.FirstOrDefaultAsync(c => c.UserId == userId && c.ComplexId == complexId);
|
||||||
|
|
||||||
|
if (complexUser == null)
|
||||||
|
throw new AppException("ComplexUser not found", ApiResultStatusCode.NotFound);
|
||||||
|
|
||||||
|
var complexUserRoles = await _repositoryWrapper.SetRepository<ComplexUserRole>()
|
||||||
|
.TableNoTracking
|
||||||
|
.Where(cur => cur.ComplexUserId == complexUser.Id)
|
||||||
|
.ToListAsync();
|
||||||
|
foreach (var userRole in complexUserRoles)
|
||||||
|
{
|
||||||
|
dto.RoleIds.Add(userRole.RoleId);
|
||||||
|
}
|
||||||
|
}
|
||||||
return dto;
|
return dto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -23,7 +23,8 @@ public class GetActivitiesQueryHandler : IRequestHandler<GetActivitiesQuery, Lis
|
||||||
throw new AppException("UserId is wrong", ApiResultStatusCode.NotFound);
|
throw new AppException("UserId is wrong", ApiResultStatusCode.NotFound);
|
||||||
|
|
||||||
|
|
||||||
IQueryable<Domain.Entities.Task.Activity> activities = _repositoryWrapper.SetRepository<Domain.Entities.Task.Activity>().TableNoTracking.Where(a=>a.IsActivity);
|
IQueryable<Domain.Entities.Task.Activity> activities = _repositoryWrapper.SetRepository<Domain.Entities.Task.Activity>().TableNoTracking
|
||||||
|
.Where(a=>a.IsActivity);
|
||||||
|
|
||||||
|
|
||||||
if (request.SelectedDate > 0)
|
if (request.SelectedDate > 0)
|
||||||
|
@ -40,7 +41,7 @@ public class GetActivitiesQueryHandler : IRequestHandler<GetActivitiesQuery, Lis
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return await activities.OrderByDescending(s => s.CreatedAt)
|
return await activities.OrderBy(s => s.ScheduleType)
|
||||||
.Skip(request.Page * 15).Take(15)
|
.Skip(request.Page * 15).Take(15)
|
||||||
.Select(ActivityMapper.ProjectToSDto)
|
.Select(ActivityMapper.ProjectToSDto)
|
||||||
.ToListAsync(cancellationToken);
|
.ToListAsync(cancellationToken);
|
||||||
|
|
Loading…
Reference in New Issue