From 2c37765969abf35182b417ff1f39dd5e6398326f Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 24 Oct 2024 14:11:56 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E5=A4=96=E9=83=A8?= =?UTF-8?q?=E4=BA=BA=E5=91=98=E7=B3=BB=E7=BB=9F=E6=96=87=E6=A1=A3=E7=AD=BE?= =?UTF-8?q?=E7=BD=B2=E9=97=AE=E9=A2=98=E8=A7=A3=E5=86=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Auth/IRaCISClaims.cs | 6 ++- IRaCIS.Core.Application/Auth/TokenService.cs | 2 +- .../IRaCIS.Core.Application.xml | 18 ++++---- .../Service/Common/MailService.cs | 44 ------------------- .../Service/Document/SystemDocumentService.cs | 5 +++ .../Service/Management/DTO/UserModel.cs | 2 + .../MinimalApiService/FileToPDFService.cs | 5 +++ .../TestMinimalApiService.cs | 3 ++ .../AuthUser/IUserInfo.cs | 11 +---- IRaCIS.Core.Infra.EFCore/AuthUser/UserInfo.cs | 18 +++++++- 10 files changed, 49 insertions(+), 65 deletions(-) diff --git a/IRaCIS.Core.Application/Auth/IRaCISClaims.cs b/IRaCIS.Core.Application/Auth/IRaCISClaims.cs index 608157270..3eefc9fd2 100644 --- a/IRaCIS.Core.Application/Auth/IRaCISClaims.cs +++ b/IRaCIS.Core.Application/Auth/IRaCISClaims.cs @@ -22,6 +22,8 @@ namespace IRaCIS.Core.Application.Auth public bool IsTestUser { get; set; } + public bool IsZhiZhun { get; set; } + public string Phone { get; set; } = String.Empty; public static IRaCISClaims Create(UserBasicInfo user) @@ -36,9 +38,9 @@ namespace IRaCIS.Core.Application.Auth IsTestUser = user.IsTestUser, Code = user.Code, PermissionStr = user.PermissionStr, - + IsZhiZhun = user.IsZhiZhun, UserTypeShortName = user.UserTypeShortName }; - } + } } } \ No newline at end of file diff --git a/IRaCIS.Core.Application/Auth/TokenService.cs b/IRaCIS.Core.Application/Auth/TokenService.cs index 365c97e68..d9e5f0214 100644 --- a/IRaCIS.Core.Application/Auth/TokenService.cs +++ b/IRaCIS.Core.Application/Auth/TokenService.cs @@ -36,7 +36,7 @@ namespace IRaCIS.Core.Application.Auth new Claim(JwtIRaCISClaimType.UserTypeEnumInt,((int)user.UserTypeEnum).ToString()), new Claim(JwtIRaCISClaimType.UserTypeShortName,user.UserTypeShortName), new Claim(JwtIRaCISClaimType.PermissionStr,user.PermissionStr), - + new Claim(JwtIRaCISClaimType.IsZhiZhun,user.IsZhiZhun.ToString()), new Claim(JwtIRaCISClaimType.IsTestUser,user.IsTestUser.ToString()) }; diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 748a0ec80..1b2bdd184 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -2305,20 +2305,22 @@ - + - minimal api 测试 - 学习参考文档:http://fanrk.cn/%E6%8A%80%E6%9C%AF%E6%96%87%E6%A1%A3/MinimalApi/MinimalApi.html - 组件参考文档:https://docs.masastack.com/framework/building-blocks/minimal-apis#section-69828ff0 + 上传文件转PDF 或者给url 这边下载然后转PDF + + - + - minimal api 测试 - 学习参考文档:http://fanrk.cn/%E6%8A%80%E6%9C%AF%E6%96%87%E6%A1%A3/MinimalApi/MinimalApi.html - 组件参考文档:https://docs.masastack.com/framework/building-blocks/minimal-apis#section-69828ff0 + 上传文件转PDF 或者给url 这边下载然后转PDF + + + + 验证CRC 是否已提交 已提交 就不允许进行任何操作,如果是IQC 那么还验证是否是当前任务领取人 diff --git a/IRaCIS.Core.Application/Service/Common/MailService.cs b/IRaCIS.Core.Application/Service/Common/MailService.cs index 05b59c2d7..2d0fe9a98 100644 --- a/IRaCIS.Core.Application/Service/Common/MailService.cs +++ b/IRaCIS.Core.Application/Service/Common/MailService.cs @@ -18,7 +18,6 @@ namespace IRaCIS.Core.Application.Service Task SendEmailVerification(string emailAddress, int verificationCode); - Task SiteSurveyRejectEmail(MimeMessage messageToSend, TrialSiteSurvey trialSiteSurvey, string routeUrl, User? user = null); Task SenMFAVerifyEmail(Guid userId, string userName, string emailAddress, int verificationCode, UserMFAType mfaType = UserMFAType.Login); @@ -334,49 +333,6 @@ namespace IRaCIS.Core.Application.Service } - public async Task SiteSurveyRejectEmail(MimeMessage messageToSend, TrialSiteSurvey trialSiteSurvey, string routeUrl, User? user) - { - - //发件地址 - messageToSend.From.Add(new MailboxAddress(_systemEmailConfig.FromName, _systemEmailConfig.FromEmail)); - - - var trialInfo = await _trialRepository.FirstOrDefaultAsync(t => t.Id == trialSiteSurvey.TrialId); - - var siteInfo = await _trialSiteRepository.FirstOrDefaultAsync(t => t.TrialId == trialSiteSurvey.TrialId && t.Id == trialSiteSurvey.TrialSiteId, true); - - - var companyName = _userInfo.IsEn_Us ? _systemEmailConfig.CompanyShortName : _systemEmailConfig.CompanyShortNameCN; - - - Func<(string topicStr, string htmlBodyStr), (string topicStr, string htmlBodyStr)> emailConfigFunc = input => - { - var topicStr = string.Format(input.topicStr, companyName, trialInfo.ResearchProgramNo); - - var htmlBodyStr = string.Format(ReplaceCompanyName(input.htmlBodyStr), - - (user == null ? trialSiteSurvey.UserName : user.LastName + "/ " + user.FirstName), - trialInfo.TrialCode, - trialInfo.ResearchProgramNo, - trialInfo.ExperimentName, - siteInfo.TrialSiteCode, - siteInfo.TrialSiteAliasName, - trialSiteSurvey.LatestBackReason, - routeUrl, - (trialSiteSurvey.State == TrialSiteSurveyEnum.ToSubmit ? "inline - block" : "none") - ); - - return (topicStr, htmlBodyStr); - }; - - - await GetEmailSubejctAndHtmlInfoAndBuildAsync(EmailBusinessScenario.SiteSurveyReject, messageToSend, emailConfigFunc); - - - - await SendEmailHelper.SendEmailAsync(messageToSend, _systemEmailConfig); - - } //添加用户发送邮件 public async Task AddUserSendEmailAsync(Guid userId, string baseUrl, string routeUrl) diff --git a/IRaCIS.Core.Application/Service/Document/SystemDocumentService.cs b/IRaCIS.Core.Application/Service/Document/SystemDocumentService.cs index 885776bbb..d81554657 100644 --- a/IRaCIS.Core.Application/Service/Document/SystemDocumentService.cs +++ b/IRaCIS.Core.Application/Service/Document/SystemDocumentService.cs @@ -143,8 +143,13 @@ namespace IRaCIS.Core.Application.Services [HttpPost] public async Task> getWaitSignSysDocList(SystemDocumentQuery inQuery) { + + var isInternal = _userInfo.IsZhiZhun; + var query = from sysDoc in _systemDocumentRepository.Where(t => t.NeedConfirmedUserTypeList.Any(t => t.NeedConfirmUserTypeId == _userInfo.UserTypeId)) .WhereIf(!string.IsNullOrEmpty(inQuery.Name), t => t.Name.Contains(inQuery.Name)) + //外部人员 只签署 文档类型枚举值有值的 + .WhereIf(isInternal == false, t => t.FileType.Code.Length == 0) .WhereIf(inQuery.FileTypeId != null, t => t.FileTypeId == inQuery.FileTypeId) join confirm in _systemDocConfirmedUserRepository.Where() on new { ConfirmUserId = _userInfo.Id, SystemDocumentId = sysDoc.Id } equals new { confirm.ConfirmUserId, confirm.SystemDocumentId } into cc from confirm in cc.DefaultIfEmpty() diff --git a/IRaCIS.Core.Application/Service/Management/DTO/UserModel.cs b/IRaCIS.Core.Application/Service/Management/DTO/UserModel.cs index f2f7c8824..a4f6938fe 100644 --- a/IRaCIS.Core.Application/Service/Management/DTO/UserModel.cs +++ b/IRaCIS.Core.Application/Service/Management/DTO/UserModel.cs @@ -65,6 +65,8 @@ namespace IRaCIS.Application.Contracts public string EMail { get; set; } = string.Empty; public bool IsFirstAdd { get; set; } + + public bool IsZhiZhun { get; set; } public bool IsReviewer { get; set; } = false; public int LoginState { get; set; } = 0; diff --git a/IRaCIS.Core.Application/Service/MinimalApiService/FileToPDFService.cs b/IRaCIS.Core.Application/Service/MinimalApiService/FileToPDFService.cs index 9e4570b79..1a899fbc6 100644 --- a/IRaCIS.Core.Application/Service/MinimalApiService/FileToPDFService.cs +++ b/IRaCIS.Core.Application/Service/MinimalApiService/FileToPDFService.cs @@ -16,6 +16,11 @@ using System.Threading.Tasks; namespace IRaCIS.Core.Application.Service.MinimalApiService { + /// + /// 上传文件转PDF 或者给url 这边下载然后转PDF + /// + /// + /// [ApiExplorerSettings(GroupName = "Institution")] public class FileToPDFService(IWebHostEnvironment _hostEnvironment) : ServiceBase { diff --git a/IRaCIS.Core.Application/Service/MinimalApiService/TestMinimalApiService.cs b/IRaCIS.Core.Application/Service/MinimalApiService/TestMinimalApiService.cs index 5b0678790..381a0d56b 100644 --- a/IRaCIS.Core.Application/Service/MinimalApiService/TestMinimalApiService.cs +++ b/IRaCIS.Core.Application/Service/MinimalApiService/TestMinimalApiService.cs @@ -14,6 +14,9 @@ namespace IRaCIS.Core.Application.Service.MinimalApiService /// minimal api 测试 /// 学习参考文档:http://fanrk.cn/%E6%8A%80%E6%9C%AF%E6%96%87%E6%A1%A3/MinimalApi/MinimalApi.html /// 组件参考文档:https://docs.masastack.com/framework/building-blocks/minimal-apis#section-69828ff0 + /// 升级只用改一个地方 搜索关键词: 统一使用 Directory.Build.props 管理项目 + //https://www.toutiao.com/article/7407615998343348787/?app=news_article×tamp=1724760241&use_new_style=1&req_id=20240827200400D600951D2F54551B5ACF&group_id=7407615998343348787&share_token=03C009BA-571C-47AB-86E5-87DA93F08975&tt_from=weixin&utm_source=weixin&utm_medium=toutiao_ios&utm_campaign=client_share&wxshare_count=1&source=m_redirect&wid=1729739417949 + /// [ApiExplorerSettings(GroupName = "Institution")] diff --git a/IRaCIS.Core.Infra.EFCore/AuthUser/IUserInfo.cs b/IRaCIS.Core.Infra.EFCore/AuthUser/IUserInfo.cs index 6653a770d..e05a11ed2 100644 --- a/IRaCIS.Core.Infra.EFCore/AuthUser/IUserInfo.cs +++ b/IRaCIS.Core.Infra.EFCore/AuthUser/IUserInfo.cs @@ -5,25 +5,18 @@ /// public interface IUserInfo { - /// - /// 主键 - /// + Guid Id { get; } - /// - /// 用户名 - /// string UserName { get; } - /// - /// 昵称 - /// string RealName { get; } string ReviewerCode { get; } bool IsAdmin { get; } bool IsTestUser { get; } + public bool IsZhiZhun { get; } string UserTypeShortName { get; } diff --git a/IRaCIS.Core.Infra.EFCore/AuthUser/UserInfo.cs b/IRaCIS.Core.Infra.EFCore/AuthUser/UserInfo.cs index b83ac6d04..6b6e1253e 100644 --- a/IRaCIS.Core.Infra.EFCore/AuthUser/UserInfo.cs +++ b/IRaCIS.Core.Infra.EFCore/AuthUser/UserInfo.cs @@ -151,7 +151,21 @@ namespace IRaCIS.Core.Domain.Share } } - public bool IsTestUser + public bool IsZhiZhun + { + get + { + var isZhizhunClaime = _accessor?.HttpContext?.User?.FindFirst(JwtIRaCISClaimType.IsZhiZhun); + + if (isZhizhunClaime != null && !string.IsNullOrEmpty(isZhizhunClaime.Value)) + { + return bool.Parse(isZhizhunClaime.Value); + } + return false; + } + } + + public bool IsTestUser { get { @@ -341,6 +355,8 @@ namespace IRaCIS.Core.Domain.Share public const string IsTestUser = "isTestUser"; + public const string IsZhiZhun = "isZhiZhun"; + public const string PermissionStr = "permissionStr"; From f8108da641b556ba369815213345c1e93b27486c Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 24 Oct 2024 14:24:01 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=A3=81=E5=88=A4?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E6=A0=87=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Service/QC/_MapConfig.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/IRaCIS.Core.Application/Service/QC/_MapConfig.cs b/IRaCIS.Core.Application/Service/QC/_MapConfig.cs index 203f7dc45..3d0341019 100644 --- a/IRaCIS.Core.Application/Service/QC/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/QC/_MapConfig.cs @@ -236,7 +236,7 @@ namespace IRaCIS.Core.Application.Service (arbitrationRule == ArbitrationRule.Reading ? u.Subject.SubjectVisitTaskList.Any(t => t.TaskState == TaskState.Effect && t.IsAnalysisCreate == false && t.ReadingCategory == ReadingCategory.Judge && t.TrialReadingCriterionId == trialReadingCriterionId && u.VisitTaskNum < t.VisitTaskNum) : false))) - .ForMember(o => o.JudgeNote, t => t.MapFrom(u => u.JudgeResultRemark)) + .ForMember(o => o.JudgeNote, t => t.MapFrom(u => u.JudgeResultTask.JudgeResultRemark)) .ForMember(o => o.VisitNote, t => t.MapFrom(u => u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.AdjustReason).FirstOrDefault()!.Answer)) .ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => u.Subject.TrialSite.TrialSiteCode)) .ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.Subject.Code)) From 9c95d22b6ae6c76290aa2d74e33771051ee8cc1e Mon Sep 17 00:00:00 2001 From: hang <872297557@qq.com> Date: Thu, 24 Oct 2024 14:48:11 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=AF=BC=E8=A1=A8bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- IRaCIS.Core.Application/Service/QC/_MapConfig.cs | 4 ++-- IRaCIS.Core.Domain/Allocation/VisitTask.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/IRaCIS.Core.Application/Service/QC/_MapConfig.cs b/IRaCIS.Core.Application/Service/QC/_MapConfig.cs index 3d0341019..d44c2e6ba 100644 --- a/IRaCIS.Core.Application/Service/QC/_MapConfig.cs +++ b/IRaCIS.Core.Application/Service/QC/_MapConfig.cs @@ -232,11 +232,11 @@ namespace IRaCIS.Core.Application.Service CreateMap() .ForMember(o => o.IsBaseline, t => t.MapFrom(u => u.SourceSubjectVisit.IsBaseLine)) .ForMember(o => o.JudgeArmEnum, t => t.MapFrom(u => u.JudgeResultTask.ArmEnum)) - .ForMember(o => o.IsTrigerJudge, t => t.MapFrom(u => arbitrationRule == ArbitrationRule.Visit ? u.JudgeResultTaskId != null : + .ForMember(o => o.IsTrigerJudge, t => t.MapFrom(u => arbitrationRule == ArbitrationRule.Visit ? u.JudgeVisitTaskId != null : (arbitrationRule == ArbitrationRule.Reading ? u.Subject.SubjectVisitTaskList.Any(t => t.TaskState == TaskState.Effect && t.IsAnalysisCreate == false && t.ReadingCategory == ReadingCategory.Judge && t.TrialReadingCriterionId == trialReadingCriterionId && u.VisitTaskNum < t.VisitTaskNum) : false))) - .ForMember(o => o.JudgeNote, t => t.MapFrom(u => u.JudgeResultTask.JudgeResultRemark)) + .ForMember(o => o.JudgeNote, t => t.MapFrom(u => u.JudgeVisitTask.JudgeResultRemark)) .ForMember(o => o.VisitNote, t => t.MapFrom(u => u.ReadingTaskQuestionAnswerList.Where(c => c.ReadingQuestionTrial.QuestionType == QuestionType.AdjustReason).FirstOrDefault()!.Answer)) .ForMember(o => o.TrialSiteCode, t => t.MapFrom(u => u.Subject.TrialSite.TrialSiteCode)) .ForMember(o => o.SubjectCode, t => t.MapFrom(u => u.Subject.Code)) diff --git a/IRaCIS.Core.Domain/Allocation/VisitTask.cs b/IRaCIS.Core.Domain/Allocation/VisitTask.cs index b0331aa99..fb273eaef 100644 --- a/IRaCIS.Core.Domain/Allocation/VisitTask.cs +++ b/IRaCIS.Core.Domain/Allocation/VisitTask.cs @@ -175,7 +175,7 @@ public class VisitTask : BaseFullAuditEntity public Guid? DoctorUserId { get; set; } public Guid TrialReadingCriterionId { get; set; } - [Comment("裁判任务的Id")] + [Comment("在访视或者全局任务上记录 裁判任务的Id")] public Guid? JudgeVisitTaskId { get; set; } [Comment("任务阅片状态")] @@ -191,7 +191,7 @@ public class VisitTask : BaseFullAuditEntity [Comment("PM 对该任务进行了回退 影响的任务不设置")] public bool IsPMSetBack { get; set; } - [Comment("裁判结果的任务ID(访视或者全局)")] + [Comment("在裁判任务上记录 裁判结果的任务ID(访视或者全局)")] public Guid? JudgeResultTaskId { get; set; } [Comment("随访任务号 取访视的号 计划外是 访视+0.1 裁判任务在访视任务上+0.002 全局任务在截止访视号上+0.03 肿瘤待定")] public decimal VisitTaskNum { get; set; }