修改中心调研,引入hangfire
This commit is contained in:
@@ -705,6 +705,9 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
throw new BusinessValidationFailedException("当前调研表已废除,或者调研表状态已锁定,不允许操作");
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
var siteUserList = await _trialSiteUserSurveyRepository.Where(t => t.TrialSiteSurveyId == trialSiteSurveyId)
|
||||
.Where(t => !(t.IsHistoryUser && t.IsHistoryUserDeleted == true))
|
||||
.Select(t =>
|
||||
@@ -719,19 +722,25 @@ namespace IRaCIS.Core.Application.Contracts
|
||||
t.Email,
|
||||
}).ToListAsync();
|
||||
|
||||
var currentUserList = siteUserList.Where(t => t.TrialSiteSurveyId == trialSiteSurveyId).ToList();
|
||||
|
||||
|
||||
if (!currentUserList.Any(t => t.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator) ||
|
||||
!currentUserList.Any(t => t.UserTypeEnum == UserTypeEnum.SR))
|
||||
{
|
||||
throw new BusinessValidationFailedException("本次提交,生成账号必须要有CRC和SR");
|
||||
}
|
||||
|
||||
if(currentUserList.GroupBy(t=>new {t.UserTypeId,t.Email})
|
||||
.Any(g => g.Count() > 1))
|
||||
{
|
||||
throw new BusinessValidationFailedException("同一邮箱同一用户类型,生成账号的数据只允许存在一条!");
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.Undefined)
|
||||
{
|
||||
var currentUserList = siteUserList.Where(t => t.TrialSiteSurveyId == trialSiteSurveyId).ToList();
|
||||
|
||||
|
||||
|
||||
if (!currentUserList.Any(t => t.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator) ||
|
||||
!currentUserList.Any(t => t.UserTypeEnum == UserTypeEnum.SR))
|
||||
{
|
||||
throw new BusinessValidationFailedException("本次提交,生成账号必须要有CRC和SR");
|
||||
}
|
||||
|
||||
|
||||
await _trialSiteSurveyRepository.UpdatePartialFromQueryAsync(t => t.Id == trialSiteSurveyId && t.State == TrialSiteSurveyEnum.ToSubmit, u => new TrialSiteSurvey() { State = TrialSiteSurveyEnum.SPMApproved });
|
||||
|
||||
|
||||
Reference in New Issue
Block a user