diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs index d02f7a345..7b4b830ed 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs @@ -594,6 +594,11 @@ namespace IRaCIS.Core.Application.Contracts public UserTypeEnum? UserType { get; set; } public bool? IsSuccess { get; set; } + + public DateTime? DownloadStartTime { get; set; } + public DateTime? DownloadEndTime { get; set; } + + public string IP { get; set; } } public class SubjectVisitTaskInfo diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs index 6420df534..32e86766d 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DownloadAndUploadService.cs @@ -734,6 +734,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc Id = NewId.NextSequentialGuid(), TrialId = result.TrialId, SubjectCode = result.SubjectCode, + IP = _userInfo.IP, DownloadStartTime = DateTime.Now, IsSuccess = false, ImageType = imageType, @@ -912,6 +913,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc Id = NewId.NextSequentialGuid(), TrialId = info.TrialId, SubjectCode = inQuery.SubjectCode, + IP=_userInfo.IP, DownloadStartTime = DateTime.Now, IsSuccess = false, ImageType = imageType, @@ -998,9 +1000,13 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc { var query = _trialImageDownloadRepository.Where(t => t.TrialId == inQuery.TrialId) .WhereIf(inQuery.SubjectCode.IsNotNullOrEmpty(), t => t.SubjectCode.Contains(inQuery.SubjectCode)) + .WhereIf(inQuery.IP.IsNotNullOrEmpty(), t => t.IP.Contains(inQuery.IP)) .WhereIf(inQuery.ImageType != null, t => t.ImageType == inQuery.ImageType) .WhereIf(inQuery.UserType != null, t => t.CreateUser.UserTypeEnum == inQuery.UserType) .WhereIf(inQuery.IsSuccess != null, t => t.IsSuccess == inQuery.IsSuccess) + .WhereIf(inQuery.DownloadStartTime != null, t => t.DownloadStartTime >= inQuery.DownloadStartTime) + .WhereIf(inQuery.DownloadEndTime != null, t => t.DownloadEndTime <= inQuery.DownloadEndTime) + .ProjectTo(_mapper.ConfigurationProvider); return await query.ToPagedListAsync(inQuery); diff --git a/IRaCIS.Core.Domain/Image/TrialImageDownload.cs b/IRaCIS.Core.Domain/Image/TrialImageDownload.cs index effc0cc64..12b65c1fa 100644 --- a/IRaCIS.Core.Domain/Image/TrialImageDownload.cs +++ b/IRaCIS.Core.Domain/Image/TrialImageDownload.cs @@ -37,6 +37,8 @@ namespace IRaCIS.Core.Domain.Models public int ImageCount { get; set; } public long ImageSize { get; set; } + public string IP { get; set; } + } public enum ImageType