diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 43cdc4f96..afabecdbb 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -1054,7 +1054,7 @@ 医生文档关联关系维护 - + 医生文档关联关系维护 @@ -1110,6 +1110,13 @@ + + + 删除 + + + + 上传项目医生 @@ -17802,6 +17809,11 @@ 已经签名的临床数据数量 + + + 是否授权 + + Reviewer 列表查询参数 diff --git a/IRaCIS.Core.Application/Service/Doctor/AttachmentService.cs b/IRaCIS.Core.Application/Service/Doctor/AttachmentService.cs index 79fda26c3..9c776b7f8 100644 --- a/IRaCIS.Core.Application/Service/Doctor/AttachmentService.cs +++ b/IRaCIS.Core.Application/Service/Doctor/AttachmentService.cs @@ -152,12 +152,24 @@ namespace IRaCIS.Core.Application.Service [HttpPost] public async Task SetAuthorizedView(SetAttachmentAuthorizedView inDto) { - await _attachmentrepository.UpdatePartialFromQueryAsync(x => x.Id == inDto.Id, x => new Attachment() { IsAuthorizedView = inDto.IsAuthorizedView }); + await _attachmentrepository.UpdatePartialFromQueryAsync(x => inDto.Ids.Contains(x.Id), x => new Attachment() { IsAuthorizedView = inDto.IsAuthorizedView }); await _attachmentrepository.SaveChangesAsync(); return ResponseOutput.Ok(); } + /// + /// 删除 + /// + /// + /// + [HttpDelete("{id:guid}")] + public async Task DeleteAttachment(Guid id) + { + var success = await _attachmentrepository.DeleteFromQueryAsync(t => t.Id == id, true); + return ResponseOutput.Ok(); + } + /// /// 上传项目医生 @@ -167,24 +179,26 @@ namespace IRaCIS.Core.Application.Service [HttpPost] public async Task> SaveTrialAttachments(IEnumerable attachmentList) { - foreach (var item in attachmentList) - { - if (item.DoctorId != null) + + foreach (var item in attachmentList) { - await _attachmentrepository.BatchDeleteNoTrackingAsync(a => a.DoctorId == item.DoctorId && a.Type == item.Type); + if (item.DoctorId != null) + { + await _attachmentrepository.BatchDeleteNoTrackingAsync(a => a.DoctorId == item.DoctorId && a.Type == item.Type); + } } - } - var attachments = _mapper.Map>(attachmentList).ToList(); - var newAttachment = attachments.Where(t => t.Id == Guid.Empty); - await _attachmentrepository.AddRangeAsync(newAttachment); - await _attachmentrepository.SaveChangesAsync(); + var attachments = _mapper.Map>(attachmentList).ToList(); + var newAttachment = attachments.Where(t => t.Id == Guid.Empty); + await _attachmentrepository.AddRangeAsync(newAttachment); + await _attachmentrepository.SaveChangesAsync(); - var list = _mapper.Map>(attachments).ToList(); + var list = _mapper.Map>(attachments).ToList(); - list.ForEach(t => t.FullPath = t.Path + "?access_token=" + _userInfo.UserToken); + list.ForEach(t => t.FullPath = t.Path + "?access_token=" + _userInfo.UserToken); - return list; + return list; + } diff --git a/IRaCIS.Core.Application/Service/Doctor/DTO/AttachmentModel.cs b/IRaCIS.Core.Application/Service/Doctor/DTO/AttachmentModel.cs index db3662223..3c057497c 100644 --- a/IRaCIS.Core.Application/Service/Doctor/DTO/AttachmentModel.cs +++ b/IRaCIS.Core.Application/Service/Doctor/DTO/AttachmentModel.cs @@ -2,7 +2,7 @@ { public class AttachmentDTO { - public Guid Id { get; set; } + public Guid? Id { get; set; } public Guid? DoctorId { get; set; } public bool IsOfficial { get; set; } public string Type { get; set; } = string.Empty; @@ -35,7 +35,7 @@ public class SetAttachmentAuthorizedView { - public Guid Id { get; set; } + public List Ids { get; set; } public bool IsAuthorizedView { get; set; } }