diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/UserTrialViewModel.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/UserTrialViewModel.cs index 09afa1397..e8e20d3ee 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/UserTrialViewModel.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/DTO/UserTrialViewModel.cs @@ -21,7 +21,7 @@ namespace IRaCIS.Application.Contracts public Guid IdentityUserId { get; set; } - public string UserType { get; set; } + public string UserType { get; set; } public string Phone { get; set; } = String.Empty; @@ -180,8 +180,8 @@ namespace IRaCIS.Application.Contracts [ExcelFormat("yyyy-MM-dd")] public DateTime? JoinTime { get; set; } - public string JoinTimeStr => JoinTime?.ToString("yyyy-MM-dd") ?? string.Empty; - public string RemoveTimeStr => RemoveTime?.ToString("yyyy-MM-dd") ?? string.Empty; + //public string JoinTimeStr => JoinTime?.ToString("yyyy-MM-dd") ?? string.Empty; + //public string RemoveTimeStr => RemoveTime?.ToString("yyyy-MM-dd") ?? string.Empty; public List TrialUserRoleList { get; set; } @@ -518,6 +518,12 @@ namespace IRaCIS.Application.Contracts } + public class UpdateTrialUserRoleCommand + { + public List IdList { get; set; } + + public bool IsDeleted { get; set; } + } public class UpdateTrialUserCommand { diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs index 535345baa..fbb6c2697 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialMaintenanceService.cs @@ -1,4 +1,5 @@ -using IRaCIS.Application.Contracts; +using FellowOakDicom; +using IRaCIS.Application.Contracts; using IRaCIS.Application.Interfaces; using IRaCIS.Core.Application.Contracts.DTO; using IRaCIS.Core.Application.Filter; @@ -41,19 +42,26 @@ namespace IRaCIS.Core.Application.Service .WhereIf(!string.IsNullOrWhiteSpace(inQuery.UserRealName), t => (t.IdentityUser.FullName).Contains(inQuery.UserRealName)) .Select(t => new TrialIdentityUserDto() { - Id=t.Id, - TrialId=t.TrialId, - IsDeleted=t.IsDeleted, - CreateTime=t.CreateTime, - EMail=t.IdentityUser.EMail, - FullName=t.IdentityUser.FullName, - IdentityUserId=t.IdentityUserId, - JoinTime=t.JoinTime, - OrganizationName=t.IdentityUser.OrganizationName, - Phone=t.IdentityUser.Phone, - UpdateTime=t.UpdateTime, - UserName=t.IdentityUser.UserName, - RemoveTime=t.RemoveTime + Id = t.Id, + TrialId = t.TrialId, + IsDeleted = t.IsDeleted, + CreateTime = t.CreateTime, + EMail = t.IdentityUser.EMail, + FullName = t.IdentityUser.FullName, + IdentityUserId = t.IdentityUserId, + JoinTime = t.JoinTime, + OrganizationName = t.IdentityUser.OrganizationName, + Phone = t.IdentityUser.Phone, + UpdateTime = t.UpdateTime, + UserName = t.IdentityUser.UserName, + RemoveTime = t.RemoveTime, + TrialUserRoleList = t.TrialUserRoleList.Select(ur => new TrialIdentityUserRoleDto() + { + Id = ur.Id, + IsDeleted = ur.IsDeleted, + CreateTime = ur.CreateTime, + UpdateTime = ur.UpdateTime + }).ToList() }); return await query.ToPagedListAsync(inQuery, nameof(TrialIdentityUserDto.UpdateTime)); @@ -96,6 +104,15 @@ namespace IRaCIS.Core.Application.Service } + [HttpPut] + public async Task UpdateTrialUserRole(UpdateTrialUserRoleCommand updateCommand) + { + await _trialUseRoleRepository.UpdatePartialFromQueryAsync(t => updateCommand.IdList.Contains(t.Id), u => new TrialUserRole() { IsDeleted = updateCommand.IsDeleted }, true); + + return ResponseOutput.Ok(); + } + + /// Setting页面 项目参与人员勾选列表 [HttpPost] public async Task> GetTrialUserScreeningList(TrialUserQuery inQuery)