修改邮件发送
parent
8406f6a8db
commit
a06e6a2616
|
@ -4,7 +4,7 @@ using AutoMapper;
|
||||||
|
|
||||||
using IRaCIS.Application.Interfaces;
|
using IRaCIS.Application.Interfaces;
|
||||||
using IRaCIS.Core.Application.Contracts;
|
using IRaCIS.Core.Application.Contracts;
|
||||||
|
using IRaCIS.Core.Application.Filter;
|
||||||
using IRaCIS.Core.Application.Image.QA;
|
using IRaCIS.Core.Application.Image.QA;
|
||||||
using IRaCIS.Core.Application.Interfaces;
|
using IRaCIS.Core.Application.Interfaces;
|
||||||
using IRaCIS.Core.Application.Service;
|
using IRaCIS.Core.Application.Service;
|
||||||
|
@ -300,6 +300,8 @@ namespace IRaCIS.Core.API.Controllers
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPost, Route("Inspection/configTrialBasicInfo/TrialConfigSignatureConfirm")]
|
[HttpPost, Route("Inspection/configTrialBasicInfo/TrialConfigSignatureConfirm")]
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
|
[TypeFilter(typeof(TrialResourceFilter))]
|
||||||
|
|
||||||
public async Task<IResponseOutput> TrialConfigSignatureConfirm(DataInspectionDto<SignConfirmDTO> opt)
|
public async Task<IResponseOutput> TrialConfigSignatureConfirm(DataInspectionDto<SignConfirmDTO> opt)
|
||||||
{
|
{
|
||||||
var singid = await _inspectionService.RecordSing(opt.SignInfo);
|
var singid = await _inspectionService.RecordSing(opt.SignInfo);
|
||||||
|
|
|
@ -36,7 +36,7 @@ namespace IRaCIS.Core.API
|
||||||
//logEvent.AddPropertyIfAbsent(propertyFactory.CreateProperty("RequestBody", await ReadRequestBody(httpContext.Request)));
|
//logEvent.AddPropertyIfAbsent(propertyFactory.CreateProperty("RequestBody", await ReadRequestBody(httpContext.Request)));
|
||||||
//logEvent.AddPropertyIfAbsent(propertyFactory.CreateProperty("RequestIP", IPHelper.GetIP(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("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("Referer", httpContext.Request.Headers["Referer"].ToString()));
|
||||||
//logEvent.AddPropertyIfAbsent(propertyFactory.CreateProperty("request_path", httpContext.Request.Path));
|
//logEvent.AddPropertyIfAbsent(propertyFactory.CreateProperty("request_path", httpContext.Request.Path));
|
||||||
|
|
|
@ -9,7 +9,7 @@ namespace IRaCIS.Core.Application.Filter
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 主要为了 处理项目结束 锁库,不允许操作
|
/// 主要为了 处理项目结束 锁库,不允许操作
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class TrialResourceFilter : Attribute, IAsyncResourceFilter /* , IResourceFilter*/
|
public class TrialResourceFilter : Attribute, IAsyncResourceFilter
|
||||||
{
|
{
|
||||||
private readonly IEasyCachingProvider _provider;
|
private readonly IEasyCachingProvider _provider;
|
||||||
private readonly IUserInfo _userInfo;
|
private readonly IUserInfo _userInfo;
|
||||||
|
|
|
@ -107,6 +107,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
t.SourceSubjectVisitId,
|
t.SourceSubjectVisitId,
|
||||||
t.SouceReadModuleId,
|
t.SouceReadModuleId,
|
||||||
t.SubjectId,
|
t.SubjectId,
|
||||||
|
t.Subject.SiteId,
|
||||||
|
|
||||||
t.ReadingTaskState,
|
t.ReadingTaskState,
|
||||||
t.ReadingCategory,
|
t.ReadingCategory,
|
||||||
|
@ -182,8 +183,12 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
var sendEmailConfig = new SMTPEmailConfig();
|
var sendEmailConfig = new SMTPEmailConfig();
|
||||||
|
|
||||||
|
//收件人 如果是CRC CRA 要按照中心发送
|
||||||
var toUserTypeEnumList = emailConfig.TrialEmailNoticeUserList.Where(t => t.EmailUserType == EmailUserType.To).Select(c => c.UserType).ToList();
|
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 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();
|
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();
|
||||||
|
|
|
@ -14,6 +14,7 @@ using IRaCIS.Core.Application.Service.Reading.Dto;
|
||||||
using IRaCIS.Core.Application.Interfaces;
|
using IRaCIS.Core.Application.Interfaces;
|
||||||
using IRaCIS.Core.Application.ViewModel;
|
using IRaCIS.Core.Application.ViewModel;
|
||||||
using MassTransit;
|
using MassTransit;
|
||||||
|
using IRaCIS.Core.Application.Filter;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application
|
namespace IRaCIS.Core.Application
|
||||||
{
|
{
|
||||||
|
@ -647,6 +648,7 @@ namespace IRaCIS.Core.Application
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPut]
|
[HttpPut]
|
||||||
[Authorize(Policy = IRaCISPolicy.PM_APM)]
|
[Authorize(Policy = IRaCISPolicy.PM_APM)]
|
||||||
|
[TypeFilter(typeof(TrialResourceFilter))]
|
||||||
public async Task<IResponseOutput> ConfigTrialBasicInfo(BasicTrialConfig trialConfig)
|
public async Task<IResponseOutput> ConfigTrialBasicInfo(BasicTrialConfig trialConfig)
|
||||||
{
|
{
|
||||||
await VerifyOnlyInOngoingOrInitialIzingOptAsync(trialConfig.TrialId);
|
await VerifyOnlyInOngoingOrInitialIzingOptAsync(trialConfig.TrialId);
|
||||||
|
@ -670,6 +672,7 @@ namespace IRaCIS.Core.Application
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPut]
|
[HttpPut]
|
||||||
[Authorize(Policy = IRaCISPolicy.PM_APM)]
|
[Authorize(Policy = IRaCISPolicy.PM_APM)]
|
||||||
|
[TypeFilter(typeof(TrialResourceFilter))]
|
||||||
public async Task<IResponseOutput> ConfigTrialProcessInfo(TrialProcessConfig trialConfig)
|
public async Task<IResponseOutput> ConfigTrialProcessInfo(TrialProcessConfig trialConfig)
|
||||||
{
|
{
|
||||||
if (!await _trialRepository.Where(t => t.Id == trialConfig.TrialId).IgnoreQueryFilters().AnyAsync(t => t.TrialStatusStr == StaticData.TrialState.TrialInitializing))
|
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>
|
/// <returns></returns>
|
||||||
[HttpPut]
|
[HttpPut]
|
||||||
[Authorize(Policy = IRaCISPolicy.PM_APM)]
|
[Authorize(Policy = IRaCISPolicy.PM_APM)]
|
||||||
|
[TypeFilter(typeof(TrialResourceFilter))]
|
||||||
public async Task<IResponseOutput> ConfigTrialUrgentInfo(TrialUrgentConfig trialConfig)
|
public async Task<IResponseOutput> ConfigTrialUrgentInfo(TrialUrgentConfig trialConfig)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -902,6 +906,7 @@ namespace IRaCIS.Core.Application
|
||||||
/// <param name="trialConfig"></param>
|
/// <param name="trialConfig"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPut]
|
[HttpPut]
|
||||||
|
[TypeFilter(typeof(TrialResourceFilter))]
|
||||||
public async Task<IResponseOutput> ConfigTrialTaskInfo(TrialTaskConfig trialConfig)
|
public async Task<IResponseOutput> ConfigTrialTaskInfo(TrialTaskConfig trialConfig)
|
||||||
{
|
{
|
||||||
var trialInfo = (await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialConfig.TrialId)).IfNullThrowException();
|
var trialInfo = (await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialConfig.TrialId)).IfNullThrowException();
|
||||||
|
@ -918,6 +923,7 @@ namespace IRaCIS.Core.Application
|
||||||
/// <param name="trialConfig"></param>
|
/// <param name="trialConfig"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[HttpPut]
|
[HttpPut]
|
||||||
|
[TypeFilter(typeof(TrialResourceFilter))]
|
||||||
public async Task<IResponseOutput> ConfigTrialReadingTaskViewRule(TrialReadingTaskViewConfig trialConfig)
|
public async Task<IResponseOutput> ConfigTrialReadingTaskViewRule(TrialReadingTaskViewConfig trialConfig)
|
||||||
{
|
{
|
||||||
var trialInfo = (await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialConfig.TrialId)).IfNullThrowException();
|
var trialInfo = (await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialConfig.TrialId)).IfNullThrowException();
|
||||||
|
|
|
@ -88,6 +88,7 @@ namespace IRaCIS.Application.Services
|
||||||
/// <summary> 添加或更新访视计划某项</summary>
|
/// <summary> 添加或更新访视计划某项</summary>
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
[HttpPost]
|
[HttpPost]
|
||||||
|
[TypeFilter(typeof(TrialResourceFilter))]
|
||||||
[Authorize(Policy = IRaCISPolicy.PM_APM)]
|
[Authorize(Policy = IRaCISPolicy.PM_APM)]
|
||||||
public async Task<IResponseOutput> AddOrUpdateVisitStage(VisitPlanCommand visitPlan)
|
public async Task<IResponseOutput> AddOrUpdateVisitStage(VisitPlanCommand visitPlan)
|
||||||
{
|
{
|
||||||
|
@ -189,6 +190,7 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
[UnitOfWork]
|
[UnitOfWork]
|
||||||
[HttpPost("{trialId:guid}")]
|
[HttpPost("{trialId:guid}")]
|
||||||
|
[TypeFilter(typeof(TrialResourceFilter))]
|
||||||
[Authorize(Policy = IRaCISPolicy.PM_APM)]
|
[Authorize(Policy = IRaCISPolicy.PM_APM)]
|
||||||
public async Task<IResponseOutput> ConfirmTrialVisitPlan(Guid trialId)
|
public async Task<IResponseOutput> ConfirmTrialVisitPlan(Guid trialId)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue