Merge branch 'Uat_IRC_Net8' into Test_IRC_Net8
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-02-17 17:15:44 +08:00
4 changed files with 44 additions and 22 deletions
@@ -7,6 +7,7 @@ using IRaCIS.Core.Infrastructure;
using MailKit;
using Medallion.Threading;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Identity;
using Microsoft.Extensions.Options;
using MimeKit;
@@ -485,14 +486,6 @@ namespace IRaCIS.Core.Application.Service
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig, null);
//创建账号 和创建角色 一条,更新的时候才记录更新角色
if (!sysUserInfo.IsFirstAdd)
{
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = _userInfo.IdentityUserId, ActionUserName = _userInfo.UserName, TargetIdentityUserId = userId, OptType = UserOptType.UpdateUserRole }, true);
}
}
//Site调研 用户加入项目
@@ -553,13 +546,6 @@ namespace IRaCIS.Core.Application.Service
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig);
//创建账号 和创建角色 一条,更新的时候才记录更新角色
if (!sysUserInfo.IsFirstAdd)
{
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = _userInfo.IdentityUserId, ActionUserName = _userInfo.UserName, TargetIdentityUserId = userId, OptType = UserOptType.UpdateUserRole }, true);
}
}
@@ -574,6 +560,9 @@ namespace IRaCIS.Core.Application.Service
var userType = await _userTypeRepository.FirstAsync(t => t.UserTypeEnum == UserTypeEnum.IndependentReviewer);
//需要创建新的账户
var isNeedCreateNewUser = false;
var @lock = _distributedLockProvider.CreateLock($"UserCode");
using (await @lock.AcquireAsync())
@@ -583,6 +572,7 @@ namespace IRaCIS.Core.Application.Service
if (!isDoctorHaveAccount)
{
isNeedCreateNewUser = true;
var saveItem = new IdentityUser() { FirstName = doctor.FirstName, LastName = doctor.LastName, EMail = doctor.EMail };
@@ -685,10 +675,9 @@ namespace IRaCIS.Core.Application.Service
await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig, null);
//创建账号 和创建角色 一条,更新的时候才记录更新角色
if (!sysUserInfo.IsFirstAdd)
if (isNeedCreateNewUser == false)
{
await _userLogRepository.AddAsync(new UserLog() { IP = _userInfo.IP, ActionIdentityUserId = _userInfo.IdentityUserId, ActionUserName = _userInfo.UserName, TargetIdentityUserId = sysUserInfo.Id, OptType = UserOptType.UpdateUserRole }, true);
}