diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 1b2bdd184..5e2a9f601 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -13071,6 +13071,7 @@ + 通知PM 进行一致性核查 (018,030) @@ -13083,7 +13084,12 @@ - QC 领取了质控任务 + QC 领取了质控任务 (007,008) + + + + + QC 领取了质控任务 (007,008) @@ -15011,6 +15017,11 @@ TrialSiteSurveyQuery 列表查询参数模型 + + + + + TrialSiteSurveyAddOrEdit 列表查询参数模型 @@ -15050,6 +15061,13 @@ + + + 通过UserId获取Doctorid + + + + 验证邮箱验证码 获取医生信息Id diff --git a/IRaCIS.Core.Application/MassTransit/Consumer/SubjectVisitQCAndCheckConsumer.cs b/IRaCIS.Core.Application/MassTransit/Consumer/SubjectVisitQCAndCheckConsumer.cs index f05c99808..3fdd222cb 100644 --- a/IRaCIS.Core.Application/MassTransit/Consumer/SubjectVisitQCAndCheckConsumer.cs +++ b/IRaCIS.Core.Application/MassTransit/Consumer/SubjectVisitQCAndCheckConsumer.cs @@ -8,6 +8,7 @@ using IRaCIS.Core.Infra.EFCore.Common; using MassTransit; using Microsoft.Extensions.Options; using MimeKit; +using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Globalization; @@ -47,6 +48,8 @@ public class CRCSubmitedAndQCToAuditEventConsumer( var userinfoList = trialUser.Where(x => x.UserTypeEnum == UserTypeEnum.IQC).ToList(); + var pmandAPm = trialUser.Where(x => x.UserTypeEnum == UserTypeEnum.APM || x.UserTypeEnum == UserTypeEnum.ProjectManager).ToList(); + var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == subjectVisit.TrialId); var auditStateCode = "AuditStatePE"; @@ -77,6 +80,10 @@ public class CRCSubmitedAndQCToAuditEventConsumer( messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail)); messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail)); + foreach (var pm in pmandAPm) + { + messageToSend.Cc.Add(new MailboxAddress(String.Empty, pm.EMail)); + } var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN; @@ -143,7 +150,12 @@ public class CRCRepliedQCChallengeEventConsumer( var trialUser = await _trialUseRepository.Where(x => x.TrialId == subjectVisit.TrialId).Include(x => x.User).Select(x => x.User).ToListAsync(); + + + var userinfoList = trialUser.Where(x => x.UserTypeEnum == UserTypeEnum.IQC).ToList(); + var pmandAPm = trialUser.Where(x => x.UserTypeEnum == UserTypeEnum.APM || x.UserTypeEnum == UserTypeEnum.ProjectManager).ToList(); + var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == subjectVisit.TrialId); @@ -155,7 +167,10 @@ public class CRCRepliedQCChallengeEventConsumer( messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail)); messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail)); - + foreach (var pm in pmandAPm) + { + messageToSend.Cc.Add(new MailboxAddress(String.Empty, pm.EMail)); + } var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN; @@ -389,11 +404,110 @@ public class CRCRepliedCheckChallengeEventConsumer( /// PM 一致性核查 通知CRC (016,017) /// -public class PMRepliedCheckChallengeEventConsumer : IConsumer +public class PMRepliedCheckChallengeEventConsumer( + IRepository _userRepository, + IRepository _trialUseRepository, + IRepository _subjectVisitRepository, + IRepository _trialRepository, + IRepository _checkChallengeDialogRepository, + IRepository _qCChallengeDialogRepository, + IRepository _dictionaryRepository, + IRepository _emailNoticeConfigrepository, + IOptionsMonitor systemEmailConfig) : IConsumer { - public Task Consume(ConsumeContext context) + + private readonly SystemEmailSendConfig _systemEmailConfig = systemEmailConfig.CurrentValue; + public async Task Consume(ConsumeContext context) { - throw new NotImplementedException(); + Console.WriteLine("发送(016,017) 【 PM 一致性核查 通知CRC】邮件!!!"); + var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US; + var checkChallengeDialog = await _checkChallengeDialogRepository.Where(x => x.Id == context.Message.CheckChallengeDialogId).FirstNotNullAsync(); + var subjectVisitId = context.Message.SubjectVisitId; + + var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == subjectVisitId).Include(x => x.Subject).FirstNotNullAsync(); + + var trialUser = await _trialUseRepository.Where(x => x.TrialId == subjectVisit.TrialId).Include(x => x.User).Select(x => x.User).ToListAsync(); + + var userinfoList = trialUser.Where(x => x.UserTypeEnum == UserTypeEnum.ClinicalResearchCoordinator).ToList(); + + var craInfo = trialUser.Where(x => x.UserTypeEnum == UserTypeEnum.CRA).FirstOrDefault(); + + var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == subjectVisit.TrialId); + + string json = checkChallengeDialog.ParamInfo; + List modalities = new List(); + if (json.IsNotNullOrEmpty()) + { + List> studies = JsonConvert.DeserializeObject>>(json); + foreach (var study in studies) + { + if (study.ContainsKey("Modality")) + { + modalities.Add(study["Modality"]); + } + } + } + + modalities = modalities.Distinct().ToList(); + + + var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto() + { + + DictionaryRepository = _dictionaryRepository, + IsEn_US = isEn_US, + DictionaryList = new List() + { + new DictionaryDto (){DictionaryCode= "CheckState",EnumValue=subjectVisit.CheckState.GetEnumInt(), }, //核查状态 + + } + }); + + + foreach (var userinfo in userinfoList) + { + var messageToSend = new MimeMessage(); + //发件地址 + messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail)); + messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail)); + if (craInfo != null) + { + messageToSend.Cc.Add(new MailboxAddress(String.Empty, craInfo.EMail)); + } + + var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN; + + + + + Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input => + { + var subjectCode = subjectVisit.Subject.Code; + var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo, subjectCode, subjectVisit.VisitName); + var htmlBodyStr = string.Format( + CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr), + userinfo.FullName, // 用户名 {0} + trialInfo.ExperimentName, // 项目 {1} + + subjectCode, // 受试者 {2} + subjectVisit.VisitName, // 访视 {3} + string.Join(',', modalities), // 检查类型 {4} + dictionValue[0], // 核查状态 {5} + checkChallengeDialog.TalkContent,// 质疑内容{6} + _systemEmailConfig.SiteUrl // 链接 {7} + ); + + return (topicStr, htmlBodyStr); + }; + + await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository, + + context.Message.IsPd ? EmailBusinessScenario.PDVerification_UnderDR : EmailBusinessScenario.EligibilityVerification_UnderDR, + + messageToSend, emailConfigFunc); + + await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig); + } } } @@ -487,12 +601,106 @@ public class CheckStateChangedToAuditEventConsumer( } /// -/// QC 领取了质控任务 +/// QC 领取了质控任务 (007,008) /// -public class QCClaimTaskEventConsumer : IConsumer +public class QCClaimTaskEventConsumer( + IRepository _userRepository, + IRepository _trialUseRepository, + IRepository _subjectVisitRepository, + IRepository _trialRepository, + IRepository _qCChallengeRepository, + IRepository _qCChallengeDialogRepository, + IRepository _dictionaryRepository, + IRepository _emailNoticeConfigrepository, + IOptionsMonitor systemEmailConfig) : IConsumer { - public Task Consume(ConsumeContext context) + private readonly SystemEmailSendConfig _systemEmailConfig = systemEmailConfig.CurrentValue; + public async Task Consume(ConsumeContext context) { - throw new NotImplementedException(); + Console.WriteLine("发送(Code007,008) 【QC 领取了质控任务】邮件!!!"); + var isEn_US = CultureInfo.CurrentCulture.Name == StaticData.CultureInfo.en_US; + + var subjectVisitId = context.Message.SubjectVisitId; + + var subjectVisit = await _subjectVisitRepository.Where(x => x.Id == subjectVisitId).Include(x => x.Subject).Include(x => x.CurrentActionUser).FirstNotNullAsync(); + + + var subjectVisitList = await _subjectVisitRepository.Where(x => x.CurrentActionUserId == context.Message.CurrentActionUserId && x.TrialId == subjectVisit.TrialId).Include(x => x.Subject).ToListAsync(); + + + + + + var trialUser = await _trialUseRepository.Where(x => x.TrialId == subjectVisit.TrialId).Include(x => x.User).Select(x => x.User).ToListAsync(); + + + + + + var pmandAPm = trialUser.Where(x => x.UserTypeEnum == UserTypeEnum.APM || x.UserTypeEnum == UserTypeEnum.ProjectManager).ToList(); + + + var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == subjectVisit.TrialId); + + + var userinfo = subjectVisit.CurrentActionUser; + + var messageToSend = new MimeMessage(); + //发件地址 + messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail)); + messageToSend.To.Add(new MailboxAddress(String.Empty, userinfo.EMail)); + + foreach (var pm in pmandAPm) + { + messageToSend.Cc.Add(new MailboxAddress(String.Empty, pm.EMail)); + } + var companyName = isEn_US ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN; + + var auditStateCode = "AuditStatePE"; + + if (trialInfo.QCProcessEnum == TrialQCProcess.DoubleAudit) + { + auditStateCode = "AuditStateRC"; + } + + var dictionValue = await CommonEmailHelper.TranslationDictionary(new TranslationDictionaryDto() + { + DictionaryRepository = _dictionaryRepository, + IsEn_US = isEn_US, + DictionaryList = new List() + { + new DictionaryDto (){DictionaryCode= auditStateCode,EnumValue=subjectVisit.AuditState.GetEnumInt(), }, //审核状态 + + } + }); + + var subjectcodes = subjectVisitList.Select(x => x.Subject.Code).ToList(); + var visitnames = subjectVisitList.Select(x => x.VisitName).ToList(); + + Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input => + { + var subjectCode = subjectVisit.Subject.Code; + var topicStr = string.Format(input.topicStr, trialInfo.ResearchProgramNo, subjectCode, subjectVisit.VisitName); + var htmlBodyStr = string.Format( + CommonEmailHelper.ReplaceCompanyName(_systemEmailConfig, input.htmlBodyStr), + userinfo.FullName, // 用户名 {0} + trialInfo.ExperimentName, // 项目 {1} + string.Join(',', subjectcodes), // 受试者 {2} + string.Join(',', visitnames), // 访视 {3} + dictionValue[0], // 审核状态 {4} + + _systemEmailConfig.SiteUrl // 链接 {5} + ); + + return (topicStr, htmlBodyStr); + }; + + await CommonEmailHelper.GetEmailSubejctAndHtmlInfoAndBuildAsync(_emailNoticeConfigrepository, + + context.Message.IsPd ? EmailBusinessScenario.PDVerification_PendingImageQCClaim : EmailBusinessScenario.EligibilityVerification_PendingClaim, + + messageToSend, emailConfigFunc); + + await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig); } } diff --git a/IRaCIS.Core.Application/Service/Management/_MapConfig.cs b/IRaCIS.Core.Application/Service/Management/_MapConfig.cs index 9680789ad..bd6289e3f 100644 --- a/IRaCIS.Core.Application/Service/Management/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Management/_MapConfig.cs @@ -2,6 +2,7 @@ using AutoMapper.EquivalencyExpression; using IRaCIS.Application.Contracts; using IRaCIS.Core.Application.Contracts; +using IRaCIS.Core.Application.Service.Reading.Dto; using IRaCIS.Core.Application.ViewModel; namespace IRaCIS.Core.Application.Service @@ -15,8 +16,6 @@ namespace IRaCIS.Core.Application.Service - - CreateMap().ForMember(d => d.UserCode, x => x.Ignore()); CreateMap().ReverseMap() .ForMember(t => t.UserTypeMenuList, u => u.MapFrom(c => c.MenuIds)) diff --git a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs index 63d4b8d5f..92893e0ca 100644 --- a/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs +++ b/IRaCIS.Core.Application/Service/Reading/Dto/ReadingQuestionViewModel.cs @@ -1598,6 +1598,165 @@ namespace IRaCIS.Core.Application.Service.Reading.Dto public Guid QuestionId { get; set; } public string QuestionName { get; set; } + + [NotMapped] + public List ParentTriggerValueList + { + get + { + try + { + return this.ParentTriggerValue.Split(',').ToList(); + } + catch (Exception) + { + + return new List(); + } + } + + } + [NotMapped] + public List RelevanceValueList + { + get + { + try + { + return this.RelevanceValue.Split(',').ToList(); + } + catch (Exception) + { + + return new List(); + } + } + + } + + [Comment("系统表的问题Id ReadingQuestionSystem的Id")] + public Guid ReadingQuestionId { get; set; } + + public string Type { get; set; } = string.Empty; + public Guid? ParentId { get; set; } + + [Comment("父问题触发值")] + public string ParentTriggerValue { get; set; } = string.Empty; + + + + + public IsRequired IsRequired { get; set; } + + [Comment("排序号")] + public int ShowOrder { get; set; } + + [Comment("值")] + public string TypeValue { get; set; } = string.Empty; + + [Comment("是否启用")] + public bool IsEnable { get; set; } + + [Comment("备注")] + public string Remark { get; set; } = string.Empty; + + [Comment("显示父问题")] + public Guid? RelevanceId { get; set; } + + [Comment("显示父问题的值")] + public string RelevanceValue { get; set; } = string.Empty; + + [Comment("是否显示")] + public int ShowQuestion { get; set; } + + [Comment("最大问题数")] + public int? MaxRowCount { get; set; } + + [Comment("图片数量")] + public int? ImageCount { get; set; } + + [Comment("数据表名称")] + public string DataTableName { get; set; } = string.Empty; + + [Comment("数据列")] + public string DataTableColumn { get; set; } = string.Empty; + [Comment("关联父问题")] + public Guid? DependParentId { get; set; } + + [Comment("是否关联")] + public IsDepend IsDepend { get; set; } + + [Comment("表格问题类型")] + public TableQuestionType? TableQuestionType { get; set; } + + [Comment("系统标准Id")] + public Guid SystemCriterionId { get; set; } + + [Comment("问题标识")] + public QuestionMark? QuestionMark { get; set; } + + [Comment("字典code")] + public string DictionaryCode { get; set; } = string.Empty; + [Comment("数值类型")] + public ValueOfType? ValueType { get; set; } + + [Comment("单位")] + public ValueUnit? Unit { get; set; } + + [Comment("问题英文名称")] + public string QuestionEnName { get; set; } = string.Empty; + + [Comment("数据来源")] + public DataSources DataSource { get; set; } = DataSources.ManualEntry; + + [Comment("限制编辑")] + public LimitEdit LimitEdit { get; set; } = LimitEdit.None; + + [Comment("最大答案长度")] + public int? MaxAnswerLength { get; set; } + + [Comment("文件类型")] + public string? FileType { get; set; } = string.Empty; + + [Comment("问题分类")] + public QuestionClassify? QuestionClassify { get; set; } + + [Comment("复制病灶的时候 是否复制这个问题")] + public bool IsCopy { get; set; } = false; + + [Comment("分类问题表格Id")] + public Guid? ClassifyTableQuestionId { get; set; } + + [Comment("分类类型")] + public ClassifyType? ClassifyType { get; set; } + + [Comment("分类算法")] + public string ClassifyAlgorithms { get; set; } = string.Empty; + + [Comment("导出标识")] + public ExportIdentification? ExportIdentification { get; set; } + + [Comment("导出结果")] + public string ExportResultStr { get; set; } = "[]"; + + [NotMapped] + public List ExportResult + { + get + { + try + { + var result = JsonConvert.DeserializeObject>(this.ExportResultStr); + return result == null ? new List() : result; + } + catch (Exception) + { + + return new List(); + } + + } + } } diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs index 63d36a437..78a91e998 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingCriterion/ReadingQuestionService.cs @@ -152,13 +152,10 @@ namespace IRaCIS.Core.Application.Service .Where(x => x.ReadingQuestionId == inDto.QuestionId) .WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type == inDto.Type) .OrderBy(x => x.ShowOrder) - .Select(x => new GetCalculateTableQuestionsOutDto - () - { - QuestionId = x.Id, - QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us) - - }).ToListAsync(); + .ProjectTo(_mapper.ConfigurationProvider, new + { + isEn_Us = _userInfo.IsEn_Us, + }).ToListAsync(); return result; } @@ -177,13 +174,10 @@ namespace IRaCIS.Core.Application.Service .Where(x => x.ReadingQuestionId == inDto.QuestionId) .WhereIf(!inDto.Type.IsNullOrEmpty(), x => x.Type == inDto.Type) .OrderBy(x => x.ShowOrder) - .Select(x => new GetCalculateTableQuestionsOutDto - () - { - QuestionId = x.Id, - QuestionName = x.QuestionName.LanguageName(x.QuestionEnName, _userInfo.IsEn_Us) - - }).ToListAsync(); + .ProjectTo(_mapper.ConfigurationProvider, new + { + isEn_Us = _userInfo.IsEn_Us, + }).ToListAsync(); return result; } diff --git a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs index 3a55897d4..1e88652d7 100644 --- a/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/Reading/_MapConfig.cs @@ -228,7 +228,15 @@ namespace IRaCIS.Core.Application.Service CreateMap(); - CreateMap(); + CreateMap(); + + + CreateMap() + .ForMember(d => d.QuestionName, u => u.MapFrom(s => isEn_Us ? s.QuestionEnName : s.QuestionName)); + + CreateMap() + .ForMember(d => d.QuestionName, u => u.MapFrom(s => isEn_Us ? s.QuestionEnName : s.QuestionName)); + CreateMap() .ForMember(dest => dest.CreateUser, opt => opt.Ignore()) diff --git a/IRaCIS.Core.Application/Service/SiteSurvey/DTO/TrialSiteSurveyViewModel.cs b/IRaCIS.Core.Application/Service/SiteSurvey/DTO/TrialSiteSurveyViewModel.cs index 81c8e615e..678507ff6 100644 --- a/IRaCIS.Core.Application/Service/SiteSurvey/DTO/TrialSiteSurveyViewModel.cs +++ b/IRaCIS.Core.Application/Service/SiteSurvey/DTO/TrialSiteSurveyViewModel.cs @@ -229,6 +229,20 @@ namespace IRaCIS.Core.Application.Contracts public string EmailOrPhone { get; set; } } + /// + /// + /// + public class UseUserIDGetDoctorIDOutDto + { + public Guid? DoctorID { get; set; } + } + + + public class UseUserIDGetDoctorIDInDto + { + public Guid UserID { get; set; } + } + public class VerifyEmialGetDoctorInfoOutDto { public Guid? DoctorId { get; set; } diff --git a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs index 4a3ac77f3..37fc2923e 100644 --- a/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs +++ b/IRaCIS.Core.Application/Service/SiteSurvey/TrialSiteSurveyService.cs @@ -18,6 +18,8 @@ using Microsoft.VisualBasic; using MimeKit; using Newtonsoft.Json; using System.Text.RegularExpressions; +using static MassTransit.ValidationResultExtensions; +using DocumentFormat.OpenXml.Vml.Spreadsheet; namespace IRaCIS.Core.Application.Contracts { @@ -68,6 +70,50 @@ namespace IRaCIS.Core.Application.Contracts return ResponseOutput.Ok(); } + /// + /// 通过UserId获取Doctorid + /// + /// + /// + [HttpPost] + public async Task UseUserIDGetDoctorID(UseUserIDGetDoctorIDInDto inDto) + { + + var userinfo = await _userRepository.Where(x => x.Id == inDto.UserID).FirstOrDefaultAsync(); + + if (userinfo != null && userinfo.DoctorId != null) + { + return new UseUserIDGetDoctorIDOutDto() + { + + DoctorID = userinfo.DoctorId + }; + } + else + { + Doctor doctor = new Doctor() + { + + }; + + var info = await _doctorRepository.AddAsync(doctor, true); + + await _userRepository.BatchUpdateNoTrackingAsync(x => x.Id == inDto.UserID, x => new User() + { + + DoctorId = info.Id + }); + + return new UseUserIDGetDoctorIDOutDto() + { + + DoctorID = info.Id + }; + } + + + } + /// /// 验证邮箱验证码 获取医生信息Id /// @@ -107,6 +153,18 @@ namespace IRaCIS.Core.Application.Contracts result.DoctorId = dockerInfo.Id; result.ReviewStatus = dockerInfo.ReviewStatus; } + else + { + Doctor doctor = new Doctor() + { + EMail = inDto.EmailOrPhone + }; + + var info=await _doctorRepository.AddAsync(doctor,true); + + result.DoctorId = info.Id; + result.ReviewStatus = info.ReviewStatus; + } result.Token = _tokenService.GetToken(IRaCISClaims.Create(new UserBasicInfo())); } diff --git a/IRaCIS.Core.Domain/Dcotor/Doctor.cs b/IRaCIS.Core.Domain/Dcotor/Doctor.cs index 97d11708b..a9730a421 100644 --- a/IRaCIS.Core.Domain/Dcotor/Doctor.cs +++ b/IRaCIS.Core.Domain/Dcotor/Doctor.cs @@ -52,14 +52,14 @@ public class Doctor : BaseFullAuditEntity public Guid AuditUserId { get; set; } - public string BlindName { get; set; } = null!; + public string BlindName { get; set; } = string.Empty; - public string BlindNameCN { get; set; } = null!; + public string BlindNameCN { get; set; } = string.Empty; [MaxLength] public string? BlindPublications { get; set; } - public string ChineseName { get; set; } = null!; + public string ChineseName { get; set; } = string.Empty; public int Code { get; set; } @@ -68,16 +68,16 @@ public class Doctor : BaseFullAuditEntity public Guid? DepartmentId { get; set; } - public string DepartmentOther { get; set; } = null!; + public string DepartmentOther { get; set; } = string.Empty; - - public string DepartmentOtherCN { get; set; } = null!; - - public string EMail { get; set; } = null!; + public string DepartmentOtherCN { get; set; } = string.Empty; - - public string FirstName { get; set; } = null!; + + public string EMail { get; set; } = string.Empty; + + + public string FirstName { get; set; } = string.Empty; public int GCP { get; set; } @@ -95,19 +95,19 @@ public class Doctor : BaseFullAuditEntity public Guid? HospitalId { get; set; } - public string HospitalOther { get; set; } = null!; + public string HospitalOther { get; set; } = string.Empty; - public string HospitalOtherCN { get; set; } = null!; + public string HospitalOtherCN { get; set; } = string.Empty; [MaxLength] - public string Introduction { get; set; } = null!; + public string Introduction { get; set; } = string.Empty; public bool IsVirtual { get; set; } public DateTime? LastLoginTime { get; set; } - public string LastName { get; set; } = null!; + public string LastName { get; set; } = string.Empty; public int Nation { get; set; } @@ -118,48 +118,48 @@ public class Doctor : BaseFullAuditEntity public string? OtherClinicalExperienceCN { get; set; } - public string Password { get; set; } = null!; + public string Password { get; set; } = string.Empty; - public string Phone { get; set; } = null!; + public string Phone { get; set; } = string.Empty; - public string PhotoPath { get; set; } = null!; + public string PhotoPath { get; set; } = string.Empty; - public string Physician { get; set; } = null!; + public string Physician { get; set; } = string.Empty; - public string PhysicianCN { get; set; } = null!; + public string PhysicianCN { get; set; } = string.Empty; public Guid? PhysicianId { get; set; } public Guid? PositionId { get; set; } - public string PositionOther { get; set; } = null!; + public string PositionOther { get; set; } = string.Empty; - public string PositionOtherCN { get; set; } = null!; + public string PositionOtherCN { get; set; } = string.Empty; public Guid? RankId { get; set; } - public string RankOther { get; set; } = null!; + public string RankOther { get; set; } = string.Empty; - public string RankOtherCN { get; set; } = null!; + public string RankOtherCN { get; set; } = string.Empty; - public string ReadingTypeOther { get; set; } = null!; + public string ReadingTypeOther { get; set; } = string.Empty; - public string ReadingTypeOtherCN { get; set; } = null!; + public string ReadingTypeOtherCN { get; set; } = string.Empty; [StringLength(1000)] - public string ResumePath { get; set; } = null!; + public string ResumePath { get; set; } = string.Empty; public ResumeStatusEnum ResumeStatus { get; set; } = ResumeStatusEnum.Failed; - public string ReviewerCode { get; set; } = null!; + public string ReviewerCode { get; set; } = string.Empty; public ReviewerInformationConfirmStatus ReviewStatus { get; set; } = ReviewerInformationConfirmStatus.ConfirmRefuse; @@ -168,19 +168,19 @@ public class Doctor : BaseFullAuditEntity public Guid? SpecialityId { get; set; } - public string SpecialityOther { get; set; } = null!; + public string SpecialityOther { get; set; } = string.Empty; - public string SpecialityOtherCN { get; set; } = null!; + public string SpecialityOtherCN { get; set; } = string.Empty; - public string SubspecialityOther { get; set; } = null!; + public string SubspecialityOther { get; set; } = string.Empty; - public string SubspecialityOtherCN { get; set; } = null!; + public string SubspecialityOtherCN { get; set; } = string.Empty; - public string WeChat { get; set; } = null!; + public string WeChat { get; set; } = string.Empty; /// /// ְ diff --git a/IRaCIS.Core.Domain/_DomainEvent/SubjectVisitStateChangedEvent.cs b/IRaCIS.Core.Domain/_DomainEvent/SubjectVisitStateChangedEvent.cs index 82b0e428c..cb0648178 100644 --- a/IRaCIS.Core.Domain/_DomainEvent/SubjectVisitStateChangedEvent.cs +++ b/IRaCIS.Core.Domain/_DomainEvent/SubjectVisitStateChangedEvent.cs @@ -72,6 +72,8 @@ public class CRCRepliedCheckChallengeEvent : DomainEvent /// public class PMRepliedCheckChallengeEvent : DomainEvent { + public bool IsPd { get; set; } + public Guid CheckChallengeDialogId { get; set; } public Guid TrialId { get; set; } @@ -99,4 +101,6 @@ public class QCClaimTaskEvent : DomainEvent public Guid SubjectVisitId { get; set; } public Guid CurrentActionUserId { get; set; } + + public bool IsPd { get; set; } } \ No newline at end of file diff --git a/IRaCIS.Core.Infra.EFCore/Interceptor/AddDomainExt.cs b/IRaCIS.Core.Infra.EFCore/Interceptor/AddDomainExt.cs index e18e9ce1f..e7b28a8e2 100644 --- a/IRaCIS.Core.Infra.EFCore/Interceptor/AddDomainExt.cs +++ b/IRaCIS.Core.Infra.EFCore/Interceptor/AddDomainExt.cs @@ -99,7 +99,7 @@ public static class DBContext_Ext var delaySeconds = dbContext.TrialEmailNoticeConfig.Where(t => t.BusinessScenarioEnum == businessEnum) .Select(t => t.EmailDelaySeconds).FirstOrDefault(); - subjectVisit.AddDomainEvent(new QCClaimTaskEvent() { SubjectVisitId = subjectVisit.Id, DelaySeconds= delaySeconds, CurrentActionUserId = (Guid)subjectVisit.CurrentActionUserId }); + subjectVisit.AddDomainEvent(new QCClaimTaskEvent() { IsPd = subjectVisit.PDState == PDStateEnum.PDProgress, SubjectVisitId = subjectVisit.Id, DelaySeconds= delaySeconds, CurrentActionUserId = (Guid)subjectVisit.CurrentActionUserId }); } @@ -155,7 +155,7 @@ public static class DBContext_Ext } else if (entry.State == EntityState.Added && checkChallengeDialog.UserTypeEnum == UserTypeEnum.ProjectManager) { - checkChallengeDialog.AddDomainEvent(new PMRepliedCheckChallengeEvent() { CheckChallengeDialogId = checkChallengeDialog.Id, SubjectVisitId = findSubjectVisit.Id, TrialId = findSubjectVisit.TrialId }); + checkChallengeDialog.AddDomainEvent(new PMRepliedCheckChallengeEvent() { IsPd = findSubjectVisit.PDState == PDStateEnum.PDProgress, CheckChallengeDialogId = checkChallengeDialog.Id, SubjectVisitId = findSubjectVisit.Id, TrialId = findSubjectVisit.TrialId }); } //添加进记录