修改邮件发送

Uat_Study
{872297557@qq.com} 2022-12-01 11:38:09 +08:00
parent 8406f6a8db
commit a06e6a2616
6 changed files with 19 additions and 4 deletions

View File

@ -4,7 +4,7 @@ using AutoMapper;
using IRaCIS.Application.Interfaces;
using IRaCIS.Core.Application.Contracts;
using IRaCIS.Core.Application.Filter;
using IRaCIS.Core.Application.Image.QA;
using IRaCIS.Core.Application.Interfaces;
using IRaCIS.Core.Application.Service;
@ -300,6 +300,8 @@ namespace IRaCIS.Core.API.Controllers
/// <returns></returns>
[HttpPost, Route("Inspection/configTrialBasicInfo/TrialConfigSignatureConfirm")]
[UnitOfWork]
[TypeFilter(typeof(TrialResourceFilter))]
public async Task<IResponseOutput> TrialConfigSignatureConfirm(DataInspectionDto<SignConfirmDTO> opt)
{
var singid = await _inspectionService.RecordSing(opt.SignInfo);

View File

@ -36,7 +36,7 @@ namespace IRaCIS.Core.API
//logEvent.AddPropertyIfAbsent(propertyFactory.CreateProperty("RequestBody", await ReadRequestBody(httpContext.Request)));
//logEvent.AddPropertyIfAbsent(propertyFactory.CreateProperty("RequestIP", IPHelper.GetIP(httpContext.Request) ));
logEvent.AddPropertyIfAbsent(propertyFactory.CreateProperty("TokenUserRealName", httpContext?.User?.FindFirst(ClaimAttributes.RealName)?.Value));
logEvent.AddPropertyIfAbsent(propertyFactory.CreateProperty("TokenUserType", httpContext?.User?.FindFirst("userTypeEnumName")?.Value));
logEvent.AddPropertyIfAbsent(propertyFactory.CreateProperty("TokenUserType", httpContext?.User?.FindFirst(JwtIRaCISClaimType.UserTypeShortName)?.Value));
//logEvent.AddPropertyIfAbsent(propertyFactory.CreateProperty("Referer", httpContext.Request.Headers["Referer"].ToString()));
//logEvent.AddPropertyIfAbsent(propertyFactory.CreateProperty("request_path", httpContext.Request.Path));

View File

@ -9,7 +9,7 @@ namespace IRaCIS.Core.Application.Filter
/// <summary>
/// 主要为了 处理项目结束 锁库,不允许操作
/// </summary>
public class TrialResourceFilter : Attribute, IAsyncResourceFilter /* , IResourceFilter*/
public class TrialResourceFilter : Attribute, IAsyncResourceFilter
{
private readonly IEasyCachingProvider _provider;
private readonly IUserInfo _userInfo;

View File

@ -107,6 +107,7 @@ namespace IRaCIS.Core.Application.Service
t.SourceSubjectVisitId,
t.SouceReadModuleId,
t.SubjectId,
t.Subject.SiteId,
t.ReadingTaskState,
t.ReadingCategory,
@ -182,8 +183,12 @@ namespace IRaCIS.Core.Application.Service
var sendEmailConfig = new SMTPEmailConfig();
//收件人 如果是CRC CRA 要按照中心发送
var toUserTypeEnumList = emailConfig.TrialEmailNoticeUserList.Where(t => t.EmailUserType == EmailUserType.To).Select(c => c.UserType).ToList();
var toUserList = _repository.Where<TrialUser>(t => t.TrialId == taskInfo.TrialId && toUserTypeEnumList.Contains(t.User.UserTypeEnum)).Select(t => new { t.User.EMail, t.User.FullName }).ToList();
var toUserList = _repository.Where<TrialSiteUser>(t => t.TrialId == taskInfo.TrialId && toUserTypeEnumList.Contains(t.User.UserTypeEnum) && t.SiteId== taskInfo.SiteId).Select(t => new { t.User.EMail, t.User.FullName }).ToList();
var copyUserTypeEnumList = emailConfig.TrialEmailNoticeUserList.Where(t => t.EmailUserType == EmailUserType.Copy).Select(c => c.UserType).ToList();
var copyUserList = _repository.Where<TrialUser>(t => t.TrialId == taskInfo.TrialId && copyUserTypeEnumList.Contains(t.User.UserTypeEnum)).Select(t => new { t.User.EMail, t.User.FullName }).ToList();

View File

@ -14,6 +14,7 @@ using IRaCIS.Core.Application.Service.Reading.Dto;
using IRaCIS.Core.Application.Interfaces;
using IRaCIS.Core.Application.ViewModel;
using MassTransit;
using IRaCIS.Core.Application.Filter;
namespace IRaCIS.Core.Application
{
@ -647,6 +648,7 @@ namespace IRaCIS.Core.Application
/// <returns></returns>
[HttpPut]
[Authorize(Policy = IRaCISPolicy.PM_APM)]
[TypeFilter(typeof(TrialResourceFilter))]
public async Task<IResponseOutput> ConfigTrialBasicInfo(BasicTrialConfig trialConfig)
{
await VerifyOnlyInOngoingOrInitialIzingOptAsync(trialConfig.TrialId);
@ -670,6 +672,7 @@ namespace IRaCIS.Core.Application
/// <returns></returns>
[HttpPut]
[Authorize(Policy = IRaCISPolicy.PM_APM)]
[TypeFilter(typeof(TrialResourceFilter))]
public async Task<IResponseOutput> ConfigTrialProcessInfo(TrialProcessConfig trialConfig)
{
if (!await _trialRepository.Where(t => t.Id == trialConfig.TrialId).IgnoreQueryFilters().AnyAsync(t => t.TrialStatusStr == StaticData.TrialState.TrialInitializing))
@ -743,6 +746,7 @@ namespace IRaCIS.Core.Application
/// <returns></returns>
[HttpPut]
[Authorize(Policy = IRaCISPolicy.PM_APM)]
[TypeFilter(typeof(TrialResourceFilter))]
public async Task<IResponseOutput> ConfigTrialUrgentInfo(TrialUrgentConfig trialConfig)
{
@ -902,6 +906,7 @@ namespace IRaCIS.Core.Application
/// <param name="trialConfig"></param>
/// <returns></returns>
[HttpPut]
[TypeFilter(typeof(TrialResourceFilter))]
public async Task<IResponseOutput> ConfigTrialTaskInfo(TrialTaskConfig trialConfig)
{
var trialInfo = (await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialConfig.TrialId)).IfNullThrowException();
@ -918,6 +923,7 @@ namespace IRaCIS.Core.Application
/// <param name="trialConfig"></param>
/// <returns></returns>
[HttpPut]
[TypeFilter(typeof(TrialResourceFilter))]
public async Task<IResponseOutput> ConfigTrialReadingTaskViewRule(TrialReadingTaskViewConfig trialConfig)
{
var trialInfo = (await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialConfig.TrialId)).IfNullThrowException();

View File

@ -88,6 +88,7 @@ namespace IRaCIS.Application.Services
/// <summary> 添加或更新访视计划某项</summary>
[UnitOfWork]
[HttpPost]
[TypeFilter(typeof(TrialResourceFilter))]
[Authorize(Policy = IRaCISPolicy.PM_APM)]
public async Task<IResponseOutput> AddOrUpdateVisitStage(VisitPlanCommand visitPlan)
{
@ -189,6 +190,7 @@ namespace IRaCIS.Application.Services
[UnitOfWork]
[HttpPost("{trialId:guid}")]
[TypeFilter(typeof(TrialResourceFilter))]
[Authorize(Policy = IRaCISPolicy.PM_APM)]
public async Task<IResponseOutput> ConfirmTrialVisitPlan(Guid trialId)
{