修改导表
parent
4e4336c461
commit
e836cd2daa
|
@ -479,6 +479,16 @@
|
|||
<param name="_trialRepository"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.Common.ExcelExportService.GetStudyUploadMonitor_Export(IRaCIS.Core.Application.Contracts.StudyQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.CommonDocument},IRaCIS.Application.Interfaces.IDictionaryService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
|
||||
<summary>
|
||||
影像上传监控表
|
||||
</summary>
|
||||
<param name="studyQuery"></param>
|
||||
<param name="_commonDocumentRepository"></param>
|
||||
<param name="_dictionaryService"></param>
|
||||
<param name="_trialRepository"></param>
|
||||
<returns></returns>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.Common.ExcelExportService.GetReadingPeriodList_Export(IRaCIS.Core.Application.Contracts.ReadPeriodQuery,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.CommonDocument},IRaCIS.Application.Interfaces.IDictionaryService,IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial})">
|
||||
<summary>
|
||||
阅片期信息表
|
||||
|
|
|
@ -334,6 +334,75 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// 影像上传监控表
|
||||
/// </summary>
|
||||
/// <param name="studyQuery"></param>
|
||||
/// <param name="_commonDocumentRepository"></param>
|
||||
/// <param name="_dictionaryService"></param>
|
||||
/// <param name="_trialRepository"></param>
|
||||
/// <returns></returns>
|
||||
[HttpPost]
|
||||
public async Task<IActionResult> GetStudyUploadMonitor_Export(StudyQuery studyQuery,
|
||||
[FromServices] IRepository<CommonDocument> _commonDocumentRepository,
|
||||
[FromServices] IDictionaryService _dictionaryService,
|
||||
[FromServices] IRepository<Trial> _trialRepository)
|
||||
{
|
||||
|
||||
var svExpression = QCCommon.GetStudyMonitorSubjectVisitFilter(studyQuery.VisitPlanArray);
|
||||
var StudyMonitorQuery = _repository.Where<StudyMonitor>(t => t.TrialId == studyQuery.TrialId)
|
||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
|
||||
.WhereIf(studyQuery.VisitPlanArray != null && studyQuery.VisitPlanArray?.Length > 0, svExpression)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(studyQuery.SubjectInfo), t => t.Subject.Code.Contains(studyQuery.SubjectInfo))
|
||||
.WhereIf(studyQuery.SubjectId != null, t => t.SubjectId == studyQuery.SubjectId)
|
||||
.WhereIf(studyQuery.SubjectVisitId != null, t => t.SubjectId == studyQuery.SubjectVisitId)
|
||||
.WhereIf(studyQuery.SiteId != null, t => t.SiteId == studyQuery.SiteId)
|
||||
.Select(t => new UnionStudyMonitorExportDto()
|
||||
{
|
||||
TrialSiteCode = t.TrialSite.TrialSiteCode,
|
||||
TrialSiteAliasName = t.TrialSite.TrialSiteAliasName,
|
||||
|
||||
SubjectCode = t.Subject.Code,
|
||||
|
||||
|
||||
VisitName = t.SubjectVisit.VisitName,
|
||||
|
||||
StudyCode = t.StudyCode,
|
||||
|
||||
IsDicom = t.IsDicom,
|
||||
|
||||
Uploader = t.Uploader.UserName,
|
||||
|
||||
IP = t.IP,
|
||||
|
||||
UploadStartTime = t.UploadStartTime,
|
||||
|
||||
UploadFinishedTime = t.UploadFinishedTime,
|
||||
|
||||
TotalMillisecondsInterval = t.TotalMillisecondsInterval,
|
||||
|
||||
UploadTime = t.CreateTime,
|
||||
|
||||
FileCount = t.FileCount,
|
||||
FileSize = t.FileSize,
|
||||
|
||||
IsDicomReUpload = t.IsDicomReUpload,
|
||||
|
||||
IsSuccess = t.IsSuccess,
|
||||
Note = t.Note,
|
||||
});
|
||||
|
||||
var list = await StudyMonitorQuery.ToListAsync();
|
||||
|
||||
var exportInfo = (await _trialRepository.Where(t => t.Id == studyQuery.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
exportInfo.List = list;
|
||||
|
||||
return await ExcelExportHelper.DataExportAsync(StaticData.Export.TrialStudyUploadMonitor_Export, exportInfo, $"{exportInfo.ResearchProgramNo}", _commonDocumentRepository, _hostEnvironment, _dictionaryService, typeof(UnionStudyMonitorExportDto));
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -440,6 +440,72 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public class UnionStudyMonitorExportDto
|
||||
{
|
||||
public string SubjectCode { get; set; } = String.Empty;
|
||||
|
||||
public string VisitName { get; set; } = string.Empty;
|
||||
|
||||
|
||||
public string TrialSiteCode { get; set; } = string.Empty;
|
||||
|
||||
public string TrialSiteAliasName { get; set; } = string.Empty;
|
||||
|
||||
public string Uploader { get; set; } = string.Empty;
|
||||
|
||||
public DateTime UploadTime { get; set; }
|
||||
|
||||
public string StudyCode { get; set; }
|
||||
|
||||
|
||||
public bool IsDicom { get; set; }
|
||||
|
||||
public string IsDicomStr => IsDicom ? "DICOM" : "Non-DICOM";
|
||||
|
||||
public string UploadStartTimeStr => UploadStartTime.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||
public string UploadFinishedTimeStr => UploadFinishedTime.ToString("yyyy-MM-dd HH:mm:ss.fff");
|
||||
|
||||
|
||||
public double TotalMillisecondsInterval { get; set; }
|
||||
|
||||
|
||||
public string TimeInterval
|
||||
{
|
||||
get
|
||||
{
|
||||
|
||||
var uploadTimeSpan = UploadFinishedTime - UploadStartTime;
|
||||
|
||||
return $" {uploadTimeSpan.Hours}:{uploadTimeSpan.Minutes}:{uploadTimeSpan.Seconds}.{uploadTimeSpan.Milliseconds}";
|
||||
}
|
||||
}
|
||||
|
||||
public DateTime UploadStartTime { get; set; }
|
||||
|
||||
|
||||
public DateTime UploadFinishedTime { get; set; }
|
||||
|
||||
|
||||
public decimal FileSize { get; set; }
|
||||
|
||||
public string FileSizeStr => $"{(FileSize / (decimal)Math.Pow(1024, 2)).ToString("F")}M";
|
||||
|
||||
public string IP { get; set; } = String.Empty;
|
||||
|
||||
|
||||
public bool IsDicomReUpload { get; set; }
|
||||
|
||||
|
||||
public int FileCount { get; set; }
|
||||
|
||||
[DictionaryTranslateAttribute("YesOrNo")]
|
||||
public bool IsSuccess { get; set; } = true;
|
||||
|
||||
public string Note = string.Empty;
|
||||
|
||||
}
|
||||
|
||||
public class UnionStudyExportDTO
|
||||
|
|
|
@ -149,6 +149,8 @@ public static class StaticData
|
|||
|
||||
public const string TrialStudyList_Export = "TrialStudyList_Export";
|
||||
|
||||
public const string TrialStudyUploadMonitor_Export = "TrialStudyUploadMonitor_Export";
|
||||
|
||||
public const string TrialSubjectVisitCheckList_Export = "TrialSubjectVisitCheckList_Export";
|
||||
|
||||
public const string TrialReadingTaskList_Export = "TrialReadingTaskList_Export";
|
||||
|
|
Loading…
Reference in New Issue