迁移修改
continuous-integration/drone/push Build is passing Details

Uat_Study
hang 2023-11-24 09:51:50 +08:00
parent abd5c8942d
commit 6e22515603
7 changed files with 10 additions and 210 deletions

View File

@ -968,141 +968,8 @@ namespace IRaCIS.Core.API.Controllers
#endregion
#region 医生文件上传下载
#region DTO
public class DoctorDownloadInfo
{
public Guid Id { get; set; }
public string Name { get; set; }
public string ReviewerCode { get; set; }
public List<DownloadFileInfo> FileList { get; set; }
}
public class DownloadFileInfo
{
public string FileName { get; set; }
public string Path { get; set; }
}
public class GetDoctorPathCommand
{
public int Language { get; set; }
public List<Guid> DoctorIdList { get; set; }
}
public class GetDoctoreAttachPathCommand
{
public Guid DoctorId { get; set; }
public List<Guid> AttachmentIdList { get; set; }
}
#endregion
/// <summary>医生文件上传下载</summary>
[ApiExplorerSettings(GroupName = "Common")]
[ApiController]
public class FileController : UploadBaseController
{
public IMapper _mapper { get; set; }
public IUserInfo _userInfo { get; set; }
private readonly IWebHostEnvironment _hostEnvironment;
private readonly IFileService _fileService;
public FileController(IMapper mapper, IUserInfo userInfo, IWebHostEnvironment hostEnvironment, IFileService fileService)
{
_fileService = fileService;
_hostEnvironment = hostEnvironment;
_mapper = mapper;
_userInfo = userInfo;
}
/// <summary>
/// New 医生首页 多选 获取多个医生信息+文件路径列表 医生压缩包名称 doctorCode + "_" + doctorName _(时间戳或者随机的Guid)
/// </summary>
/// <returns></returns>
[HttpPost, Route("file/GetOfficialResume")]
public async Task<IResponseOutput<List<DoctorDownloadInfo>>> GetOfficialResume(GetDoctorPathCommand command,
[FromServices] IRepository<Attachment> _attachmentrepository)
{
var list = await _attachmentrepository.Where(t => command.DoctorIdList.Contains(t.DoctorId) && command.Language==t.Language).GroupBy(t => new { Name = t.Doctor.FirstName + "_" + t.Doctor.LastName, ReviewerCode = t.Doctor.ReviewerCode, t.DoctorId })
.Select(g => new DoctorDownloadInfo()
{
Id = g.Key.DoctorId,
Name = g.Key.Name,
ReviewerCode = g.Key.ReviewerCode,
FileList = g.Select(t => new DownloadFileInfo() { FileName = t.FileName, Path = t.Path }).ToList()
}).ToListAsync();
return ResponseOutput.Ok(list);
}
/// <summary>
/// New 项目入组 勾选获取简历路径
/// </summary>
/// <param name="command"></param>
/// <param name="_doctorService"></param>
/// <param name="_attachmentrepository"></param>
/// <returns></returns>
[HttpPost,Route("file/GetTrialDoctorOfficialResume")]
public async Task<IResponseOutput<List<DoctorDownloadInfo>>> GetTrialDoctorOfficialResume(GetDoctorPathCommand command,
[FromServices] IDoctorService _doctorService,
[FromServices] IRepository<Attachment> _attachmentrepository)
{
var list = await _attachmentrepository.Where(t => command.DoctorIdList.Contains(t.DoctorId) && command.Language == t.Language && t.IsOfficial && t.Type.Equals("Resume")).GroupBy(t => new { Name = t.Doctor.FirstName + "_" + t.Doctor.LastName, ReviewerCode = t.Doctor.ReviewerCode, t.DoctorId })
.Select(g => new DoctorDownloadInfo()
{
Id = g.Key.DoctorId,
Name = g.Key.Name,
ReviewerCode = g.Key.ReviewerCode,
FileList = g.Select(t => new DownloadFileInfo() { FileName = t.FileName, Path = t.Path }).ToList()
}).ToListAsync();
return ResponseOutput.Ok(list);
}
/// <summary>
/// new 医生详情 勾选或者下载文件路径
/// </summary>
/// <param name="command"></param>
/// <param name="_doctorService"></param>
/// <param name="_attachmentrepository"></param>
/// <returns></returns>
[HttpPost, Route("file/GetDoctorAttachment")]
public async Task<IResponseOutput<DoctorDownloadInfo>> GetDoctorAttachment(GetDoctoreAttachPathCommand command,
[FromServices] IDoctorService _doctorService,
[FromServices] IRepository<Attachment> _attachmentrepository)
{
var find = await _attachmentrepository.Where(t => command.DoctorId==t.DoctorId && command.AttachmentIdList.Contains(t.Id)).GroupBy(t => new { Name = t.Doctor.FirstName + "_" + t.Doctor.LastName, ReviewerCode = t.Doctor.ReviewerCode, t.DoctorId })
.Select(g => new DoctorDownloadInfo()
{
Id = g.Key.DoctorId,
Name = g.Key.Name,
ReviewerCode = g.Key.ReviewerCode,
FileList = g.Select(t => new DownloadFileInfo() { FileName = t.FileName, Path = t.Path }).ToList()
}).FirstOrDefaultAsync();
return ResponseOutput.Ok(find);
}
}
#endregion
#region 项目 系统 基本文件 上传 下载 预览
@ -1139,7 +1006,9 @@ namespace IRaCIS.Core.API.Controllers
public async Task<IResponseOutput> UploadTrialSiteSurveyUser(Guid trialId, string baseUrl, string routeUrl,
[FromServices] IRepository<TrialSite> _trialSiteRepository,
[FromServices] IRepository<UserType> _usertypeRepository,
[FromServices] ITrialSiteSurveyService _trialSiteSurveyService)
[FromServices] ITrialSiteSurveyService _trialSiteSurveyService,
[FromServices] IOSSService oSSService,
[FromServices] IRepository<InspectionFile> _inspectionFileRepository)
{
var templateFileStream = new MemoryStream();

View File

@ -37,7 +37,7 @@ namespace IRaCIS.Core.Application.Image.QA
_subjectVisitRepository = subjectVisitRepository;
this._trialQCQuestionAnswerRepository = trialQCQuestionAnswerRepository;
this._trialQCQuestionRepository = trialQCQuestionRepository;
this._UserUploadFileRepository = UserUploadFileRepository;
this._consistencyCheckFileRepository = consistencyCheckFileRepository;
_trialRepository = trialRepository;
this._clinicalDataTrialSet = clinicalDataTrialSet;
}
@ -852,7 +852,7 @@ namespace IRaCIS.Core.Application.Image.QA
public async Task<PageOutput<GetUserUploadFileDto>> GetUserUploadFile(GetUserUploadFileInDto indto)
{
var query = _repository.Where<InspectionFile>(t => t.TrialId == indto.TrialId)
.ProjectTo<GetConsistencyCheckFileDto>(_mapper.ConfigurationProvider);
.ProjectTo<GetUserUploadFileDto>(_mapper.ConfigurationProvider);
return await query.ToPagedListAsync(indto.PageIndex, indto.PageSize, "CreateTime", false);
}

