Uat_Study
parent
dd7c710c90
commit
73fa081d50
|
@ -182,7 +182,7 @@ namespace IRaCIS.Core.Application.Services
|
|||
{
|
||||
var query = _trialSiteUserRepository.Where(t => t.TrialId == trialId && t.SiteId == siteId).IgnoreQueryFilters()
|
||||
.ProjectTo<UserTrialDTO>(_mapper.ConfigurationProvider);
|
||||
|
||||
|
||||
return await query.ToListAsync();
|
||||
}
|
||||
|
||||
|
@ -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>
|
||||
|
|
|
@ -62,8 +62,7 @@ namespace IRaCIS.Core.Domain.Models
|
|||
|
||||
[ForeignKey("UserId")]
|
||||
public TrialUser TrialUser { get; set; }
|
||||
[ForeignKey("UserId")]
|
||||
public UserType UserTypeRole { get; set; }
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -303,7 +303,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
|||
var entity = item.Entity as TrialSiteUser;
|
||||
if (entity.TrialSite == null)
|
||||
{
|
||||
entity.TrialSite= await _dbContext.TrialSite.Where(x => x.TrialId == entity.TrialId&&x.SiteId== entity.SiteId).FirstOrDefaultAsync();
|
||||
entity.TrialSite = await _dbContext.TrialSite.Where(x => x.TrialId == entity.TrialId && x.SiteId == entity.SiteId).FirstOrDefaultAsync();
|
||||
}
|
||||
|
||||
if (entity.Site == null)
|
||||
|
@ -311,16 +311,24 @@ 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();
|
||||
}
|
||||
|
||||
if (entity.UserTypeRole == null)
|
||||
else
|
||||
{
|
||||
entity.UserTypeRole = await _dbContext.UserType.Where(x => x.Id == entity.User.UserTypeId).FirstOrDefaultAsync();
|
||||
user = entity.User;
|
||||
}
|
||||
|
||||
// 这里有问题
|
||||
|
||||
UserType userType = new UserType();
|
||||
userType = await _dbContext.UserType.Where(x => x.Id == user.UserTypeId).FirstOrDefaultAsync();
|
||||
|
||||
await InsertInspection<TrialSiteUser>(item, type, x => new DataInspection()
|
||||
{
|
||||
GeneralId = x.Id,
|
||||
|
@ -332,13 +340,13 @@ 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,
|
||||
Organization= entity.User.OrganizationName,
|
||||
|
||||
UserName = user.UserName,
|
||||
UserRealName = user.FullName,
|
||||
UserType = userType.UserTypeShortName,
|
||||
Phone = user.Phone,
|
||||
Email = user.EMail,
|
||||
Organization = entity.User.OrganizationName,
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue