@@ -98,7 +98,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
/// <param name="_commonDocumentRepository"></param>
|
||||
/// <param name="_dictionaryService"></param>
|
||||
/// <param name="_trialRepository"></param>
|
||||
/// <param name="_trialSiteUserRepository"></param>
|
||||
/// <param name="_trialSiteUserRoleRepository"></param>
|
||||
/// <returns></returns>
|
||||
/// <exception cref="Exception"></exception>
|
||||
[HttpPost]
|
||||
@@ -107,14 +107,14 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||
[FromServices] IRepository<CommonDocument> _commonDocumentRepository,
|
||||
[FromServices] IDictionaryService _dictionaryService,
|
||||
[FromServices] IRepository<Trial> _trialRepository,
|
||||
[FromServices] IRepository<TrialSiteUser> _trialSiteUserRepository
|
||||
[FromServices] IRepository<TrialSiteUserRole> _trialSiteUserRoleRepository
|
||||
)
|
||||
{
|
||||
|
||||
|
||||
var exportInfo = (await _trialRepository.Where(t => t.Id == param.TrialId).IgnoreQueryFilters().ProjectTo<ExcelExportInfo>(_mapper.ConfigurationProvider).FirstOrDefaultAsync()).IfNullThrowException();
|
||||
|
||||
var list = await _trialSiteUserRepository.Where(t => t.TrialId == param.TrialId).IgnoreQueryFilters()
|
||||
var list = await _trialSiteUserRoleRepository.Where(t => t.TrialId == param.TrialId).IgnoreQueryFilters()
|
||||
.WhereIf(param.IsDeleted != null, t => t.IsDeleted == param.IsDeleted)
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(param.SiteName), t => t.TrialSite.TrialSiteName.Contains(param.SiteName) || t.TrialSite.TrialSiteAliasName.Contains(param.SiteName))
|
||||
.WhereIf(!string.IsNullOrWhiteSpace(param.TrialSiteAliasName),
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
IRepository<Trial> _trialRepository,
|
||||
IRepository<TrialUserRole> _trialUserRepository,
|
||||
IRepository<VisitTask> _visitTaskRepository,
|
||||
IRepository<TrialSiteUser> _trialSiteUserRepository,
|
||||
IRepository<TrialSiteUserRole> _trialSiteUserRoleRepository,
|
||||
IOptionsMonitor<SystemEmailSendConfig> _SystemEmailSendConfig, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, IEmailSendService
|
||||
{
|
||||
|
||||
@@ -157,7 +157,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
}
|
||||
if (trialSiteId != null && toUserTypeEnumList.Any(t => t == UserTypeEnum.ClinicalResearchCoordinator || t == UserTypeEnum.CRA))
|
||||
{
|
||||
var curentSiteUserIdList = _trialSiteUserRepository.Where(t => t.TrialId == trialId && t.TrialSiteId == trialSiteId).Select(t => t.UserId).ToList();
|
||||
var curentSiteUserIdList = _trialSiteUserRoleRepository.Where(t => t.TrialId == trialId && t.TrialSiteId == trialSiteId).Select(t => t.UserId).ToList();
|
||||
|
||||
toUserList = toUserList.Where(t => (t.UserTypeEnum != UserTypeEnum.CRA && t.UserTypeEnum != UserTypeEnum.ClinicalResearchCoordinator) || curentSiteUserIdList.Contains(t.UserId)).ToList();
|
||||
}
|
||||
@@ -171,7 +171,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
if (trialSiteId != null && copyUserTypeEnumList.Any(t => t == UserTypeEnum.ClinicalResearchCoordinator || t == UserTypeEnum.CRA))
|
||||
{
|
||||
var curentSiteUserIdList = _trialSiteUserRepository.Where(t => t.TrialId == trialId && t.TrialSiteId == trialSiteId).Select(t => t.UserId).ToList();
|
||||
var curentSiteUserIdList = _trialSiteUserRoleRepository.Where(t => t.TrialId == trialId && t.TrialSiteId == trialSiteId).Select(t => t.UserId).ToList();
|
||||
|
||||
copyUserList = copyUserList.Where(t => (t.UserTypeEnum != UserTypeEnum.CRA && t.UserTypeEnum != UserTypeEnum.ClinicalResearchCoordinator) || curentSiteUserIdList.Contains(t.UserId)).ToList();
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
[ApiExplorerSettings(GroupName = "Institution")]
|
||||
public class SiteService(IRepository<Site> _siteRepository,
|
||||
IRepository<TrialSiteUser> _trialSiteUserRepository,
|
||||
IRepository<TrialSiteUserRole> _trialSiteUserRoleRepository,
|
||||
IDistributedLockProvider _distributedLockProvider,
|
||||
IRepository<TrialSite> _trialSiteRepository,
|
||||
IRepository<Hospital> _hospitalRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ISiteService
|
||||
@@ -114,7 +114,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
public async Task<IResponseOutput> DeleteSite(Guid siteId)
|
||||
{
|
||||
|
||||
if (await _trialSiteUserRepository.AnyAsync(t => t.TrialSite.SiteId == siteId))
|
||||
if (await _trialSiteUserRoleRepository.AnyAsync(t => t.TrialSite.SiteId == siteId))
|
||||
{
|
||||
//---该中心已经加入项目,不可以被删除。
|
||||
return ResponseOutput.NotOk(_localizer["Site_InProject"]);
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace IRaCIS.Application.Contracts
|
||||
|
||||
public Guid UserTypeId { get; set; }
|
||||
|
||||
public UserTypeEnum UserType { get; set; }
|
||||
public UserTypeEnum UserTypeEnum { get; set; }
|
||||
|
||||
public string UserTypeShortName { get; set; }
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
IRepository<Doctor> _doctorRepository,
|
||||
IRepository<VerificationCode> _verificationCodeRepository,
|
||||
IRepository<TrialUserRole> _trialUserRepository,
|
||||
IRepository<TrialSiteUser> _trialSiteUserRepository,
|
||||
IRepository<TrialSiteUserRole> _trialSiteUserRoleRepository,
|
||||
IDistributedLockProvider _distributedLockProvider,
|
||||
ITokenService _tokenService,
|
||||
IRepository<UserType> _userTypeRepository,
|
||||
@@ -311,7 +311,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
|
||||
TrialSiteSurvey? currentEntity = null;
|
||||
|
||||
var userList = await _trialSiteUserRepository.Where(t => t.TrialId == userInfo.TrialId && t.TrialSiteId == userInfo.TrialSiteId, false, true).ProjectTo<TrialSiteUserSurvey>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
var userList = await _trialSiteUserRoleRepository.Where(t => t.TrialId == userInfo.TrialId && t.TrialSiteId == userInfo.TrialSiteId, false, true).ProjectTo<TrialSiteUserSurvey>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
|
||||
//普通登录
|
||||
@@ -489,7 +489,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
|
||||
if (find.State != TrialSiteSurveyEnum.PMCreatedAndLock && find.IsDeleted != true)
|
||||
{
|
||||
var userList = await _trialSiteUserRepository.Where(t => t.TrialId == find.TrialId && t.TrialSiteId == find.TrialSiteId, false, true).ProjectTo<TrialSiteUserSurvey>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
var userList = await _trialSiteUserRoleRepository.Where(t => t.TrialId == find.TrialId && t.TrialSiteId == find.TrialSiteId, false, true).ProjectTo<TrialSiteUserSurvey>(_mapper.ConfigurationProvider).ToListAsync();
|
||||
|
||||
|
||||
await UnlockSyncSiteUserAsync(find.TrialId, find.TrialSiteId, find.Id, userList);
|
||||
@@ -970,11 +970,11 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
await _mailVerificationService.SiteSurveyUserJoinEmail(trialId, userId, joinCommand.BaseUrl, joinCommand.RouteUrl);
|
||||
}
|
||||
|
||||
var findTrialSiteUser = await _trialSiteUserRepository.FirstOrDefaultAsync(t => t.TrialId == trialId && t.UserId == userId && t.TrialSiteId == trialSiteId, true);
|
||||
var findTrialSiteUser = await _trialSiteUserRoleRepository.FirstOrDefaultAsync(t => t.TrialId == trialId && t.UserId == userId && t.TrialSiteId == trialSiteId, true);
|
||||
|
||||
if (findTrialSiteUser == null)
|
||||
{
|
||||
await _trialSiteUserRepository.AddAsync(new TrialSiteUser() { TrialId = trialId, TrialSiteId = trialSiteId, UserId = userId });
|
||||
await _trialSiteUserRoleRepository.AddAsync(new TrialSiteUserRole() { TrialId = trialId, TrialSiteId = trialSiteId, UserId = userId });
|
||||
|
||||
}
|
||||
else
|
||||
@@ -1005,14 +1005,14 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
var userIdList = list.Select(t => t.SystemUserId).ToList();
|
||||
|
||||
|
||||
await _trialSiteUserRepository.UpdatePartialFromQueryAsync(t => t.TrialId == trialId && t.TrialSiteId == siteId && userIdList.Contains(t.UserId), c => new TrialSiteUser()
|
||||
await _trialSiteUserRoleRepository.UpdatePartialFromQueryAsync(t => t.TrialId == trialId && t.TrialSiteId == siteId && userIdList.Contains(t.UserId), c => new TrialSiteUserRole()
|
||||
{
|
||||
IsDeleted = true,
|
||||
DeletedTime = DateTime.Now,
|
||||
});
|
||||
|
||||
|
||||
await _trialSiteUserRepository.SaveChangesAsync();
|
||||
await _trialSiteUserRoleRepository.SaveChangesAsync();
|
||||
}
|
||||
|
||||
|
||||
@@ -1091,11 +1091,11 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
}
|
||||
|
||||
|
||||
var findTrialSiteUser = await _trialSiteUserRepository.FirstOrDefaultAsync(t => t.TrialId == trialId && t.UserId == userId && t.TrialSiteId == trialSiteId, true);
|
||||
var findTrialSiteUser = await _trialSiteUserRoleRepository.FirstOrDefaultAsync(t => t.TrialId == trialId && t.UserId == userId && t.TrialSiteId == trialSiteId, true);
|
||||
|
||||
if (findTrialSiteUser == null)
|
||||
{
|
||||
await _trialSiteUserRepository.AddAsync(new TrialSiteUser() { TrialId = trialId, TrialSiteId = trialSiteId, UserId = userId });
|
||||
await _trialSiteUserRoleRepository.AddAsync(new TrialSiteUserRole() { TrialId = trialId, TrialSiteId = trialSiteId, UserId = userId });
|
||||
|
||||
}
|
||||
else
|
||||
@@ -1106,7 +1106,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
|
||||
await _userRoleRepository.BatchUpdateNoTrackingAsync(t => t.Id == userId, u => new UserRole() { Status = UserStateEnum.Enable });
|
||||
|
||||
await _trialSiteUserRepository.SaveChangesAsync();
|
||||
await _trialSiteUserRoleRepository.SaveChangesAsync();
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace IRaCIS.Core.Application.AutoMapper
|
||||
|
||||
CreateMap<LoginDto, TrialSiteSurvey>().ForMember(d => d.Email, t => t.MapFrom(t => t.EmailOrPhone));
|
||||
|
||||
CreateMap<TrialSiteUser, TrialSiteUserSurvey>()
|
||||
CreateMap<TrialSiteUserRole, TrialSiteUserSurvey>()
|
||||
.ForMember(d => d.Id, u => u.Ignore())
|
||||
.ForMember(d => d.Phone, u => u.MapFrom(c => c.UserRole.Phone))
|
||||
.ForMember(d => d.Email, u => u.MapFrom(c => c.UserRole.EMail))
|
||||
|
||||
@@ -11,7 +11,10 @@ namespace IRaCIS.Application.Contracts
|
||||
{
|
||||
|
||||
|
||||
public class TrialSiteCRCListDTO
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public class UserTrialDTO : UserTrialCommand
|
||||
{
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
[ApiExplorerSettings(GroupName = "Trial")]
|
||||
public class TrialMaintenanceService(IRepository<TrialUserRole> _trialUseRoleRepository, IRepository<TrialIdentityUser> _trialIdentityUserRepository,
|
||||
IRepository<UserRole> _userRoleRepository,
|
||||
IRepository<TrialSiteUser> _trialSiteUserRepository,
|
||||
IRepository<TrialSiteUserRole> _trialSiteUserRoleRepository,
|
||||
IRepository<SubjectVisit> _subjectVisitRepository,
|
||||
IRepository<Trial> _trialRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ITrialMaintenanceService
|
||||
{
|
||||
@@ -56,7 +56,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
if (updateTrialUserCommand.IsDeleted)
|
||||
{
|
||||
if (await _trialSiteUserRepository.AnyAsync(t => t.UserRole.IdentityUserId == trialUser.IdentityUserId && t.TrialId == trialUser.TrialId))
|
||||
if (await _trialSiteUserRoleRepository.AnyAsync(t => t.UserRole.IdentityUserId == trialUser.IdentityUserId && t.TrialId == trialUser.TrialId))
|
||||
{
|
||||
// ----人员已加入现场维护
|
||||
return ResponseOutput.NotOk(_localizer["TrialMaint_PersonnelJoined"]);
|
||||
@@ -145,17 +145,20 @@ namespace IRaCIS.Core.Application.Service
|
||||
{
|
||||
var currentUserRoleList = item.ToList();
|
||||
|
||||
var addArray = _mapper.Map<TrialIdentityUser[]>(currentUserRoleList);
|
||||
var first = currentUserRoleList.FirstOrDefault();
|
||||
|
||||
var trialUsers = await _trialIdentityUserRepository.AddRangeAsync(addArray);
|
||||
|
||||
foreach (var trialUser in trialUsers)
|
||||
var currentUser = new TrialIdentityUser()
|
||||
{
|
||||
trialUser.JoinTime = DateTime.Now;
|
||||
}
|
||||
TrialId = first.TrialId,
|
||||
IdentityUserId = item.Key,
|
||||
JoinTime = DateTime.Now,
|
||||
TrialUserRoleList = currentUserRoleList.Select(t => new TrialUserRole() { UserId = t.UserId, TrialId = t.TrialId }).ToList()
|
||||
};
|
||||
|
||||
|
||||
var success = await _trialUseRoleRepository.SaveChangesAsync();
|
||||
await _trialIdentityUserRepository.AddAsync(currentUser);
|
||||
|
||||
var success = await _trialIdentityUserRepository.SaveChangesAsync();
|
||||
|
||||
}
|
||||
|
||||
@@ -207,7 +210,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
if (trialUser == null) return Null404NotFound(trialUser);
|
||||
|
||||
if (await _trialSiteUserRepository.AnyAsync(t => t.UserId == trialUser.UserId && t.TrialId == trialUser.TrialId))
|
||||
if (await _trialSiteUserRoleRepository.AnyAsync(t => t.UserId == trialUser.UserId && t.TrialId == trialUser.TrialId))
|
||||
{
|
||||
//---人员已加入现场维护
|
||||
return ResponseOutput.NotOk(_localizer["TrialMaint_PersonnelJoined"]);
|
||||
|
||||
@@ -551,7 +551,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
await _repository.BatchDeleteNoTrackingAsync<TrialSiteEquipmentSurvey>(t => t.TrialSiteSurvey.TrialId == trialId);
|
||||
|
||||
await _repository.BatchDeleteNoTrackingAsync<TrialUserRole>(t => t.TrialId == trialId);
|
||||
await _repository.BatchDeleteNoTrackingAsync<TrialSiteUser>(t => t.TrialId == trialId);
|
||||
await _repository.BatchDeleteNoTrackingAsync<TrialSiteUserRole>(t => t.TrialId == trialId);
|
||||
await _repository.BatchDeleteNoTrackingAsync<VisitStage>(t => t.TrialId == trialId);
|
||||
await _repository.BatchDeleteNoTrackingAsync<VisitPlanInfluenceStat>(t => t.TrialId == trialId);
|
||||
await _repository.BatchDeleteNoTrackingAsync<VisitPlanInfluenceStudy>(t => t.TrialId == trialId);
|
||||
|
||||
@@ -10,15 +10,30 @@ namespace IRaCIS.Core.Application.Services
|
||||
{
|
||||
[ApiExplorerSettings(GroupName = "Trial")]
|
||||
public class TrialMaintenanceService(IRepository<TrialSite> _trialSiteRepository,
|
||||
IRepository<TrialSiteUser> _trialSiteUserRepository,
|
||||
IRepository<TrialSiteUserRole> _trialSiteUserRoleRepository,
|
||||
IRepository<Site> _siteRepository,
|
||||
IRepository<Subject> _subjectRepository,
|
||||
IRepository<VisitTask> _visitTaskRepository,
|
||||
IRepository<Trial> _trialRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ITrialSiteService
|
||||
{
|
||||
|
||||
#region 账户修改已维护
|
||||
|
||||
|
||||
/// <summary>获取某一Site下面的负责的CRC列表</summary>
|
||||
[HttpGet, Route("{trialId:guid}/{siteId:guid}")]
|
||||
public async Task<List<UserTrialDTO>> GetTrialSiteCRCList(Guid trialId, Guid siteId)
|
||||
{
|
||||
var query = _trialSiteUserRoleRepository.Where(t => t.TrialId == trialId && t.TrialSiteId == siteId).IgnoreQueryFilters()
|
||||
.ProjectTo<UserTrialDTO>(_mapper.ConfigurationProvider);
|
||||
|
||||
return await query.ToListAsync();
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
/// <summary>Pannel 进去 SiteTab </summary>
|
||||
[HttpPost]
|
||||
@@ -65,16 +80,6 @@ namespace IRaCIS.Core.Application.Services
|
||||
}
|
||||
|
||||
|
||||
/// <summary>获取某一Site下面的负责的CRC列表</summary>
|
||||
[HttpGet, Route("{trialId:guid}/{siteId:guid}")]
|
||||
public async Task<List<UserTrialDTO>> GetTrialSiteCRCList(Guid trialId, Guid siteId)
|
||||
{
|
||||
var query = _trialSiteUserRepository.Where(t => t.TrialId == trialId && t.TrialSiteId == siteId).IgnoreQueryFilters()
|
||||
.ProjectTo<UserTrialDTO>(_mapper.ConfigurationProvider);
|
||||
|
||||
return await query.ToListAsync();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>[new] Setting页面 Site勾选列表( </summary>
|
||||
[HttpPost]
|
||||
@@ -111,7 +116,7 @@ namespace IRaCIS.Core.Application.Services
|
||||
[HttpPost]
|
||||
[UnitOfWork]
|
||||
//[Authorize(Policy = IRaCISPolicy.PM_APM)]
|
||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
||||
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||
public async Task<IResponseOutput> AddTrialSites(List<TrialSiteCommand> trialSites)
|
||||
{
|
||||
var addArray = _mapper.Map<List<TrialSite>>(trialSites);
|
||||
@@ -152,7 +157,7 @@ namespace IRaCIS.Core.Application.Services
|
||||
if (editTrialSiteCommand.IsDeleted)
|
||||
{
|
||||
|
||||
if (await _trialSiteUserRepository.AnyAsync(t => t.TrialId == trialId && t.TrialSiteId == trialSiteId))
|
||||
if (await _trialSiteUserRoleRepository.AnyAsync(t => t.TrialId == trialId && t.TrialSiteId == trialSiteId))
|
||||
{
|
||||
//---The site has been associated with CRC, and couldn't be deleted.
|
||||
return ResponseOutput.NotOk(_localizer["TrialSite_CannotDeleteAssociatedCRC"]);
|
||||
@@ -205,36 +210,36 @@ namespace IRaCIS.Core.Application.Services
|
||||
|
||||
/// <summary> 批量添加Site下 CRC的负责人 </summary>
|
||||
[HttpPost]
|
||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
||||
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||
//[Authorize(Policy = IRaCISPolicy.PM_APM)]
|
||||
public async Task<IResponseOutput> AssignSiteCRC(List<AssginSiteCRCCommand> trialSiteCRCList)
|
||||
{
|
||||
var addArray = _mapper.Map<List<TrialSiteUser>>(trialSiteCRCList);
|
||||
var addArray = _mapper.Map<List<TrialSiteUserRole>>(trialSiteCRCList);
|
||||
|
||||
await _trialSiteUserRepository.AddRangeAsync(addArray);
|
||||
await _trialSiteUserRoleRepository.AddRangeAsync(addArray);
|
||||
|
||||
await _trialSiteUserRepository.SaveChangesAsync();
|
||||
await _trialSiteUserRoleRepository.SaveChangesAsync();
|
||||
return ResponseOutput.Result(true);
|
||||
}
|
||||
|
||||
/// <summary> 删除CRC人员</summary>
|
||||
[HttpDelete, Route("{id:guid}/{trialId:guid}/{isDelete:bool}")]
|
||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
||||
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||
//[Authorize(Policy = IRaCISPolicy.PM_APM)]
|
||||
public async Task<IResponseOutput> DeleteSiteCRC(Guid id, bool isDelete)
|
||||
{
|
||||
|
||||
|
||||
await _trialSiteUserRepository.UpdatePartialFromQueryAsync(t => t.Id == id, u => new TrialSiteUser() { IsDeleted = isDelete, DeletedTime = isDelete ? DateTime.Now : null }, true, true);
|
||||
await _trialSiteUserRoleRepository.UpdatePartialFromQueryAsync(t => t.Id == id, u => new TrialSiteUserRole() { IsDeleted = isDelete, DeletedTime = isDelete ? DateTime.Now : null }, true, true);
|
||||
|
||||
//删除又启用改授权时间
|
||||
if (isDelete == false)
|
||||
{
|
||||
await _trialSiteUserRepository.BatchUpdateNoTrackingAsync(t => t.Id == id, u => new TrialSiteUser() { CreateTime = DateTime.Now });
|
||||
await _trialSiteUserRoleRepository.BatchUpdateNoTrackingAsync(t => t.Id == id, u => new TrialSiteUserRole() { CreateTime = DateTime.Now });
|
||||
}
|
||||
|
||||
////不跟踪
|
||||
//await _trialSiteUserRepository.ExecuteUpdateAsync(t => t.Id == id, s=>s.SetProperty(t=>t.IsDeleted,u=>isDelete)
|
||||
//await _trialSiteUserRoleRepository.ExecuteUpdateAsync(t => t.Id == id, s=>s.SetProperty(t=>t.IsDeleted,u=>isDelete)
|
||||
// .SetProperty(t=>t.DeletedTime,u=> isDelete ? DateTime.Now : null)
|
||||
// .SetProperty(t=>t.CreateTime,u=>isDelete?u.CreateTime:DateTime.Now));
|
||||
|
||||
@@ -280,7 +285,7 @@ namespace IRaCIS.Core.Application.Services
|
||||
|
||||
/// <summary>删除 项目 下某一site </summary>
|
||||
[HttpDelete("{id:guid}/{trialId:guid}")]
|
||||
[TrialGlobalLimit( "AfterStopCannNotOpt" )]
|
||||
[TrialGlobalLimit("AfterStopCannNotOpt")]
|
||||
[Obsolete]
|
||||
public async Task<IResponseOutput> DeleteTrialSite(Guid id)
|
||||
{
|
||||
@@ -291,7 +296,7 @@ namespace IRaCIS.Core.Application.Services
|
||||
var trialId = relation.TrialId;
|
||||
var trialSiteId = relation.Id;
|
||||
|
||||
if (await _trialSiteUserRepository.AnyAsync(t => t.TrialId == trialId && t.TrialSiteId == trialSiteId))
|
||||
if (await _trialSiteUserRoleRepository.AnyAsync(t => t.TrialId == trialId && t.TrialSiteId == trialSiteId))
|
||||
{
|
||||
//---The site has been associated with CRC, and couldn't be deleted.
|
||||
return ResponseOutput.NotOk(_localizer["TrialSite_CannotDeleteAssociatedCRC"]);
|
||||
@@ -305,7 +310,7 @@ namespace IRaCIS.Core.Application.Services
|
||||
|
||||
await _trialSiteRepository.DeleteAsync(relation);
|
||||
|
||||
return ResponseOutput.Result(await _trialSiteUserRepository.SaveChangesAsync());
|
||||
return ResponseOutput.Result(await _trialSiteUserRoleRepository.SaveChangesAsync());
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
|
||||
|
||||
CreateMap<TrialSiteUser, UserTrialDTO>().IncludeMembers(t => t.UserRole)
|
||||
CreateMap<TrialSiteUserRole, UserTrialDTO>().IncludeMembers(t => t.UserRole)
|
||||
.ForMember(d => d.UserType, u => u.MapFrom(s => s.UserRole.UserTypeRole.UserTypeShortName))
|
||||
.ForMember(d => d.UserRealName, u => u.MapFrom(s => s.UserRole.FullName));
|
||||
CreateMap<UserRole, UserTrialDTO>();
|
||||
@@ -157,7 +157,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
|
||||
|
||||
|
||||
CreateMap<AssginSiteCRCCommand, TrialSiteUser>();
|
||||
CreateMap<AssginSiteCRCCommand, TrialSiteUserRole>();
|
||||
|
||||
|
||||
CreateMap<Domain.Models.Trial, TrialConfigDTO>().ForMember(t => t.TrialId, u => u.MapFrom(c => c.Id))
|
||||
@@ -266,7 +266,7 @@ namespace IRaCIS.Core.Application.Service
|
||||
CreateMap<Trial, TrialSiteUserExportDto>()
|
||||
.ForMember(t => t.TrialSiteUserList, u => u.Ignore());
|
||||
|
||||
CreateMap<TrialSiteUser, SiteUserExportDTO>().IncludeMembers(t => t.UserRole)
|
||||
CreateMap<TrialSiteUserRole, SiteUserExportDTO>().IncludeMembers(t => t.UserRole)
|
||||
.ForMember(t => t.TrialSiteCode, u => u.MapFrom(c => c.TrialSite.TrialSiteCode))
|
||||
.ForMember(t => t.TrialSiteAliasName, u => u.MapFrom(c => c.TrialSite.TrialSiteAliasName))
|
||||
.ForMember(t => t.UserRealName, u => u.MapFrom(c => c.UserRole.FullName))
|
||||
|
||||
@@ -59,7 +59,6 @@ namespace IRaCIS.Core.Application.Service
|
||||
CreateMap<TrialUserRole, TrialIdentityUserRoleDto>();
|
||||
|
||||
|
||||
CreateMap<TrialUserAddCommand, TrialIdentityUser>();
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user