修改中心命名提交
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
parent
54d17f2e24
commit
ccdad2f4fd
|
@ -12834,7 +12834,7 @@
|
|||
项目外部人员 录入流程相关
|
||||
</summary>
|
||||
</member>
|
||||
<member name="M:IRaCIS.Core.Application.Service.TrialExternalUserService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialExternalUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.IdentityUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialUserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserType},IRaCIS.Core.Application.Service.IMailVerificationService,Medallion.Threading.IDistributedLockProvider,AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
|
||||
<member name="M:IRaCIS.Core.Application.Service.TrialExternalUserService.#ctor(IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialExternalUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.IdentityUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialUserRole},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.TrialIdentityUser},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.Trial},IRaCIS.Core.Infra.EFCore.IRepository{IRaCIS.Core.Domain.Models.UserType},IRaCIS.Core.Application.Service.IMailVerificationService,Medallion.Threading.IDistributedLockProvider,AutoMapper.IMapper,IRaCIS.Core.Domain.Share.IUserInfo,Microsoft.Extensions.Localization.IStringLocalizer)">
|
||||
<summary>
|
||||
项目外部人员 录入流程相关
|
||||
</summary>
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace IRaCIS.Core.Application.MassTransit.Consumer;
|
|||
public class UserSiteSurveySubmitedEventConsumer(
|
||||
IRepository<Trial> _trialRepository,
|
||||
IRepository<TrialSite> _trialSiteRepository,
|
||||
IRepository<TrialUserRole> _trialUserRepository,
|
||||
IRepository<TrialUserRole> _trialUserRoleRepository,
|
||||
IRepository<TrialSiteSurvey> _trialSiteSurveyRepository,
|
||||
IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
|
||||
IOptionsMonitor<SystemEmailSendConfig> systemEmailConfig
|
||||
|
@ -47,7 +47,7 @@ public class UserSiteSurveySubmitedEventConsumer(
|
|||
|
||||
var trialId = siteSurveyInfo.TrialId;
|
||||
|
||||
var trialUserList = await _trialUserRepository.Where(t => t.TrialId == siteSurveyInfo.TrialId)
|
||||
var trialUserList = await _trialUserRoleRepository.Where(t => t.TrialId == siteSurveyInfo.TrialId)
|
||||
.Where(t => t.UserRole.UserTypeEnum == UserTypeEnum.SPM || t.UserRole.UserTypeEnum == UserTypeEnum.CPM || t.UserRole.UserTypeEnum == UserTypeEnum.ProjectManager || t.UserRole.UserTypeEnum == UserTypeEnum.APM)
|
||||
.Select(t => new { t.UserRole.FullName, t.UserRole.EMail, t.UserRole.UserTypeEnum }).ToListAsync();
|
||||
|
||||
|
@ -125,7 +125,7 @@ public class UserSiteSurveySubmitedEventConsumer(
|
|||
/// </summary>
|
||||
public class SiteSurveySPMSubmitedEventConsumer(
|
||||
IRepository<Trial> _trialRepository,
|
||||
IRepository<TrialUserRole> _trialUserRepository,
|
||||
IRepository<TrialUserRole> _trialUserRoleRepository,
|
||||
IRepository<TrialSite> _trialSiteRepository,
|
||||
IRepository<TrialSiteSurvey> _trialSiteSurveyRepository,
|
||||
IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
|
||||
|
@ -145,7 +145,7 @@ public class SiteSurveySPMSubmitedEventConsumer(
|
|||
|
||||
var messageToSend = new MimeMessage();
|
||||
|
||||
var trialUserList = _trialUserRepository.Where(t => t.TrialId == trialId)
|
||||
var trialUserList = _trialUserRoleRepository.Where(t => t.TrialId == trialId)
|
||||
.Where(t => t.UserRole.UserTypeEnum == UserTypeEnum.SPM || t.UserRole.UserTypeEnum == UserTypeEnum.CPM || t.UserRole.UserTypeEnum == UserTypeEnum.ProjectManager || t.UserRole.UserTypeEnum == UserTypeEnum.APM)
|
||||
.Select(t => new { t.UserRole.EMail, t.UserRole.FullName, t.UserRole.UserTypeEnum }).ToList();
|
||||
|
||||
|
@ -200,7 +200,7 @@ public class SiteSurveySPMSubmitedEventConsumer(
|
|||
/// 调研表驳回发送邮件 之前已有,需要迁移过来
|
||||
/// </summary>
|
||||
public class SiteSurverRejectedEventConsumer(
|
||||
IRepository<TrialUserRole> _trialUserRepository,
|
||||
IRepository<TrialUserRole> _trialUserRoleRepository,
|
||||
IRepository<Trial> _trialRepository,
|
||||
IRepository<TrialSite> _trialSiteRepository,
|
||||
IRepository<TrialSiteSurvey> _trialSiteSurveyRepository,
|
||||
|
@ -233,7 +233,7 @@ public class SiteSurverRejectedEventConsumer(
|
|||
|
||||
//name = user.FullName;
|
||||
|
||||
var sPMOrCPMList = _trialUserRepository.Where(t => t.TrialId == trialId)
|
||||
var sPMOrCPMList = _trialUserRoleRepository.Where(t => t.TrialId == trialId)
|
||||
.Where(t => t.UserRole.UserTypeEnum == UserTypeEnum.SPM || t.UserRole.UserTypeEnum == UserTypeEnum.CPM)
|
||||
.Select(t => new { t.UserRole.EMail, t.UserRole.FullName, t.UserRole.UserTypeEnum }).ToList();
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring
|
|||
IRepository<ReadingQuestionCriterionTrial> _trialReadingCriterionRepository,
|
||||
IRepository<VisitTask> _visitTaskRepository,
|
||||
IRepository<Dictionary> _dictionaryRepository,
|
||||
IRepository<TrialUserRole> _trialUserRepository,
|
||||
IRepository<TrialUserRole> _trialUserRoleRepository,
|
||||
IRepository<EmailNoticeConfig> _emailNoticeConfigrepository,
|
||||
IOptionsMonitor<SystemEmailSendConfig> systemEmailConfig) : IConsumer<UrgentIRUnReadTaskRecurringEvent>
|
||||
{
|
||||
|
@ -52,7 +52,7 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring
|
|||
|
||||
Expression<Func<VisitTask, bool>> comonTaskFilter = t => t.TrialId == trialId && t.TaskState == TaskState.Effect && t.ReadingTaskState != ReadingTaskState.HaveSigned && t.TaskAllocationState == TaskAllocationState.Allocated;
|
||||
|
||||
var trialUserList = _trialUserRepository.Where(t => t.TrialId == trialId).Select(t => new
|
||||
var trialUserList = _trialUserRoleRepository.Where(t => t.TrialId == trialId).Select(t => new
|
||||
{
|
||||
t.UserId,
|
||||
t.UserRole.FullName,
|
||||
|
|
|
@ -22,7 +22,7 @@ public static class OldRecurringEmailHelper
|
|||
public static async Task SendTrialEmailAsync(
|
||||
IRepository<TrialEmailNoticeConfig> _trialEmailNoticeConfigRepository,
|
||||
IRepository<Trial> _trialRepository,
|
||||
IRepository<TrialUserRole> _trialUserRepository,
|
||||
IRepository<TrialUserRole> _trialUserRoleRepository,
|
||||
IRepository<VisitTask> _visitTaskRepository,
|
||||
IRepository<TrialSiteUserRole> _trialSiteUserRoleRepository,
|
||||
|
||||
|
@ -59,7 +59,7 @@ public static class OldRecurringEmailHelper
|
|||
|
||||
var allUserTypeEnumList = toUserTypeEnumList.Union(copyUserTypeEnumList).Distinct().ToList();
|
||||
|
||||
var allUserList = await _trialUserRepository.Where(t => t.TrialId == trialId && allUserTypeEnumList.Contains(t.UserRole.UserTypeEnum)).Select(t => new { t.UserId, t.UserRole.EMail, t.UserRole.FullName, t.UserRole.UserTypeEnum }).ToListAsync();
|
||||
var allUserList = await _trialUserRoleRepository.Where(t => t.TrialId == trialId && allUserTypeEnumList.Contains(t.UserRole.UserTypeEnum)).Select(t => new { t.UserId, t.UserRole.EMail, t.UserRole.FullName, t.UserRole.UserTypeEnum }).ToListAsync();
|
||||
|
||||
|
||||
var toUserList = allUserList.Where(t => toUserTypeEnumList.Contains(t.UserTypeEnum))
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace IRaCIS.Core.Application.MassTransit.Consumer;
|
|||
|
||||
public class QCImageQuestionRecurringEventConsumer(IRepository<Trial> _trialRepository,
|
||||
IRepository<TrialEmailNoticeConfig> _trialEmailNoticeConfigRepository,
|
||||
IRepository<TrialUserRole> _trialUserRepository,
|
||||
IRepository<TrialUserRole> _trialUserRoleRepository,
|
||||
IRepository<VisitTask> _visitTaskRepository,
|
||||
IRepository<TrialSiteUserRole> _trialSiteUserRoleRepository,
|
||||
IOptionsMonitor<SystemEmailSendConfig> _SystemEmailSendConfig) : IConsumer<QCImageQuestionRecurringEvent>
|
||||
|
@ -37,7 +37,7 @@ public class QCImageQuestionRecurringEventConsumer(IRepository<Trial> _trialRepo
|
|||
var trialInfo = await _trialRepository.Where(t => t.Id == trialId).Select(t => new { t.ResearchProgramNo, t.ExperimentName, t.TrialCode, t.TrialStatusStr }).FirstNotNullAsync();
|
||||
|
||||
//找到 该项目的CRC 用户Id
|
||||
var userList = await _trialUserRepository.Where(t => t.TrialId == trialId).Where(t => t.UserRole.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Select(t => new { t.UserId, t.UserRole.FullName }).ToListAsync();
|
||||
var userList = await _trialUserRoleRepository.Where(t => t.TrialId == trialId).Where(t => t.UserRole.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).Select(t => new { t.UserId, t.UserRole.FullName }).ToListAsync();
|
||||
|
||||
//判断是否任务可以领取 ,可以的话 发送邮件
|
||||
|
||||
|
@ -73,7 +73,7 @@ public class QCImageQuestionRecurringEventConsumer(IRepository<Trial> _trialRepo
|
|||
await OldRecurringEmailHelper.SendTrialEmailAsync(
|
||||
_trialEmailNoticeConfigRepository,
|
||||
_trialRepository,
|
||||
_trialUserRepository,
|
||||
_trialUserRoleRepository,
|
||||
_visitTaskRepository,
|
||||
_trialSiteUserRoleRepository,
|
||||
trialId, EmailBusinessScenario.QCToCRCImageQuestion, topicAndHtmlFunc);
|
||||
|
@ -88,7 +88,7 @@ public class QCImageQuestionRecurringEventConsumer(IRepository<Trial> _trialRepo
|
|||
/// </summary>
|
||||
public class CRCImageQuestionRecurringEventConsumer(IRepository<Trial> _trialRepository,
|
||||
IRepository<TrialEmailNoticeConfig> _trialEmailNoticeConfigRepository,
|
||||
IRepository<TrialUserRole> _trialUserRepository,
|
||||
IRepository<TrialUserRole> _trialUserRoleRepository,
|
||||
IRepository<VisitTask> _visitTaskRepository,
|
||||
IRepository<TrialSiteUserRole> _trialSiteUserRoleRepository,
|
||||
IOptionsMonitor<SystemEmailSendConfig> _SystemEmailSendConfig) : IConsumer<CRCImageQuestionRecurringEvent>
|
||||
|
@ -101,7 +101,7 @@ public class CRCImageQuestionRecurringEventConsumer(IRepository<Trial> _trialRep
|
|||
var trialInfo = await _trialRepository.Where(t => t.Id == trialId).Select(t => new { t.ResearchProgramNo, t.ExperimentName, t.TrialCode, t.TrialStatusStr, t.DeclarationTypeEnumList }).FirstNotNullAsync();
|
||||
|
||||
//找到 该项目的IQC 用户Id
|
||||
var userList = await _trialUserRepository.Where(t => t.TrialId == trialId).Where(t => t.UserRole.UserTypeEnum == UserTypeEnum.IQC).Select(t => new { t.UserId, t.UserRole.FullName }).ToListAsync();
|
||||
var userList = await _trialUserRoleRepository.Where(t => t.TrialId == trialId).Where(t => t.UserRole.UserTypeEnum == UserTypeEnum.IQC).Select(t => new { t.UserId, t.UserRole.FullName }).ToListAsync();
|
||||
|
||||
//判断是否任务可以领取 ,可以的话 发送邮件
|
||||
|
||||
|
@ -141,7 +141,7 @@ public class CRCImageQuestionRecurringEventConsumer(IRepository<Trial> _trialRep
|
|||
|
||||
await OldRecurringEmailHelper.SendTrialEmailAsync(_trialEmailNoticeConfigRepository,
|
||||
_trialRepository,
|
||||
_trialUserRepository,
|
||||
_trialUserRoleRepository,
|
||||
_visitTaskRepository,
|
||||
_trialSiteUserRoleRepository,
|
||||
trialId, EmailBusinessScenario.CRCToQCQuestion, topicAndHtmlFunc);
|
||||
|
@ -155,7 +155,7 @@ public class CRCImageQuestionRecurringEventConsumer(IRepository<Trial> _trialRep
|
|||
/// </summary>
|
||||
public class ImageQCRecurringEventConsumer(IRepository<Trial> _trialRepository,
|
||||
IRepository<TrialEmailNoticeConfig> _trialEmailNoticeConfigRepository,
|
||||
IRepository<TrialUserRole> _trialUserRepository,
|
||||
IRepository<TrialUserRole> _trialUserRoleRepository,
|
||||
IRepository<VisitTask> _visitTaskRepository,
|
||||
IRepository<TrialSiteUserRole> _trialSiteUserRoleRepository,
|
||||
IOptionsMonitor<SystemEmailSendConfig> _SystemEmailSendConfig) : IConsumer<ImageQCRecurringEvent>
|
||||
|
@ -169,7 +169,7 @@ public class ImageQCRecurringEventConsumer(IRepository<Trial> _trialRepository,
|
|||
var trialInfo = await _trialRepository.Where(t => t.Id == trialId).Select(t => new { t.ResearchProgramNo, t.ExperimentName, t.TrialCode, t.TrialStatusStr }).FirstNotNullAsync();
|
||||
|
||||
//找到 该项目的IQC 用户Id
|
||||
var userList = await _trialUserRepository.Where(t => t.TrialId == trialId).Where(t => t.UserRole.UserTypeEnum == UserTypeEnum.IQC).Select(t => new { t.UserId, t.UserRole.FullName }).ToListAsync();
|
||||
var userList = await _trialUserRoleRepository.Where(t => t.TrialId == trialId).Where(t => t.UserRole.UserTypeEnum == UserTypeEnum.IQC).Select(t => new { t.UserId, t.UserRole.FullName }).ToListAsync();
|
||||
|
||||
//判断是否任务可以领取 ,可以的话 发送邮件
|
||||
var userIdList = userList.Select(t => t.UserId).ToList();
|
||||
|
@ -209,7 +209,7 @@ public class ImageQCRecurringEventConsumer(IRepository<Trial> _trialRepository,
|
|||
await OldRecurringEmailHelper.SendTrialEmailAsync(
|
||||
_trialEmailNoticeConfigRepository,
|
||||
_trialRepository,
|
||||
_trialUserRepository,
|
||||
_trialUserRoleRepository,
|
||||
_visitTaskRepository,
|
||||
_trialSiteUserRoleRepository,
|
||||
trialId, EmailBusinessScenario.QCTask, topicAndHtmlFunc);
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
/// </summary>
|
||||
[ApiExplorerSettings(GroupName = "Trial")]
|
||||
public class TaskMedicalReviewRuleService(IRepository<TaskMedicalReviewRule> _taskMedicalReviewRuleRepository,
|
||||
IRepository<TrialUserRole> _trialUserRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ITaskMedicalReviewRuleService
|
||||
IRepository<TrialUserRole> _trialUserRoleRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ITaskMedicalReviewRuleService
|
||||
{
|
||||
|
||||
|
||||
|
@ -29,7 +29,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
var taskTaskMedicalReviewRuleQueryable = _taskMedicalReviewRuleRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||
.ProjectTo<TaskMedicalReviewRuleView>(_mapper.ConfigurationProvider);
|
||||
|
||||
var isHaveMIM = await _trialUserRepository.AnyAsync(t => t.UserRole.UserTypeEnum == Domain.Share.UserTypeEnum.MIM && t.TrialId == inQuery.TrialId);
|
||||
var isHaveMIM = await _trialUserRoleRepository.AnyAsync(t => t.UserRole.UserTypeEnum == Domain.Share.UserTypeEnum.MIM && t.TrialId == inQuery.TrialId);
|
||||
|
||||
return (await taskTaskMedicalReviewRuleQueryable.ToListAsync(), new { IsHaveMIM = isHaveMIM });
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
/// </summary>
|
||||
[ApiExplorerSettings(GroupName = "Trial")]
|
||||
public class TaskMedicalReviewService(IRepository<TaskMedicalReview> _taskMedicalReviewRepository,
|
||||
IRepository<TrialUserRole> _trialUserRepository,
|
||||
IRepository<TrialUserRole> _trialUserRoleRepository,
|
||||
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
|
||||
IRepository<VisitTask> _visitTaskRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ITaskMedicalReviewService
|
||||
{
|
||||
|
@ -328,7 +328,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
[HttpGet("{trialId:guid}")]
|
||||
public async Task<List<UserSimpleInfo>> GetMIMUserList(Guid trialId)
|
||||
{
|
||||
var query = _trialUserRepository.Where(t => (t.UserRole.UserTypeEnum == Domain.Share.UserTypeEnum.MIM || t.UserRole.UserTypeEnum == Domain.Share.UserTypeEnum.MC) && t.TrialId == trialId).Select(t => t.UserRole).ProjectTo<UserSimpleInfo>(_mapper.ConfigurationProvider);
|
||||
var query = _trialUserRoleRepository.Where(t => (t.UserRole.UserTypeEnum == Domain.Share.UserTypeEnum.MIM || t.UserRole.UserTypeEnum == Domain.Share.UserTypeEnum.MC) && t.TrialId == trialId).Select(t => t.UserRole).ProjectTo<UserSimpleInfo>(_mapper.ConfigurationProvider);
|
||||
|
||||
return await query.ToListAsync();
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
{
|
||||
|
||||
[ApiExplorerSettings(GroupName = "Common")]
|
||||
public class ExcelExportService(IRepository<TrialUserRole> _trialUserRepository,
|
||||
public class ExcelExportService(IRepository<TrialUserRole> _trialUserRoleRepository,
|
||||
IRepository<VisitTask> _visitTaskRepository,
|
||||
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository,
|
||||
IRepository<SystemDocNeedConfirmedUserType> _systemDocNeedConfirmedUserTypeRepository,
|
||||
|
@ -348,7 +348,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
var trialInfo = (await _trialRepository.Where(t => t.Id == inQuery.TrialId).Select(t => new { t.TrialFinishedTime, t.TrialStatusStr }).FirstNotNullAsync());
|
||||
|
||||
var trialDocQuery = from trialDocumentNeedConfirmedUserType in _trialDocNeedConfirmedUserTypeRepository.Where(t => t.TrialDocument.TrialId == inQuery.TrialId)
|
||||
join trialUser in _trialUserRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||
join trialUser in _trialUserRoleRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||
.WhereIf(inQuery.UserId != null, t => t.UserId == inQuery.UserId)
|
||||
.WhereIf(inQuery.UserTypeId != null, t => t.UserRole.UserTypeId == inQuery.UserTypeId)
|
||||
on trialDocumentNeedConfirmedUserType.NeedConfirmUserTypeId equals trialUser.UserRole.UserTypeId
|
||||
|
@ -387,7 +387,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
|||
|
||||
var systemDocQuery = from needConfirmEdUserType in _systemDocNeedConfirmedUserTypeRepository.WhereIf(trialInfo.TrialFinishedTime != null, u => u.SystemDocument.CreateTime < trialInfo.TrialFinishedTime)
|
||||
|
||||
join trialUser in _trialUserRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||
join trialUser in _trialUserRoleRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||
.WhereIf(inQuery.UserId != null, t => t.UserId == inQuery.UserId)
|
||||
on needConfirmEdUserType.NeedConfirmUserTypeId equals trialUser.UserRole.UserTypeId
|
||||
join confirm in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = trialUser.UserId, SystemDocumentId = needConfirmEdUserType.SystemDocumentId } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
|
||||
|
|
|
@ -15,7 +15,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
public class EmailSendService(IRepository<TrialEmailNoticeConfig> _trialEmailNoticeConfigRepository,
|
||||
IRepository<Trial> _trialRepository,
|
||||
IRepository<TrialUserRole> _trialUserRepository,
|
||||
IRepository<TrialUserRole> _trialUserRoleRepository,
|
||||
IRepository<VisitTask> _visitTaskRepository,
|
||||
IRepository<TrialSiteUserRole> _trialSiteUserRoleRepository,
|
||||
IOptionsMonitor<SystemEmailSendConfig> _SystemEmailSendConfig, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, IEmailSendService
|
||||
|
@ -144,7 +144,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
var allUserTypeEnumList = toUserTypeEnumList.Union(copyUserTypeEnumList).Distinct().ToList();
|
||||
|
||||
var allUserList = await _trialUserRepository.Where(t => t.TrialId == trialId && allUserTypeEnumList.Contains(t.UserRole.UserTypeEnum)).Select(t => new { t.UserId, t.UserRole.EMail, t.UserRole.FullName, t.UserRole.UserTypeEnum }).ToListAsync();
|
||||
var allUserList = await _trialUserRoleRepository.Where(t => t.TrialId == trialId && allUserTypeEnumList.Contains(t.UserRole.UserTypeEnum)).Select(t => new { t.UserId, t.UserRole.EMail, t.UserRole.FullName, t.UserRole.UserTypeEnum }).ToListAsync();
|
||||
|
||||
|
||||
var toUserList = allUserList.Where(t => toUserTypeEnumList.Contains(t.UserTypeEnum))
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace IRaCIS.Core.Application.Services
|
|||
IRepository<SystemDocNeedConfirmedUserType> _systemDocNeedConfirmedUserTypeRepository,
|
||||
IRepository<TrialDocNeedConfirmedUserType> _trialDocNeedConfirmedUserTypeRepository,
|
||||
IRepository<SystemDocument> _systemDocumentRepository,
|
||||
IRepository<TrialUserRole> _trialUserRepository,
|
||||
IRepository<TrialUserRole> _trialUserRoleRepository,
|
||||
IRepository<TrialDocConfirmedUser> _trialDocConfirmedUserRepository,
|
||||
IRepository<ReadingQuestionCriterionTrial> _readingQuestionCriterionTrialRepository, IMapper _mapper, IUserInfo _userInfo, IStringLocalizer _localizer) : BaseService, ITrialDocumentService
|
||||
{
|
||||
|
@ -57,7 +57,7 @@ namespace IRaCIS.Core.Application.Services
|
|||
.WhereIf(inQuery.TrialId != null, t => t.TrialId == inQuery.TrialId)
|
||||
.Where(t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||
|
||||
join trialUser in _trialUserRepository.Where(t => t.UserId == _userInfo.UserRoleId) on trialDoc.TrialId equals trialUser.TrialId
|
||||
join trialUser in _trialUserRoleRepository.Where(t => t.UserId == _userInfo.UserRoleId) on trialDoc.TrialId equals trialUser.TrialId
|
||||
join confirm in _trialDocConfirmedUserRepository.Where() on
|
||||
new { trialUser.UserId, TrialDocumentId = trialDoc.Id } equals new { UserId = confirm.ConfirmUserId, confirm.TrialDocumentId } into cc
|
||||
|
||||
|
@ -223,7 +223,7 @@ namespace IRaCIS.Core.Application.Services
|
|||
.WhereIf(trialInfo.TrialFinishedTime != null, u => u.SystemDocument.CreateTime < trialInfo.TrialFinishedTime)
|
||||
.WhereIf(!_userInfo.IsAdmin, t => t.SystemDocument.IsDeleted == false || (t.SystemDocument.IsDeleted == true && t.SystemDocument.SystemDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.UserRoleId)))
|
||||
|
||||
join trialUser in _trialUserRepository.Where(t => t.TrialId == inQuery.TrialId && t.UserId == _userInfo.UserRoleId)
|
||||
join trialUser in _trialUserRoleRepository.Where(t => t.TrialId == inQuery.TrialId && t.UserId == _userInfo.UserRoleId)
|
||||
on needConfirmedUserType.NeedConfirmUserTypeId equals trialUser.UserRole.UserTypeId
|
||||
join confirm in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = trialUser.UserId, SystemDocumentId = needConfirmedUserType.SystemDocumentId } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
|
||||
from confirm in cc.DefaultIfEmpty()
|
||||
|
@ -257,7 +257,7 @@ namespace IRaCIS.Core.Application.Services
|
|||
.WhereIf(!_userInfo.IsAdmin, t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId))
|
||||
.WhereIf(!_userInfo.IsAdmin, t => t.IsDeleted == false || (t.IsDeleted == true && t.TrialDocConfirmedUserList.Any(t => t.ConfirmUserId == _userInfo.UserRoleId)))
|
||||
|
||||
join trialUser in _trialUserRepository.Where(t => t.TrialId == inQuery.TrialId && t.UserId == _userInfo.UserRoleId) on trialDoc.TrialId equals trialUser.TrialId
|
||||
join trialUser in _trialUserRoleRepository.Where(t => t.TrialId == inQuery.TrialId && t.UserId == _userInfo.UserRoleId) on trialDoc.TrialId equals trialUser.TrialId
|
||||
join confirm in _trialDocConfirmedUserRepository.Where(t => t.TrialDocument.TrialId == inQuery.TrialId) on
|
||||
new { trialUser.UserId, TrialDocumentId = trialDoc.Id } equals new { UserId = confirm.ConfirmUserId, confirm.TrialDocumentId } into cc
|
||||
from confirm in cc.DefaultIfEmpty()
|
||||
|
@ -356,7 +356,7 @@ namespace IRaCIS.Core.Application.Services
|
|||
|
||||
#region linq join 方式
|
||||
//var trialDocQuery = from trialDocumentNeedConfirmedUserType in _trialDocumentNeedConfirmedUserTypeRepository.Where(t => t.TrialDocument.TrialId == querySystemDocument.TrialId)
|
||||
// join trialUser in _trialUserRepository.Where(t => t.TrialId == querySystemDocument.TrialId)
|
||||
// join trialUser in _trialUserRoleRepository.Where(t => t.TrialId == querySystemDocument.TrialId)
|
||||
// .WhereIf(querySystemDocument.UserId != null, t => t.UserId == querySystemDocument.UserId)
|
||||
// on trialDocumentNeedConfirmedUserType.NeedConfirmUserTypeId equals trialUser.User.UserTypeId
|
||||
|
||||
|
@ -390,7 +390,7 @@ namespace IRaCIS.Core.Application.Services
|
|||
var trialInfo = (await _trialRepository.Where(t => t.Id == inQuery.TrialId, ignoreQueryFilters: true).Select(t => new { t.TrialFinishedTime, t.TrialStatusStr }).FirstNotNullAsync());
|
||||
|
||||
var trialDocQuery = from trialDocumentNeedConfirmedUserType in _trialDocNeedConfirmedUserTypeRepository.Where(t => t.TrialDocument.TrialId == inQuery.TrialId)
|
||||
join trialUser in _trialUserRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||
join trialUser in _trialUserRoleRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||
.WhereIf(inQuery.UserId != null, t => t.UserId == inQuery.UserId)
|
||||
.WhereIf(inQuery.UserTypeId != null, t => t.UserRole.UserTypeId == inQuery.UserTypeId)
|
||||
on trialDocumentNeedConfirmedUserType.NeedConfirmUserTypeId equals trialUser.UserRole.UserTypeId
|
||||
|
@ -429,7 +429,7 @@ namespace IRaCIS.Core.Application.Services
|
|||
|
||||
var systemDocQuery = from needConfirmEdUserType in _systemDocNeedConfirmedUserTypeRepository.WhereIf(trialInfo.TrialFinishedTime != null, u => u.SystemDocument.CreateTime < trialInfo.TrialFinishedTime)
|
||||
|
||||
join trialUser in _trialUserRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||
join trialUser in _trialUserRoleRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||
.WhereIf(inQuery.UserId != null, t => t.UserId == inQuery.UserId)
|
||||
on needConfirmEdUserType.NeedConfirmUserTypeId equals trialUser.UserRole.UserTypeId
|
||||
join confirm in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = trialUser.UserId, SystemDocumentId = needConfirmEdUserType.SystemDocumentId } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc
|
||||
|
@ -492,7 +492,7 @@ namespace IRaCIS.Core.Application.Services
|
|||
[HttpGet("{trialId:guid}")]
|
||||
public async Task<List<TrialUserDto>> GetTrialUserSelect(Guid trialId)
|
||||
{
|
||||
return await _trialUserRepository.Where(t => t.TrialId == trialId)
|
||||
return await _trialUserRoleRepository.Where(t => t.TrialId == trialId)
|
||||
.Select(t => new TrialUserDto() { UserId = t.UserId, RealName = t.UserRole.FullName, UserName = t.UserRole.UserName })
|
||||
.ToListAsync();
|
||||
}
|
||||
|
@ -774,7 +774,7 @@ namespace IRaCIS.Core.Application.Services
|
|||
[Obsolete]
|
||||
public List<TrialUserUnionDocumentView> GetTrialUserDocumentList(Guid trialId)
|
||||
{
|
||||
var query = _trialUserRepository.Where(t => t.TrialId == trialId)
|
||||
var query = _trialUserRoleRepository.Where(t => t.TrialId == trialId)
|
||||
.Select(t => new TrialUserUnionDocumentView()
|
||||
{
|
||||
UserId = t.UserId,
|
||||
|
@ -819,7 +819,7 @@ namespace IRaCIS.Core.Application.Services
|
|||
SignViewMinimumMinutes = t.SignViewMinimumMinutes,
|
||||
DocumentConfirmedUserCount = t.SystemDocConfirmedUserList.Count(),
|
||||
|
||||
//DocumentUserCount= _trialUserRepository.Where(tu=>tu.TrialId== querySystemDocument.TrialId).Count(u=>t.NeedConfirmedUserTypeList.Any(cc=>cc.NeedConfirmUserTypeId== u.User.UserTypeId ))
|
||||
//DocumentUserCount= _trialUserRoleRepository.Where(tu=>tu.TrialId== querySystemDocument.TrialId).Count(u=>t.NeedConfirmedUserTypeList.Any(cc=>cc.NeedConfirmUserTypeId== u.User.UserTypeId ))
|
||||
DocumentUserCount = t.NeedConfirmedUserTypeList.SelectMany(u => u.UserTypeRole.UserList.SelectMany(b => b.UserRoleTrials.Where(r => r.TrialId == inQuery.TrialId))).Count()
|
||||
});
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
IRepository<TaskMedicalReview> _taskMedicalReviewRepository,
|
||||
IRepository<ReadingGlobalTaskInfo> _readingGlobalTaskInfoRepository,
|
||||
IRepository<VisitTask> _visitTaskRepository,
|
||||
IRepository<TrialUserRole> _trialUserRepository,
|
||||
IRepository<TrialUserRole> _trialUserRoleRepository,
|
||||
IRepository<TrialEmailNoticeUser> _trialEmailNoticeUserRepository,
|
||||
IRepository<Subject> _subjectRepository,
|
||||
IRepository<ReadModule> _readModuleRepository,
|
||||
|
@ -300,7 +300,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
var answer = "否";
|
||||
var isNeedSend = true;
|
||||
var minUserIdList = _trialUserRepository.Where(t => t.UserRole.UserTypeEnum == Domain.Share.UserTypeEnum.MIM && t.TrialId == taskInfo.TrialId).Select(t => t.UserId).ToList();
|
||||
var minUserIdList = _trialUserRoleRepository.Where(t => t.UserRole.UserTypeEnum == Domain.Share.UserTypeEnum.MIM && t.TrialId == taskInfo.TrialId).Select(t => t.UserId).ToList();
|
||||
|
||||
|
||||
|
||||
|
@ -1199,7 +1199,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
public async Task<List<TrialUserType>> GetTrialUserTypeSelectList(Guid trialId)
|
||||
{
|
||||
|
||||
var query = _trialUserRepository.Where(t => t.TrialId == trialId, false, true).IgnoreQueryFilters().Select(t => t.UserRole.UserTypeRole).Distinct()
|
||||
var query = _trialUserRoleRepository.Where(t => t.TrialId == trialId, false, true).IgnoreQueryFilters().Select(t => t.UserRole.UserTypeRole).Distinct()
|
||||
|
||||
.ProjectTo<TrialUserType>(_mapper.ConfigurationProvider);
|
||||
|
||||
|
@ -1222,7 +1222,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
var userTypeList = trialEmailNoticeConfig.TrialEmailNoticeUserList.Select(t => t.UserType).ToList();
|
||||
|
||||
|
||||
var query = _trialUserRepository.Where(t => t.TrialId == trialId && userTypeList.Contains(t.UserRole.UserTypeEnum), false, true).IgnoreQueryFilters()
|
||||
var query = _trialUserRoleRepository.Where(t => t.TrialId == trialId && userTypeList.Contains(t.UserRole.UserTypeEnum), false, true).IgnoreQueryFilters()
|
||||
.Select(t => new TrialSelectUser()
|
||||
{
|
||||
UserId = t.UserId,
|
||||
|
@ -1525,7 +1525,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
#region 人员还未加入,可以先配置邮件 历史废弃
|
||||
|
||||
//var toUserList = await _trialUserRepository.Where(t => t.TrialId == config.TrialId)
|
||||
//var toUserList = await _trialUserRoleRepository.Where(t => t.TrialId == config.TrialId)
|
||||
// .WhereIf(config.ToUserTypeList != null, t => config.ToUserTypeList.Contains(t.User.UserTypeEnum))
|
||||
// .Select(t => new { t.User.EMail, t.User.FullName }).ToListAsync();
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
IRepository<TrialQCQuestionAnswer> _trialQCQuestionAnswerRepository,
|
||||
IRepository<TrialQCQuestion> _trialQCQuestionRepository,
|
||||
IRepository<DicomStudy> _dicomStudyRepository,
|
||||
IRepository<TrialUserRole> _trialUserRepository,
|
||||
IRepository<TrialUserRole> _trialUserRoleRepository,
|
||||
IRepository<DicomSeries> _dicomSeriesRepository,
|
||||
IRepository<NoneDicomStudy> _noneDicomStudyRepository,
|
||||
IRepository<QCChallenge> _qcChallengeRepository,
|
||||
|
@ -584,7 +584,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
public async Task<List<QCChanllengeCreatorDto>> GetQCChallengeCreatorList(Guid trialId)
|
||||
{
|
||||
|
||||
return await _trialUserRepository.Where(t => t.TrialId == trialId && t.UserRole.UserTypeEnum == UserTypeEnum.IQC).Select(t => new QCChanllengeCreatorDto()
|
||||
return await _trialUserRoleRepository.Where(t => t.TrialId == trialId && t.UserRole.UserTypeEnum == UserTypeEnum.IQC).Select(t => new QCChanllengeCreatorDto()
|
||||
{
|
||||
CreatorRealName = t.UserRole.FullName,
|
||||
Creator = t.UserRole.UserName,
|
||||
|
@ -601,7 +601,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
[HttpGet("{trialId:guid}")]
|
||||
public async Task<List<ParticipantDTO>> GetQCParticipantList(Guid trialId)
|
||||
{
|
||||
return await _trialUserRepository.Where(t => t.TrialId == trialId && (t.UserRole.UserTypeEnum == UserTypeEnum.IQC || t.UserRole.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator)).Select(t => new ParticipantDTO()
|
||||
return await _trialUserRoleRepository.Where(t => t.TrialId == trialId && (t.UserRole.UserTypeEnum == UserTypeEnum.IQC || t.UserRole.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator)).Select(t => new ParticipantDTO()
|
||||
{
|
||||
HandleUserRealName = t.UserRole.FullName,
|
||||
HandleUser = t.UserRole.UserName,
|
||||
|
|
|
@ -29,7 +29,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
IRepository<VisitTask> _visitTaskRepository,
|
||||
IRepository<SCPPatient> _scpPatientRepository,
|
||||
IRepository<SCPStudy> _scpStudyRepository,
|
||||
IRepository<TrialUserRole> _trialUserRepository,
|
||||
IRepository<TrialUserRole> _trialUserRoleRepository,
|
||||
IRepository<ReadModule> _readModuleRepository,
|
||||
IRepository<DicomInstance> _dicomInstanceRepository,
|
||||
IRepository<TrialQCQuestionAnswer> _trialQCQuestionAnswerRepository,
|
||||
|
@ -1513,7 +1513,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
|||
public async Task<IResponseOutput> QCPassedOrFailed(Guid trialId, Guid subjectVisitId, [FromRoute] AuditStateEnum auditState)
|
||||
{
|
||||
|
||||
if (!await _trialUserRepository.AnyAsync(t => t.TrialId == trialId && t.UserId == _userInfo.UserRoleId))
|
||||
if (!await _trialUserRoleRepository.AnyAsync(t => t.TrialId == trialId && t.UserId == _userInfo.UserRoleId))
|
||||
{
|
||||
//---您已经被移出项目,没有操作权限。
|
||||
return ResponseOutput.NotOk(_localizer["QCOperation_RemoveItem"]);
|
||||
|
|
|
@ -36,7 +36,7 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
IRepository<TrialSite> _trialSiteRepository,
|
||||
IRepository<Doctor> _doctorRepository,
|
||||
IRepository<VerificationCode> _verificationCodeRepository,
|
||||
IRepository<TrialUserRole> _trialUserRepository,
|
||||
IRepository<TrialUserRole> _trialUserRoleRepository,
|
||||
IRepository<TrialSiteUserRole> _trialSiteUserRoleRepository,
|
||||
IDistributedLockProvider _distributedLockProvider,
|
||||
ITokenService _tokenService,
|
||||
|
@ -950,17 +950,17 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
|
||||
//判断TrialUser中是否存在 不存在就插入
|
||||
|
||||
var findTrialUser = await _trialUserRepository.FirstOrDefaultAsync(t => t.TrialId == trialId && t.UserId == userId, true);
|
||||
var findTrialUser = await _trialUserRoleRepository.FirstOrDefaultAsync(t => t.TrialId == trialId && t.UserId == userId, true);
|
||||
if (findTrialUser == null)
|
||||
{
|
||||
await _trialUserRepository.AddAsync(new TrialUserRole() { TrialId = trialId, UserId = userId, JoinTime = DateTime.Now });
|
||||
await _trialUserRoleRepository.AddAsync(new TrialUserRole() { TrialId = trialId, UserId = userId, JoinTime = DateTime.Now });
|
||||
|
||||
await _mailVerificationService.SiteSurveyUserJoinEmail(trialId, userId, joinCommand.BaseUrl, joinCommand.RouteUrl);
|
||||
|
||||
}
|
||||
else if (findTrialUser.IsDeleted == true)
|
||||
{
|
||||
await _trialUserRepository.UpdatePartialFromQueryAsync(t => t.TrialId == trialId && t.UserId == userId, c => new TrialUserRole()
|
||||
await _trialUserRoleRepository.UpdatePartialFromQueryAsync(t => t.TrialId == trialId && t.UserId == userId, c => new TrialUserRole()
|
||||
{
|
||||
IsDeleted = false,
|
||||
DeletedTime = null,
|
||||
|
@ -1070,17 +1070,17 @@ namespace IRaCIS.Core.Application.Contracts
|
|||
var trialSiteId = item.TrialSiteId;
|
||||
|
||||
//判断是否加入到项目
|
||||
var findTrialUser = await _trialUserRepository.FirstOrDefaultAsync(t => t.TrialId == trialId && t.UserId == userId, true);
|
||||
var findTrialUser = await _trialUserRoleRepository.FirstOrDefaultAsync(t => t.TrialId == trialId && t.UserId == userId, true);
|
||||
if (findTrialUser == null)
|
||||
{
|
||||
await _trialUserRepository.AddAsync(new TrialUserRole() { TrialId = trialId, UserId = userId, JoinTime = DateTime.Now });
|
||||
await _trialUserRoleRepository.AddAsync(new TrialUserRole() { TrialId = trialId, UserId = userId, JoinTime = DateTime.Now });
|
||||
|
||||
await _mailVerificationService.SiteSurveyUserJoinEmail(trialId, userId, baseUrl, routeUrl);
|
||||
|
||||
}
|
||||
else if (findTrialUser.IsDeleted == true)
|
||||
{
|
||||
await _trialUserRepository.UpdatePartialFromQueryAsync(t => t.TrialId == trialId && t.UserId == userId, c => new TrialUserRole()
|
||||
await _trialUserRoleRepository.UpdatePartialFromQueryAsync(t => t.TrialId == trialId && t.UserId == userId, c => new TrialUserRole()
|
||||
{
|
||||
IsDeleted = false,
|
||||
DeletedTime = null,
|
||||
|
|
|
@ -1476,10 +1476,10 @@ namespace IRaCIS.Core.Application
|
|||
|
||||
[HttpPost]
|
||||
public async Task<IResponseOutput<List<TrialUserToBeDoneDto>>> GetTrialUserToBeDoneList(TrialUserToBeDoneQuery inQuery,
|
||||
[FromServices] IRepository<TrialUserRole> _trialUserRepository)
|
||||
[FromServices] IRepository<TrialUserRole> _trialUserRoleRepository)
|
||||
{
|
||||
|
||||
var query = _trialUserRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||
var query = _trialUserRoleRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||
.Select(t => new TrialUserToBeDoneDto()
|
||||
{
|
||||
UserName = t.UserRole.UserName,
|
||||
|
|
|
@ -23,7 +23,8 @@ namespace IRaCIS.Core.Application.Service
|
|||
public class TrialExternalUserService(IRepository<TrialExternalUser> _trialExternalUseRepository,
|
||||
IRepository<UserRole> _userRoleRepository,
|
||||
IRepository<IdentityUser> _identityUserRepository,
|
||||
IRepository<TrialUserRole> _trialUserRepository,
|
||||
IRepository<TrialUserRole> _trialUserRoleRepository,
|
||||
IRepository<TrialIdentityUser> _trialIdentityUserRepository,
|
||||
IRepository<Trial> _trialRepository,
|
||||
IRepository<UserType> _userTypeRepository,
|
||||
IMailVerificationService _mailVerificationService,
|
||||
|
@ -218,19 +219,18 @@ namespace IRaCIS.Core.Application.Service
|
|||
{
|
||||
var trialExternalUser = await _trialExternalUseRepository.FirstOrDefaultAsync(t => t.Id == trialExternalUserId);
|
||||
|
||||
if (await _trialUserRepository.AnyAsync(t => t.TrialId == trialExternalUser.TrialId && t.UserId == trialExternalUser.SystemUserId))
|
||||
if (await _trialIdentityUserRepository.AnyAsync(t => t.TrialId == trialExternalUser.TrialId && t.IdentityUserId == trialExternalUser.SystemUserId))
|
||||
{
|
||||
//---当前用户已参与到项目,不允许删除
|
||||
return ResponseOutput.NotOk(_localizer["TrialExternalUser_CannotDelete"]);
|
||||
}
|
||||
|
||||
|
||||
var success = await _trialExternalUseRepository.BatchDeleteNoTrackingAsync(t => t.Id == trialExternalUserId);
|
||||
|
||||
if (isSystemUser == false)
|
||||
{
|
||||
await _userRoleRepository.BatchDeleteNoTrackingAsync(t => t.Id == systemUserId);
|
||||
}
|
||||
//if (isSystemUser == false)
|
||||
//{
|
||||
// await _userRoleRepository.BatchDeleteNoTrackingAsync(t => t.Id == systemUserId);
|
||||
//}
|
||||
|
||||
return ResponseOutput.Result(success);
|
||||
}
|
||||
|
@ -253,10 +253,10 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
|
||||
//判断TrialUser中是否存在 不存在就插入 注意退出了,也不能再加进来
|
||||
if (!await _trialUserRepository.AnyAsync(t => t.TrialId == trialId && t.UserId == userId, true))
|
||||
if (!await _trialIdentityUserRepository.AnyAsync(t => t.TrialId == trialId && t.IdentityUserId == userId, true))
|
||||
{
|
||||
|
||||
await _trialUserRepository.AddAsync(new TrialUserRole() { TrialId = trialId, UserId = userId, JoinTime = DateTime.Now });
|
||||
await _trialUserRoleRepository.AddAsync(new TrialUserRole() { TrialId = trialId, UserId = userId, JoinTime = DateTime.Now });
|
||||
|
||||
await _userRoleRepository.BatchUpdateNoTrackingAsync(t => t.Id == userId, u => new UserRole() { Status = UserStateEnum.Enable });
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
[ApiExplorerSettings(GroupName = "Trial")]
|
||||
|
||||
public class TrialService(IRepository<Trial> _trialRepository,
|
||||
IRepository<TrialUserRole> _trialUserRepository,
|
||||
IRepository<TrialUserRole> _trialUserRoleRepository,
|
||||
IRepository<CRO> _croRepository,
|
||||
IRepository<EnrollDetail> _enrollDetailRepository,
|
||||
IRepository<Dictionary> _dictionaryRepository,
|
||||
|
@ -208,7 +208,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
//如果是PM, 则需要将该人员添加到 运维人员表
|
||||
//添加运维人员PM
|
||||
await _trialUserRepository.AddAsync(new TrialUserRole() { TrialId = trial.Id, UserId = _userInfo.UserRoleId, JoinTime = DateTime.Now });
|
||||
await _trialUserRoleRepository.AddAsync(new TrialUserRole() { TrialId = trial.Id, UserId = _userInfo.UserRoleId, JoinTime = DateTime.Now });
|
||||
|
||||
// 添加扩展信息表记录
|
||||
await _trialPaymentPriceRepository.AddAsync(new TrialPaymentPrice() { TrialId = trial.Id });
|
||||
|
|
|
@ -17,7 +17,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
IRepository<EnrollDetail> _enrollDetailRepository,
|
||||
IRepository<Workload> _workloadRepository,
|
||||
IRepository<UserRole> _userRoleRepository,
|
||||
IRepository<TrialUserRole> _trialUserRepository,
|
||||
IRepository<TrialUserRole> _trialUserRoleRepository,
|
||||
IRepository<ReadingQuestionCriterionTrial> _ReadingQuestionCriterionTrialRepository,
|
||||
|
||||
IRepository<TrialExperience> _trialExperienceRepository,
|
||||
|
@ -174,7 +174,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
|
||||
var trial = await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialId);
|
||||
|
||||
var hasSPMOrCPM = await _trialUserRepository.Where(t => t.TrialId == trialId).AnyAsync(t => t.UserRole.UserTypeEnum == UserTypeEnum.SPM || t.UserRole.UserTypeEnum == UserTypeEnum.CPM);
|
||||
var hasSPMOrCPM = await _trialUserRoleRepository.Where(t => t.TrialId == trialId).AnyAsync(t => t.UserRole.UserTypeEnum == UserTypeEnum.SPM || t.UserRole.UserTypeEnum == UserTypeEnum.CPM);
|
||||
|
||||
var isSPMjoin= trial.IsSPMJoinReviewerSelect && hasSPMOrCPM;
|
||||
|
||||
|
@ -354,7 +354,7 @@ namespace IRaCIS.Core.Application.Service
|
|||
//[Authorize(Policy = IRaCISPolicy.PM_APM_SPM_CPM_SMM_CMM)]
|
||||
[UnitOfWork]
|
||||
public async Task<IResponseOutput> ConfirmReviewer(ConfirmReviewerCommand confirmReviewerCommand,
|
||||
[FromServices] IRepository<TrialUserRole> _trialUserRepository,
|
||||
[FromServices] IRepository<TrialUserRole> _trialUserRoleRepository,
|
||||
[FromServices] IRepository<TaskAllocationRule> _taskAllocationRuleRepository)
|
||||
{
|
||||
//var trial = _trialRepository.FirstOrDefault(t => t.Id == trialId);
|
||||
|
@ -410,9 +410,9 @@ namespace IRaCIS.Core.Application.Service
|
|||
{
|
||||
var userId = await _mailVerificationService.DoctorJoinTrialEmail(trialId, intoGroupItem.DoctorId, confirmReviewerCommand.BaseUrl, confirmReviewerCommand.RouteUrl);
|
||||
|
||||
if (!await _trialUserRepository.AnyAsync(t => t.TrialId == trialId && t.UserId == userId, true))
|
||||
if (!await _trialUserRoleRepository.AnyAsync(t => t.TrialId == trialId && t.UserId == userId, true))
|
||||
{
|
||||
await _trialUserRepository.AddAsync(new TrialUserRole() { TrialId = trialId, UserId = userId, JoinTime = DateTime.Now });
|
||||
await _trialUserRoleRepository.AddAsync(new TrialUserRole() { TrialId = trialId, UserId = userId, JoinTime = DateTime.Now });
|
||||
}
|
||||
|
||||
await _enrollRepository.BatchUpdateNoTrackingAsync(t => t.Id == intoGroupItem.Id, u => new Enroll() { DoctorUserId = userId });
|
||||
|
|
Loading…
Reference in New Issue