View File

@ -494,7 +494,7 @@ namespace IRaCIS.Core.Application.Service
;
// 一致性核查文件
CreateMap<InspectionFile, GetConsistencyCheckFileDto>()
CreateMap<InspectionFile, GetUserUploadFileDto>()
.ForMember(d => d.CreateUserName, u => u.MapFrom(t => t.User.FirstName + "/" + t.User.LastName));

View File

@ -265,38 +265,6 @@ namespace IRaCIS.Core.Application
}
/// <summary>
///PM 阅片人筛选 -- PM APM 待办
/// </summary>
/// <param name="inQuery"></param>
/// <param name="_enrollRepository"></param>
/// <param name="_trialRepository"></param>
/// <returns></returns> vvv
[HttpPost]
public async Task<IResponseOutput<PageOutput<ReviewerSelectToBeDoneDto>>> GetPM_ReviewerSelectToBeDoneList(ReviewerSelectToBeDoneQuery inQuery
, [FromServices] IRepository<Enroll> _enrollRepository,
[FromServices] IRepository<Trial> _trialRepository)
{
var query = _trialRepository
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Select(t => new ReviewerSelectToBeDoneDto()
{
TrialId = t.Id,
ResearchProgramNo = t.ResearchProgramNo,
ExperimentName = t.ExperimentName,
TrialCode = t.TrialCode,
IsUrgent = t.IsUrgent || t.IsSubjectExpeditedView,
ToBeApprovalCount = t.EnrollList.Where(u => u.EnrollStatus == EnrollStatus.InviteIntoGroup).Count()
}).Where(x => x.ToBeApprovalCount > 0);
var defalutSortArray = new string[] { nameof(ReviewerSelectToBeDoneDto.IsUrgent) + " desc", nameof(ReReadingApplyToBeDoneDto.ToBeApprovalCount) + " desc" };
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var toBeApprovalCount = await _enrollRepository.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Where(u => u.EnrollStatus == EnrollStatus.HasCommittedToCRO).CountAsync();
/// <summary>
/// 获取PM核对临床数据
@ -344,43 +312,6 @@ namespace IRaCIS.Core.Application
#region SPM CPM 待办
/// <summary>
///SPM 阅片人筛选
/// </summary>
/// <param name="inQuery"></param>
/// <param name="_enrollRepository"></param>
/// <param name="_trialRepository"></param>
/// <returns></returns> vvv
[HttpPost]
public async Task<IResponseOutput<PageOutput<ReviewerSelectToBeDoneDto>>> GetSPM_ReviewerSelectToBeDoneList(ReviewerSelectToBeDoneQuery inQuery
, [FromServices] IRepository<Enroll> _enrollRepository,
[FromServices] IRepository<Trial> _trialRepository)
{
var query = _trialRepository
.Where(t => t.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Select(t => new ReviewerSelectToBeDoneDto()
{
TrialId = t.Id,
ResearchProgramNo = t.ResearchProgramNo,
ExperimentName = t.ExperimentName,
TrialCode = t.TrialCode,
IsUrgent = t.IsUrgent || t.IsSubjectExpeditedView,
ToBeApprovalCount = t.EnrollList.Where(u => u.EnrollStatus == EnrollStatus.HasCommittedToCRO).Count()
}).Where(x => x.ToBeApprovalCount > 0);
var defalutSortArray = new string[] { nameof(ReviewerSelectToBeDoneDto.IsUrgent) + " desc", nameof(ReviewerSelectToBeDoneDto.ToBeApprovalCount) + " desc" };
var result = await query.ToPagedListAsync(inQuery.PageIndex, inQuery.PageSize, inQuery.SortField, inQuery.Asc, string.IsNullOrWhiteSpace(inQuery.SortField), defalutSortArray);
var toBeApprovalCount = await _enrollRepository.Where(t => t.Trial.TrialUserList.Any(t => t.UserId == _userInfo.Id))
.Where(u => u.EnrollStatus == EnrollStatus.HasCommittedToCRO).CountAsync();
return ResponseOutput.Ok(result, new { TotalToBeApprovalCount = toBeApprovalCount }); ;
}
/// <summary>
/// SPM 重阅审批

View File

@ -306,7 +306,7 @@ namespace IRaCIS.Application.Services
await _repository.BatchDeleteAsync<ClinicalQuestionAnswer>(o => o.ClinicalForm.TrialId == trialId);
await _repository.BatchDeleteAsync<ClinicalForm>(o => o.TrialId == trialId);
await _repository.BatchDeleteAsync<UserUploadFile>(o => o.TrialId == trialId);
await _repository.BatchDeleteAsync<CriterionNidusSystem>(o => o.TrialReadingCriterion.TrialId == trialId);
await _repository.BatchDeleteAsync<CriterionNidusTrial>(o => o.TrialReadingCriterion.TrialId == trialId);

View File

@ -1356,11 +1356,11 @@ namespace IRaCIS.Core.Infra.EFCore.Common
// 一致性核查文件 是否需要单独一个表记录?
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(UserUploadFile)))
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(InspectionFile)))
{
var type = GetEntityAuditOpt(item);
await InsertInspection<UserUploadFile>(item.Entity as UserUploadFile, type, x => new InspectionConvertDTO()
await InsertInspection<InspectionFile>(item.Entity as InspectionFile, type, x => new InspectionConvertDTO()
{
ObjectRelationParentId = x.TrialId

View File

@ -466,7 +466,7 @@ namespace IRaCIS.Core.Infra.EFCore
public virtual DbSet<FrontAuditConfig> FrontAuditConfig { get; set; }
public virtual DbSet<UserUploadFile> UserUploadFile { get; set; }
public virtual DbSet<InspectionFile> InspectionFile { get; set; }
public virtual DbSet<CommonDocument> CommonDocument { get; set; }