CRA权限修改 以及修改邮件提示

Uat_Study
hang 2022-05-07 15:55:01 +08:00
parent 18b2599f35
commit e63f82fe5c
7 changed files with 49 additions and 35 deletions

View File

@ -31,7 +31,7 @@ namespace IRaCIS.Application.Services
}
//重置邮箱
public async Task SendMailEditEmail(Guid userId, string userName, string emailAddress, int verificationCode)
{
@ -42,15 +42,17 @@ namespace IRaCIS.Application.Services
//收件地址
messageToSend.To.Add(new MailboxAddress(userName, emailAddress));
//主题
messageToSend.Subject = "重置邮箱";
messageToSend.Subject = "[来自展影IRC] 关于重置邮箱的提醒";
messageToSend.Body = new TextPart("plain")
{
Text = $@" {userName},您好:
使
{verificationCode}3
"
Text = $@"尊敬的{userName},您好:
使
: {verificationCode}3
/Best Regards.
"
};
using (var smtp = new MailKit.Net.Smtp.SmtpClient())
{
@ -83,6 +85,7 @@ namespace IRaCIS.Application.Services
}
}
//不登录 通过邮箱重置密码
public async Task AnolymousSendEmailForResetAccount( string emailAddress, int verificationCode)
{
var messageToSend = new MimeMessage();
@ -91,15 +94,17 @@ namespace IRaCIS.Application.Services
//收件地址
messageToSend.To.Add(new MailboxAddress(String.Empty, emailAddress));
//主题
messageToSend.Subject = "重置密码";
messageToSend.Subject = "[来自展影IRC] 关于重置密码的提醒";
messageToSend.Body = new TextPart("plain")
{
Text = $@" 您好:
使
{verificationCode}3
"
Text = $@"您好:
使
: {verificationCode}3
/Best Regards.
"
};
using (var smtp = new MailKit.Net.Smtp.SmtpClient())
{
@ -132,7 +137,7 @@ namespace IRaCIS.Application.Services
}
}
//中心调研 登陆
public async Task AnolymousSendEmail(string researchProgramNo,string emailAddress, int verificationCode)
{
@ -143,13 +148,16 @@ namespace IRaCIS.Application.Services
//收件地址
messageToSend.To.Add(new MailboxAddress(String.Empty, emailAddress));
//主题
messageToSend.Subject = $"[{researchProgramNo}]中心调研";
messageToSend.Subject = $"[来自展影IRC] [{researchProgramNo}] 关于中心调研的提醒";
messageToSend.Body = new TextPart("plain")
{
Text = $@" 感谢您使用展影云平台。
IRC: {verificationCode}3
Text = $@"尊敬的用户,您好:
使
IRC: {verificationCode}3
/Best Regards.
"
};
using (var smtp = new MailKit.Net.Smtp.SmtpClient())
@ -186,7 +194,7 @@ namespace IRaCIS.Application.Services
//废弃 添加用户发送邮件
public async Task SendMail(Guid userId, string userName, string emailAddress, int verificationCode)
{
@ -197,13 +205,17 @@ namespace IRaCIS.Application.Services
//收件地址
messageToSend.To.Add(new MailboxAddress(userName, emailAddress));
//主题
messageToSend.Subject = "Reset PassWord (Verification Code)";
messageToSend.Subject = "[来自展影IRC] 关于重置邮箱的提醒";
messageToSend.Body = new TextPart("plain")
{
Text = $@"Hey {userName},you are resetting your password via email. The verification code is: {verificationCode}, which is valid within 3 minutes. If it is not your own operation, please ignore it!
Text = $@"尊敬的{userName},您好:
使
: {verificationCode}3
-- GRR"
/Best Regards.
"
};
using (var smtp = new MailKit.Net.Smtp.SmtpClient())
{

View File

@ -27,7 +27,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
{
var dicomStudyQuery = _repository.Where<DicomStudy>(t => t.TrialId == studyQuery.TrialId)
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
.WhereIf(!string.IsNullOrEmpty(studyQuery.VisitPlanInfo), studyQuery.VisitPlanInfo.Contains('.') ? t => t.SubjectVisit.VisitNum.ToString().Contains(".") : t => t.SubjectVisit.VisitNum == decimal.Parse(studyQuery.VisitPlanInfo))
.WhereIf(!string.IsNullOrWhiteSpace(studyQuery.SubjectInfo), t => t.Subject.Code.Contains(studyQuery.SubjectInfo))
.Select(t => new UnionStudyViewModel()
@ -74,7 +74,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
var nodeDicomStudyQuery = _repository.Where<NoneDicomStudy>(t => t.TrialId == studyQuery.TrialId)
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
.WhereIf(!string.IsNullOrEmpty(studyQuery.VisitPlanInfo), studyQuery.VisitPlanInfo.Contains('.') ? t => t.SubjectVisit.VisitNum.ToString().Contains(".") : t => t.SubjectVisit.VisitNum == decimal.Parse(studyQuery.VisitPlanInfo))
.WhereIf(!string.IsNullOrWhiteSpace(studyQuery.SubjectInfo), t => t.Subject.Code.Contains(studyQuery.SubjectInfo))
@ -133,7 +133,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
{
var StudyMonitorQuery = _repository.Where<StudyMonitor>(t => t.TrialId == studyQuery.TrialId)
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
.WhereIf(!string.IsNullOrEmpty(studyQuery.VisitPlanInfo), studyQuery.VisitPlanInfo.Contains('.') ? t => t.SubjectVisit.VisitNum.ToString().Contains(".") : t => t.SubjectVisit.VisitNum == decimal.Parse(studyQuery.VisitPlanInfo))
.WhereIf(!string.IsNullOrWhiteSpace(studyQuery.SubjectInfo), t => t.Subject.Code.Contains(studyQuery.SubjectInfo))
.WhereIf(studyQuery.SubjectId != null, t => t.SubjectId == studyQuery.SubjectId)

View File

@ -106,7 +106,7 @@ namespace IRaCIS.Core.Application.Image.QA
.WhereIf(visitSearchDTO.SubmitState != null, t => t.SubmitState == visitSearchDTO.SubmitState)
.WhereIf(visitSearchDTO.ChallengeState != null, t => t.ChallengeState == visitSearchDTO.ChallengeState)
.WhereIf(visitSearchDTO.IsUrgent != null, t => t.IsUrgent == visitSearchDTO.IsUrgent)
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
.ProjectTo<QCCRCVisitViewModel>(_mapper.ConfigurationProvider);
@ -177,7 +177,7 @@ namespace IRaCIS.Core.Application.Image.QA
//.WhereIf(!string.IsNullOrEmpty(challengeQuery.VisitPlanInfo), challengeQuery.VisitPlanInfo.Contains('.') ? t => t.SubjectVisit.VisitNum.ToString().Contains(".") : t => t.SubjectVisit.VisitNum == decimal.Parse(challengeQuery.VisitPlanInfo))
.WhereIf(challengeQuery.IsOverTime != null, t => DateTime.Now > t.DeadlineTime)
.WhereIf(challengeQuery.IsUrgent != null, t => t.SubjectVisit.IsUrgent == challengeQuery.IsUrgent)
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator, t => t.SubjectVisit.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.SubjectVisit.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
.ProjectTo<QCCRCChallengeViewModel>(_mapper.ConfigurationProvider);
var pageList = await query2.ToPagedListAsync(challengeQuery.PageIndex, challengeQuery.PageSize, challengeQuery.SortField, challengeQuery.Asc, string.IsNullOrWhiteSpace(challengeQuery.SortField), new string[] { "IsUrgent desc", "IsClosed asc" });
@ -538,7 +538,7 @@ namespace IRaCIS.Core.Application.Image.QA
.WhereIf(!string.IsNullOrEmpty(checkQuery.SubjectInfo), t => t.Subject.Code.Contains(checkQuery.SubjectInfo))
.WhereIf(checkQuery.VisitPlanArray != null && checkQuery.VisitPlanArray?.Length > 0, svExpression)
//.WhereIf(!string.IsNullOrEmpty(checkQuery.VisitPlanInfo), checkQuery.VisitPlanInfo.Contains('.') ? t => t.InPlan == false : t => t.VisitNum == decimal.Parse(checkQuery.VisitPlanInfo))
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))//CRC 过滤负责的site
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))//CRC 过滤负责的site
.ProjectTo<QCCheckViewModel>(_mapper.ConfigurationProvider);
var pageList = await query.ToPagedListAsync(checkQuery.PageIndex, checkQuery.PageSize, checkQuery.SortField, checkQuery.Asc);

View File

@ -487,8 +487,6 @@ namespace IRaCIS.Core.Application.Contracts
//发件地址
messageToSend.From.Add(new MailboxAddress("GRR", "iracis_grr@163.com"));
//主题
messageToSend.Subject = "GRR Site survey ( Rejection )";
if (await _repository.AnyAsync<TrialSiteSurvey>(t => t.State == TrialSiteSurveyEnum.PMCreatedAndLock && t.Id == trialSiteSurveyId))
@ -544,6 +542,10 @@ namespace IRaCIS.Core.Application.Contracts
var siteInfo = await _trialSiteRepository.FirstOrDefaultAsync(t => t.TrialId == trialSiteSubmitBackCommand.TrialId && t.SiteId == survey.SiteId, true);
//主题
messageToSend.Subject = $"[来自展影IRC] [{trialInfo.ResearchProgramNo}] 关于中心调研审批的提醒";
builder.HtmlBody = @$"<body style='font-family: 微软雅黑;padding: 0;margin: 0;'>
<div style='padding-left: 40px;background: #f6f6f6'>
<div style='padding-top: 20px;'>
@ -665,7 +667,7 @@ namespace IRaCIS.Core.Application.Contracts
}
//Site 调研邀请
public async Task<IResponseOutput> SendInviteEmail(InviteEmailCommand inviteEmailCommand)
{
@ -681,7 +683,7 @@ namespace IRaCIS.Core.Application.Contracts
//收件地址
messageToSend.To.Add(new MailboxAddress(String.Empty, item.Email));
//主题
messageToSend.Subject = $"[{trialInfo.ResearchProgramNo}] 邀请";
messageToSend.Subject = $"[来自展影IRC] [{trialInfo.ResearchProgramNo}] 邀请";
var builder = new BodyBuilder();

View File

@ -333,7 +333,7 @@ namespace IRaCIS.Core.Application.Service
//收件地址
messageToSend.To.Add(new MailboxAddress(String.Empty, needUpdate.Email));
//主题
messageToSend.Subject = $"[{trialInfo.ResearchProgramNo}] 账号信息";
messageToSend.Subject = $"[来自展影IRC] [{trialInfo.ResearchProgramNo}] 账户信息";
var builder = new BodyBuilder();
@ -503,7 +503,7 @@ namespace IRaCIS.Core.Application.Service
//收件地址
messageToSend.To.Add(new MailboxAddress(String.Empty, editInfo.IsJoin == true ? needUpdate.Email : revieweUser.EMail));
//主题
messageToSend.Subject = $"[{trialInfo.ResearchProgramNo}] 账号信息";
messageToSend.Subject = $"[来自展影IRC] [{trialInfo.ResearchProgramNo}] 账户信息";
var builder = new BodyBuilder();

View File

@ -317,7 +317,7 @@ namespace IRaCIS.Core.Application.Services
//CRC只看到他负责的
var list = await _trialSiteRepository.Where(t => t.TrialId == trialId)
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator, t => t.CRCUserList.Any(t => t.UserId == _userInfo.Id))
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.CRCUserList.Any(t => t.UserId == _userInfo.Id))
.ProjectTo<TrialSiteForSelect>(_mapper.ConfigurationProvider).OrderBy(t => t.TrialSiteCode).ToListAsync();

View File

@ -128,7 +128,7 @@ namespace IRaCIS.Application.Services
.WhereIf(param.Status != null, t => t.Status == param.Status)
.WhereIf(param.SiteId != null, t => t.SiteId == param.SiteId)
// CRC 只负责他管理site的受试者
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA, t => t.TrialSite.CRCUserList.Any(t => t.UserId == _userInfo.Id))
.ProjectTo<SubjectQueryView>(_mapper.ConfigurationProvider);