From 0151305ca3371e28d3129a4352b71b198f267a99 Mon Sep 17 00:00:00 2001 From: he <109787524@qq.com> Date: Tue, 23 Dec 2025 14:55:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Common/DTO/EmailLogViewModel.cs | 11 +++++++++++ .../Service/Common/EmailLogService.cs | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/IRaCIS.Core.Application/Service/Common/DTO/EmailLogViewModel.cs b/IRaCIS.Core.Application/Service/Common/DTO/EmailLogViewModel.cs index 247908408..724746d11 100644 --- a/IRaCIS.Core.Application/Service/Common/DTO/EmailLogViewModel.cs +++ b/IRaCIS.Core.Application/Service/Common/DTO/EmailLogViewModel.cs @@ -14,6 +14,17 @@ namespace IRaCIS.Core.Application.ViewModel; public class GetReSendEmailInDto : PageInput { public Guid Id { get; set; } + + + public DateTime? EmailStartDate { get; set; } + + public DateTime? EmailEndDate { get; set; } + + public EmailState? EmailStateEnum { get; set; } + + public string ToRecipientName { get; set; } = string.Empty; + + public string CcRecipientName { get; set; } = string.Empty; } public class EmailLogView : EmailLogAddOrEdit { diff --git a/IRaCIS.Core.Application/Service/Common/EmailLogService.cs b/IRaCIS.Core.Application/Service/Common/EmailLogService.cs index 6af33cf19..177658f23 100644 --- a/IRaCIS.Core.Application/Service/Common/EmailLogService.cs +++ b/IRaCIS.Core.Application/Service/Common/EmailLogService.cs @@ -93,6 +93,11 @@ public class EmailLogService(IRepository _emailLogRepository, var emailLogQueryable = _emailLogRepository .Where(x => reSendMessagelist.Contains(x.MessageId)) + .WhereIf(inDto.EmailStartDate.HasValue, x => x.EmailDate >= inDto.EmailStartDate.Value) + .WhereIf(inDto.EmailEndDate.HasValue, x => x.EmailDate <= inDto.EmailEndDate.Value) + .WhereIf(inDto.EmailStateEnum.HasValue, x => x.EmailStateEnum == inDto.EmailStateEnum.Value) + .WhereIf(inDto.CcRecipientName.IsNotNullOrEmpty(), x => x.EmailRecipientLogList.Any(x => x.RecipientTypeEnum == RecipientType.Cc && x.RecipientName.Contains(inDto.CcRecipientName))) + .WhereIf(inDto.ToRecipientName.IsNotNullOrEmpty(), x => x.EmailRecipientLogList.Any(x => x.RecipientTypeEnum == RecipientType.To && x.RecipientName.Contains(inDto.ToRecipientName))) .ProjectTo(_mapper.ConfigurationProvider); var defalutSortArray = new string[] { nameof(EmailLogView.EmailDate) + " desc" };