Uat_Study
parent
4c0831e2c3
commit
3009fb422f
|
@ -140,7 +140,7 @@ namespace IRaCIS.Application.Services
|
||||||
|
|
||||||
//中心调研 登陆
|
//中心调研 登陆
|
||||||
public async Task AnolymousSendEmail(string researchProgramNo,string emailAddress, int verificationCode)
|
public async Task AnolymousSendEmail(string researchProgramNo,string emailAddress, int verificationCode)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
var messageToSend = new MimeMessage();
|
var messageToSend = new MimeMessage();
|
||||||
|
|
|
@ -157,8 +157,8 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
return ResponseOutput.NotOk("已有QC审核记录,不允许删除问题项");
|
return ResponseOutput.NotOk("已有QC审核记录,不允许删除问题项");
|
||||||
}
|
}
|
||||||
|
|
||||||
var success = await _trialQcQuestionRepository.BatchDeleteNoTrackingAsync(t => t.Id == trialQCQuestionConfigureId);
|
var success = await _trialQcQuestionRepository.DeleteFromQueryAsync(t => t.Id == trialQCQuestionConfigureId,true);
|
||||||
return ResponseOutput.Result(success);
|
return ResponseOutput.Result(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -355,9 +355,23 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
return ResponseOutput.NotOk("已锁定,不允许操作");
|
return ResponseOutput.NotOk("已锁定,不允许操作");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var entity = await _trialSiteSurveyRepository.InsertOrUpdateAsync(addOrEditTrialSiteSurvey, true);
|
|
||||||
|
|
||||||
return ResponseOutput.Ok(entity.Id.ToString());
|
|
||||||
|
if (addOrEditTrialSiteSurvey.Id == null)
|
||||||
|
{
|
||||||
|
var entity = _mapper.Map<TrialSiteSurvey>(addOrEditTrialSiteSurvey);
|
||||||
|
await _trialSiteSurveyRepository.AddAsync(entity, true);
|
||||||
|
return ResponseOutput.Ok(entity.Id.ToString());
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
var entity = await _trialSiteSurveyRepository.Where(t => t.Id == addOrEditTrialSiteSurvey.Id, true).Include(x=>x.ReviewerUser).Include(x=>x.PreliminaryUser).FirstOrDefaultAsync();
|
||||||
|
_mapper.Map(addOrEditTrialSiteSurvey, entity);
|
||||||
|
await _trialSiteSurveyRepository.SaveChangesAsync();
|
||||||
|
|
||||||
|
}
|
||||||
|
return ResponseOutput.Ok(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -801,12 +815,12 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
|
|
||||||
if (hasSPMOrCPM)
|
if (hasSPMOrCPM)
|
||||||
{
|
{
|
||||||
await _trialSiteSurveyRepository.BatchUpdateNoTrackingAsync(t => t.Id == trialSiteSurveyId && t.State == TrialSiteSurveyEnum.ToSubmit, u => new TrialSiteSurvey() { State = TrialSiteSurveyEnum.CRCSubmitted });
|
await _trialSiteSurveyRepository.UpdatePartialFromQueryAsync(t => t.Id == trialSiteSurveyId && t.State == TrialSiteSurveyEnum.ToSubmit, u => new TrialSiteSurvey() { State = TrialSiteSurveyEnum.CRCSubmitted });
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
await _trialSiteSurveyRepository.BatchUpdateNoTrackingAsync(t => t.Id == trialSiteSurveyId && t.State == TrialSiteSurveyEnum.ToSubmit, u => new TrialSiteSurvey() { State = TrialSiteSurveyEnum.SPMApproved });
|
await _trialSiteSurveyRepository.UpdatePartialFromQueryAsync(t => t.Id == trialSiteSurveyId && t.State == TrialSiteSurveyEnum.ToSubmit, u => new TrialSiteSurvey() { State = TrialSiteSurveyEnum.SPMApproved });
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -814,7 +828,7 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
else if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM)
|
else if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.SPM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.CPM)
|
||||||
{
|
{
|
||||||
|
|
||||||
await _trialSiteSurveyRepository.BatchUpdateNoTrackingAsync(t => t.Id == trialSiteSurveyId && t.State == TrialSiteSurveyEnum.CRCSubmitted, u => new TrialSiteSurvey() { State = TrialSiteSurveyEnum.SPMApproved, PreliminaryUserId = _userInfo.Id, PreliminaryTime = DateTime.Now });
|
await _trialSiteSurveyRepository.UpdatePartialFromQueryAsync(t => t.Id == trialSiteSurveyId && t.State == TrialSiteSurveyEnum.CRCSubmitted, u => new TrialSiteSurvey() { State = TrialSiteSurveyEnum.SPMApproved, PreliminaryUserId = _userInfo.Id, PreliminaryTime = DateTime.Now });
|
||||||
|
|
||||||
}
|
}
|
||||||
else if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager)
|
else if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.APM || _userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager)
|
||||||
|
@ -831,10 +845,10 @@ namespace IRaCIS.Core.Application.Contracts
|
||||||
|
|
||||||
await SendInviteEmail(new InviteEmailCommand() { TrialId = trialId, RouteUrl = siteSurvyeSubmit.RouteUrl, UserList = needGenerateList });
|
await SendInviteEmail(new InviteEmailCommand() { TrialId = trialId, RouteUrl = siteSurvyeSubmit.RouteUrl, UserList = needGenerateList });
|
||||||
|
|
||||||
await _trialSiteSurveyRepository.BatchUpdateNoTrackingAsync(t => t.Id == trialSiteSurveyId && t.State == TrialSiteSurveyEnum.SPMApproved, u => new TrialSiteSurvey() { State = TrialSiteSurveyEnum.PMCreatedAndLock, ReviewerUserId = _userInfo.Id, ReviewerTime = DateTime.Now });
|
await _trialSiteSurveyRepository.UpdatePartialFromQueryAsync(t => t.Id == trialSiteSurveyId && t.State == TrialSiteSurveyEnum.SPMApproved, u => new TrialSiteSurvey() { State = TrialSiteSurveyEnum.PMCreatedAndLock, ReviewerUserId = _userInfo.Id, ReviewerTime = DateTime.Now });
|
||||||
|
|
||||||
}
|
}
|
||||||
|
await _trialSiteSurveyRepository.SaveChangesAsync();
|
||||||
return ResponseOutput.Ok();
|
return ResponseOutput.Ok();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -161,7 +161,7 @@ namespace IRaCIS.Core.Application
|
||||||
throw new BusinessValidationFailedException("QC审核问题已被其他QC确认,不允许再次确认");
|
throw new BusinessValidationFailedException("QC审核问题已被其他QC确认,不允许再次确认");
|
||||||
}
|
}
|
||||||
|
|
||||||
await _trialRepository.UpdatePartialFromQueryAsync(t => t.Id == signConfirmDTO.TrialId, u => new Trial() { QCQuestionConfirmedTime = DateTime.Now, QCQuestionConfirmedUserId = _userInfo.Id, IsQCQuestionConfirmed = true });
|
await _trialRepository.UpdatePartialFromQueryAsync(t => t.Id == signConfirmDTO.TrialId, u => new Trial() { QCQuestionConfirmedTime = DateTime.Now, QCQuestionConfirmedUserId = _userInfo.Id, IsQCQuestionConfirmed = true },true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -80,6 +80,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
return new List<Type>()
|
return new List<Type>()
|
||||||
{
|
{
|
||||||
typeof(TrialUser),
|
typeof(TrialUser),
|
||||||
|
typeof(TrialSiteSurvey),
|
||||||
typeof(TrialSiteUser),
|
typeof(TrialSiteUser),
|
||||||
typeof(TrialSite)
|
typeof(TrialSite)
|
||||||
};
|
};
|
||||||
|
@ -173,7 +174,7 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// TrialDocument
|
// 项目文档
|
||||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TrialDocument)))
|
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TrialDocument)))
|
||||||
{
|
{
|
||||||
await InsertInspection<TrialDocument>(item, type);
|
await InsertInspection<TrialDocument>(item, type);
|
||||||
|
@ -202,6 +203,28 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 项目人员
|
||||||
|
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TrialUser)))
|
||||||
|
{
|
||||||
|
|
||||||
|
var entity = item.Entity as TrialUser;
|
||||||
|
var user = await _dbContext.Users.Include(x => x.UserTypeRole).FirstOrDefaultAsync(x => x.Id == entity.UserId);
|
||||||
|
await InsertInspection<TrialUser>(item, type, x => new DataInspection
|
||||||
|
{
|
||||||
|
TrialId = x.TrialId,
|
||||||
|
}, new
|
||||||
|
{
|
||||||
|
UserRealName = user.FullName,
|
||||||
|
UserName = user.UserName,
|
||||||
|
UserType = user.UserTypeRole.UserTypeShortName,
|
||||||
|
EMail = user.EMail,
|
||||||
|
Phone = user.Phone,
|
||||||
|
OrganizationName = user.OrganizationName,
|
||||||
|
State = entity.IsDeleted ? "退出" : "加入",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// 项目中心人员
|
// 项目中心人员
|
||||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TrialSiteUser)))
|
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TrialSiteUser)))
|
||||||
{
|
{
|
||||||
|
@ -229,7 +252,6 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
await InsertInspection<TrialSiteUser>(item, type, x => new DataInspection()
|
await InsertInspection<TrialSiteUser>(item, type, x => new DataInspection()
|
||||||
{
|
{
|
||||||
GeneralId = x.Id,
|
GeneralId = x.Id,
|
||||||
|
|
||||||
}, new
|
}, new
|
||||||
{
|
{
|
||||||
TrialSiteCode = entity.TrialSite.TrialSiteCode,
|
TrialSiteCode = entity.TrialSite.TrialSiteCode,
|
||||||
|
@ -248,29 +270,65 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
// 项目人员
|
|
||||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TrialUser)))
|
|
||||||
{
|
|
||||||
|
|
||||||
var entity = item.Entity as TrialUser;
|
|
||||||
var user =await _dbContext.Users.Include(x=>x.UserTypeRole).FirstOrDefaultAsync(x => x.Id == entity.UserId);
|
// 中心调研表
|
||||||
await InsertInspection<TrialUser>(item, type, x => new DataInspection
|
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TrialSiteSurvey)))
|
||||||
|
{
|
||||||
|
var entity = item.Entity as TrialSiteSurvey;
|
||||||
|
if (entity.TrialSite == null)
|
||||||
{
|
{
|
||||||
TrialId=x.TrialId,
|
entity.TrialSite = await _dbContext.TrialSite.Where(x => x.SiteId == entity.SiteId&&x.TrialId== entity.TrialId).FirstOrDefaultAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (entity.PreliminaryUser == null)
|
||||||
|
{
|
||||||
|
entity.PreliminaryUser = await _dbContext.User.Where(x => x.Id == entity.PreliminaryUserId).FirstOrDefaultAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (entity.ReviewerUser == null)
|
||||||
|
{
|
||||||
|
entity.ReviewerUser = await _dbContext.User.Where(x => x.Id == entity.ReviewerUserId).FirstOrDefaultAsync();
|
||||||
|
}
|
||||||
|
|
||||||
|
await InsertInspection<TrialSiteSurvey>(item, type, x => new DataInspection()
|
||||||
|
{
|
||||||
|
GeneralId = x.Id,
|
||||||
|
|
||||||
|
|
||||||
},new {
|
},new {
|
||||||
UserRealName= user.FullName,
|
TrialSiteCode = entity.TrialSite.TrialSiteCode,
|
||||||
UserName= user.UserName,
|
TrialSiteAliasName = entity.TrialSite.TrialSiteAliasName,
|
||||||
UserType= user.UserTypeRole.UserTypeShortName,
|
Phone= entity.Phone,
|
||||||
EMail= user.EMail,
|
Email=entity.Email,
|
||||||
Phone= user.Phone,
|
PreliminaryUser= entity.PreliminaryUser==null?"": entity.PreliminaryUser.LastName + " / " + entity.PreliminaryUser.FirstName,
|
||||||
OrganizationName= user.OrganizationName,
|
ReviewerUser = entity.ReviewerUser == null ? "" : entity.ReviewerUser.LastName + " / " + entity.ReviewerUser.FirstName,
|
||||||
State=entity.IsDeleted?"退出":"加入",
|
IsDeleted=entity.IsDeleted ? "是" : "否",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 项目问题
|
||||||
|
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(TrialQCQuestion)))
|
||||||
|
{
|
||||||
|
|
||||||
|
var entity = item.Entity as TrialQCQuestion;
|
||||||
|
var isQCQuestionConfirmed = await _dbContext.Trial.Where(x => x.Id == entity.TrialId).Select(x => x.IsQCQuestionConfirmed).FirstOrDefaultAsync();
|
||||||
|
var paretName = await _dbContext.TrialQCQuestionConfigure.Where(x => x.Id == entity.ParentId).Select(x => x.QuestionName).FirstOrDefaultAsync();
|
||||||
|
await InsertInspection<TrialQCQuestion>(item, type, x => new DataInspection()
|
||||||
|
{
|
||||||
|
GeneralId = x.Id,
|
||||||
|
},new {
|
||||||
|
QuestionName= entity.QuestionName,
|
||||||
|
Type= entity.Type,
|
||||||
|
TypeValue=entity.TypeValue,
|
||||||
|
ShowOrder=entity.ShowOrder,
|
||||||
|
IsRequired= entity.IsRequired,
|
||||||
|
ParentName= paretName,
|
||||||
|
ParentTriggerValue=entity.ParentTriggerValue,
|
||||||
|
IsEnable=entity.IsEnable,
|
||||||
|
IsQCQuestionConfirmed= isQCQuestionConfirmed,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
// 受试者
|
// 受试者
|
||||||
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(Subject)))
|
foreach (var item in entitys.Where(x => x.Entity.GetType() == typeof(Subject)))
|
||||||
|
@ -342,8 +400,6 @@ namespace IRaCIS.Core.Infra.EFCore.Common
|
||||||
}
|
}
|
||||||
|
|
||||||
// 非Dicom文件
|
// 非Dicom文件
|
||||||
//var noneDicomFile=
|
|
||||||
|
|
||||||
if (entitys.Any(x => x.Entity.GetType() == typeof(NoneDicomStudyFile)))
|
if (entitys.Any(x => x.Entity.GetType() == typeof(NoneDicomStudyFile)))
|
||||||
{
|
{
|
||||||
var noneDicomStudyfile = entitys.Where(x => x.Entity.GetType() == typeof(NoneDicomStudyFile)).Select(x => x.Entity).FirstOrDefault() as NoneDicomStudyFile;
|
var noneDicomStudyfile = entitys.Where(x => x.Entity.GetType() == typeof(NoneDicomStudyFile)).Select(x => x.Entity).FirstOrDefault() as NoneDicomStudyFile;
|
||||||
|
|
Loading…
Reference in New Issue