正式用户 非正式用户代码修改

This commit is contained in:
2023-01-03 16:17:01 +08:00
parent 75c598c912
commit caa573551e
14 changed files with 174 additions and 7 deletions
@@ -695,7 +695,7 @@ namespace IRaCIS.Core.Application.Contracts
//await SendInviteEmail(new InviteEmailCommand() { TrialId = trialId, RouteUrl = siteSurvyeSubmit.RouteUrl, UserList = needGenerateList });
await GenerateAccountAsync(needGenerateList);
await GenerateAccountAsync(needGenerateList,trialId);
await SendSiteSurveyUserJoinEmail(new TrialSiteUserSurveyJoinCommand() { TrialId = trialId, TrialSiteSurveyId = trialSiteSurveyId, RouteUrl = siteSurvyeSubmit.RouteUrl, BaseUrl = siteSurvyeSubmit.BaseUrl, UserList = needGenerateList });
@@ -706,7 +706,7 @@ namespace IRaCIS.Core.Application.Contracts
private async Task GenerateAccountAsync(List<TrialSiteUserSurveyView> needGenerateList)
private async Task GenerateAccountAsync(List<TrialSiteUserSurveyView> needGenerateList,Guid trialId)
{
foreach (var item in needGenerateList)
{
@@ -722,6 +722,13 @@ namespace IRaCIS.Core.Application.Contracts
{
var saveItem = _mapper.Map<User>(item);
var trialType = _repository.Where<Trial>(t => t.Id == trialId).Select(t => t.TrialType).FirstOrDefault();
if (trialType == TrialType.NoneOfficial)
{
saveItem.IsTestUser = true;
}
saveItem.Code = _userRepository.Select(t => t.Code).DefaultIfEmpty().Max() + 1;
saveItem.UserCode = AppSettings.GetCodeStr(saveItem.Code, nameof(User));