Uat_Study
he 2022-05-20 16:53:36 +08:00
parent dd7c710c90
commit 73fa081d50
3 changed files with 24 additions and 16 deletions

View File

@ -290,7 +290,8 @@ namespace IRaCIS.Core.Application.Services
await _trialSiteUserRepository.AddRangeAsync(addArray);
return ResponseOutput.Result(await _trialSiteUserRepository.SaveChangesAsync());
await _trialSiteUserRepository.SaveChangesAsync();
return ResponseOutput.Result(true);
}
/// <summary> 删除CRC人员</summary>

View File

@ -62,8 +62,7 @@ namespace IRaCIS.Core.Domain.Models
[ForeignKey("UserId")]
public TrialUser TrialUser { get; set; }
[ForeignKey("UserId")]
public UserType UserTypeRole { get; set; }
}

View File

@ -311,15 +311,23 @@ namespace IRaCIS.Core.Infra.EFCore.Common
entity.Site = await _dbContext.Site.Where(x => x.Id == entity.SiteId).FirstOrDefaultAsync();
}
var user = new User();
if (entity.User == null)
{
entity.User = await _dbContext.User.Where(x => x.Id == entity.UserId).FirstOrDefaultAsync();
user = await _dbContext.User.Where(x => x.Id == entity.UserId).FirstOrDefaultAsync();
}
else
{
user = entity.User;
}
if (entity.UserTypeRole == null)
{
entity.UserTypeRole = await _dbContext.UserType.Where(x => x.Id == entity.User.UserTypeId).FirstOrDefaultAsync();
}
// 这里有问题
UserType userType = new UserType();
userType = await _dbContext.UserType.Where(x => x.Id == user.UserTypeId).FirstOrDefaultAsync();
await InsertInspection<TrialSiteUser>(item, type, x => new DataInspection()
{
@ -332,11 +340,11 @@ namespace IRaCIS.Core.Infra.EFCore.Common
City = entity.Site.City,
Country = entity.Site.Country,
Status = entity.IsDeleted ? "禁用" : "启用",
UserName = entity.User.UserName,
UserRealName = entity.User.FullName,
UserType= entity.UserTypeRole.UserTypeShortName,
Phone= entity.User.Phone,
Email= entity.User.EMail,
UserName = user.UserName,
UserRealName = user.FullName,
UserType = userType.UserTypeShortName,
Phone = user.Phone,
Email = user.EMail,
Organization = entity.User.OrganizationName,
});