From 76e65b061347ec3b7e0349439d2c2e5f60fb3abc Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Tue, 1 Nov 2022 15:53:23 +0800 Subject: [PATCH] =?UTF-8?q?=E9=82=AE=E4=BB=B6=E5=8F=91=E9=80=81=E6=B5=8B?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Service/Document/TrialEmailNoticeConfigService.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs b/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs index 2c06beaa4..60ad6d580 100644 --- a/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs +++ b/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs @@ -181,9 +181,11 @@ namespace IRaCIS.Core.Application.Service var sendEmailConfig = new SMTPEmailConfig(); - var toUserList = _repository.Where(t => t.TrialId == taskInfo.TrialId && emailConfig.TrialEmailNoticeUserList.Where(t => t.EmailUserType == EmailUserType.To).Select(c => c.UserType).Contains(t.User.UserTypeEnum)).Select(t => new { t.User.EMail, t.User.FullName }); + var toUserTypeEnumList = emailConfig.TrialEmailNoticeUserList.Where(t => t.EmailUserType == EmailUserType.To).Select(c => c.UserType).ToList(); + var toUserList = _repository.Where(t => t.TrialId == taskInfo.TrialId && toUserTypeEnumList.Contains(t.User.UserTypeEnum)).Select(t => new { t.User.EMail, t.User.FullName }).ToList(); - var copyUserList = _repository.Where(t => t.TrialId == taskInfo.TrialId && emailConfig.TrialEmailNoticeUserList.Where(t => t.EmailUserType == EmailUserType.Copy).Select(c => c.UserType).Contains(t.User.UserTypeEnum)).Select(t => new { t.User.EMail, t.User.FullName }); + var copyUserTypeEnumList = emailConfig.TrialEmailNoticeUserList.Where(t => t.EmailUserType == EmailUserType.Copy).Select(c => c.UserType).ToList(); + var copyUserList = _repository.Where(t => t.TrialId == taskInfo.TrialId && copyUserTypeEnumList.Contains(t.User.UserTypeEnum)).Select(t => new { t.User.EMail, t.User.FullName }).ToList(); if (toUserList.Count() == 0)