修改
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
0b937663ff
commit
b205757f8f
|
@ -1054,7 +1054,7 @@
|
|||
医生文档关联关系维护
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.AttachmentService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Attachment},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Enroll},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Doctor},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
|
||||
<member name="M:IRaCIS.Core.Application.Service.AttachmentService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Attachment},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Dictionary},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Enroll},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Doctor},AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
|
||||
<summary>
|
||||
医生文档关联关系维护
|
||||
</summary>
|
||||
|
@ -1110,6 +1110,13 @@
|
|||
<param name="inDto"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.AttachmentService.DeleteAttachment(System.Guid)">
|
||||
<summary>
|
||||
删除
|
||||
</summary>
|
||||
<param name="id"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.AttachmentService.SaveTrialAttachments(System.Collections.Generic.IEnumerable{IRaCIS.Application.Contracts.AttachmentDTO})">
|
||||
<summary>
|
||||
上传项目医生
|
||||
|
@ -17802,6 +17809,11 @@
|
|||
已经签名的临床数据数量
|
||||
</summary>
|
||||
</member>
|
||||
<member name="P:IRaCIS.Application.Contracts.AttachmentDTO.IsAuthorizedView">
|
||||
<summary>
|
||||
是否授权
|
||||
</summary>
|
||||
</member>
|
||||
<member name="T:IRaCIS.Application.Contracts.DoctorSearchDTO">
|
||||
<summary>
|
||||
Reviewer 列表查询参数
|
||||
|
|
|
@ -152,12 +152,24 @@ namespace IRaCIS.Core.Application.Service
|
|||
[HttpPost]
|
||||
public async Task<IResponseOutput> 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();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 删除
|
||||
/// </summary>
|
||||
/// <param name="id"></param>
|
||||
/// <returns></returns>
|
||||
[HttpDelete("{id:guid}")]
|
||||
public async Task<IResponseOutput> DeleteAttachment(Guid id)
|
||||
{
|
||||
var success = await _attachmentrepository.DeleteFromQueryAsync(t => t.Id == id, true);
|
||||
return ResponseOutput.Ok();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 上传项目医生
|
||||
|
@ -167,24 +179,26 @@ namespace IRaCIS.Core.Application.Service
|
|||
[HttpPost]
|
||||
public async Task<IEnumerable<AttachmentDTO>> SaveTrialAttachments(IEnumerable<AttachmentDTO> 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<IEnumerable<Attachment>>(attachmentList).ToList();
|
||||
var newAttachment = attachments.Where(t => t.Id == Guid.Empty);
|
||||
await _attachmentrepository.AddRangeAsync(newAttachment);
|
||||
await _attachmentrepository.SaveChangesAsync();
|
||||
var attachments = _mapper.Map<IEnumerable<Attachment>>(attachmentList).ToList();
|
||||
var newAttachment = attachments.Where(t => t.Id == Guid.Empty);
|
||||
await _attachmentrepository.AddRangeAsync(newAttachment);
|
||||
await _attachmentrepository.SaveChangesAsync();
|
||||
|
||||
var list = _mapper.Map<IEnumerable<AttachmentDTO>>(attachments).ToList();
|
||||
var list = _mapper.Map<IEnumerable<AttachmentDTO>>(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;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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<Guid> Ids { get; set; }
|
||||
|
||||
public bool IsAuthorizedView { get; set; }
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue