From 247b11cec4d9718d2d03554f14e57b2ce1c728ca Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Wed, 11 Sep 2024 15:46:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BD=B1=E5=83=8F=E7=9B=91?= =?UTF-8?q?=E6=8E=A7=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/ImageAndDoc/DTO/UnionStudyViewDodel.cs | 5 +++++ .../Service/ImageAndDoc/DownloadAndUploadService.cs | 6 ++++++ IRaCIS.Core.Domain/Image/TrialImageDownload.cs | 2 ++ 3 files changed, 13 insertions(+) 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