修改发送邮件和稽查修改
							parent
							
								
									cfb6ba593b
								
							
						
					
					
						commit
						372fa13239
					
				| 
						 | 
				
			
			@ -1,7 +1,9 @@
 | 
			
		|||
using IRaCIS.Core.Domain.Share;
 | 
			
		||||
using DocumentFormat.OpenXml.Spreadsheet;
 | 
			
		||||
using IRaCIS.Core.Domain.Share;
 | 
			
		||||
using MailKit;
 | 
			
		||||
using MailKit.Security;
 | 
			
		||||
using MimeKit;
 | 
			
		||||
using NPOI.HPSF;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
namespace IRaCIS.Core.Application.Helper;
 | 
			
		||||
| 
						 | 
				
			
			@ -40,10 +42,10 @@ public static class SendEmailHelper
 | 
			
		|||
        catch (Exception ex)
 | 
			
		||||
        {
 | 
			
		||||
 | 
			
		||||
            throw new Exception("邮件发送失败,您进行的操作未能成功,请检查邮箱或联系维护人员") ;
 | 
			
		||||
            throw new Exception("邮件发送失败,您进行的操作未能成功,请检查邮箱或联系维护人员");
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
      
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    public static async Task SendEmailAsync(SMTPEmailConfig sMTPEmailConfig, EventHandler<MessageSentEventArgs>? messageSentSuccess = null)
 | 
			
		||||
| 
						 | 
				
			
			@ -88,10 +90,19 @@ public static class SendEmailHelper
 | 
			
		|||
        {
 | 
			
		||||
            //builder.Attachments.Add(item.FileName, item.FileData);
 | 
			
		||||
 | 
			
		||||
            builder.Attachments.Add(item.FileName, item.FileStream);
 | 
			
		||||
            var attachment = builder.Attachments.Add(item.FileName, item.FileStream);
 | 
			
		||||
 | 
			
		||||
            //解决附件名过长  奇怪的名字
 | 
			
		||||
            foreach (var param in attachment.ContentDisposition.Parameters)
 | 
			
		||||
                param.EncodingMethod = ParameterEncodingMethod.Rfc2047;
 | 
			
		||||
            foreach (var param in attachment.ContentType.Parameters)
 | 
			
		||||
                param.EncodingMethod = ParameterEncodingMethod.Rfc2047;
 | 
			
		||||
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
        messageToSend.Body = builder.ToMessageBody();
 | 
			
		||||
 | 
			
		||||
        using (var smtp = new MailKit.Net.Smtp.SmtpClient())
 | 
			
		||||
| 
						 | 
				
			
			@ -113,7 +124,7 @@ public static class SendEmailHelper
 | 
			
		|||
            await smtp.DisconnectAsync(true);
 | 
			
		||||
 | 
			
		||||
        }
 | 
			
		||||
       
 | 
			
		||||
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -123,12 +134,12 @@ public static class SendEmailHelper
 | 
			
		|||
 | 
			
		||||
public class SMTPEmailConfig
 | 
			
		||||
{
 | 
			
		||||
    public int Port { get; set; } 
 | 
			
		||||
    public int Port { get; set; }
 | 
			
		||||
 | 
			
		||||
    public string Host { get; set; }
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    public string UserName { get; set; } 
 | 
			
		||||
    public string UserName { get; set; }
 | 
			
		||||
 | 
			
		||||
    public string AuthorizationCode { get; set; }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1195,7 +1195,7 @@ namespace IRaCIS.Core.Application.Image.QA
 | 
			
		|||
 | 
			
		||||
                    // CRC 上传的基线数据签名
 | 
			
		||||
 | 
			
		||||
                    await _readingClinicalDataRepository.BatchUpdateNoTrackingAsync(x => x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC && x.ReadingId == dbSubjectVisit.Id, x => new ReadingClinicalData()
 | 
			
		||||
                    await _readingClinicalDataRepository.UpdatePartialFromQueryAsync(x => x.ClinicalDataTrialSet.UploadRole == UploadRole.CRC && x.ReadingId == dbSubjectVisit.Id && x.IsSign==false, x => new ReadingClinicalData()
 | 
			
		||||
                    {
 | 
			
		||||
                        IsSign = true,
 | 
			
		||||
                        ReadingClinicalDataState = ReadingClinicalDataStatus.HaveSigned
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1696,7 +1696,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
 | 
			
		|||
 | 
			
		||||
                    IsDistinctionInterface = type == AuditOpt.Update ? true : false,
 | 
			
		||||
 | 
			
		||||
                    //SubjectVisitId = x.IsVisit ? x.ReadingId : null,
 | 
			
		||||
                    SubjectVisitId = x.IsVisit ? x.ReadingId : null,
 | 
			
		||||
 | 
			
		||||
                    ObjectRelationParentId = entity.ClinicalDataTrialSetId,
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue