From 6e22515603b339ebf5ed66926668abaf207831f6 Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Fri, 24 Nov 2023 09:51:50 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=81=E7=A7=BB=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/UploadDownLoadController.cs | 137 +----------------- .../Service/QC/QCListService.cs | 4 +- .../Service/QC/_MapConfig.cs | 2 +- .../TrialSiteUser/PersonalWorkstation.cs | 69 --------- .../Service/TrialSiteUser/TrialService.cs | 2 +- .../Common/AuditingData.cs | 4 +- .../Context/IRaCISDBContext.cs | 2 +- 7 files changed, 10 insertions(+), 210 deletions(-) diff --git a/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs b/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs index d9f0d11e2..fdab77e01 100644 --- a/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs +++ b/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs @@ -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 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 DoctorIdList { get; set; } - } - - public class GetDoctoreAttachPathCommand - { - public Guid DoctorId { get; set; } - public List AttachmentIdList { get; set; } - } - #endregion - - - /// 医生文件上传下载 - [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; - } - - /// - /// New 医生首页 多选 获取多个医生信息+文件路径列表 医生压缩包名称 doctorCode + "_" + doctorName _(时间戳或者随机的Guid) - /// - /// - [HttpPost, Route("file/GetOfficialResume")] - public async Task>> GetOfficialResume(GetDoctorPathCommand command, - [FromServices] IRepository _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); - - } - - /// - /// New 项目入组 勾选获取简历路径 - /// - /// - /// - /// - /// - [HttpPost,Route("file/GetTrialDoctorOfficialResume")] - public async Task>> GetTrialDoctorOfficialResume(GetDoctorPathCommand command, - [FromServices] IDoctorService _doctorService, - [FromServices] IRepository _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); - - } - - /// - /// new 医生详情 勾选或者下载文件路径 - /// - /// - /// - /// - /// - [HttpPost, Route("file/GetDoctorAttachment")] - public async Task> GetDoctorAttachment(GetDoctoreAttachPathCommand command, - [FromServices] IDoctorService _doctorService, - [FromServices] IRepository _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 UploadTrialSiteSurveyUser(Guid trialId, string baseUrl, string routeUrl, [FromServices] IRepository _trialSiteRepository, [FromServices] IRepository _usertypeRepository, - [FromServices] ITrialSiteSurveyService _trialSiteSurveyService) + [FromServices] ITrialSiteSurveyService _trialSiteSurveyService, + [FromServices] IOSSService oSSService, + [FromServices] IRepository _inspectionFileRepository) { var templateFileStream = new MemoryStream(); diff --git a/IRaCIS.Core.Application/Service/QC/QCListService.cs b/IRaCIS.Core.Application/Service/QC/QCListService.cs index bc2a5777c..171a83016 100644 --- a/IRaCIS.Core.Application/Service/QC/QCListService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCListService.cs @@ -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> GetUserUploadFile(GetUserUploadFileInDto indto) { var query = _repository.Where(t => t.TrialId == indto.TrialId) - .ProjectTo(_mapper.ConfigurationProvider); + .ProjectTo(_mapper.ConfigurationProvider); return await query.ToPagedListAsync(indto.PageIndex, indto.PageSize, "CreateTime", false); } diff --git a/IRaCIS.Core.Application/Service/QC/_MapConfig.cs b/IRaCIS.Core.Application/Service/QC/_MapConfig.cs index b53aa1700..07f3b8df1 100644 --- a/IRaCIS.Core.Application/Service/QC/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/QC/_MapConfig.cs @@ -494,7 +494,7 @@ namespace IRaCIS.Core.Application.Service ; // 一致性核查文件 - CreateMap() + CreateMap() .ForMember(d => d.CreateUserName, u => u.MapFrom(t => t.User.FirstName + "/" + t.User.LastName)); diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs index 54cabe7f8..a3735827c 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/PersonalWorkstation.cs @@ -265,38 +265,6 @@ namespace IRaCIS.Core.Application } - /// - ///PM 阅片人筛选 -- PM APM 待办 - /// - /// - /// - /// - /// vvv - [HttpPost] - public async Task>> GetPM_ReviewerSelectToBeDoneList(ReviewerSelectToBeDoneQuery inQuery - , [FromServices] IRepository _enrollRepository, - [FromServices] IRepository _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(); /// /// 获取PM核对临床数据 @@ -344,43 +312,6 @@ namespace IRaCIS.Core.Application #region SPM CPM 待办 - /// - ///SPM 阅片人筛选 - /// - /// - /// - /// - /// vvv - [HttpPost] - public async Task>> GetSPM_ReviewerSelectToBeDoneList(ReviewerSelectToBeDoneQuery inQuery - , [FromServices] IRepository _enrollRepository, - [FromServices] IRepository _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 }); ; - - } /// /// SPM 重阅审批 diff --git a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs index a42f9d3bc..c46592ff5 100644 --- a/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs +++ b/IRaCIS.Core.Application/Service/TrialSiteUser/TrialService.cs @@ -306,7 +306,7 @@ namespace IRaCIS.Application.Services await _repository.BatchDeleteAsync(o => o.ClinicalForm.TrialId == trialId); await _repository.BatchDeleteAsync(o => o.TrialId == trialId); - await _repository.BatchDeleteAsync(o => o.TrialId == trialId); + await _repository.BatchDeleteAsync(o => o.TrialReadingCriterion.TrialId == trialId); await _repository.BatchDeleteAsync(o => o.TrialReadingCriterion.TrialId == trialId); diff --git a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs index c3d3db1d4..f77de20f5 100644 --- a/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs +++ b/IRaCIS.Core.Infra.EFCore/Common/AuditingData.cs @@ -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(item.Entity as UserUploadFile, type, x => new InspectionConvertDTO() + await InsertInspection(item.Entity as InspectionFile, type, x => new InspectionConvertDTO() { ObjectRelationParentId = x.TrialId diff --git a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs index bf54cfa5a..29e9d87c9 100644 --- a/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs +++ b/IRaCIS.Core.Infra.EFCore/Context/IRaCISDBContext.cs @@ -466,7 +466,7 @@ namespace IRaCIS.Core.Infra.EFCore public virtual DbSet FrontAuditConfig { get; set; } - public virtual DbSet UserUploadFile { get; set; } + public virtual DbSet InspectionFile { get; set; } public virtual DbSet CommonDocument { get; set; }