Merge branch 'Test_IRC_Net8' of https://gitea.frp.extimaging.com/XCKJ/irc-netcore-api into Test_IRC_Net8
continuous-integration/drone/push Build is failing
Details
continuous-integration/drone/push Build is failing
Details
commit
644fe1bd3c
|
@ -21,7 +21,7 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
Task SiteSurveyRejectEmail(MimeMessage messageToSend);
|
Task SiteSurveyRejectEmail(MimeMessage messageToSend);
|
||||||
|
|
||||||
Task SenMFAVerifyEmail(Guid userId, string userName, string emailAddress, int verificationCode);
|
Task SenMFAVerifyEmail(Guid userId, string userName, string emailAddress, int verificationCode, UserMFAType mfaType = UserMFAType.Login);
|
||||||
|
|
||||||
Task SendMailEditEmail(Guid userId, string userName, string emailAddress, int verificationCode);
|
Task SendMailEditEmail(Guid userId, string userName, string emailAddress, int verificationCode);
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ namespace IRaCIS.Application.Services
|
||||||
}
|
}
|
||||||
|
|
||||||
//MFA
|
//MFA
|
||||||
public async Task SenMFAVerifyEmail(Guid userId, string userName, string emailAddress, int verificationCode)
|
public async Task SenMFAVerifyEmail(Guid userId, string userName, string emailAddress, int verificationCode, UserMFAType mfaType = UserMFAType.Login)
|
||||||
{
|
{
|
||||||
var messageToSend = new MimeMessage();
|
var messageToSend = new MimeMessage();
|
||||||
//发件地址
|
//发件地址
|
||||||
|
@ -103,7 +103,7 @@ namespace IRaCIS.Application.Services
|
||||||
messageToSend.To.Add(new MailboxAddress(userName, emailAddress));
|
messageToSend.To.Add(new MailboxAddress(userName, emailAddress));
|
||||||
//主题
|
//主题
|
||||||
//---[来自{0}] 关于MFA邮箱验证的提醒
|
//---[来自{0}] 关于MFA邮箱验证的提醒
|
||||||
messageToSend.Subject = _localizer["Mail_EmailMFATopic", _userInfo.IsEn_Us ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN];
|
messageToSend.Subject = _localizer[mfaType == UserMFAType.Login? "Mail_EmailMFALoginTopic":"Mail_EmailMFAUnlockTopic", _userInfo.IsEn_Us ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN];
|
||||||
|
|
||||||
var builder = new BodyBuilder();
|
var builder = new BodyBuilder();
|
||||||
|
|
||||||
|
@ -123,7 +123,7 @@ namespace IRaCIS.Application.Services
|
||||||
builder.HtmlBody = string.Format(ReplaceCompanyName(templateInfo),
|
builder.HtmlBody = string.Format(ReplaceCompanyName(templateInfo),
|
||||||
|
|
||||||
userName,
|
userName,
|
||||||
_localizer["Mail_MFAEmail"],
|
_localizer[mfaType == UserMFAType.Login ? "Mail_EmailMFALoginEmail": "Mail_EmailMFAUnlockEmail"],
|
||||||
verificationCode
|
verificationCode
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ namespace IRaCIS.Application.Services
|
||||||
Task<IResponseOutput<LoginReturnDTO>> Login(string userName, string password);
|
Task<IResponseOutput<LoginReturnDTO>> Login(string userName, string password);
|
||||||
Task<IResponseOutput> VerifyMFACodeAsync(Guid userId, string Code);
|
Task<IResponseOutput> VerifyMFACodeAsync(Guid userId, string Code);
|
||||||
|
|
||||||
Task<IResponseOutput> SendMFAEmail(Guid userId);
|
Task<IResponseOutput> SendMFAEmail(Guid userId, UserMFAType mfaType);
|
||||||
Task<UserBasicInfo> GetUserBasicInfo(Guid userId,string pwd);
|
Task<UserBasicInfo> GetUserBasicInfo(Guid userId,string pwd);
|
||||||
Task<IResponseOutput> ModifyPassword(EditPasswordCommand editPwModel);
|
Task<IResponseOutput> ModifyPassword(EditPasswordCommand editPwModel);
|
||||||
Task<IResponseOutput> ResetPassword(Guid userId);
|
Task<IResponseOutput> ResetPassword(Guid userId);
|
||||||
|
|
|
@ -653,15 +653,16 @@ namespace IRaCIS.Application.Services
|
||||||
/// 发送MFA 验证邮件
|
/// 发送MFA 验证邮件
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="userId"></param>
|
/// <param name="userId"></param>
|
||||||
|
/// <param name="mfaType"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
[AllowAnonymous]
|
[AllowAnonymous]
|
||||||
public async Task<IResponseOutput> SendMFAEmail(Guid userId)
|
public async Task<IResponseOutput> SendMFAEmail(Guid userId, UserMFAType mfaType = UserMFAType.Login)
|
||||||
{
|
{
|
||||||
var userInfo = await _userRepository.Where(u => u.Id == userId).Select(t => new { t.FullName, t.EMail }).FirstOrDefaultAsync();
|
var userInfo = await _userRepository.Where(u => u.Id == userId).Select(t => new { t.FullName, t.EMail }).FirstOrDefaultAsync();
|
||||||
|
|
||||||
int verificationCode = new Random().Next(100000, 1000000);
|
int verificationCode = new Random().Next(100000, 1000000);
|
||||||
|
|
||||||
await _mailVerificationService.SenMFAVerifyEmail(userId, userInfo.FullName, userInfo.EMail, verificationCode);
|
await _mailVerificationService.SenMFAVerifyEmail(userId, userInfo.FullName, userInfo.EMail, verificationCode, mfaType);
|
||||||
|
|
||||||
return ResponseOutput.Ok();
|
return ResponseOutput.Ok();
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
//--------------------------------------------------------------------
|
//--------------------------------------------------------------------
|
||||||
|
|
||||||
using System.ComponentModel.DataAnnotations;
|
using System.ComponentModel.DataAnnotations;
|
||||||
|
using System.Text.Json.Serialization;
|
||||||
using IRaCIS.Core.Domain.Share;
|
using IRaCIS.Core.Domain.Share;
|
||||||
namespace IRaCIS.Core.Application.Contracts
|
namespace IRaCIS.Core.Application.Contracts
|
||||||
{
|
{
|
||||||
|
@ -67,6 +68,9 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
public List<TrialSiteEquipmentSurveyView> TrialSiteEquipmentSurveyList { get; set; } = new List<TrialSiteEquipmentSurveyView>();
|
public List<TrialSiteEquipmentSurveyView> TrialSiteEquipmentSurveyList { get; set; } = new List<TrialSiteEquipmentSurveyView>();
|
||||||
|
|
||||||
public List<TrialSiteUserSurveyView> TrialSiteUserSurveyList { get; set; } = new List<TrialSiteUserSurveyView>();
|
public List<TrialSiteUserSurveyView> TrialSiteUserSurveyList { get; set; } = new List<TrialSiteUserSurveyView>();
|
||||||
|
|
||||||
|
|
||||||
|
public SiteSurveyFiledConfig SiteSurveyFiledConfig { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class TrialSiteUserSurveyAllDTO : TrialSiteUserSurveyView
|
public class TrialSiteUserSurveyAllDTO : TrialSiteUserSurveyView
|
||||||
|
|
|
@ -22,6 +22,8 @@ using IRaCIS.Core.Domain.Models;
|
||||||
using IRaCIS.Core.Application.ViewModel;
|
using IRaCIS.Core.Application.ViewModel;
|
||||||
using Medallion.Threading;
|
using Medallion.Threading;
|
||||||
using Microsoft.Extensions.Options;
|
using Microsoft.Extensions.Options;
|
||||||
|
using NPOI.SS.Formula.Functions;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Contracts
|
namespace IRaCIS.Core.Application.Contracts
|
||||||
{
|
{
|
||||||
|
@ -115,7 +117,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
}
|
}
|
||||||
else //验证码正确 并且 没有超时
|
else //验证码正确 并且 没有超时
|
||||||
{
|
{
|
||||||
var dockerInfo=await _repository.Where<Doctor>(t=>t.EMail==inDto.EmailOrPhone||t.Phone==inDto.EmailOrPhone).FirstOrDefaultAsync();
|
var dockerInfo = await _repository.Where<Doctor>(t => t.EMail == inDto.EmailOrPhone || t.Phone == inDto.EmailOrPhone).FirstOrDefaultAsync();
|
||||||
|
|
||||||
if (dockerInfo != null)
|
if (dockerInfo != null)
|
||||||
{
|
{
|
||||||
|
@ -386,10 +388,12 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var result = await _trialSiteSurveyRepository.Where(t => t.Id == trialSiteSurveyId && t.TrialId == trialId).IgnoreQueryFilters()
|
var result = await _trialSiteSurveyRepository.Where(t => t.Id == trialSiteSurveyId && t.TrialId == trialId).IgnoreQueryFilters()
|
||||||
.ProjectTo<LoginReturnDTO>(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException();
|
.ProjectTo<LoginReturnDTO>(_mapper.ConfigurationProvider).FirstOrDefaultAsync().IfNullThrowException();
|
||||||
|
|
||||||
|
var siteSurveryConfig = _trialSiteSurveyRepository.Where(t => t.Id == trialSiteSurveyId).Select(t => t.Trial.SiteSurveyConfigJsonStr).FirstOrDefault();
|
||||||
|
|
||||||
|
result.SiteSurveyFiledConfig = JsonConvert.DeserializeObject<SiteSurveyFiledConfig>(siteSurveryConfig) ?? new SiteSurveyFiledConfig();
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -466,11 +470,11 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
.WhereIf(surveyQueryDTO.State != null, t => t.State == surveyQueryDTO.State)
|
.WhereIf(surveyQueryDTO.State != null, t => t.State == surveyQueryDTO.State)
|
||||||
.WhereIf(surveyQueryDTO.UpdateTimeBegin != null, t => t.UpdateTime >= surveyQueryDTO.UpdateTimeBegin)
|
.WhereIf(surveyQueryDTO.UpdateTimeBegin != null, t => t.UpdateTime >= surveyQueryDTO.UpdateTimeBegin)
|
||||||
.WhereIf(surveyQueryDTO.UpdateTimeEnd != null, t => t.UpdateTime <= surveyQueryDTO.UpdateTimeEnd)
|
.WhereIf(surveyQueryDTO.UpdateTimeEnd != null, t => t.UpdateTime <= surveyQueryDTO.UpdateTimeEnd)
|
||||||
|
|
||||||
.ProjectTo<TrialSiteSurveyView>(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us })
|
.ProjectTo<TrialSiteSurveyView>(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us })
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(surveyQueryDTO.PreliminaryUserName), t => t.PreliminaryUser.RealName.Contains(surveyQueryDTO.PreliminaryUserName))
|
.WhereIf(!string.IsNullOrWhiteSpace(surveyQueryDTO.PreliminaryUserName), t => t.PreliminaryUser.RealName.Contains(surveyQueryDTO.PreliminaryUserName))
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(surveyQueryDTO.ReviewerUserName), t => t.ReviewerUser.RealName.Contains(surveyQueryDTO.ReviewerUserName))
|
.WhereIf(!string.IsNullOrWhiteSpace(surveyQueryDTO.ReviewerUserName), t => t.ReviewerUser.RealName.Contains(surveyQueryDTO.ReviewerUserName))
|
||||||
;
|
;
|
||||||
|
|
||||||
return await trialSiteSurveyQueryable.ToPagedListAsync(surveyQueryDTO.PageIndex, surveyQueryDTO.PageSize, surveyQueryDTO.SortField, surveyQueryDTO.Asc);
|
return await trialSiteSurveyQueryable.ToPagedListAsync(surveyQueryDTO.PageIndex, surveyQueryDTO.PageSize, surveyQueryDTO.SortField, surveyQueryDTO.Asc);
|
||||||
}
|
}
|
||||||
|
@ -497,7 +501,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
var groupSelectIdQuery =
|
var groupSelectIdQuery =
|
||||||
_trialSiteSurveyRepository.Where(t => t.TrialId == queryParam.TrialId)
|
_trialSiteSurveyRepository.Where(t => t.TrialId == queryParam.TrialId)
|
||||||
.WhereIf(queryParam.TrialSiteId != null, t => t.TrialSiteId == queryParam.TrialSiteId)
|
.WhereIf(queryParam.TrialSiteId != null, t => t.TrialSiteId == queryParam.TrialSiteId)
|
||||||
|
|
||||||
.WhereIf(!string.IsNullOrEmpty(queryParam.FormWriterKeyInfo), t => (t.UserName).Contains(queryParam.FormWriterKeyInfo) || t.Email.Contains(queryParam.FormWriterKeyInfo) || t.Phone.Contains(queryParam.FormWriterKeyInfo))
|
.WhereIf(!string.IsNullOrEmpty(queryParam.FormWriterKeyInfo), t => (t.UserName).Contains(queryParam.FormWriterKeyInfo) || t.Email.Contains(queryParam.FormWriterKeyInfo) || t.Phone.Contains(queryParam.FormWriterKeyInfo))
|
||||||
.GroupBy(t => t.TrialSiteId)
|
.GroupBy(t => t.TrialSiteId)
|
||||||
.Select(g => g.OrderByDescending(u => u.CreateTime).Select(t => t.Id).First());
|
.Select(g => g.OrderByDescending(u => u.CreateTime).Select(t => t.Id).First());
|
||||||
|
@ -622,7 +626,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
+ Path.DirectorySeparatorChar.ToString()
|
+ Path.DirectorySeparatorChar.ToString()
|
||||||
+ "EmailTemplate"
|
+ "EmailTemplate"
|
||||||
+ Path.DirectorySeparatorChar.ToString()
|
+ Path.DirectorySeparatorChar.ToString()
|
||||||
+ (_userInfo.IsEn_Us ? "TrialSiteSurveyReject_US.html" : "TrialSiteSurveyReject.html") ;
|
+ (_userInfo.IsEn_Us ? "TrialSiteSurveyReject_US.html" : "TrialSiteSurveyReject.html");
|
||||||
|
|
||||||
|
|
||||||
using (StreamReader SourceReader = System.IO.File.OpenText(pathToFile))
|
using (StreamReader SourceReader = System.IO.File.OpenText(pathToFile))
|
||||||
|
@ -725,12 +729,12 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
var currentUserList = siteUserList.Where(t => t.TrialSiteSurveyId == trialSiteSurveyId).ToList();
|
var currentUserList = siteUserList.Where(t => t.TrialSiteSurveyId == trialSiteSurveyId).ToList();
|
||||||
|
|
||||||
|
|
||||||
if (!currentUserList.Any(t => t.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator) )
|
if (!currentUserList.Any(t => t.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator))
|
||||||
{
|
{
|
||||||
throw new BusinessValidationFailedException(_localizer["TrialSiteSurvey_MissingAccount"]);
|
throw new BusinessValidationFailedException(_localizer["TrialSiteSurvey_MissingAccount"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (currentUserList.Where(t=>t.IsGenerateAccount && t.UserTypeId!=null).GroupBy(t => new { t.UserTypeId, t.Email })
|
if (currentUserList.Where(t => t.IsGenerateAccount && t.UserTypeId != null).GroupBy(t => new { t.UserTypeId, t.Email })
|
||||||
.Any(g => g.Count() > 1))
|
.Any(g => g.Count() > 1))
|
||||||
{
|
{
|
||||||
throw new BusinessValidationFailedException(_localizer["TrialSiteSurvey_DuplicateEmail"]);
|
throw new BusinessValidationFailedException(_localizer["TrialSiteSurvey_DuplicateEmail"]);
|
||||||
|
@ -760,7 +764,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
await _trialSiteSurveyRepository.UpdatePartialFromQueryAsync(t => t.Id == trialSiteSurveyId && t.State == TrialSiteSurveyEnum.CRCSubmitted, u => new TrialSiteSurvey() { State = TrialSiteSurveyEnum.SPMApproved, PreliminaryUserId = _userInfo.Id, PreliminaryTime = DateTime.Now });
|
await _trialSiteSurveyRepository.UpdatePartialFromQueryAsync(t => t.Id == trialSiteSurveyId && t.State == TrialSiteSurveyEnum.CRCSubmitted, u => new TrialSiteSurvey() { State = TrialSiteSurveyEnum.SPMApproved, PreliminaryUserId = _userInfo.Id, PreliminaryTime = DateTime.Now });
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager|| _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM)
|
else if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM)
|
||||||
{
|
{
|
||||||
|
|
||||||
var allUserList = _trialSiteUserSurveyRepository.Where(t => t.TrialSiteSurveyId == trialSiteSurveyId).ProjectTo<TrialSiteUserSurveyView>(_mapper.ConfigurationProvider).ToList();
|
var allUserList = _trialSiteUserSurveyRepository.Where(t => t.TrialSiteSurveyId == trialSiteSurveyId).ProjectTo<TrialSiteUserSurveyView>(_mapper.ConfigurationProvider).ToList();
|
||||||
|
@ -934,7 +938,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
DeletedTime = DateTime.Now,
|
DeletedTime = DateTime.Now,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
await _repository.SaveChangesAsync();
|
await _repository.SaveChangesAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,13 @@
|
||||||
namespace IRaCIS.Core.Domain.Share
|
using System.Collections.Generic;
|
||||||
|
|
||||||
|
namespace IRaCIS.Core.Domain.Share
|
||||||
{
|
{
|
||||||
public enum TrialExpedited
|
public enum TrialExpedited
|
||||||
{
|
{
|
||||||
|
|
||||||
All=-1,
|
All = -1,
|
||||||
|
|
||||||
None=0,
|
None = 0,
|
||||||
|
|
||||||
ExpeditedIn24H = 1,
|
ExpeditedIn24H = 1,
|
||||||
|
|
||||||
|
@ -29,26 +31,43 @@
|
||||||
{
|
{
|
||||||
//0全部中国医生 1美国医生 2既有中国医生,也有美国医生
|
//0全部中国医生 1美国医生 2既有中国医生,也有美国医生
|
||||||
|
|
||||||
CN=0,
|
CN = 0,
|
||||||
|
|
||||||
US=1,
|
US = 1,
|
||||||
|
|
||||||
EU=2,
|
EU = 2,
|
||||||
|
|
||||||
Other=3
|
Other = 3
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class SiteSurveyFiledConfig
|
||||||
|
{
|
||||||
|
public List<string> NotShowFieldList { get; set; }=new List<string>();
|
||||||
|
|
||||||
|
public List<SiteSurveyModifyFiled> ModifyFiledList { get; set; }=new List<SiteSurveyModifyFiled>();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SiteSurveyModifyFiled
|
||||||
|
{
|
||||||
|
public string NeedModifyFiled { get; set; }
|
||||||
|
|
||||||
|
public string ReplaceContent { get; set; }
|
||||||
|
|
||||||
|
public string ReplaceContentCN { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
public enum DeclarationType
|
public enum DeclarationType
|
||||||
{
|
{
|
||||||
Other=3,
|
Other = 3,
|
||||||
|
|
||||||
US=1,
|
US = 1,
|
||||||
|
|
||||||
CN=0,
|
CN = 0,
|
||||||
|
|
||||||
EU=2,
|
EU = 2,
|
||||||
|
|
||||||
JP=4
|
JP = 4
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -90,6 +90,13 @@
|
||||||
EnrollOrPD_EMailCopy=5,
|
EnrollOrPD_EMailCopy=5,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum UserMFAType
|
||||||
|
{
|
||||||
|
Login=0,
|
||||||
|
|
||||||
|
Unlock=1,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -182,6 +182,9 @@ namespace IRaCIS.Core.Domain.Models
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//public List<SiteSurveyFiledConfig>
|
||||||
|
|
||||||
|
public string SiteSurveyConfigJsonStr { get; set; } = string.Empty;
|
||||||
|
|
||||||
public bool VisitPlanConfirmed { get; set; }
|
public bool VisitPlanConfirmed { get; set; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue