修改查询
parent
c06681f379
commit
7853614d2d
|
@ -49,7 +49,7 @@ public class UserSiteSurveySubmitedEventConsumer(
|
||||||
|
|
||||||
var trialUserList = await _trialUserRoleRepository.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)
|
.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();
|
.Select(t => new { t.UserRole.FullName, t.UserRole.IdentityUser.EMail, t.UserRole.UserTypeEnum }).ToListAsync();
|
||||||
|
|
||||||
var sPMOrCPMList = trialUserList.Where(t => t.UserTypeEnum == UserTypeEnum.SPM || t.UserTypeEnum == UserTypeEnum.CPM).ToList();
|
var sPMOrCPMList = trialUserList.Where(t => t.UserTypeEnum == UserTypeEnum.SPM || t.UserTypeEnum == UserTypeEnum.CPM).ToList();
|
||||||
var pmAndAPMList = trialUserList.Where(t => t.UserTypeEnum == UserTypeEnum.ProjectManager || t.UserTypeEnum == UserTypeEnum.APM).ToList();
|
var pmAndAPMList = trialUserList.Where(t => t.UserTypeEnum == UserTypeEnum.ProjectManager || t.UserTypeEnum == UserTypeEnum.APM).ToList();
|
||||||
|
@ -147,7 +147,7 @@ public class SiteSurveySPMSubmitedEventConsumer(
|
||||||
|
|
||||||
var trialUserList = _trialUserRoleRepository.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)
|
.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();
|
.Select(t => new { t.UserRole.IdentityUser.EMail, t.UserRole.FullName, t.UserRole.UserTypeEnum }).ToList();
|
||||||
|
|
||||||
var sPMOrCPMList = trialUserList.Where(t => t.UserTypeEnum == UserTypeEnum.SPM || t.UserTypeEnum == UserTypeEnum.CPM).ToList();
|
var sPMOrCPMList = trialUserList.Where(t => t.UserTypeEnum == UserTypeEnum.SPM || t.UserTypeEnum == UserTypeEnum.CPM).ToList();
|
||||||
var pmAndAPMList = trialUserList.Where(t => t.UserTypeEnum == UserTypeEnum.ProjectManager || t.UserTypeEnum == UserTypeEnum.APM).ToList();
|
var pmAndAPMList = trialUserList.Where(t => t.UserTypeEnum == UserTypeEnum.ProjectManager || t.UserTypeEnum == UserTypeEnum.APM).ToList();
|
||||||
|
@ -235,7 +235,7 @@ public class SiteSurverRejectedEventConsumer(
|
||||||
|
|
||||||
var sPMOrCPMList = _trialUserRoleRepository.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)
|
.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();
|
.Select(t => new { t.UserRole.IdentityUser.EMail, t.UserRole.FullName, t.UserRole.UserTypeEnum }).ToList();
|
||||||
|
|
||||||
|
|
||||||
foreach (var user in sPMOrCPMList)
|
foreach (var user in sPMOrCPMList)
|
||||||
|
|
|
@ -56,8 +56,8 @@ namespace IRaCIS.Core.Application.MassTransit.Recurring
|
||||||
{
|
{
|
||||||
t.UserId,
|
t.UserId,
|
||||||
t.UserRole.FullName,
|
t.UserRole.FullName,
|
||||||
t.UserRole.EMail,
|
t.UserRole.IdentityUser.EMail,
|
||||||
t.UserRole.UserName,
|
t.UserRole.IdentityUser.UserName,
|
||||||
t.Trial.TrialCode,
|
t.Trial.TrialCode,
|
||||||
t.Trial.ResearchProgramNo
|
t.Trial.ResearchProgramNo
|
||||||
//TrialReadingCriterionList = t.Trial.TrialReadingCriterionList.Select(t => new { t.CriterionName, TrialReadingCriterionId = t.Id }).ToList()
|
//TrialReadingCriterionList = t.Trial.TrialReadingCriterionList.Select(t => new { t.CriterionName, TrialReadingCriterionId = t.Id }).ToList()
|
||||||
|
|
|
@ -59,7 +59,7 @@ public static class OldRecurringEmailHelper
|
||||||
|
|
||||||
var allUserTypeEnumList = toUserTypeEnumList.Union(copyUserTypeEnumList).Distinct().ToList();
|
var allUserTypeEnumList = toUserTypeEnumList.Union(copyUserTypeEnumList).Distinct().ToList();
|
||||||
|
|
||||||
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 allUserList = await _trialUserRoleRepository.Where(t => t.TrialId == trialId && allUserTypeEnumList.Contains(t.UserRole.UserTypeEnum)).Select(t => new { t.UserId, t.UserRole.IdentityUser.EMail, t.UserRole.FullName, t.UserRole.UserTypeEnum }).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
var toUserList = allUserList.Where(t => toUserTypeEnumList.Contains(t.UserTypeEnum))
|
var toUserList = allUserList.Where(t => toUserTypeEnumList.Contains(t.UserTypeEnum))
|
||||||
|
|
|
@ -73,7 +73,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
|
|
||||||
var list = await _trialUseRoleRepository.Where(t => t.TrialId == param.TrialId).IgnoreQueryFilters()
|
var list = await _trialUseRoleRepository.Where(t => t.TrialId == param.TrialId).IgnoreQueryFilters()
|
||||||
.WhereIf(param.UserTypeId != null, t => t.UserRole.UserTypeId == param.UserTypeId)
|
.WhereIf(param.UserTypeId != null, t => t.UserRole.UserTypeId == param.UserTypeId)
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(param.UserName), t => t.UserRole.UserName.Contains(param.UserName))
|
.WhereIf(!string.IsNullOrWhiteSpace(param.UserName), t => t.UserRole.IdentityUser.UserName.Contains(param.UserName))
|
||||||
|
|
||||||
.WhereIf(param.IsDeleted != null, t => t.IsDeleted == param.IsDeleted)
|
.WhereIf(param.IsDeleted != null, t => t.IsDeleted == param.IsDeleted)
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(param.OrganizationName),
|
.WhereIf(!string.IsNullOrWhiteSpace(param.OrganizationName),
|
||||||
|
@ -124,7 +124,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator,
|
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator,
|
||||||
t => t.UserId == _userInfo.UserRoleId)
|
t => t.UserId == _userInfo.UserRoleId)
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(param.UserKeyInfo), t => (t.UserRole.FullName).Contains(param.UserKeyInfo)
|
.WhereIf(!string.IsNullOrWhiteSpace(param.UserKeyInfo), t => (t.UserRole.FullName).Contains(param.UserKeyInfo)
|
||||||
|| t.UserRole.UserName.Contains(param.UserKeyInfo) || t.UserRole.EMail.Contains(param.UserKeyInfo))
|
|| t.UserRole.IdentityUser.UserName.Contains(param.UserKeyInfo) || t.UserRole.IdentityUser.EMail.Contains(param.UserKeyInfo))
|
||||||
|
|
||||||
.ProjectTo<SiteUserExportDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
.ProjectTo<SiteUserExportDTO>(_mapper.ConfigurationProvider).ToListAsync();
|
||||||
|
|
||||||
|
@ -225,7 +225,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.ExperimentName), o => o.ExperimentName.Contains(inQuery.ExperimentName))
|
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.ExperimentName), o => o.ExperimentName.Contains(inQuery.ExperimentName))
|
||||||
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.Admin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.OP, t => t.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId && t.IsDeleted == false) && t.IsDeleted == false)
|
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.Admin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.OP, t => t.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId && t.IsDeleted == false) && t.IsDeleted == false)
|
||||||
.WhereIf(inQuery.CriterionType != null, o => o.TrialReadingCriterionList.Any(t => t.CriterionType == inQuery.CriterionType && t.IsSigned && t.IsConfirm))
|
.WhereIf(inQuery.CriterionType != null, o => o.TrialReadingCriterionList.Any(t => t.CriterionType == inQuery.CriterionType && t.IsSigned && t.IsConfirm))
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.PM_EMail), o => o.TrialUserList.Any(t => t.UserRole.EMail.Contains(inQuery.PM_EMail) && (t.UserRole.UserTypeEnum == UserTypeEnum.ProjectManager || t.UserRole.UserTypeEnum == UserTypeEnum.APM)))
|
.WhereIf(!string.IsNullOrEmpty(inQuery.PM_EMail), o => o.TrialUserList.Any(t => t.UserRole.IdentityUser.EMail.Contains(inQuery.PM_EMail) && (t.UserRole.UserTypeEnum == UserTypeEnum.ProjectManager || t.UserRole.UserTypeEnum == UserTypeEnum.APM)))
|
||||||
.Select(t => new TrialToBeDoneDto()
|
.Select(t => new TrialToBeDoneDto()
|
||||||
{
|
{
|
||||||
TrialId = t.Id,
|
TrialId = t.Id,
|
||||||
|
@ -286,7 +286,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
|
|
||||||
IR_ReadingCriterionList = isIR ? t.TrialReadingCriterionList.Where(t => t.IsConfirm && t.IsSigned).OrderBy(t => t.CriterionName).Select(t => t.CriterionName).ToList() : null,
|
IR_ReadingCriterionList = isIR ? t.TrialReadingCriterionList.Where(t => t.IsConfirm && t.IsSigned).OrderBy(t => t.CriterionName).Select(t => t.CriterionName).ToList() : null,
|
||||||
|
|
||||||
IR_PMEmailList = isIR ? t.TrialUserList.Where(t => t.UserRole.UserTypeEnum == UserTypeEnum.ProjectManager || t.UserRole.UserTypeEnum == UserTypeEnum.APM).OrderBy(t => t.UserRole.EMail).Select(t => t.UserRole.EMail).ToList() : null,
|
IR_PMEmailList = isIR ? t.TrialUserList.Where(t => t.UserRole.UserTypeEnum == UserTypeEnum.ProjectManager || t.UserRole.UserTypeEnum == UserTypeEnum.APM).OrderBy(t => t.UserRole.IdentityUser.EMail).Select(t => t.UserRole.IdentityUser.EMail).ToList() : null,
|
||||||
|
|
||||||
IR_TotalReadCount = isIR ? t.VisitTaskList.Where(t => t.DoctorUserId == _userInfo.UserRoleId && t.TaskState == TaskState.Effect && t.ReadingTaskState == ReadingTaskState.HaveSigned).Count() : 0,
|
IR_TotalReadCount = isIR ? t.VisitTaskList.Where(t => t.DoctorUserId == _userInfo.UserRoleId && t.TaskState == TaskState.Effect && t.ReadingTaskState == ReadingTaskState.HaveSigned).Count() : 0,
|
||||||
|
|
||||||
|
@ -376,7 +376,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
//ConfirmUserId = confirm.ConfirmUserId,
|
//ConfirmUserId = confirm.ConfirmUserId,
|
||||||
ConfirmTime = confirm.ConfirmTime,
|
ConfirmTime = confirm.ConfirmTime,
|
||||||
RealName = trialUser.UserRole.FullName,
|
RealName = trialUser.UserRole.FullName,
|
||||||
UserName = trialUser.UserRole.UserName,
|
UserName = trialUser.UserRole.IdentityUser.UserName,
|
||||||
UserTypeId = trialUser.UserRole.UserTypeId,
|
UserTypeId = trialUser.UserRole.UserTypeId,
|
||||||
UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName,
|
UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName,
|
||||||
|
|
||||||
|
@ -410,7 +410,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
//ConfirmUserId = confirm.ConfirmUserId,
|
//ConfirmUserId = confirm.ConfirmUserId,
|
||||||
ConfirmTime = confirm.ConfirmTime,
|
ConfirmTime = confirm.ConfirmTime,
|
||||||
RealName = trialUser.UserRole.FullName,
|
RealName = trialUser.UserRole.FullName,
|
||||||
UserName = trialUser.UserRole.UserName,
|
UserName = trialUser.UserRole.IdentityUser.UserName,
|
||||||
UserTypeId = trialUser.UserRole.UserTypeId,
|
UserTypeId = trialUser.UserRole.UserTypeId,
|
||||||
UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName,
|
UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName,
|
||||||
|
|
||||||
|
@ -818,7 +818,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
.WhereIf(inQuery.SubjectVisitId != null, t => t.SubjectId == inQuery.SubjectVisitId)
|
.WhereIf(inQuery.SubjectVisitId != null, t => t.SubjectId == inQuery.SubjectVisitId)
|
||||||
.WhereIf(inQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == inQuery.TrialSiteId)
|
.WhereIf(inQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == inQuery.TrialSiteId)
|
||||||
.WhereIf(inQuery.IsDicom != null, t => t.IsDicom == inQuery.IsDicom)
|
.WhereIf(inQuery.IsDicom != null, t => t.IsDicom == inQuery.IsDicom)
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.Uploader), t => t.CreateUserRole.UserName.Contains(inQuery.Uploader))
|
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.Uploader), t => t.CreateUserRole.IdentityUser.UserName.Contains(inQuery.Uploader))
|
||||||
.WhereIf(inQuery.IsSuccess != null, t => t.IsSuccess == inQuery.IsSuccess)
|
.WhereIf(inQuery.IsSuccess != null, t => t.IsSuccess == inQuery.IsSuccess)
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.StudyCode), t => t.StudyCode.Contains(inQuery.StudyCode))
|
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.StudyCode), t => t.StudyCode.Contains(inQuery.StudyCode))
|
||||||
.Select(t => new UnionStudyMonitorExportDto()
|
.Select(t => new UnionStudyMonitorExportDto()
|
||||||
|
@ -835,7 +835,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
|
|
||||||
IsDicom = t.IsDicom,
|
IsDicom = t.IsDicom,
|
||||||
|
|
||||||
Uploader = t.CreateUserRole.UserName,
|
Uploader = t.CreateUserRole.IdentityUser.UserName,
|
||||||
|
|
||||||
IP = t.IP,
|
IP = t.IP,
|
||||||
|
|
||||||
|
@ -1233,7 +1233,7 @@ namespace IRaCIS.Core.Application.Service.Common
|
||||||
var query = _trialImageDownloadRepository.Where(t => t.TrialId == inQuery.TrialId)
|
var query = _trialImageDownloadRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||||
.WhereIf(inQuery.SubjectCode.IsNotNullOrEmpty(), t => t.SubjectCode.Contains(inQuery.SubjectCode))
|
.WhereIf(inQuery.SubjectCode.IsNotNullOrEmpty(), t => t.SubjectCode.Contains(inQuery.SubjectCode))
|
||||||
.WhereIf(inQuery.IP.IsNotNullOrEmpty(), t => t.IP.Contains(inQuery.IP))
|
.WhereIf(inQuery.IP.IsNotNullOrEmpty(), t => t.IP.Contains(inQuery.IP))
|
||||||
.WhereIf(inQuery.Name.IsNotNullOrEmpty(), t => t.CreateUserRole.UserName.Contains(inQuery.Name) || t.CreateUserRole.FullName.Contains(inQuery.Name))
|
.WhereIf(inQuery.Name.IsNotNullOrEmpty(), t => t.CreateUserRole.IdentityUser.UserName.Contains(inQuery.Name) || t.CreateUserRole.FullName.Contains(inQuery.Name))
|
||||||
.WhereIf(inQuery.ImageType != null, t => t.ImageType == inQuery.ImageType)
|
.WhereIf(inQuery.ImageType != null, t => t.ImageType == inQuery.ImageType)
|
||||||
.WhereIf(inQuery.UserType != null, t => t.CreateUserRole.UserTypeEnum == inQuery.UserType)
|
.WhereIf(inQuery.UserType != null, t => t.CreateUserRole.UserTypeEnum == inQuery.UserType)
|
||||||
.WhereIf(inQuery.IsSuccess != null, t => t.IsSuccess == inQuery.IsSuccess)
|
.WhereIf(inQuery.IsSuccess != null, t => t.IsSuccess == inQuery.IsSuccess)
|
||||||
|
|
|
@ -32,7 +32,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
Task SiteSurveyUserJoinEmail(Guid trialId, Guid userId, string baseUrl, string rootUrl);
|
Task SiteSurveyUserJoinEmail(Guid trialId, Guid userId, string baseUrl, string rootUrl);
|
||||||
|
|
||||||
Task ExternalUserJoinEmail(Guid trialId, Guid userId, string baseUrl, string rootUrl);
|
Task ExternalUserJoinEmail(Guid trialId, Guid userId,string userTypes, string baseUrl, string rootUrl);
|
||||||
|
|
||||||
Task<(Guid identityUserId, Guid userRoleId)> DoctorJoinTrialEmail(Guid trialId, Guid doctorId, string baseUrl, string rootUrl);
|
Task<(Guid identityUserId, Guid userRoleId)> DoctorJoinTrialEmail(Guid trialId, Guid doctorId, string baseUrl, string rootUrl);
|
||||||
|
|
||||||
|
@ -429,14 +429,12 @@ namespace IRaCIS.Core.Application.Service
|
||||||
}
|
}
|
||||||
|
|
||||||
//外部用户 加入项目
|
//外部用户 加入项目
|
||||||
public async Task ExternalUserJoinEmail(Guid trialId, Guid userId, string baseUrl, string rootUrl)
|
public async Task ExternalUserJoinEmail(Guid trialId, Guid userId, string userTypes, string baseUrl, string rootUrl)
|
||||||
{
|
{
|
||||||
var trialInfo = (await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialId)).IfNullThrowException();
|
var trialInfo = (await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialId)).IfNullThrowException();
|
||||||
|
|
||||||
var sysUserInfo = (await _identityUserRepository.Where(t => t.Id == userId).FirstOrDefaultAsync()).IfNullThrowException();
|
var sysUserInfo = (await _identityUserRepository.Where(t => t.Id == userId).FirstOrDefaultAsync()).IfNullThrowException();
|
||||||
|
|
||||||
var userTypes = await _userRoleRepository.Where(t => t.IdentityUserId == sysUserInfo.Id).Select(t => t.UserTypeRole.UserTypeShortName).ToListAsync();
|
|
||||||
|
|
||||||
var messageToSend = new MimeMessage();
|
var messageToSend = new MimeMessage();
|
||||||
//发件地址
|
//发件地址
|
||||||
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
|
messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail));
|
||||||
|
@ -473,7 +471,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
trialInfo.ResearchProgramNo,
|
trialInfo.ResearchProgramNo,
|
||||||
trialInfo.TrialCode,
|
trialInfo.TrialCode,
|
||||||
sysUserInfo.UserName,
|
sysUserInfo.UserName,
|
||||||
string.Join(',', userTypes),
|
userTypes,
|
||||||
sysUserInfo.IsFirstAdd ? redirectUrl : baseUrl
|
sysUserInfo.IsFirstAdd ? redirectUrl : baseUrl
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -100,7 +100,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
CreateMap<TrialImageDownload, TrialImageDownloadExportDto>()
|
CreateMap<TrialImageDownload, TrialImageDownloadExportDto>()
|
||||||
.ForMember(d => d.UserFullName, u => u.MapFrom(s => s.CreateUserRole.FullName))
|
.ForMember(d => d.UserFullName, u => u.MapFrom(s => s.CreateUserRole.FullName))
|
||||||
.ForMember(d => d.UserTypeEnum, u => u.MapFrom(s => s.CreateUserRole.UserTypeEnum))
|
.ForMember(d => d.UserTypeEnum, u => u.MapFrom(s => s.CreateUserRole.UserTypeEnum))
|
||||||
.ForMember(d => d.UserName, u => u.MapFrom(s => s.CreateUserRole.UserName))
|
.ForMember(d => d.UserName, u => u.MapFrom(s => s.CreateUserRole.IdentityUser.UserName))
|
||||||
.ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.Subject.TrialSite.TrialSiteCode));
|
.ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.Subject.TrialSite.TrialSiteCode));
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -120,7 +120,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
#region 医生基本信息
|
#region 医生基本信息
|
||||||
CreateMap<Doctor, SelectionReviewerDTO>()
|
CreateMap<Doctor, SelectionReviewerDTO>()
|
||||||
.ForMember(d => d.DoctorUserName, u => u.MapFrom(t => t.UserRole.UserName));
|
.ForMember(d => d.DoctorUserName, u => u.MapFrom(t => t.UserRole.IdentityUser.UserName));
|
||||||
CreateMap<Doctor, DoctorDTO>().IncludeMembers(t => t.Hospital).Include<Doctor, SelectionReviewerDTO>()
|
CreateMap<Doctor, DoctorDTO>().IncludeMembers(t => t.Hospital).Include<Doctor, SelectionReviewerDTO>()
|
||||||
.ForMember(d => d.AccountUserName, u => u.MapFrom(s => s.EnrollList.Where(t => t.DoctorUserId != null).Select(c => c.DoctorUser.UserName).FirstOrDefault()))
|
.ForMember(d => d.AccountUserName, u => u.MapFrom(s => s.EnrollList.Where(t => t.DoctorUserId != null).Select(c => c.DoctorUser.UserName).FirstOrDefault()))
|
||||||
.ForMember(d => d.Department, u => u.MapFrom(s => s.Department.Value))
|
.ForMember(d => d.Department, u => u.MapFrom(s => s.Department.Value))
|
||||||
|
@ -178,7 +178,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
CreateMap<EnrollDetail, DoctorStateModelDTO>()
|
CreateMap<EnrollDetail, DoctorStateModelDTO>()
|
||||||
.ForMember(d => d.IntoGroupState, u => u.MapFrom(s => s.EnrollStatus))
|
.ForMember(d => d.IntoGroupState, u => u.MapFrom(s => s.EnrollStatus))
|
||||||
.ForMember(d => d.OptTime, u => u.MapFrom(s => s.CreateTime))
|
.ForMember(d => d.OptTime, u => u.MapFrom(s => s.CreateTime))
|
||||||
.ForMember(d => d.OptUserName, u => u.MapFrom(s => s.CreateUserRole.UserName));
|
.ForMember(d => d.OptUserName, u => u.MapFrom(s => s.CreateUserRole.IdentityUser.UserName));
|
||||||
|
|
||||||
CreateMap<Enroll, ConfirmationReviewerDTO>().IncludeMembers(t => t.Doctor, t => t.Doctor.Hospital)
|
CreateMap<Enroll, ConfirmationReviewerDTO>().IncludeMembers(t => t.Doctor, t => t.Doctor.Hospital)
|
||||||
.ForMember(o => o.DictionaryList, t => t.MapFrom(u => u.Doctor.DoctorDicRelationList.Where(t => t.KeyName == StaticData.ReadingType || t.KeyName == StaticData.Subspeciality).Select(t => t.Dictionary).OrderBy(t => t.ShowOrder)))
|
.ForMember(o => o.DictionaryList, t => t.MapFrom(u => u.Doctor.DoctorDicRelationList.Where(t => t.KeyName == StaticData.ReadingType || t.KeyName == StaticData.Subspeciality).Select(t => t.Dictionary).OrderBy(t => t.ShowOrder)))
|
||||||
|
|
|
@ -144,7 +144,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
var allUserTypeEnumList = toUserTypeEnumList.Union(copyUserTypeEnumList).Distinct().ToList();
|
var allUserTypeEnumList = toUserTypeEnumList.Union(copyUserTypeEnumList).Distinct().ToList();
|
||||||
|
|
||||||
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 allUserList = await _trialUserRoleRepository.Where(t => t.TrialId == trialId && allUserTypeEnumList.Contains(t.UserRole.UserTypeEnum)).Select(t => new { t.UserId, t.UserRole.IdentityUser.EMail, t.UserRole.FullName, t.UserRole.UserTypeEnum }).ToListAsync();
|
||||||
|
|
||||||
|
|
||||||
var toUserList = allUserList.Where(t => toUserTypeEnumList.Contains(t.UserTypeEnum))
|
var toUserList = allUserList.Where(t => toUserTypeEnumList.Contains(t.UserTypeEnum))
|
||||||
|
|
|
@ -173,7 +173,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
|
|
||||||
ConfirmUserId = confirm.ConfirmUserId,
|
ConfirmUserId = confirm.ConfirmUserId,
|
||||||
ConfirmTime = confirm.ConfirmTime,
|
ConfirmTime = confirm.ConfirmTime,
|
||||||
RealName = user.LastName + " / " + user.FirstName,
|
RealName = user.FullName,
|
||||||
UserName = user.UserName,
|
UserName = user.UserName,
|
||||||
UserTypeId = user.UserTypeId,
|
UserTypeId = user.UserTypeId,
|
||||||
UserTypeShortName = user.UserTypeRole.UserTypeShortName
|
UserTypeShortName = user.UserTypeRole.UserTypeShortName
|
||||||
|
|
|
@ -83,7 +83,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
ConfirmUserId = confirm.ConfirmUserId,
|
ConfirmUserId = confirm.ConfirmUserId,
|
||||||
ConfirmTime = confirm.ConfirmTime,
|
ConfirmTime = confirm.ConfirmTime,
|
||||||
RealName = trialUser.UserRole.FullName,
|
RealName = trialUser.UserRole.FullName,
|
||||||
UserName = trialUser.UserRole.UserName,
|
UserName = trialUser.UserRole.IdentityUser.UserName,
|
||||||
UserTypeId = trialUser.UserRole.UserTypeId,
|
UserTypeId = trialUser.UserRole.UserTypeId,
|
||||||
UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName
|
UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName
|
||||||
|
|
||||||
|
@ -247,7 +247,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
ConfirmUserId = confirm.ConfirmUserId,
|
ConfirmUserId = confirm.ConfirmUserId,
|
||||||
ConfirmTime = confirm.ConfirmTime,
|
ConfirmTime = confirm.ConfirmTime,
|
||||||
RealName = trialUser.UserRole.FullName,
|
RealName = trialUser.UserRole.FullName,
|
||||||
UserName = trialUser.UserRole.UserName,
|
UserName = trialUser.UserRole.IdentityUser.UserName,
|
||||||
UserTypeId = trialUser.UserRole.UserTypeId,
|
UserTypeId = trialUser.UserRole.UserTypeId,
|
||||||
UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName
|
UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName
|
||||||
};
|
};
|
||||||
|
@ -279,7 +279,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
ConfirmUserId = confirm.ConfirmUserId,
|
ConfirmUserId = confirm.ConfirmUserId,
|
||||||
ConfirmTime = confirm.ConfirmTime,
|
ConfirmTime = confirm.ConfirmTime,
|
||||||
RealName = trialUser.UserRole.FullName,
|
RealName = trialUser.UserRole.FullName,
|
||||||
UserName = trialUser.UserRole.UserName,
|
UserName = trialUser.UserRole.IdentityUser.UserName,
|
||||||
UserTypeId = trialUser.UserRole.UserTypeId,
|
UserTypeId = trialUser.UserRole.UserTypeId,
|
||||||
UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName
|
UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName
|
||||||
|
|
||||||
|
@ -418,7 +418,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
ConfirmUserId = confirm.ConfirmUserId,
|
ConfirmUserId = confirm.ConfirmUserId,
|
||||||
ConfirmTime = confirm.ConfirmTime,
|
ConfirmTime = confirm.ConfirmTime,
|
||||||
RealName = trialUser.UserRole.FullName,
|
RealName = trialUser.UserRole.FullName,
|
||||||
UserName = trialUser.UserRole.UserName,
|
UserName = trialUser.UserRole.IdentityUser.UserName,
|
||||||
UserTypeId = trialUser.UserRole.UserTypeId,
|
UserTypeId = trialUser.UserRole.UserTypeId,
|
||||||
UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName,
|
UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName,
|
||||||
|
|
||||||
|
@ -452,7 +452,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
ConfirmUserId = confirm.ConfirmUserId,
|
ConfirmUserId = confirm.ConfirmUserId,
|
||||||
ConfirmTime = confirm.ConfirmTime,
|
ConfirmTime = confirm.ConfirmTime,
|
||||||
RealName = trialUser.UserRole.FullName,
|
RealName = trialUser.UserRole.FullName,
|
||||||
UserName = trialUser.UserRole.UserName,
|
UserName = trialUser.UserRole.IdentityUser.UserName,
|
||||||
UserTypeId = trialUser.UserRole.UserTypeId,
|
UserTypeId = trialUser.UserRole.UserTypeId,
|
||||||
UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName,
|
UserTypeShortName = trialUser.UserRole.UserTypeRole.UserTypeShortName,
|
||||||
|
|
||||||
|
@ -493,7 +493,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
public async Task<List<TrialUserDto>> GetTrialUserSelect(Guid trialId)
|
public async Task<List<TrialUserDto>> GetTrialUserSelect(Guid trialId)
|
||||||
{
|
{
|
||||||
return await _trialUserRoleRepository.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 })
|
.Select(t => new TrialUserDto() { UserId = t.UserId, RealName = t.UserRole.FullName, UserName = t.UserRole.IdentityUser.UserName })
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -778,7 +778,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
.Select(t => new TrialUserUnionDocumentView()
|
.Select(t => new TrialUserUnionDocumentView()
|
||||||
{
|
{
|
||||||
UserId = t.UserId,
|
UserId = t.UserId,
|
||||||
UserName = t.UserRole.UserName,
|
UserName = t.UserRole.IdentityUser.UserName,
|
||||||
RealName = t.UserRole.FullName,
|
RealName = t.UserRole.FullName,
|
||||||
UserTypeShortName = t.UserRole.UserTypeRole.UserTypeShortName,
|
UserTypeShortName = t.UserRole.UserTypeRole.UserTypeShortName,
|
||||||
TrialDocumentCount = t.Trial.TrialDocumentList.Count(u => u.NeedConfirmedUserTypeList.Any(k => k.NeedConfirmUserTypeId == t.UserRole.UserTypeId)),
|
TrialDocumentCount = t.Trial.TrialDocumentList.Count(u => u.NeedConfirmedUserTypeList.Any(k => k.NeedConfirmUserTypeId == t.UserRole.UserTypeId)),
|
||||||
|
|
|
@ -1226,7 +1226,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
.Select(t => new TrialSelectUser()
|
.Select(t => new TrialSelectUser()
|
||||||
{
|
{
|
||||||
UserId = t.UserId,
|
UserId = t.UserId,
|
||||||
UserName = t.UserRole.UserName,
|
UserName = t.UserRole.IdentityUser.UserName,
|
||||||
RealName = t.UserRole.FullName,
|
RealName = t.UserRole.FullName,
|
||||||
UserTypeEnum = t.UserRole.UserTypeEnum
|
UserTypeEnum = t.UserRole.UserTypeEnum
|
||||||
}).Distinct();
|
}).Distinct();
|
||||||
|
|
|
@ -1129,7 +1129,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
var query = _trialImageDownloadRepository.Where(t => t.TrialId == inQuery.TrialId)
|
var query = _trialImageDownloadRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||||
.WhereIf(inQuery.SubjectCode.IsNotNullOrEmpty(), t => t.SubjectCode.Contains(inQuery.SubjectCode))
|
.WhereIf(inQuery.SubjectCode.IsNotNullOrEmpty(), t => t.SubjectCode.Contains(inQuery.SubjectCode))
|
||||||
.WhereIf(inQuery.IP.IsNotNullOrEmpty(), t => t.IP.Contains(inQuery.IP))
|
.WhereIf(inQuery.IP.IsNotNullOrEmpty(), t => t.IP.Contains(inQuery.IP))
|
||||||
.WhereIf(inQuery.Name.IsNotNullOrEmpty(), t => t.CreateUserRole.UserName.Contains(inQuery.Name) || t.CreateUserRole.FullName.Contains(inQuery.Name))
|
.WhereIf(inQuery.Name.IsNotNullOrEmpty(), t => t.CreateUserRole.IdentityUser.UserName.Contains(inQuery.Name) || t.CreateUserRole.FullName.Contains(inQuery.Name))
|
||||||
.WhereIf(inQuery.ImageType != null, t => t.ImageType == inQuery.ImageType)
|
.WhereIf(inQuery.ImageType != null, t => t.ImageType == inQuery.ImageType)
|
||||||
.WhereIf(inQuery.UserType != null, t => t.CreateUserRole.UserTypeEnum == inQuery.UserType)
|
.WhereIf(inQuery.UserType != null, t => t.CreateUserRole.UserTypeEnum == inQuery.UserType)
|
||||||
.WhereIf(inQuery.IsSuccess != null, t => t.IsSuccess == inQuery.IsSuccess)
|
.WhereIf(inQuery.IsSuccess != null, t => t.IsSuccess == inQuery.IsSuccess)
|
||||||
|
|
|
@ -394,7 +394,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
|
|
||||||
TrialSiteCode = t.Subject.TrialSite.TrialSiteCode,
|
TrialSiteCode = t.Subject.TrialSite.TrialSiteCode,
|
||||||
|
|
||||||
Uploader = t.CreateUserRole.UserName,
|
Uploader = t.CreateUserRole.IdentityUser.UserName,
|
||||||
|
|
||||||
UploadTime = t.CreateTime
|
UploadTime = t.CreateTime
|
||||||
|
|
||||||
|
@ -444,7 +444,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
|
|
||||||
TrialSiteCode = t.Subject.TrialSite.TrialSiteCode,
|
TrialSiteCode = t.Subject.TrialSite.TrialSiteCode,
|
||||||
|
|
||||||
Uploader = t.CreateUserRole.UserName,
|
Uploader = t.CreateUserRole.IdentityUser.UserName,
|
||||||
|
|
||||||
UploadTime = t.CreateTime
|
UploadTime = t.CreateTime
|
||||||
|
|
||||||
|
@ -476,7 +476,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
.WhereIf(inQuery.SubjectVisitId != null, t => t.SubjectId == inQuery.SubjectVisitId)
|
.WhereIf(inQuery.SubjectVisitId != null, t => t.SubjectId == inQuery.SubjectVisitId)
|
||||||
.WhereIf(inQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == inQuery.TrialSiteId)
|
.WhereIf(inQuery.TrialSiteId != null, t => t.Subject.TrialSiteId == inQuery.TrialSiteId)
|
||||||
.WhereIf(inQuery.IsDicom != null, t => t.IsDicom == inQuery.IsDicom)
|
.WhereIf(inQuery.IsDicom != null, t => t.IsDicom == inQuery.IsDicom)
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.Uploader), t => t.CreateUserRole.UserName.Contains(inQuery.Uploader))
|
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.Uploader), t => t.CreateUserRole.IdentityUser.UserName.Contains(inQuery.Uploader))
|
||||||
.WhereIf(inQuery.IsSuccess != null, t => t.IsSuccess == inQuery.IsSuccess)
|
.WhereIf(inQuery.IsSuccess != null, t => t.IsSuccess == inQuery.IsSuccess)
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.StudyCode), t => t.StudyCode.Contains(inQuery.StudyCode))
|
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.StudyCode), t => t.StudyCode.Contains(inQuery.StudyCode))
|
||||||
.WhereIf(inQuery.UploadStartTime != null, t => t.UploadStartTime >= inQuery.UploadStartTime)
|
.WhereIf(inQuery.UploadStartTime != null, t => t.UploadStartTime >= inQuery.UploadStartTime)
|
||||||
|
@ -499,7 +499,7 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc
|
||||||
|
|
||||||
TrialSiteCode = t.Subject.TrialSite.TrialSiteCode,
|
TrialSiteCode = t.Subject.TrialSite.TrialSiteCode,
|
||||||
|
|
||||||
Uploader = t.CreateUserRole.UserName,
|
Uploader = t.CreateUserRole.IdentityUser.UserName,
|
||||||
|
|
||||||
UploadTime = t.CreateTime,
|
UploadTime = t.CreateTime,
|
||||||
|
|
||||||
|
|
|
@ -40,8 +40,8 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
CreateMap<DicomStudy, StudyDTO>().IncludeMembers(t => t.Subject, u => u.SubjectVisit)
|
CreateMap<DicomStudy, StudyDTO>().IncludeMembers(t => t.Subject, u => u.SubjectVisit)
|
||||||
.ForMember(d => d.SiteName, u => u.MapFrom(s => s.Subject.TrialSite.TrialSiteName))
|
.ForMember(d => d.SiteName, u => u.MapFrom(s => s.Subject.TrialSite.TrialSiteName))
|
||||||
.ForMember(d => d.UploaderFirstName, u => u.MapFrom(s => s.CreateUserRole.FirstName))
|
.ForMember(d => d.UploaderFirstName, u => u.MapFrom(s => s.CreateUserRole.IdentityUser.FirstName))
|
||||||
.ForMember(d => d.UploaderLastName, u => u.MapFrom(s => s.CreateUserRole.LastName))
|
.ForMember(d => d.UploaderLastName, u => u.MapFrom(s => s.CreateUserRole.IdentityUser.LastName))
|
||||||
.ForMember(d => d.UploadedTime, u => u.MapFrom(s => s.CreateTime));
|
.ForMember(d => d.UploadedTime, u => u.MapFrom(s => s.CreateTime));
|
||||||
|
|
||||||
CreateMap<Subject, StudyDTO>();
|
CreateMap<Subject, StudyDTO>();
|
||||||
|
@ -66,7 +66,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
CreateMap<DicomStudy, QAStudyInfoDTO>()
|
CreateMap<DicomStudy, QAStudyInfoDTO>()
|
||||||
.ForMember(o => o.IsCompleteClinicalData, t => t.MapFrom(u => !u.ReadingClinicalDataList.Any(x => x.ReadingClinicalDataPDFList.Count() == 0)))
|
.ForMember(o => o.IsCompleteClinicalData, t => t.MapFrom(u => !u.ReadingClinicalDataList.Any(x => x.ReadingClinicalDataPDFList.Count() == 0)))
|
||||||
.ForMember(o => o.UploadedTime, t => t.MapFrom(u => u.CreateTime))
|
.ForMember(o => o.UploadedTime, t => t.MapFrom(u => u.CreateTime))
|
||||||
.ForMember(o => o.Uploader, t => t.MapFrom(u => u.CreateUserRole.LastName + " / " + u.CreateUserRole.FirstName))
|
.ForMember(o => o.Uploader, t => t.MapFrom(u => u.CreateUserRole.IdentityUser.FullName))
|
||||||
.ForMember(o => o.StudyId, t => t.MapFrom(u => u.Id))
|
.ForMember(o => o.StudyId, t => t.MapFrom(u => u.Id))
|
||||||
.ForMember(o => o.IsHaveUploadFailed, t => t.MapFrom(u => u.DicomStudyMonitorList.Any(t => t.FailedFileCount > 0)))
|
.ForMember(o => o.IsHaveUploadFailed, t => t.MapFrom(u => u.DicomStudyMonitorList.Any(t => t.FailedFileCount > 0)))
|
||||||
.ForMember(o => o.Modalities, t => t.MapFrom(u => string.Join('、', u.SeriesList.Select(t => t.Modality).Distinct())));
|
.ForMember(o => o.Modalities, t => t.MapFrom(u => string.Join('、', u.SeriesList.Select(t => t.Modality).Distinct())));
|
||||||
|
@ -143,7 +143,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
CreateMap<TrialImageDownload, TrialImageDownloadView>()
|
CreateMap<TrialImageDownload, TrialImageDownloadView>()
|
||||||
.ForMember(d => d.UserFullName, u => u.MapFrom(s => s.CreateUserRole.FullName))
|
.ForMember(d => d.UserFullName, u => u.MapFrom(s => s.CreateUserRole.FullName))
|
||||||
.ForMember(d => d.UserTypeEnum, u => u.MapFrom(s => s.CreateUserRole.UserTypeEnum))
|
.ForMember(d => d.UserTypeEnum, u => u.MapFrom(s => s.CreateUserRole.UserTypeEnum))
|
||||||
.ForMember(d => d.UserName, u => u.MapFrom(s => s.CreateUserRole.UserName))
|
.ForMember(d => d.UserName, u => u.MapFrom(s => s.CreateUserRole.IdentityUser.UserName))
|
||||||
.ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.Subject.TrialSite.TrialSiteCode))
|
.ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.Subject.TrialSite.TrialSiteCode))
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
|
@ -63,7 +63,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
AccessToDialogueOutDto title = (await _qCChallengeRepository.Where(x => x.Id == inDto.Id).Include(x => x.CreateUserRole).Select(x => new AccessToDialogueOutDto()
|
AccessToDialogueOutDto title = (await _qCChallengeRepository.Where(x => x.Id == inDto.Id).Include(x => x.CreateUserRole).Select(x => new AccessToDialogueOutDto()
|
||||||
{
|
{
|
||||||
CreateTime = x.CreateTime,
|
CreateTime = x.CreateTime,
|
||||||
CreateUserName = x.CreateUserRole.UserName,
|
CreateUserName = x.CreateUserRole.IdentityUser.UserName,
|
||||||
TalkContent = x.Content,
|
TalkContent = x.Content,
|
||||||
IsTitle = true,
|
IsTitle = true,
|
||||||
}).FirstOrDefaultAsync()) ?? new AccessToDialogueOutDto();
|
}).FirstOrDefaultAsync()) ?? new AccessToDialogueOutDto();
|
||||||
|
@ -72,7 +72,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
x => new AccessToDialogueOutDto()
|
x => new AccessToDialogueOutDto()
|
||||||
{
|
{
|
||||||
CreateTime = x.CreateTime,
|
CreateTime = x.CreateTime,
|
||||||
CreateUserName = x.CreateUserRole.UserName,
|
CreateUserName = x.CreateUserRole.IdentityUser.UserName,
|
||||||
TalkContent = x.TalkContent
|
TalkContent = x.TalkContent
|
||||||
}
|
}
|
||||||
).OrderBy(x => x.CreateTime).ToListAsync();
|
).OrderBy(x => x.CreateTime).ToListAsync();
|
||||||
|
@ -85,7 +85,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
x => new AccessToDialogueOutDto()
|
x => new AccessToDialogueOutDto()
|
||||||
{
|
{
|
||||||
CreateTime = x.CreateTime,
|
CreateTime = x.CreateTime,
|
||||||
CreateUserName = x.CreateUserRole.UserName,
|
CreateUserName = x.CreateUserRole.IdentityUser.UserName,
|
||||||
TalkContent = x.TalkContent
|
TalkContent = x.TalkContent
|
||||||
}
|
}
|
||||||
).OrderBy(x => x.CreateTime).ToListAsync();
|
).OrderBy(x => x.CreateTime).ToListAsync();
|
||||||
|
|
|
@ -315,6 +315,8 @@ namespace IRaCIS.Application.Contracts
|
||||||
|
|
||||||
public string FullName { get; set; }
|
public string FullName { get; set; }
|
||||||
|
|
||||||
|
public DateTime? LastChangePassWordTime { get; set; }
|
||||||
|
|
||||||
public List<IdentityUserTypeDTO> UserRoleList { get; set; }
|
public List<IdentityUserTypeDTO> UserRoleList { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,7 +40,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
.WhereIf(inQuery.EndCreatime != null, t => t.CreateTime == inQuery.EndCreatime)
|
.WhereIf(inQuery.EndCreatime != null, t => t.CreateTime == inQuery.EndCreatime)
|
||||||
.WhereIf(inQuery.UserTypeEnum != null, t => t.CreateUserRole.UserTypeEnum == inQuery.UserTypeEnum)
|
.WhereIf(inQuery.UserTypeEnum != null, t => t.CreateUserRole.UserTypeEnum == inQuery.UserTypeEnum)
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.FeedBackUserKeyInfo), t => t.CreateUserRole.FullName.Contains(inQuery.FeedBackUserKeyInfo) || t.CreateUserRole.UserName.Contains(inQuery.FeedBackUserKeyInfo))
|
.WhereIf(!string.IsNullOrEmpty(inQuery.FeedBackUserKeyInfo), t => t.CreateUserRole.FullName.Contains(inQuery.FeedBackUserKeyInfo) || t.CreateUserRole.IdentityUser.UserName.Contains(inQuery.FeedBackUserKeyInfo))
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.QuestionDescription), t => t.QuestionDescription.Contains(inQuery.QuestionDescription))
|
.WhereIf(!string.IsNullOrEmpty(inQuery.QuestionDescription), t => t.QuestionDescription.Contains(inQuery.QuestionDescription))
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.TrialKeyInfo), t => t.Trial.ExperimentName.Contains(inQuery.TrialKeyInfo) || t.Trial.TrialCode.Contains(inQuery.TrialKeyInfo))
|
.WhereIf(!string.IsNullOrEmpty(inQuery.TrialKeyInfo), t => t.Trial.ExperimentName.Contains(inQuery.TrialKeyInfo) || t.Trial.TrialCode.Contains(inQuery.TrialKeyInfo))
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.SubejctAndVisitKeyInfo), t => t.Subject.Code.Contains(inQuery.SubejctAndVisitKeyInfo) || t.SubjectVisit.VisitName.Contains(inQuery.SubejctAndVisitKeyInfo))
|
.WhereIf(!string.IsNullOrEmpty(inQuery.SubejctAndVisitKeyInfo), t => t.Subject.Code.Contains(inQuery.SubejctAndVisitKeyInfo) || t.SubjectVisit.VisitName.Contains(inQuery.SubejctAndVisitKeyInfo))
|
||||||
|
|
|
@ -97,7 +97,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
var userId = Guid.Empty;
|
var userId = Guid.Empty;
|
||||||
CreateMap<SystemNotice, SystemNoticeView>()
|
CreateMap<SystemNotice, SystemNoticeView>()
|
||||||
.ForMember(t => t.PublishUserName, d => d.MapFrom(t => t.PublishedUser.UserName))
|
.ForMember(t => t.PublishUserName, d => d.MapFrom(t => t.PublishedUser.UserName))
|
||||||
.ForMember(t => t.CreateUserName, d => d.MapFrom(t => t.CreateUserRole.UserName))
|
.ForMember(t => t.CreateUserName, d => d.MapFrom(t => t.CreateUserRole.IdentityUser.UserName))
|
||||||
.ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path + "?access_token=" + token));
|
.ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path + "?access_token=" + token));
|
||||||
|
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
CreateMap<SystemNotice, SystemNoticeReadDTO>()
|
CreateMap<SystemNotice, SystemNoticeReadDTO>()
|
||||||
.ForMember(t => t.PublishUserName, d => d.MapFrom(t => t.PublishedUser.UserName))
|
.ForMember(t => t.PublishUserName, d => d.MapFrom(t => t.PublishedUser.UserName))
|
||||||
.ForMember(t => t.CreateUserName, d => d.MapFrom(t => t.CreateUserRole.UserName))
|
.ForMember(t => t.CreateUserName, d => d.MapFrom(t => t.CreateUserRole.IdentityUser.UserName))
|
||||||
.ForMember(t => t.IsRead, d => d.MapFrom(t => t.NoticeUserReadList.Any(t => t.CreateUserId == userId)))
|
.ForMember(t => t.IsRead, d => d.MapFrom(t => t.NoticeUserReadList.Any(t => t.CreateUserId == userId)))
|
||||||
.ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path + "?access_token=" + token));
|
.ForMember(d => d.FullFilePath, u => u.MapFrom(s => s.Path + "?access_token=" + token));
|
||||||
|
|
||||||
|
|
|
@ -587,7 +587,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||||
return await _trialUserRoleRepository.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,
|
CreatorRealName = t.UserRole.FullName,
|
||||||
Creator = t.UserRole.UserName,
|
Creator = t.UserRole.IdentityUser.UserName,
|
||||||
CreateUserId = t.UserId
|
CreateUserId = t.UserId
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
|
|
||||||
|
@ -604,7 +604,7 @@ namespace IRaCIS.Core.Application.Image.QA
|
||||||
return await _trialUserRoleRepository.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,
|
HandleUserRealName = t.UserRole.FullName,
|
||||||
HandleUser = t.UserRole.UserName,
|
HandleUser = t.UserRole.IdentityUser.UserName,
|
||||||
HandleUserId = t.UserId
|
HandleUserId = t.UserId
|
||||||
}).ToListAsync();
|
}).ToListAsync();
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
.ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.SubjectVisit.TrialSite.TrialSiteCode))
|
.ForMember(d => d.TrialSiteCode, u => u.MapFrom(s => s.SubjectVisit.TrialSite.TrialSiteCode))
|
||||||
.ForMember(d => d.VisitName, u => u.MapFrom(s => s.SubjectVisit.VisitName))
|
.ForMember(d => d.VisitName, u => u.MapFrom(s => s.SubjectVisit.VisitName))
|
||||||
|
|
||||||
.ForMember(d => d.CreateUserName, u => u.MapFrom(s => s.CreateUserRole.UserName))
|
.ForMember(d => d.CreateUserName, u => u.MapFrom(s => s.CreateUserRole.IdentityUser.UserName))
|
||||||
.ForMember(d => d.LatestReplyUserName, u => u.MapFrom(t => t.LatestReplyUser.UserName))
|
.ForMember(d => d.LatestReplyUserName, u => u.MapFrom(t => t.LatestReplyUser.UserName))
|
||||||
.ForMember(d => d.LatestReplyUserFullName, u => u.MapFrom(t => t.LatestReplyUser.FullName))
|
.ForMember(d => d.LatestReplyUserFullName, u => u.MapFrom(t => t.LatestReplyUser.FullName))
|
||||||
.ForMember(d => d.DialogList, u => u.MapFrom(t => t.DialogList))
|
.ForMember(d => d.DialogList, u => u.MapFrom(t => t.DialogList))
|
||||||
|
@ -554,7 +554,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
//一致性核查 质疑对话
|
//一致性核查 质疑对话
|
||||||
CreateMap<CheckChallengeDialog, CheckChanllengeDialogDTO>()
|
CreateMap<CheckChallengeDialog, CheckChanllengeDialogDTO>()
|
||||||
.ForMember(d => d.CreateUserName, u => u.MapFrom(t => t.CreateUserRole.UserName))
|
.ForMember(d => d.CreateUserName, u => u.MapFrom(t => t.CreateUserRole.IdentityUser.UserName))
|
||||||
.ForMember(d => d.CreateUserFullName, u => u.MapFrom(t => t.CreateUserRole.FullName));
|
.ForMember(d => d.CreateUserFullName, u => u.MapFrom(t => t.CreateUserRole.FullName));
|
||||||
|
|
||||||
CreateMap<SubjectVisit, CheckDialogDTO>()
|
CreateMap<SubjectVisit, CheckDialogDTO>()
|
||||||
|
@ -602,7 +602,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
//QC 质疑对话
|
//QC 质疑对话
|
||||||
var currentUserId = Guid.Empty;
|
var currentUserId = Guid.Empty;
|
||||||
CreateMap<QCChallengeDialog, QCChanllengeDialogDTO>()
|
CreateMap<QCChallengeDialog, QCChanllengeDialogDTO>()
|
||||||
.ForMember(d => d.CreateUserName, u => u.MapFrom(t => t.CreateUserRole.UserName))
|
.ForMember(d => d.CreateUserName, u => u.MapFrom(t => t.CreateUserRole.IdentityUser.UserName))
|
||||||
.ForMember(d => d.CreateUserFullName, u => u.MapFrom(t => t.CreateUserRole.FullName))
|
.ForMember(d => d.CreateUserFullName, u => u.MapFrom(t => t.CreateUserRole.FullName))
|
||||||
|
|
||||||
.ForMember(d => d.IsCurrentUser, u => u.MapFrom(s => s.CreateUserId == currentUserId));
|
.ForMember(d => d.IsCurrentUser, u => u.MapFrom(s => s.CreateUserId == currentUserId));
|
||||||
|
@ -666,7 +666,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
.ForMember(d => d.BlindName, u => u.MapFrom(s => s.SubjectVisit.BlindName))
|
.ForMember(d => d.BlindName, u => u.MapFrom(s => s.SubjectVisit.BlindName))
|
||||||
//.ForMember(d => d.ClosedUserUserName, u => u.MapFrom(s => s.ClosedUser.UserName))
|
//.ForMember(d => d.ClosedUserUserName, u => u.MapFrom(s => s.ClosedUser.UserName))
|
||||||
.ForMember(d => d.IsQCConfirmedReupload, u => u.MapFrom(s => s.SubjectVisit.IsQCConfirmedReupload))
|
.ForMember(d => d.IsQCConfirmedReupload, u => u.MapFrom(s => s.SubjectVisit.IsQCConfirmedReupload))
|
||||||
.ForMember(d => d.CreateUserName, u => u.MapFrom(s => s.CreateUserRole.UserName))
|
.ForMember(d => d.CreateUserName, u => u.MapFrom(s => s.CreateUserRole.IdentityUser.UserName))
|
||||||
.ForMember(d => d.LatestReplyUserName, u => u.MapFrom(t => t.LatestReplyUser.UserName))
|
.ForMember(d => d.LatestReplyUserName, u => u.MapFrom(t => t.LatestReplyUser.UserName))
|
||||||
.ForMember(d => d.LatestReplyUserFullName, u => u.MapFrom(t => t.LatestReplyUser.FullName))
|
.ForMember(d => d.LatestReplyUserFullName, u => u.MapFrom(t => t.LatestReplyUser.FullName))
|
||||||
|
|
||||||
|
|
|
@ -77,7 +77,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
medicalReviewInfo.ArmEnum = taskInfo.ArmEnum;
|
medicalReviewInfo.ArmEnum = taskInfo.ArmEnum;
|
||||||
medicalReviewInfo.SubjectCode = taskInfo.IsAnalysisCreate ? taskInfo.BlindSubjectCode : taskInfo.Subject.Code;
|
medicalReviewInfo.SubjectCode = taskInfo.IsAnalysisCreate ? taskInfo.BlindSubjectCode : taskInfo.Subject.Code;
|
||||||
medicalReviewInfo.TaskBlindName = taskInfo.TaskBlindName;
|
medicalReviewInfo.TaskBlindName = taskInfo.TaskBlindName;
|
||||||
medicalReviewInfo.ReadingUser = taskInfo.DoctorUser.FirstName + taskInfo.DoctorUser.LastName;
|
medicalReviewInfo.ReadingUser = taskInfo.DoctorUser.IdentityUser.FullName;
|
||||||
medicalReviewInfo.SubjectId = taskInfo.SubjectId;
|
medicalReviewInfo.SubjectId = taskInfo.SubjectId;
|
||||||
medicalReviewInfo.IsClosedDialog = medicalReviewInfo.MedicalReviewInfo.IsClosedDialog;
|
medicalReviewInfo.IsClosedDialog = medicalReviewInfo.MedicalReviewInfo.IsClosedDialog;
|
||||||
medicalReviewInfo.AuditState = medicalReviewInfo.MedicalReviewInfo.AuditState;
|
medicalReviewInfo.AuditState = medicalReviewInfo.MedicalReviewInfo.AuditState;
|
||||||
|
|
|
@ -860,7 +860,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
};
|
};
|
||||||
|
|
||||||
readModule.StakeholderIds = stakeholderIds.Distinct().ToList();
|
readModule.StakeholderIds = stakeholderIds.Distinct().ToList();
|
||||||
readModule.StakeholderNames = await _userRoleRepository.Where(x => readModule.StakeholderIds.Contains(x.Id)).Select(x => x.FirstName + "/" + x.LastName).ToListAsync();
|
readModule.StakeholderNames = await _userRoleRepository.Where(x => readModule.StakeholderIds.Contains(x.Id)).Select(x => x.IdentityUser.FullName).ToListAsync();
|
||||||
|
|
||||||
return readModule;
|
return readModule;
|
||||||
}
|
}
|
||||||
|
|
|
@ -389,7 +389,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
CreateMap<ReadingMedicalReviewDialog, GetMedicalReviewDialogOutDto>()
|
CreateMap<ReadingMedicalReviewDialog, GetMedicalReviewDialogOutDto>()
|
||||||
//.ForMember(x => x.FileList, y => y.MapFrom(n => n.FileList))
|
//.ForMember(x => x.FileList, y => y.MapFrom(n => n.FileList))
|
||||||
.ForMember(x => x.CreateUserName, y => y.MapFrom(n => n.CreateUserRole.UserName));
|
.ForMember(x => x.CreateUserName, y => y.MapFrom(n => n.CreateUserRole.IdentityUser.UserName));
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
@ -422,7 +422,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
CreateMap<DicomStudy, SelectStudyView>()
|
CreateMap<DicomStudy, SelectStudyView>()
|
||||||
.ForMember(o => o.UploadedTime, t => t.MapFrom(u => u.CreateTime))
|
.ForMember(o => o.UploadedTime, t => t.MapFrom(u => u.CreateTime))
|
||||||
.ForMember(o => o.Uploader, t => t.MapFrom(u => u.CreateUserRole.LastName + " / " + u.CreateUserRole.FirstName))
|
.ForMember(o => o.Uploader, t => t.MapFrom(u => u.CreateUserRole.IdentityUser.FullName))
|
||||||
.ForMember(o => o.StudyId, t => t.MapFrom(u => u.Id));
|
.ForMember(o => o.StudyId, t => t.MapFrom(u => u.Id));
|
||||||
|
|
||||||
CreateMap<VisitTask, HaveGeneratedTaskDto>()
|
CreateMap<VisitTask, HaveGeneratedTaskDto>()
|
||||||
|
|
|
@ -129,7 +129,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
{
|
{
|
||||||
// 这里是记录日志 不需要国际化
|
// 这里是记录日志 不需要国际化
|
||||||
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).Include(x => x.Trial).FirstNotNullAsync();
|
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).Include(x => x.Trial).FirstNotNullAsync();
|
||||||
var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.Subject).Include(x => x.DoctorUser).FirstNotNullAsync();
|
var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.Subject).Include(x => x.DoctorUser).ThenInclude(t => t.IdentityUser).FirstNotNullAsync();
|
||||||
|
|
||||||
//错误级别日志:项目、标准、受试者、阅片人、任务。输出其它既往新病灶数据:
|
//错误级别日志:项目、标准、受试者、阅片人、任务。输出其它既往新病灶数据:
|
||||||
|
|
||||||
|
@ -141,7 +141,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
builder.AppendLine($"【标准Id】:【{criterionInfo.Id}】");
|
builder.AppendLine($"【标准Id】:【{criterionInfo.Id}】");
|
||||||
builder.AppendLine($"【受试者】:【{taskInfo.Subject.ShortName}】");
|
builder.AppendLine($"【受试者】:【{taskInfo.Subject.ShortName}】");
|
||||||
builder.AppendLine($"【受试者Id】:【{taskInfo.Subject.Id}】");
|
builder.AppendLine($"【受试者Id】:【{taskInfo.Subject.Id}】");
|
||||||
builder.AppendLine($"【阅片人】:【{taskInfo.DoctorUser.FirstName}】");
|
builder.AppendLine($"【阅片人】:【{taskInfo.DoctorUser.IdentityUser.FullName}】");
|
||||||
builder.AppendLine($"【阅片人Id】:【{taskInfo.DoctorUser.Id}】");
|
builder.AppendLine($"【阅片人Id】:【{taskInfo.DoctorUser.Id}】");
|
||||||
builder.AppendLine($"【任务】:【{taskInfo.TaskBlindName}】");
|
builder.AppendLine($"【任务】:【{taskInfo.TaskBlindName}】");
|
||||||
builder.AppendLine($"【任务Id】:【{taskInfo.Id}】");
|
builder.AppendLine($"【任务Id】:【{taskInfo.Id}】");
|
||||||
|
|
|
@ -2698,7 +2698,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
//错误级别日志:项目、标准、受试者、阅片人、任务。输出新病灶数据:
|
//错误级别日志:项目、标准、受试者、阅片人、任务。输出新病灶数据:
|
||||||
// 这里是记录日志 不需要国际化
|
// 这里是记录日志 不需要国际化
|
||||||
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).Include(x => x.Trial).FirstNotNullAsync();
|
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).Include(x => x.Trial).FirstNotNullAsync();
|
||||||
var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.Subject).Include(x => x.DoctorUser).FirstNotNullAsync();
|
var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.Subject).Include(x => x.DoctorUser).ThenInclude(t => t.IdentityUser).FirstNotNullAsync();
|
||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
builder.AppendLine($"");
|
builder.AppendLine($"");
|
||||||
builder.AppendLine($"【项目】:【{criterionInfo.Trial.TrialCode}】");
|
builder.AppendLine($"【项目】:【{criterionInfo.Trial.TrialCode}】");
|
||||||
|
@ -2707,7 +2707,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
builder.AppendLine($"【标准Id】:【{criterionInfo.Id}】");
|
builder.AppendLine($"【标准Id】:【{criterionInfo.Id}】");
|
||||||
builder.AppendLine($"【受试者】:【{taskInfo.Subject.ShortName}】");
|
builder.AppendLine($"【受试者】:【{taskInfo.Subject.ShortName}】");
|
||||||
builder.AppendLine($"【受试者Id】:【{taskInfo.Subject.Id}】");
|
builder.AppendLine($"【受试者Id】:【{taskInfo.Subject.Id}】");
|
||||||
builder.AppendLine($"【阅片人】:【{taskInfo.DoctorUser.FirstName}】");
|
builder.AppendLine($"【阅片人】:【{taskInfo.DoctorUser.IdentityUser.FullName}】");
|
||||||
builder.AppendLine($"【阅片人Id】:【{taskInfo.DoctorUser.Id}】");
|
builder.AppendLine($"【阅片人Id】:【{taskInfo.DoctorUser.Id}】");
|
||||||
builder.AppendLine($"【任务】:【{taskInfo.TaskBlindName}】");
|
builder.AppendLine($"【任务】:【{taskInfo.TaskBlindName}】");
|
||||||
builder.AppendLine($"【任务Id】:【{taskInfo.Id}】");
|
builder.AppendLine($"【任务Id】:【{taskInfo.Id}】");
|
||||||
|
@ -3091,7 +3091,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
//错误级别日志:项目、标准、受试者、阅片人、任务。输出靶病灶、非靶病灶、新病灶的评估结果:
|
//错误级别日志:项目、标准、受试者、阅片人、任务。输出靶病灶、非靶病灶、新病灶的评估结果:
|
||||||
// 这里是记录日志 不需要国际化
|
// 这里是记录日志 不需要国际化
|
||||||
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).Include(x => x.Trial).FirstNotNullAsync();
|
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).Include(x => x.Trial).FirstNotNullAsync();
|
||||||
var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.Subject).Include(x => x.DoctorUser).FirstNotNullAsync();
|
var taskInfo = await _visitTaskRepository.Where(x => x.Id == inDto.VisitTaskId).Include(x => x.Subject).Include(x => x.DoctorUser).ThenInclude(t=>t.IdentityUser).FirstNotNullAsync();
|
||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
builder.AppendLine($"");
|
builder.AppendLine($"");
|
||||||
builder.AppendLine($"【项目】:【{criterionInfo.Trial.TrialCode}】");
|
builder.AppendLine($"【项目】:【{criterionInfo.Trial.TrialCode}】");
|
||||||
|
@ -3100,7 +3100,7 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate
|
||||||
builder.AppendLine($"【标准Id】:【{criterionInfo.Id}】");
|
builder.AppendLine($"【标准Id】:【{criterionInfo.Id}】");
|
||||||
builder.AppendLine($"【受试者】:【{taskInfo.Subject.ShortName}】");
|
builder.AppendLine($"【受试者】:【{taskInfo.Subject.ShortName}】");
|
||||||
builder.AppendLine($"【受试者Id】:【{taskInfo.Subject.Id}】");
|
builder.AppendLine($"【受试者Id】:【{taskInfo.Subject.Id}】");
|
||||||
builder.AppendLine($"【阅片人】:【{taskInfo.DoctorUser.FirstName}】");
|
builder.AppendLine($"【阅片人】:【{taskInfo.DoctorUser.IdentityUser.FullName}】");
|
||||||
builder.AppendLine($"【阅片人Id】:【{taskInfo.DoctorUser.Id}】");
|
builder.AppendLine($"【阅片人Id】:【{taskInfo.DoctorUser.Id}】");
|
||||||
builder.AppendLine($"【任务】:【{taskInfo.TaskBlindName}】");
|
builder.AppendLine($"【任务】:【{taskInfo.TaskBlindName}】");
|
||||||
builder.AppendLine($"【任务Id】:【{taskInfo.Id}】");
|
builder.AppendLine($"【任务Id】:【{taskInfo.Id}】");
|
||||||
|
|
|
@ -83,7 +83,7 @@ namespace IRaCIS.Core.Application.AutoMapper
|
||||||
CreateMap<TrialSiteUserSurveyView, UserRole>();
|
CreateMap<TrialSiteUserSurveyView, UserRole>();
|
||||||
|
|
||||||
|
|
||||||
CreateMap<UserRole, UserInfoBasic>().ForMember(d => d.RealName, u => u.MapFrom(s => s.LastName + " / " + s.FirstName));
|
CreateMap<UserRole, UserInfoBasic>().ForMember(d => d.RealName, u => u.MapFrom(s => s.IdentityUser.FullName));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -123,7 +123,7 @@ namespace IRaCIS.Core.Application.Service.Third_partyProject
|
||||||
|
|
||||||
TrialSiteCode = dicomStudy.Subject.TrialSite.TrialSiteCode,
|
TrialSiteCode = dicomStudy.Subject.TrialSite.TrialSiteCode,
|
||||||
|
|
||||||
Uploader = dicomStudy.CreateUserRole.UserName,
|
Uploader = dicomStudy.CreateUserRole.IdentityUser.UserName,
|
||||||
|
|
||||||
UploadTime = dicomStudy.CreateTime
|
UploadTime = dicomStudy.CreateTime
|
||||||
};
|
};
|
||||||
|
|
|
@ -1381,7 +1381,7 @@ namespace IRaCIS.Core.Application
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.ExperimentName), o => o.ExperimentName.Contains(inQuery.ExperimentName))
|
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.ExperimentName), o => o.ExperimentName.Contains(inQuery.ExperimentName))
|
||||||
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.Admin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.OP, t => t.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId && t.IsDeleted == false) && t.IsDeleted == false)
|
.WhereIf(_userInfo.UserTypeEnumInt != (int)UserTypeEnum.SuperAdmin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.Admin && _userInfo.UserTypeEnumInt != (int)UserTypeEnum.OP, t => t.TrialUserList.Any(t => t.UserId == _userInfo.UserRoleId && t.IsDeleted == false) && t.IsDeleted == false)
|
||||||
.WhereIf(inQuery.CriterionType != null, o => o.TrialReadingCriterionList.Any(t => t.CriterionType == inQuery.CriterionType && t.IsSigned && t.IsConfirm))
|
.WhereIf(inQuery.CriterionType != null, o => o.TrialReadingCriterionList.Any(t => t.CriterionType == inQuery.CriterionType && t.IsSigned && t.IsConfirm))
|
||||||
.WhereIf(!string.IsNullOrEmpty(inQuery.PM_EMail), o => o.TrialUserList.Any(t => t.UserRole.EMail.Contains(inQuery.PM_EMail) && (t.UserRole.UserTypeEnum == UserTypeEnum.ProjectManager || t.UserRole.UserTypeEnum == UserTypeEnum.APM)))
|
.WhereIf(!string.IsNullOrEmpty(inQuery.PM_EMail), o => o.TrialUserList.Any(t => t.UserRole.IdentityUser.EMail.Contains(inQuery.PM_EMail) && (t.UserRole.UserTypeEnum == UserTypeEnum.ProjectManager || t.UserRole.UserTypeEnum == UserTypeEnum.APM)))
|
||||||
.Select(t => new TrialToBeDoneDto()
|
.Select(t => new TrialToBeDoneDto()
|
||||||
{
|
{
|
||||||
TrialId = t.Id,
|
TrialId = t.Id,
|
||||||
|
@ -1442,7 +1442,7 @@ namespace IRaCIS.Core.Application
|
||||||
|
|
||||||
IR_ReadingCriterionList = isIR ? t.TrialReadingCriterionList.Where(t => t.IsConfirm && t.IsSigned).OrderBy(t => t.CriterionName).Select(t => t.CriterionName).ToList() : null,
|
IR_ReadingCriterionList = isIR ? t.TrialReadingCriterionList.Where(t => t.IsConfirm && t.IsSigned).OrderBy(t => t.CriterionName).Select(t => t.CriterionName).ToList() : null,
|
||||||
|
|
||||||
IR_PMEmailList = isIR ? t.TrialUserList.Where(t => t.UserRole.UserTypeEnum == UserTypeEnum.ProjectManager || t.UserRole.UserTypeEnum == UserTypeEnum.APM).OrderBy(t => t.UserRole.EMail).Select(t => t.UserRole.EMail).ToList() : null,
|
IR_PMEmailList = isIR ? t.TrialUserList.Where(t => t.UserRole.UserTypeEnum == UserTypeEnum.ProjectManager || t.UserRole.UserTypeEnum == UserTypeEnum.APM).OrderBy(t => t.UserRole.IdentityUser.EMail).Select(t => t.UserRole.IdentityUser.EMail).ToList() : null,
|
||||||
|
|
||||||
IR_TotalReadCount = isIR ? t.VisitTaskList.Where(t => t.DoctorUserId == _userInfo.UserRoleId && t.TaskState == TaskState.Effect && t.ReadingTaskState == ReadingTaskState.HaveSigned).Count() : 0,
|
IR_TotalReadCount = isIR ? t.VisitTaskList.Where(t => t.DoctorUserId == _userInfo.UserRoleId && t.TaskState == TaskState.Effect && t.ReadingTaskState == ReadingTaskState.HaveSigned).Count() : 0,
|
||||||
|
|
||||||
|
@ -1482,7 +1482,7 @@ namespace IRaCIS.Core.Application
|
||||||
var query = _trialUserRoleRepository.Where(t => t.TrialId == inQuery.TrialId)
|
var query = _trialUserRoleRepository.Where(t => t.TrialId == inQuery.TrialId)
|
||||||
.Select(t => new TrialUserToBeDoneDto()
|
.Select(t => new TrialUserToBeDoneDto()
|
||||||
{
|
{
|
||||||
UserName = t.UserRole.UserName,
|
UserName = t.UserRole.IdentityUser.UserName,
|
||||||
FullName = t.UserRole.FullName,
|
FullName = t.UserRole.FullName,
|
||||||
UserType = t.UserRole.UserTypeEnum,
|
UserType = t.UserRole.UserTypeEnum,
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@ using Medallion.Threading;
|
||||||
using Microsoft.AspNetCore.Mvc;
|
using Microsoft.AspNetCore.Mvc;
|
||||||
using DocumentFormat.OpenXml.Spreadsheet;
|
using DocumentFormat.OpenXml.Spreadsheet;
|
||||||
using IRaCIS.Core.Domain.Models;
|
using IRaCIS.Core.Domain.Models;
|
||||||
|
using IRaCIS.Application.Contracts;
|
||||||
|
|
||||||
namespace IRaCIS.Core.Application.Service
|
namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
|
@ -90,79 +91,24 @@ namespace IRaCIS.Core.Application.Service
|
||||||
return ResponseOutput.NotOk(_localizer["TrialExternalUser_EmailTypeDuplicate"]);
|
return ResponseOutput.NotOk(_localizer["TrialExternalUser_EmailTypeDuplicate"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
var addEntity = _mapper.Map<TrialExternalUser>(addOrEditTrialExternalUser);
|
var addEntity = _mapper.Map<TrialExternalUser>(addOrEditTrialExternalUser);
|
||||||
|
|
||||||
await _trialExternalUseRepository.AddAsync(addEntity);
|
await _trialExternalUseRepository.AddAsync(addEntity);
|
||||||
|
|
||||||
|
|
||||||
var trialType = await _trialRepository.Where(t => t.Id == addOrEditTrialExternalUser.TrialId).Select(t => t.TrialType).FirstOrDefaultAsync();
|
|
||||||
|
|
||||||
if (existSysUser != null)
|
if (existSysUser != null)
|
||||||
{
|
{
|
||||||
addEntity.IsSystemUser = true;
|
addEntity.IsSystemUser = true;
|
||||||
addEntity.SystemUserId = existSysUser.Id;
|
addEntity.SystemUserId = existSysUser.Id;
|
||||||
|
|
||||||
if (!existSysUser.UserRoleList.Any(t => t.UserTypeId == addOrEditTrialExternalUser.UserTypeId))
|
|
||||||
{
|
|
||||||
var addRole = _mapper.Map<UserRole>(existSysUser);
|
|
||||||
addRole.UserTypeEnum = _userTypeRepository.Where(t => t.Id == addOrEditTrialExternalUser.UserTypeId).Select(t => t.UserTypeEnum).First();
|
|
||||||
addRole.UserTypeId = addOrEditTrialExternalUser.UserTypeId;
|
|
||||||
addRole.IsUserRoleDisabled = true;
|
|
||||||
existSysUser.UserRoleList.Add(addRole);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
var trialType = await _trialRepository.Where(t => t.Id == addOrEditTrialExternalUser.TrialId).Select(t => t.TrialType).FirstOrDefaultAsync();
|
||||||
else
|
|
||||||
{
|
|
||||||
|
|
||||||
//生成账户 并插入
|
|
||||||
|
|
||||||
var generateUser = _mapper.Map<IdentityUser>(addOrEditTrialExternalUser);
|
|
||||||
|
|
||||||
if (trialType == TrialType.NoneOfficial)
|
|
||||||
{
|
|
||||||
generateUser.IsTestUser = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 外部人员生成账号 都是外部的
|
|
||||||
generateUser.IsZhiZhun = false;
|
|
||||||
|
|
||||||
generateUser.Code = _identityUserRepository.Select(t => t.Code).DefaultIfEmpty().Max() + 1;
|
|
||||||
|
|
||||||
|
|
||||||
generateUser.UserCode = AppSettings.GetCodeStr(generateUser.Code, nameof(IdentityUser));
|
|
||||||
|
|
||||||
generateUser.UserName = generateUser.UserCode;
|
|
||||||
|
|
||||||
|
|
||||||
generateUser.Password = MD5Helper.Md5(IRCEmailPasswordHelper.GenerateRandomPassword(10));
|
|
||||||
|
|
||||||
generateUser.Status = UserStateEnum.Disable;
|
|
||||||
|
|
||||||
var addRole = _mapper.Map<UserRole>(generateUser);
|
|
||||||
addRole.UserTypeEnum = _userTypeRepository.Where(t => t.Id == addOrEditTrialExternalUser.UserTypeId).Select(t => t.UserTypeEnum).First();
|
|
||||||
addRole.UserTypeId = addOrEditTrialExternalUser.UserTypeId;
|
|
||||||
|
|
||||||
generateUser.UserRoleList = new List<UserRole>() { addRole };
|
|
||||||
|
|
||||||
var newAddUser = await _identityUserRepository.AddAsync(generateUser);
|
|
||||||
|
|
||||||
addEntity.IsSystemUser = false;
|
|
||||||
addEntity.SystemUserId = newAddUser.Id;
|
|
||||||
|
|
||||||
|
|
||||||
existSysUser = newAddUser;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
#region 验证用户 能否加入
|
#region 验证用户 能否加入
|
||||||
|
|
||||||
if (trialType == TrialType.OfficialTrial || trialType == TrialType.Training)
|
if (trialType == TrialType.OfficialTrial || trialType == TrialType.Training)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (existSysUser.IsTestUser)
|
if (existSysUser != null && existSysUser.IsTestUser)
|
||||||
{
|
{
|
||||||
//---正式类型 、培训类型的项目 不允许加入测试用户
|
//---正式类型 、培训类型的项目 不允许加入测试用户
|
||||||
throw new BusinessValidationFailedException(_localizer["TrialExternalUser_TestUserNotAllowed"]);
|
throw new BusinessValidationFailedException(_localizer["TrialExternalUser_TestUserNotAllowed"]);
|
||||||
|
@ -173,7 +119,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
if (trialType == TrialType.NoneOfficial)
|
if (trialType == TrialType.NoneOfficial)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (existSysUser.IsTestUser == false)
|
if (existSysUser != null && existSysUser.IsTestUser == false)
|
||||||
{
|
{
|
||||||
//---测试项目 不允许加入正式用户
|
//---测试项目 不允许加入正式用户
|
||||||
throw new BusinessValidationFailedException(_localizer["TrialExternalUser_FormalUserNotAllowed"]);
|
throw new BusinessValidationFailedException(_localizer["TrialExternalUser_FormalUserNotAllowed"]);
|
||||||
|
@ -238,10 +184,6 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
var success = await _trialExternalUseRepository.BatchDeleteNoTrackingAsync(t => t.Id == trialExternalUserId);
|
var success = await _trialExternalUseRepository.BatchDeleteNoTrackingAsync(t => t.Id == trialExternalUserId);
|
||||||
|
|
||||||
//if (isSystemUser == false)
|
|
||||||
//{
|
|
||||||
// await _userRoleRepository.BatchDeleteNoTrackingAsync(t => t.Id == systemUserId);
|
|
||||||
//}
|
|
||||||
|
|
||||||
return ResponseOutput.Result(success);
|
return ResponseOutput.Result(success);
|
||||||
}
|
}
|
||||||
|
@ -256,53 +198,181 @@ namespace IRaCIS.Core.Application.Service
|
||||||
{
|
{
|
||||||
var trialId = sendEmail.TrialId;
|
var trialId = sendEmail.TrialId;
|
||||||
|
|
||||||
foreach (var userInfo in sendEmail.SendUsers)
|
var trialType = await _trialRepository.Where(t => t.Id == trialId).Select(t => t.TrialType).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
foreach (var item in sendEmail.SendUsers.GroupBy(t => t.Email))
|
||||||
{
|
{
|
||||||
var userId = userInfo.SystemUserId;
|
|
||||||
var userTypeId = userInfo.UserTypeId;
|
|
||||||
|
|
||||||
var findTrialUser = await _trialIdentityUserRepository.FirstOrDefaultAsync(t => t.TrialId == trialId && t.IdentityUserId == userId, true);
|
var userEmail = item.Key;
|
||||||
|
|
||||||
var findUserRoleId = await _identityUserRepository.Where(t => t.Id == userId, true).SelectMany(t => t.UserRoleList).Where(t => t.UserTypeId == userTypeId).Select(t => t.Id).FirstOrDefaultAsync();
|
var userTypeIdList = item.Select(t => t.UserTypeId).ToList();
|
||||||
|
|
||||||
if (findTrialUser == null || findUserRoleId == Guid.Empty)
|
var itemFirst = item.FirstOrDefault();
|
||||||
|
|
||||||
|
var externalIdList = item.Select(t => t.Id).ToList();
|
||||||
|
|
||||||
|
|
||||||
|
//var identityUserId = item.Key;
|
||||||
|
|
||||||
|
var existSysUser = await _identityUserRepository.Where(t => t.EMail == userEmail, true).Include(t => t.UserRoleList).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
if (existSysUser != null)
|
||||||
{
|
{
|
||||||
return ResponseOutput.NotOk("database dirty data ");
|
|
||||||
|
//账号状态设置为启用
|
||||||
|
existSysUser.Status = UserStateEnum.Enable;
|
||||||
|
|
||||||
|
foreach (var userTypeId in userTypeIdList)
|
||||||
|
{
|
||||||
|
var findRole = existSysUser.UserRoleList.FirstOrDefault(t => t.UserTypeId == userTypeId);
|
||||||
|
|
||||||
|
if (findRole != null)
|
||||||
|
{
|
||||||
|
//存在该角色,设置为启用
|
||||||
|
findRole.IsUserRoleDisabled = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var findTrialUserRole = await _trialUserRoleRepository.FirstOrDefaultAsync(t => t.TrialId == trialId && t.UserRole.IdentityUserId == userId && t.UserRole.UserTypeId == userTypeId, true);
|
//不存在该角色,那么就添加
|
||||||
|
var addRole = _mapper.Map<UserRole>(existSysUser);
|
||||||
|
addRole.UserTypeEnum = _userTypeRepository.Where(t => t.Id == userTypeId).Select(t => t.UserTypeEnum).First();
|
||||||
|
addRole.UserTypeId = userTypeId;
|
||||||
|
addRole.IsUserRoleDisabled = false;
|
||||||
|
existSysUser.UserRoleList.Add(addRole);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
//防止已经生成账号的信息与外部人员信息不一致 在此默认批量更一下
|
||||||
|
|
||||||
|
await _trialExternalUseRepository.BatchUpdateNoTrackingAsync(t => externalIdList.Contains(t.Id), u => new TrialExternalUser()
|
||||||
|
{
|
||||||
|
FirstName = existSysUser.FirstName,
|
||||||
|
LastName = existSysUser.LastName,
|
||||||
|
Phone = existSysUser.Phone,
|
||||||
|
OrganizationName = existSysUser.OrganizationName
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
|
||||||
|
//生成账户 并插入
|
||||||
|
var externalUser = _trialExternalUseRepository.FirstOrDefaultAsync(t => t.Id == itemFirst.Id);
|
||||||
|
var generateUser = _mapper.Map<IdentityUser>(externalUser);
|
||||||
|
|
||||||
|
if (trialType == TrialType.NoneOfficial)
|
||||||
|
{
|
||||||
|
generateUser.IsTestUser = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 外部人员生成账号 都是外部的
|
||||||
|
generateUser.IsZhiZhun = false;
|
||||||
|
|
||||||
|
generateUser.Code = _identityUserRepository.Select(t => t.Code).DefaultIfEmpty().Max() + 1;
|
||||||
|
|
||||||
|
|
||||||
|
generateUser.UserCode = AppSettings.GetCodeStr(generateUser.Code, nameof(IdentityUser));
|
||||||
|
|
||||||
|
generateUser.UserName = generateUser.UserCode;
|
||||||
|
|
||||||
|
|
||||||
|
generateUser.Password = MD5Helper.Md5(IRCEmailPasswordHelper.GenerateRandomPassword(10));
|
||||||
|
|
||||||
|
generateUser.Status = UserStateEnum.Disable;
|
||||||
|
|
||||||
|
generateUser.UserRoleList = new List<UserRole>() { };
|
||||||
|
|
||||||
|
foreach (var userTypeId in userTypeIdList)
|
||||||
|
{
|
||||||
|
var addRole = _mapper.Map<UserRole>(generateUser);
|
||||||
|
|
||||||
|
addRole.UserTypeEnum = _userTypeRepository.Where(t => t.Id == userTypeId).Select(t => t.UserTypeEnum).First();
|
||||||
|
|
||||||
|
addRole.UserTypeId = userTypeId;
|
||||||
|
|
||||||
|
generateUser.UserRoleList.Add(addRole);
|
||||||
|
}
|
||||||
|
|
||||||
|
var newAddUser = await _identityUserRepository.AddAsync(generateUser);
|
||||||
|
|
||||||
|
await _trialExternalUseRepository.BatchUpdateNoTrackingAsync(t => externalIdList.Contains(t.Id), u => new TrialExternalUser() { IsSystemUser = false, SystemUserId = newAddUser.Id });
|
||||||
|
|
||||||
|
existSysUser = newAddUser;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
await _identityUserRepository.SaveChangesAsync();
|
||||||
|
|
||||||
|
|
||||||
|
var identityUserId = existSysUser.Id;
|
||||||
|
|
||||||
|
|
||||||
|
var userTypeList = await _identityUserRepository.Where(t => t.Id == identityUserId).SelectMany(t => t.UserRoleList).Select(t => new { t.UserTypeId, t.UserTypeRole.UserTypeShortName }).ToListAsync();
|
||||||
|
|
||||||
|
var userHaveUserTypeIdList = userTypeList.Select(t => t.UserTypeId).ToList();
|
||||||
|
|
||||||
|
if (userTypeIdList.Except(userHaveUserTypeIdList).Any())
|
||||||
|
{
|
||||||
|
return ResponseOutput.NotOk("database dirty data ");
|
||||||
|
}
|
||||||
|
|
||||||
|
var findTrialUser = await _trialIdentityUserRepository.Where(t => t.TrialId == trialId && t.IdentityUserId == identityUserId, true).Include(t => t.TrialUserRoleList).FirstOrDefaultAsync();
|
||||||
|
|
||||||
|
if (findTrialUser == null)
|
||||||
|
{
|
||||||
|
//没有项目参与人员
|
||||||
|
findTrialUser = await _trialIdentityUserRepository.AddAsync(new TrialIdentityUser()
|
||||||
|
{
|
||||||
|
IdentityUserId = identityUserId,
|
||||||
|
TrialId = trialId,
|
||||||
|
JoinTime = DateTime.Now,
|
||||||
|
TrialUserRoleList = userTypeIdList.Select(u => new TrialUserRole()
|
||||||
|
{
|
||||||
|
TrialId = trialId,
|
||||||
|
UserId = u,
|
||||||
|
|
||||||
|
}).ToList()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//有该人员
|
||||||
|
|
||||||
|
//是否有该角色
|
||||||
|
|
||||||
|
foreach (var userTypeId in userTypeIdList)
|
||||||
|
{
|
||||||
|
var findTrialUserRole = findTrialUser.TrialUserRoleList.Where(t => t.UserId == userTypeId).FirstOrDefault();
|
||||||
|
|
||||||
if (findTrialUserRole == null)
|
if (findTrialUserRole == null)
|
||||||
{
|
{
|
||||||
|
//添加该角色
|
||||||
await _trialUserRoleRepository.AddAsync(new TrialUserRole() { TrialId = trialId, TrialUserId = findTrialUser.Id, UserId = findUserRoleId, JoinTime = DateTime.Now });
|
findTrialUser.TrialUserRoleList.Add(new TrialUserRole() { TrialUserId = findTrialUser.Id, TrialId = trialId, UserId = userTypeId });
|
||||||
|
|
||||||
await _userRoleRepository.BatchUpdateNoTrackingAsync(t => t.IdentityUserId == userId, u => new UserRole() { IsUserRoleDisabled =false });
|
|
||||||
|
|
||||||
await _trialExternalUseRepository.BatchUpdateNoTrackingAsync(t => t.Id == userInfo.Id, u => new TrialExternalUser() { IsJoin = true });
|
|
||||||
|
|
||||||
|
|
||||||
await _userRoleRepository.SaveChangesAsync();
|
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach (var item in sendEmail.SendUsers.GroupBy(t => t.SystemUserId))
|
|
||||||
{
|
{
|
||||||
await _mailVerificationService.ExternalUserJoinEmail(trialId, item.Key, sendEmail.BaseUrl, sendEmail.RouteUrl);
|
//如果禁用,那么启用
|
||||||
|
if (findTrialUserRole.IsDeleted == true)
|
||||||
|
{
|
||||||
|
findTrialUserRole.IsDeleted = false;
|
||||||
|
findTrialUserRole.DeletedTime = null;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var usertyps = string.Join(',', userTypeList.Select(t => t.UserTypeShortName));
|
||||||
|
|
||||||
|
await _mailVerificationService.ExternalUserJoinEmail(trialId, identityUserId, usertyps, sendEmail.BaseUrl, sendEmail.RouteUrl);
|
||||||
|
|
||||||
|
await _trialExternalUseRepository.BatchUpdateNoTrackingAsync(t => externalIdList.Contains(t.Id), u => new TrialExternalUser() { IsJoin = true });
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
return ResponseOutput.Ok();
|
return ResponseOutput.Ok();
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
public async Task<List<TrialUserBasicInfo>> GetTrialUserList(Guid trialId)
|
public async Task<List<TrialUserBasicInfo>> GetTrialUserList(Guid trialId)
|
||||||
{
|
{
|
||||||
return await _trialUseRoleRepository.Where(t => t.TrialId == trialId, ignoreQueryFilters: true)
|
return await _trialUseRoleRepository.Where(t => t.TrialId == trialId, ignoreQueryFilters: true)
|
||||||
.Select(t => new TrialUserBasicInfo() { FullName = t.UserRole.FullName, UserId = t.UserId, UserTypeId = t.UserRole.UserTypeId, UserName = t.UserRole.UserName })
|
.Select(t => new TrialUserBasicInfo() { FullName = t.UserRole.FullName, UserId = t.UserId, UserTypeId = t.UserRole.UserTypeId, UserName = t.UserRole.IdentityUser.UserName })
|
||||||
.ToListAsync();
|
.ToListAsync();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -89,7 +89,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.TrialSiteCode), t => t.TrialSiteCode.Contains(inQuery.TrialSiteCode))
|
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.TrialSiteCode), t => t.TrialSiteCode.Contains(inQuery.TrialSiteCode))
|
||||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator, t => t.CRCUserList.Any(k => k.UserId == _userInfo.UserRoleId))
|
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator, t => t.CRCUserList.Any(k => k.UserId == _userInfo.UserRoleId))
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.UserKeyInfo), t => t.CRCUserList.Any(k => (k.UserRole.FullName).Contains(inQuery.UserKeyInfo)
|
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.UserKeyInfo), t => t.CRCUserList.Any(k => (k.UserRole.FullName).Contains(inQuery.UserKeyInfo)
|
||||||
|| k.UserRole.UserName.Contains(inQuery.UserKeyInfo) || k.UserRole.EMail.Contains(inQuery.UserKeyInfo)))
|
|| k.UserRole.IdentityUser.UserName.Contains(inQuery.UserKeyInfo) || k.UserRole.IdentityUser.EMail.Contains(inQuery.UserKeyInfo)))
|
||||||
|
|
||||||
.ProjectTo<SiteStatDTO>(_mapper.ConfigurationProvider);
|
.ProjectTo<SiteStatDTO>(_mapper.ConfigurationProvider);
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ namespace IRaCIS.Core.Application.Services
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.TrialSiteCode), t => t.TrialSiteCode.Contains(inQuery.TrialSiteCode))
|
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.TrialSiteCode), t => t.TrialSiteCode.Contains(inQuery.TrialSiteCode))
|
||||||
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator, t => t.CRCUserList.Any(k => k.UserId == _userInfo.UserRoleId))
|
.WhereIf(_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator, t => t.CRCUserList.Any(k => k.UserId == _userInfo.UserRoleId))
|
||||||
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.UserKeyInfo), t => t.CRCUserList.Any(k => (k.UserRole.FullName).Contains(inQuery.UserKeyInfo)
|
.WhereIf(!string.IsNullOrWhiteSpace(inQuery.UserKeyInfo), t => t.CRCUserList.Any(k => (k.UserRole.FullName).Contains(inQuery.UserKeyInfo)
|
||||||
|| k.UserRole.UserName.Contains(inQuery.UserKeyInfo) || k.UserRole.EMail.Contains(inQuery.UserKeyInfo)))
|
|| k.UserRole.IdentityUser.UserName.Contains(inQuery.UserKeyInfo) || k.UserRole.IdentityUser.EMail.Contains(inQuery.UserKeyInfo)))
|
||||||
|
|
||||||
.ProjectTo<SiteStatSimpleDTO>(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us });
|
.ProjectTo<SiteStatSimpleDTO>(_mapper.ConfigurationProvider, new { isEn_Us = _userInfo.IsEn_Us });
|
||||||
|
|
||||||
|
|
|
@ -192,7 +192,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
CreateMap<TrialStateChange, TrialStateChangeDTO>()
|
CreateMap<TrialStateChange, TrialStateChangeDTO>()
|
||||||
.ForMember(t => t.UserRealName, u => u.MapFrom(c => c.CreateUserRole.FullName))
|
.ForMember(t => t.UserRealName, u => u.MapFrom(c => c.CreateUserRole.FullName))
|
||||||
.ForMember(t => t.UserName, u => u.MapFrom(c => c.CreateUserRole.UserName));
|
.ForMember(t => t.UserName, u => u.MapFrom(c => c.CreateUserRole.IdentityUser.UserName));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ namespace IRaCIS.Core.Application.Service
|
||||||
|
|
||||||
|
|
||||||
CreateMap<VisitPlanInfluenceStat, VisitPlanInfluenceSubjectVisitStatDTO>()
|
CreateMap<VisitPlanInfluenceStat, VisitPlanInfluenceSubjectVisitStatDTO>()
|
||||||
.ForMember(d => d.CreateUser, u => u.MapFrom(g => g.CreateUserRole.LastName + " / " + g.CreateUserRole.FirstName));
|
.ForMember(d => d.CreateUser, u => u.MapFrom(g => g.CreateUserRole.IdentityUser.FullName));
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -21,6 +21,7 @@ public class NoForeignKeyMigrationsSqlGenerator : SqlServerMigrationsSqlGenerato
|
||||||
protected override void Generate(Microsoft.EntityFrameworkCore.Migrations.Operations.CreateTableOperation operation, IModel? model, MigrationCommandListBuilder builder, bool terminate = true)
|
protected override void Generate(Microsoft.EntityFrameworkCore.Migrations.Operations.CreateTableOperation operation, IModel? model, MigrationCommandListBuilder builder, bool terminate = true)
|
||||||
{
|
{
|
||||||
operation.ForeignKeys.Clear();
|
operation.ForeignKeys.Clear();
|
||||||
|
|
||||||
base.Generate(operation, model, builder, terminate);
|
base.Generate(operation, model, builder, terminate);
|
||||||
}
|
}
|
||||||
protected override void Generate(AddForeignKeyOperation operation, IModel? model, MigrationCommandListBuilder builder, bool terminate = true)
|
protected override void Generate(AddForeignKeyOperation operation, IModel? model, MigrationCommandListBuilder builder, bool terminate = true)
|
||||||
|
@ -33,7 +34,8 @@ public class NoForeignKeyMigrationsSqlGenerator : SqlServerMigrationsSqlGenerato
|
||||||
// 忽略所有删除外键的操作
|
// 忽略所有删除外键的操作
|
||||||
// 不调用 base.Generate 来跳过生成删除外键的SQL
|
// 不调用 base.Generate 来跳过生成删除外键的SQL
|
||||||
}
|
}
|
||||||
////忽略掉唯一约束,因为dicom Id 的问题
|
|
||||||
|
////忽略掉唯一约束
|
||||||
//protected override void Generate(CreateIndexOperation operation, IModel? model, MigrationCommandListBuilder builder, bool terminate = true)
|
//protected override void Generate(CreateIndexOperation operation, IModel? model, MigrationCommandListBuilder builder, bool terminate = true)
|
||||||
//{
|
//{
|
||||||
// // 如果索引是唯一的,则忽略,不生成SQL语句
|
// // 如果索引是唯一的,则忽略,不生成SQL语句
|
||||||
|
|
Loading…
Reference in New Issue