From 3ff0230fc15bdb2bcf1a6df199454128147cf606 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 25 Dec 2024 14:02:17 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=9B=B4=E6=96=B0=E8=A7=92?= =?UTF-8?q?=E8=89=B2=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TrialSiteUser/DTO/UserTrialViewModel.cs | 12 +++-- .../TrialSiteUser/TrialMaintenanceService.cs | 45 +++++++++++++------ 2 files changed, 40 insertions(+), 17 deletions(-) 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)