@@ -36,7 +36,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
IRepository<TrialSite> _trialSiteRepository,
|
||||
IRepository<Doctor> _doctorRepository,
|
||||
IRepository<VerificationCode> _verificationCodeRepository,
|
||||
IRepository<TrialUserRole> _trialUserRepository,
|
||||
IRepository<TrialUserRole> _trialUserRoleRepository,
|
||||
IRepository<TrialSiteUserRole> _trialSiteUserRoleRepository,
|
||||
IDistributedLockProvider _distributedLockProvider,
|
||||
ITokenService _tokenService,
|
||||
@@ -950,17 +950,17 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
|
||||
//判断TrialUser中是否存在 不存在就插入
|
||||
|
||||
var findTrialUser = await _trialUserRepository.FirstOrDefaultAsync(t => t.TrialId == trialId && t.UserId == userId, true);
|
||||
var findTrialUser = await _trialUserRoleRepository.FirstOrDefaultAsync(t => t.TrialId == trialId && t.UserId == userId, true);
|
||||
if (findTrialUser == null)
|
||||
{
|
||||
await _trialUserRepository.AddAsync(new TrialUserRole() { TrialId = trialId, UserId = userId, JoinTime = DateTime.Now });
|
||||
await _trialUserRoleRepository.AddAsync(new TrialUserRole() { TrialId = trialId, UserId = userId, JoinTime = DateTime.Now });
|
||||
|
||||
await _mailVerificationService.SiteSurveyUserJoinEmail(trialId, userId, joinCommand.BaseUrl, joinCommand.RouteUrl);
|
||||
|
||||
}
|
||||
else if (findTrialUser.IsDeleted == true)
|
||||
{
|
||||
await _trialUserRepository.UpdatePartialFromQueryAsync(t => t.TrialId == trialId && t.UserId == userId, c => new TrialUserRole()
|
||||
await _trialUserRoleRepository.UpdatePartialFromQueryAsync(t => t.TrialId == trialId && t.UserId == userId, c => new TrialUserRole()
|
||||
{
|
||||
IsDeleted = false,
|
||||
DeletedTime = null,
|
||||
@@ -1070,17 +1070,17 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
var trialSiteId = item.TrialSiteId;
|
||||
|
||||
//判断是否加入到项目
|
||||
var findTrialUser = await _trialUserRepository.FirstOrDefaultAsync(t => t.TrialId == trialId && t.UserId == userId, true);
|
||||
var findTrialUser = await _trialUserRoleRepository.FirstOrDefaultAsync(t => t.TrialId == trialId && t.UserId == userId, true);
|
||||
if (findTrialUser == null)
|
||||
{
|
||||
await _trialUserRepository.AddAsync(new TrialUserRole() { TrialId = trialId, UserId = userId, JoinTime = DateTime.Now });
|
||||
await _trialUserRoleRepository.AddAsync(new TrialUserRole() { TrialId = trialId, UserId = userId, JoinTime = DateTime.Now });
|
||||
|
||||
await _mailVerificationService.SiteSurveyUserJoinEmail(trialId, userId, baseUrl, routeUrl);
|
||||
|
||||
}
|
||||
else if (findTrialUser.IsDeleted == true)
|
||||
{
|
||||
await _trialUserRepository.UpdatePartialFromQueryAsync(t => t.TrialId == trialId && t.UserId == userId, c => new TrialUserRole()
|
||||
await _trialUserRoleRepository.UpdatePartialFromQueryAsync(t => t.TrialId == trialId && t.UserId == userId, c => new TrialUserRole()
|
||||
{
|
||||
IsDeleted = false,
|
||||
DeletedTime = null,
|
||||
|
||||
Reference in New Issue
Block a user