diff --git a/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs b/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs index cd7ab7fbd..b9485e59d 100644 --- a/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs +++ b/IRaCIS.Core.API/Controllers/UploadDownLoadController.cs @@ -212,11 +212,12 @@ namespace IRaCIS.Core.API.Controllers private readonly IRepository _repository; private readonly IEasyCachingProvider _provider; - + private readonly QCCommon _qCCommon; public StudyController(IMapper mapper, IUserInfo userInfo, IWebHostEnvironment hostEnvironment, IMediator mediator, IEasyCachingProvider provider, - + QCCommon qCCommon, IRepository repository) { + _qCCommon = qCCommon; _provider = provider; _hostEnvironment = hostEnvironment; _mediator = mediator; @@ -439,7 +440,7 @@ namespace IRaCIS.Core.API.Controllers public async Task UploadVisitClinicalData(Guid subjectVisitId) { - await QCCommon.VerifyIsCRCSubmmitAsync(_repository, _userInfo, subjectVisitId); + await _qCCommon.VerifyIsCRCSubmmitAsync(_repository, _userInfo, subjectVisitId); var sv = _repository.Where(t => t.Id == subjectVisitId).Select(t => new { t.TrialId, t.SiteId, t.SubjectId }).FirstOrDefault().IfNullThrowException(); await FileUploadAsync(async (fileName) => @@ -677,7 +678,7 @@ namespace IRaCIS.Core.API.Controllers [FromServices] IRepository _noneDicomStudyRepository, [FromServices] IRepository _studyMonitorRepository) { - await QCCommon.VerifyIsCRCSubmmitAsync(_repository, _userInfo, subjectVisitId); + await _qCCommon.VerifyIsCRCSubmmitAsync(_repository, _userInfo, subjectVisitId); var sv = (await _repository.Where(t => t.Id == subjectVisitId).Select(t => new { t.TrialId, t.SiteId, t.SubjectId }).FirstOrDefaultAsync()).IfNullThrowConvertException(); diff --git a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml index 831dafb62..4e69e0b8f 100644 --- a/IRaCIS.Core.Application/IRaCIS.Core.Application.xml +++ b/IRaCIS.Core.Application/IRaCIS.Core.Application.xml @@ -10532,7 +10532,7 @@ - + 获取子元素 diff --git a/IRaCIS.Core.Application/Resources/en-US.json b/IRaCIS.Core.Application/Resources/en-US.json index 510373bba..78a67f193 100644 --- a/IRaCIS.Core.Application/Resources/en-US.json +++ b/IRaCIS.Core.Application/Resources/en-US.json @@ -79,28 +79,36 @@ "VisitTask_DoctorConfiguration": "", "VisitTask_BackendData": "Tasks that have not been completed or have not taken effect are not allowed to request re-reading.", "VisitTask_UnreadTask": "Tasks that re-read has been applied or approved are not allowed to apply for re-read.", + "VisitTask_NoPMRecheck": "", "VisitTask_Reapply": "PM does not allow apply for re-read of consistency analysis tasks.", "VisitTask_ConsistencyAnalysis": "PM only allows apply for re-read that the view type is visit.", "VisitTask_VisitTypeRestriction": "It is currently an ordered read type, and the subject has visit that has applied for re-read, but has not been processed (project team apply for), so it cannot been applied for continuing re-read at this time.", "VisitTask_SequentialReading": "It is currently an ordered read type, and the subject has visit that has applied for re-read, but has not been processed, so it cannot been applied for re-read for now.", "VisitTask_ImageProblem": "It is currently an ordered read type that there is something wrong with the image. The trial team has applied for returning, so it cannot been applied for re-read for now.", "VisitTask_LastReading": "It is an ordered read type, and only the request for re-readinng by the subject reader after completing the global task for the last time is allowed.", + "VisitTask_LastOncologistRecheck": "", + "VisitTask_LastAdjudicatorRecheck": "", + "VisitTask_IRGlobalRecheck": "", "VisitTask_IRReapply": "It is an disordered read type, only tasks that IR applies for global and visit read type to re-read are allowed.", "VisitTask_InvalidReapplyStatus": "The current re-read task state is not in the requested state and cannot be processed. Please refresh the page.", "VisitTask_ReapplyStatusConflict": "The status of the current task requested to be re-read has been affected by another re-read task. The re-read yes/no operation is not allowed for the task in this state", "VisitTask_ReReadTaskNotApplied": "Only tasks the read type is visit are allowed to be approved of re-read.", "VisitTask_ReReadTaskAlreadyAffected": "Do not conform to the PM request and SPM / CPM approve | IR request and PM approve.", "VisitTask_TaskTypeNotApproved": "The current re-read task state is not in the requested state and cannot be processed. Please refresh the page.", + "VisitTask_NoImageReturn": "", "VisitTask_NonEffectiveTaskCannotBeReturned": "Only effective and unfinished visit tasks can be returned. Please refresh the page data.", + "VisitTask_NoFurtherReturn": "", "VisitTask_ConsistencyTaskCannotBeReturned": "The consistency analysis task is not allowed to be set return back.", "VisitTask_PMOnlyAllowedForReturn": "Only the PM can perform the rollback.", "VisitTask_UnsupportedTaskType": "Re-read task types are not supported.", "VisitTask_UndefinedList": "The current user view list is not defined.", + "VisitTask_NoConsistencyReturn": "", "VisitTask_VisitTypeTaskAllowedForPMOnly": "Only visit task type can be returned by PM.", + // ------------------------------------------------------------Common-------------------------------------------------------------------- //CommonDocumentService "Document_CodeDuplication": "The Code of the document cannot be repeated.", @@ -158,6 +166,19 @@ "TrialEmailN_SingleBlindedSequenced": "The single and ordered reading, this type of task should not enter the logic here, please contact the background developers to check!", "TrialEmailN_PDProgressEmailTask": "Send PD progress email found problem with the task data!", "TrialEmailN_DoubleBlindedError": "The adjudication rule processing logic for double and ordered reading is not defined, please contact the business and background developers to check!", + "TrialEmailN_InCons": "", + "TrialEmailN_NoBaseLine": "", + "TrialEmailN_IncompBase": "", + "TrialEmailN_EmailFail": "", + "TrialEmailN_NoReader": "", + "TrialEmailN_NoPDConfig": "", + "TrialEmailN_NoPDTasks": "", + "TrialEmailN_PDNotFinished": "", + "TrialEmailN_PDNoImaging": "", + "TrialEmailN_PDPhaseNotFinished": "", + "TrialEmailN_NoRuleDefined": "", + "TrialEmailN_NoDoubleOrder": "", + "TrialEmailN_NoSendLogicDefined": "", "TrialEmailN_BlindedSequencedReading": "The configuration of the ordered reading is wrong (should be single or double reading), please check!", "TrialEmailN_UnblindedSequencedReading": "The configuration of unordered reading is wrong (should be single reading without adjudication, or double reading with adjudication for visiting ), please check!", "TrialEmailN_InvalidTaskTypeForEmailSending": "Do not send emails for other types of tasks except visit, adjudication and global read. Please check the business logic.", @@ -168,6 +189,7 @@ "TrialEmailN_ConfigurationCorrect": "If this email is received, the email configuration is correct.", "TrialEmailN_InvalidSenderEmailConfig": "The sender configuration is incorrect. Please check whether the server address or authorization code is correct or not.", + // ------------------------------------------------------------Financial-------------------------------------------------------------------- //CalculateService "Cal_VolDataErr": "Volume reward data error.", @@ -236,7 +258,7 @@ "User_EmailDup": "A user with the same email already exists in this user type.", "User_NewOldPwdSame": "The new password is the same as the old one.", "User_OldPwdInvalid": "Failed to verify the old password. ", - //UserService + "User_LegalEmail": "Please input a legal email", "User_VerificationCodeError": "The verification code is wrong.", "User_VerificationCodeExpired": "The verification code has expired.", "User_CreateFailed": "Check the email address or contact maintainers. The email fails to be sent and the account cannot be created", @@ -248,6 +270,7 @@ "UserType_InUse": "User already exists in that user type, and it cannot be deleted.", + // ------------------------------------------------------------QC-------------------------------------------------------------------- //QCCommon "QCCommon_CannotOperate": "CRC has submitted the image and it cannot be operated.", diff --git a/IRaCIS.Core.Application/Resources/zh-CN.json b/IRaCIS.Core.Application/Resources/zh-CN.json index 023b8ba50..622fcef29 100644 --- a/IRaCIS.Core.Application/Resources/zh-CN.json +++ b/IRaCIS.Core.Application/Resources/zh-CN.json @@ -76,25 +76,33 @@ "VisitTask_DoctorConfiguration": "后台数据有错误", "VisitTask_BackendData": "未阅片完成,或者未生效的任务不允许申请重阅", "VisitTask_UnreadTask": "重阅已申请,或者重阅已同意状态下不允许申请重阅", + "VisitTask_NoPMRecheck": "手动生成任务的不允许PM 申请影像重阅", "VisitTask_Reapply": "PM 不允许对一致性分析任务进行申请重阅", "VisitTask_ConsistencyAnalysis": "PM 仅仅允许对访视类型的任务申请重阅", "VisitTask_VisitTypeRestriction": "当前为有序阅片,该受试者已有访视已申请重阅还未处理(项目组申请),暂不能继续申请重阅", "VisitTask_SequentialReading": "当前为有序阅片,该受试者已有访视已申请重阅还未处理,暂不能继续申请重阅", "VisitTask_ImageProblem": "当前为有序阅片,影像存在问题,项目组已申请回退,暂不能申请重阅", "VisitTask_LastReading": "有序阅片,只允许申请该受试者阅片人最后一次完成全局任务重阅", + "VisitTask_LastOncologistRecheck": "有序阅片,只允许申请该受试者阅片人最后一次完成肿瘤学任务重阅", + "VisitTask_LastAdjudicatorRecheck": "有序阅片,只允许申请该受试者阅片人最后一次完成裁判的任务重阅", + "VisitTask_IRGlobalRecheck": "无序阅片,仅仅允许IR 申请 全局和访视类型类别的任务进行重阅", "VisitTask_IRReapply": "无序阅片,仅仅允许IR申请全局和访视类型类别的任务进行重阅", "VisitTask_InvalidReapplyStatus": "当前重阅任务状态不为已申请状态,不允许进行处理,请刷新页面", "VisitTask_ReapplyStatusConflict": "当前申请重阅任务的状态,已被其他任务重阅已影响,不允许对该状态下的任务进行重阅同意与否操作", "VisitTask_ReReadTaskNotApplied": "仅允许同意访视类型的任务重阅", "VisitTask_ReReadTaskAlreadyAffected": "不符合 PM申请 SPM / CPM审批 | IR申请 PM 审批 ", "VisitTask_TaskTypeNotApproved": "当前重阅任务状态不为已申请状态,不允许进行处理,请刷新页面", + "VisitTask_NoImageReturn": "手动生成任务的不允许在此入口影像退回", "VisitTask_NonEffectiveTaskCannotBeReturned": "仅仅允许针对生效、未完成的访视任务进行退回操作,请刷新页面数据", + "VisitTask_NoFurtherReturn": "当前访视已回退到影像上传,不允许继续回退!", "VisitTask_ConsistencyTaskCannotBeReturned": "一致性分析的任务,不允许设置退回", "VisitTask_PMOnlyAllowedForReturn": "仅PM 可以进行回退操作", "VisitTask_UnsupportedTaskType": "不支持重阅的任务类型", "VisitTask_UndefinedList": "当前用户查看列表未定义", + "VisitTask_NoConsistencyReturn": "不允许退回一致性分析任务", "VisitTask_VisitTypeTaskAllowedForPMOnly": "仅仅访视类型的任务支持PM退回", + // ------------------------------------------------------------Common-------------------------------------------------------------------- //CommonDocumentService "Document_CodeDuplication": "文档的Code不能够重复。", @@ -148,6 +156,19 @@ "TrialEmailN_SingleBlindedSequenced": "单重有序阅片 该类型的任务不应进入此处逻辑,请联系后台开发核查!", "TrialEmailN_PDProgressEmailTask": "发送PD 进展邮件中发现任务数据有问题!", "TrialEmailN_DoubleBlindedError": "双重有序阅片 没有定义该仲裁规则处理逻辑,请联系业务和后台开发核查!", + "TrialEmailN_InCons": "项目未配置入组确认!", + "TrialEmailN_NoBaseLine": "不存在配置了入组确认的并且生成任务的基线访视", + "TrialEmailN_IncompBase": "做入组确认的阅片人基线任务没有阅片完!", + "TrialEmailN_EmailFail": "邮件手动生成失败,请联系开发核实该场景失败原因", + "TrialEmailN_NoReader": "当前未有阅片人读完基线任务!", + "TrialEmailN_NoPDConfig": "项目未配置PD进展!", + "TrialEmailN_NoPDTasks": "不存在配置了PD进展的并且生成任务的访视", + "TrialEmailN_PDNotFinished": "当前受试者最新PD访视阅片任务完成状态不符合发送条件", + "TrialEmailN_PDNoImaging": "项目配置了阅片期仲裁,但是当前受试者最新PD访视没有影像学阅片期", + "TrialEmailN_PDPhaseNotFinished": "当前受试者最新PD访视阅片期任务完成状态不符合发送条件", + "TrialEmailN_NoRuleDefined": "未定义该仲裁规则发送业务逻辑!", + "TrialEmailN_NoDoubleOrder": "当前项目配置,不满足双重有序阅片,不满足发送条件!", + "TrialEmailN_NoSendLogicDefined": "当前项目配置,未定义发送业务逻辑!", "TrialEmailN_BlindedSequencedReading": "有序阅片配置有误(应为单重或者双重阅片),请核查!", "TrialEmailN_UnblindedSequencedReading": "无序阅片配置有误(应为单重无仲裁对象,双重针对访视仲裁),请核查!", "TrialEmailN_InvalidTaskTypeForEmailSending": "不应有 除访视、裁判、全局其他类型的任务进行发送邮件,请核查业务逻辑", @@ -157,9 +178,10 @@ "TrialEmailN_EmailTestMessage": "项目邮件测试", "TrialEmailN_ConfigurationCorrect": " 收到此邮件,代表邮件配置正确", "TrialEmailN_InvalidSenderEmailConfig": "发件人配置错误,请核对服务器地址或者授权码是否填写有误", + // ------------------------------------------------------------Financial-------------------------------------------------------------------- //CalculateService - "Cal_VolDataErr": "体积()数据错误", + "Cal_VolDataErr": "体积数据错误", //ExchangeRateService "ExR_SameMthExist": "同月的汇率已存在", "ExR_MthPymtRate": "按月付款采用汇率", @@ -170,6 +192,7 @@ //TrialRevenuesPriceService "TRP_AddMeaningful": "请添加有意义的数据", + // ------------------------------------------------------------ImageAndDoc-------------------------------------------------------------------- //DicomArchiveService "DAS_NoAnonCacheData": "未取到缓存匿名化配置数据,上传停止,请联系开发人员核实", @@ -218,7 +241,7 @@ "User_EmailDup": "该用户类型中已存在具有相同邮箱的用户。", "User_NewOldPwdSame": "新密码与旧密码相同。", "User_OldPwdInvalid": "旧密码验证失败。", - //UserService + "User_LegalEmail": "请输入合法的电子邮件", "User_VerificationCodeError": "验证码错误。", "User_VerificationCodeExpired": "验证码已经过期。", "User_CreateFailed": "请检查邮箱地址或者联系维护人员, 邮件发送失败, 未能创建账户成功", @@ -229,6 +252,7 @@ //UserTypeService "UserType_InUse": "该用户类型中已存在用户,不能删除。", + // ------------------------------------------------------------QC-------------------------------------------------------------------- //QCCommon "QCCommon_CannotOperate": "CRC 已提交影像,不能进行操作。", diff --git a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs index 715291490..f1f40d65a 100644 --- a/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs +++ b/IRaCIS.Core.Application/Service/Allocation/VisitTaskService.cs @@ -1,4 +1,4 @@ -//-------------------------------------------------------------------- +//-------------------------------------------------------------------- // 此代码由T4模板自动生成 byzhouhang 20210918 // 生成时间 2022-06-07 14:10:49 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 @@ -109,7 +109,8 @@ namespace IRaCIS.Core.Application.Service.Allocation if (list.Count == 0) { - throw new BusinessValidationFailedException("该项目还未确认任何一个阅片标准"); + //---该项目还未确认任何一个阅片标准 + throw new BusinessValidationFailedException(_localizer["VisitTask_VisitTask_TaskAlreadyApplied"]); } @@ -265,7 +266,8 @@ namespace IRaCIS.Core.Application.Service.Allocation { if (await _visitTaskRepository.AnyAsync(t => t.TrialReadingCriterionId == cancelCommand.TrialReadingCriterionId && t.SubjectId == command.SubjectId && t.DoctorUserId == command.DoctorUserId && t.ArmEnum == command.ArmEnum && t.ReadingTaskState != ReadingTaskState.WaitReading)) { - throw new BusinessValidationFailedException("当前医生已开始做该Subject 该标准的任务,不允许取消分配"); + //---当前医生已开始做该Subject 该标准的任务,不允许取消分配 + throw new BusinessValidationFailedException(_localizer["VisitTask_DoctorConfigNotFound"]); } await _subjectUserRepository.DeleteFromQueryAsync(t => t.Id == command.Id); @@ -312,25 +314,29 @@ namespace IRaCIS.Core.Application.Service.Allocation if (await _visitTaskRepository.AnyAsync(t => t.SourceSubjectVisitId == visitTask.SourceSubjectVisitId && t.TaskAllocationState == TaskAllocationState.Allocated && t.DoctorUserId == assignSubjectTaskToDoctorCommand.DoctorUserId && t.Id != visitTask.Id)) { - return ResponseOutput.NotOk("其中一个任务已分配给该医生,不允许分配"); + //---其中一个任务已分配给该医生,不允许分配 + return ResponseOutput.NotOk(_localizer["VisitTask_BackendDataError"]); } } else if (visitTask.SouceReadModuleId != null) { if (await _visitTaskRepository.AnyAsync(t => t.SouceReadModuleId == visitTask.SouceReadModuleId && t.TaskAllocationState == TaskAllocationState.Allocated && t.DoctorUserId == assignSubjectTaskToDoctorCommand.DoctorUserId && t.Id != visitTask.Id)) { - return ResponseOutput.NotOk("其中一个任务已分配给该医生,不允许分配"); + //---其中一个任务已分配给该医生,不允许分配 + return ResponseOutput.NotOk(_localizer["VisitTask_BackendDataError"]); } } else { - throw new BusinessValidationFailedException("出现脏数据 任务来源字段没有值"); + //---出现脏数据 任务来源字段没有值 + throw new BusinessValidationFailedException(_localizer["VisitTask_DirtyData"]); } //PM 回退了 但是还没生成任务 当前任务编号前有访视进行了回退就不允许分配 if (await _subjectVisitRepository.AnyAsync(t => t.SubjectId == visitTask.SubjectId && t.IsPMBackOrReReading && t.VisitNum <= visitTask.VisitTaskNum)) { - return ResponseOutput.NotOk("该受试者有访视进入了退回流程,还未经过一致性核查通过,不允许分配"); + //---该受试者有访视进入了退回流程,还未经过一致性核查通过,不允许分配 + return ResponseOutput.NotOk(_localizer["VisitTask_MissingTaskSource"]); } @@ -473,12 +479,14 @@ namespace IRaCIS.Core.Application.Service.Allocation if (await _subjectUserRepository.AnyAsync(t => t.TrialId == trialId && t.SubjectId == subjectId && t.DoctorUserId == doctorUserId && t.ArmEnum != armEnum && t.OrignalSubjectUserId == null)) { - throw new BusinessValidationFailedException("有Subject 在其他Arm组已有该医生,不允许在新的组添加该医生"); + //---有Subject 在其他Arm组已有该医生,不允许在新的组添加该医生 + throw new BusinessValidationFailedException(_localizer["VisitTask_InconsistentSubjectStatus"]); } if (await _subjectUserRepository.AnyAsync(t => t.TrialId == trialId && t.SubjectId == subjectId && t.DoctorUserId == doctorUserId && t.ArmEnum == armEnum && t.OrignalSubjectUserId == null)) { - throw new BusinessValidationFailedException("有Subject 已有该Arm组的医生,不允许继续分配,请刷新页面,确认页面数据是否过期"); + //---有Subject 已有该Arm组的医生,不允许继续分配,请刷新页面,确认页面数据是否过期 + throw new BusinessValidationFailedException(_localizer["VisitTask_DuplicateDoctorInArm"]); } else { @@ -510,7 +518,8 @@ namespace IRaCIS.Core.Application.Service.Allocation { if (await _visitTaskRepository.AnyAsync(t => t.SubjectId == subjectId && t.DoctorUserId != null && t.ArmEnum == Arm.JudgeArm)) { - throw new BusinessValidationFailedException("有Subject任务已应用,不允许取消分配"); + //---有Subject任务已应用,不允许取消分配 + throw new BusinessValidationFailedException(_localizer["VisitTask_DoctorAlreadyInArm"]); } await _subjectUserRepository.DeleteFromQueryAsync(t => t.SubjectId == subjectId && t.ArmEnum == Arm.JudgeArm); @@ -522,7 +531,8 @@ namespace IRaCIS.Core.Application.Service.Allocation { if (await _visitTaskRepository.AnyAsync(t => t.SubjectId == subjectId && t.DoctorUserId != null && t.ArmEnum != Arm.JudgeArm)) { - throw new BusinessValidationFailedException("有Subject任务已应用,不允许取消分配"); + //---有Subject任务已应用,不允许取消分配 + throw new BusinessValidationFailedException(_localizer["VisitTask_DoctorAlreadyInArm"]); } await _subjectUserRepository.DeleteFromQueryAsync(t => t.SubjectId == subjectId && t.ArmEnum != Arm.JudgeArm); @@ -614,7 +624,8 @@ namespace IRaCIS.Core.Application.Service.Allocation } else { - throw new BusinessValidationFailedException("在配置表中未找到配置的医生,无法应用绑定,请核对数据"); + //---在配置表中未找到配置的医生,无法应用绑定,请核对数据 + throw new BusinessValidationFailedException(_localizer["VisitTask_TaskAlreadyApplied"]); } } @@ -1217,7 +1228,8 @@ namespace IRaCIS.Core.Application.Service.Allocation if (requestRecordList.Count() != baseLineTaskIdList.Count()) { - return ResponseOutput.NotOk("后台数据有错误"); + //---后台数据有错误 + return ResponseOutput.NotOk(_localizer["VisitTask_DoctorConfiguration"]); } await ConfirmReReading(new ConfirmReReadingCommand() @@ -1261,12 +1273,14 @@ namespace IRaCIS.Core.Application.Service.Allocation if (task.ReadingTaskState != ReadingTaskState.HaveSigned || task.TaskState != TaskState.Effect) { - throw new BusinessValidationFailedException("未阅片完成,或者未生效的任务不允许申请重阅"); + //---未阅片完成,或者未生效的任务不允许申请重阅 + throw new BusinessValidationFailedException(_localizer["VisitTask_BackendData"]); } if (task.ReReadingApplyState == ReReadingApplyState.DocotorHaveApplyed || task.ReReadingApplyState == ReReadingApplyState.TrialGroupHaveApplyed || task.ReReadingApplyState == ReReadingApplyState.Agree) { - throw new BusinessValidationFailedException("重阅已申请,或者重阅已同意状态下不允许申请重阅"); + //---重阅已申请,或者重阅已同意状态下不允许申请重阅 + throw new BusinessValidationFailedException(_localizer["VisitTask_UnreadTask"]); } @@ -1276,17 +1290,20 @@ namespace IRaCIS.Core.Application.Service.Allocation { if (criterionConfig.IsAutoCreate == false) { - return ResponseOutput.NotOk("手动生成任务的不允许PM 申请影像重阅"); + //---手动生成任务的不允许PM 申请影像重阅 + return ResponseOutput.NotOk(_localizer["VisitTask_NoPMRecheck"]); } if (task.IsAnalysisCreate) { - throw new BusinessValidationFailedException("PM 不允许对一致性分析任务进行申请重阅"); + //---PM 不允许对一致性分析任务进行申请重阅 + throw new BusinessValidationFailedException(_localizer["VisitTask_Reapply"]); } if (task.ReadingCategory != ReadingCategory.Visit) { - throw new BusinessValidationFailedException("PM 仅仅允许对访视类型的任务申请重阅"); + //---PM 仅仅允许对访视类型的任务申请重阅 + throw new BusinessValidationFailedException(_localizer["VisitTask_ConsistencyAnalysis"]); } @@ -1297,7 +1314,8 @@ namespace IRaCIS.Core.Application.Service.Allocation && t.OriginalReReadingTask.TrialReadingCriterionId == task.TrialReadingCriterionId && t.OriginalReReadingTask.ReadingTaskState == ReadingTaskState.HaveSigned && t.RequestReReadingType == RequestReReadingType.TrialGroupApply && t.RequestReReadingResultEnum == RequestReReadingResult.Default)) { - return ResponseOutput.NotOk("当前为有序阅片,该受试者已有访视已申请重阅还未处理(项目组申请),暂不能继续申请重阅"); + //---当前为有序阅片,该受试者已有访视已申请重阅还未处理(项目组申请),暂不能继续申请重阅 + return ResponseOutput.NotOk(_localizer["VisitTask_VisitTypeRestriction"]); } } @@ -1318,7 +1336,8 @@ namespace IRaCIS.Core.Application.Service.Allocation && t.OriginalReReadingTask.TrialReadingCriterionId == task.TrialReadingCriterionId && t.OriginalReReadingTask.ReadingTaskState == ReadingTaskState.HaveSigned && t.RequestReReadingType == RequestReReadingType.DocotorApply && t.RequestReReadingResultEnum == RequestReReadingResult.Default)) { - return ResponseOutput.NotOk("当前为有序阅片,该受试者已有访视已申请重阅还未处理,暂不能继续申请重阅"); + //---当前为有序阅片,该受试者已有访视已申请重阅还未处理,暂不能继续申请重阅 + return ResponseOutput.NotOk(_localizer["VisitTask_SequentialReading"]); } @@ -1334,7 +1353,8 @@ namespace IRaCIS.Core.Application.Service.Allocation //PM 有序影响列表 if (await _visitTaskRepository.Where(t => t.TrialId == originalTask.TrialId && t.SubjectId == originalTask.SubjectId && t.TaskState == TaskState.Effect && t.TaskAllocationState == TaskAllocationState.Allocated && t.IsAnalysisCreate == false && t.TrialReadingCriterionId == originalTask.TrialReadingCriterionId && t.VisitTaskNum > originalTask.VisitTaskNum).AnyAsync(t => t.VisitTaskNum == task.VisitTaskNum)) { - return ResponseOutput.NotOk("当前为有序阅片,影像存在问题,项目组已申请回退,暂不能申请重阅"); + //---当前为有序阅片,影像存在问题,项目组已申请回退,暂不能申请重阅 + return ResponseOutput.NotOk(_localizer["VisitTask_ImageProblem"]); } } @@ -1348,17 +1368,20 @@ namespace IRaCIS.Core.Application.Service.Allocation if (task.ReadingCategory == ReadingCategory.Judge && await _visitTaskRepository.AnyAsync(filterExpression.And(t => t.ReadingCategory == ReadingCategory.Global))) { - throw new BusinessValidationFailedException("有序阅片,只允许申请该受试者阅片人最后一次完成全局任务重阅"); + //---有序阅片,只允许申请该受试者阅片人最后一次完成全局任务重阅 + throw new BusinessValidationFailedException(_localizer["VisitTask_LastReading"]); } if (task.ReadingCategory == ReadingCategory.Oncology && await _visitTaskRepository.AnyAsync(filterExpression.And(t => t.ReadingCategory == ReadingCategory.Oncology))) { - throw new BusinessValidationFailedException("有序阅片,只允许申请该受试者阅片人最后一次完成肿瘤学任务重阅"); + //---有序阅片,只允许申请该受试者阅片人最后一次完成肿瘤学任务重阅 + throw new BusinessValidationFailedException(_localizer["VisitTask_LastOncologistRecheck"]); } if (task.ReadingCategory == ReadingCategory.Judge && await _visitTaskRepository.AnyAsync(filterExpression.And(t => t.ReadingCategory == ReadingCategory.Judge))) { - throw new BusinessValidationFailedException("有序阅片,只允许申请该受试者阅片人最后一次完成裁判的任务重阅"); + //---有序阅片,只允许申请该受试者阅片人最后一次完成裁判的任务重阅 + throw new BusinessValidationFailedException(_localizer["VisitTask_LastAdjudicatorRecheck"]); } } @@ -1366,7 +1389,8 @@ namespace IRaCIS.Core.Application.Service.Allocation { if (task.ReadingCategory != ReadingCategory.Visit && task.ReadingCategory != ReadingCategory.Global) { - throw new BusinessValidationFailedException("无序阅片,仅仅允许IR 申请 全局和访视类型类别的任务进行重阅"); + //---无序阅片,仅仅允许IR 申请 全局和访视类型类别的任务进行重阅 + throw new BusinessValidationFailedException(_localizer["VisitTask_IRGlobalRecheck"]); } } @@ -1419,7 +1443,8 @@ namespace IRaCIS.Core.Application.Service.Allocation } else { - throw new BusinessValidationFailedException("当前重阅任务状态不为已申请状态,不允许进行处理,请刷新页面"); + //---当前重阅任务状态不为已申请状态,不允许进行处理,请刷新页面 + throw new BusinessValidationFailedException(_localizer["VisitTask_InvalidReapplyStatus"]); } } @@ -1491,7 +1516,8 @@ namespace IRaCIS.Core.Application.Service.Allocation if (origenalTask.TaskState != TaskState.Effect) { - return ResponseOutput.NotOk("当前申请重阅任务的状态,已被其他任务重阅已影响,不允许对该状态下的任务进行重阅同意与否操作"); + //---当前申请重阅任务的状态,已被其他任务重阅已影响,不允许对该状态下的任务进行重阅同意与否操作 + return ResponseOutput.NotOk(_localizer["VisitTask_ReapplyStatusConflict"]); } @@ -1552,7 +1578,8 @@ namespace IRaCIS.Core.Application.Service.Allocation } else { - throw new BusinessValidationFailedException("仅允许同意访视类型的任务重阅"); + //---仅允许同意访视类型的任务重阅 + throw new BusinessValidationFailedException(_localizer["VisitTask_ReReadTaskNotApplied"]); } //有序阅片 @@ -1780,7 +1807,8 @@ namespace IRaCIS.Core.Application.Service.Allocation default: - throw new BusinessValidationFailedException("不支持重阅的任务类型"); + //---不支持重阅的任务类型 + throw new BusinessValidationFailedException(_localizer["VisitTask_UnsupportedTaskType"]); } @@ -2008,7 +2036,8 @@ namespace IRaCIS.Core.Application.Service.Allocation } else { - throw new BusinessValidationFailedException("不符合 PM申请 SPM / CPM审批 | IR申请 PM 审批 "); + //---不符合 PM申请 SPM / CPM审批 | IR申请 PM 审批 + throw new BusinessValidationFailedException(_localizer["VisitTask_ReReadTaskAlreadyAffected"]); } } @@ -2024,7 +2053,8 @@ namespace IRaCIS.Core.Application.Service.Allocation } else { - throw new BusinessValidationFailedException("当前重阅任务状态不为已申请状态,不允许进行处理,请刷新页面"); + //---当前重阅任务状态不为已申请状态,不允许进行处理,请刷新页面 + throw new BusinessValidationFailedException(_localizer["VisitTask_InvalidReapplyStatus"]); } } @@ -2064,24 +2094,28 @@ namespace IRaCIS.Core.Application.Service.Allocation if (criterionConfig.IsAutoCreate == false) { - return ResponseOutput.NotOk("手动生成任务的不允许在此入口影像退回"); + //---手动生成任务的不允许在此入口影像退回 + return ResponseOutput.NotOk(_localizer["VisitTask_NoImageReturn"]); } if (task.TaskState != TaskState.Effect || task.ReadingCategory != ReadingCategory.Visit || task.ReadingTaskState == ReadingTaskState.HaveSigned) { - return ResponseOutput.NotOk("仅仅允许针对生效、未完成的访视任务进行退回操作,请刷新页面数据"); + //---仅仅允许针对生效、未完成的访视任务进行退回操作,请刷新页面数据 + return ResponseOutput.NotOk(_localizer["VisitTask_NonEffectiveTaskCannotBeReturned"]); } if (await _subjectVisitRepository.AnyAsync(t => t.Id == task.SourceSubjectVisitId && t.CheckState != CheckStateEnum.CVPassed)) { - return ResponseOutput.NotOk("当前访视已回退到影像上传,不允许继续回退!"); + //---当前访视已回退到影像上传,不允许继续回退! + return ResponseOutput.NotOk(_localizer["VisitTask_NoFurtherReturn"]); } if (task.IsAnalysisCreate) { - return ResponseOutput.NotOk("一致性分析的任务,不允许设置退回"); + //---一致性分析的任务,不允许设置退回 + return ResponseOutput.NotOk(_localizer["VisitTask_ConsistencyTaskCannotBeReturned"]); } Expression> filterExpression = t => t.TrialId == trialId && t.SubjectId == task.SubjectId && (t.TaskState == TaskState.Effect || t.TaskState == TaskState.Freeze) && t.TaskAllocationState == TaskAllocationState.Allocated; @@ -2357,7 +2391,8 @@ namespace IRaCIS.Core.Application.Service.Allocation } else { - return ResponseOutput.NotOk("仅PM 可以进行回退操作"); + //---仅PM 可以进行回退操作 + return ResponseOutput.NotOk(_localizer["VisitTask_PMOnlyAllowedForReturn"]); } @@ -2625,7 +2660,8 @@ namespace IRaCIS.Core.Application.Service.Allocation default: - throw new BusinessValidationFailedException("不支持重阅的任务类型"); + //---不支持重阅的任务类型 + throw new BusinessValidationFailedException(_localizer["VisitTask_UnsupportedTaskType"]); } } //无序 @@ -2657,7 +2693,8 @@ namespace IRaCIS.Core.Application.Service.Allocation break; default: - throw new BusinessValidationFailedException("不支持重阅的任务类型"); + //---不支持重阅的任务类型 + throw new BusinessValidationFailedException(_localizer["VisitTask_UnsupportedTaskType"]); } if (await _visitTaskReReadingRepository.AnyAsync(t => t.RequestReReadingType == RequestReReadingType.DocotorApply && t.RequestReReadingResultEnum == RequestReReadingResult.Default && @@ -2681,7 +2718,8 @@ namespace IRaCIS.Core.Application.Service.Allocation } else { - throw new BusinessValidationFailedException("当前用户查看列表未定义"); + //---当前用户查看列表未定义 + throw new BusinessValidationFailedException(_localizer["VisitTask_UndefinedList"]); } @@ -2695,7 +2733,8 @@ namespace IRaCIS.Core.Application.Service.Allocation if (filterObj.IsAnalysisCreate) { - throw new BusinessValidationFailedException("不允许退回一致性分析任务"); + //---不允许退回一致性分析任务 + throw new BusinessValidationFailedException(_localizer["VisitTask_NoConsistencyReturn"]); } if (filterObj.ReadingCategory == ReadingCategory.Visit && _userInfo.UserTypeEnumInt == (int)UserTypeEnum.ProjectManager) @@ -2724,7 +2763,8 @@ namespace IRaCIS.Core.Application.Service.Allocation } else { - throw new BusinessValidationFailedException("仅仅访视类型的任务支持PM退回"); + //---仅仅访视类型的任务支持PM退回 + throw new BusinessValidationFailedException(_localizer["VisitTask_VisitTypeTaskAllowedForPMOnly"]); } } diff --git a/IRaCIS.Core.Application/Service/Common/CommonDocumentService.cs b/IRaCIS.Core.Application/Service/Common/CommonDocumentService.cs index 0328e088d..d9e1cfe9f 100644 --- a/IRaCIS.Core.Application/Service/Common/CommonDocumentService.cs +++ b/IRaCIS.Core.Application/Service/Common/CommonDocumentService.cs @@ -1,4 +1,4 @@ -//-------------------------------------------------------------------- +//-------------------------------------------------------------------- // 此代码由T4模板自动生成 byzhouhang 20210918 // 生成时间 2022-03-31 13:18:56 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 @@ -49,7 +49,8 @@ namespace IRaCIS.Core.Application.Service var verifyExp1 = new EntityVerifyExp() { VerifyExp = t => t.Code == addOrEditCommonDocument.Code, - VerifyMsg = "文档的Code不能够重复。" + //---文档的Code不能够重复。 + VerifyMsg = _localizer["Document_CodeDuplication"] }; //var verifyExp3 = new EntityVerifyExp() @@ -61,10 +62,11 @@ namespace IRaCIS.Core.Application.Service var verifyExp2 = new EntityVerifyExp() { - VerifyExp = t => t.CriterionTypeEnum == addOrEditCommonDocument.CriterionTypeEnum && t.BusinessScenarioEnum==addOrEditCommonDocument.BusinessScenarioEnum && - t.IsDeleted==addOrEditCommonDocument.IsDeleted, - VerifyMsg = "一个场景一个标准只允许有一个模板文档", - IsVerify=addOrEditCommonDocument.CriterionTypeEnum !=null && addOrEditCommonDocument.IsDeleted==false + VerifyExp = t => t.CriterionTypeEnum == addOrEditCommonDocument.CriterionTypeEnum && t.BusinessScenarioEnum == addOrEditCommonDocument.BusinessScenarioEnum && + t.IsDeleted == addOrEditCommonDocument.IsDeleted, + //---一个场景一个标准只允许有一个模板文档 + VerifyMsg = _localizer["Document_SingleTemplate"], + IsVerify = addOrEditCommonDocument.CriterionTypeEnum != null && addOrEditCommonDocument.IsDeleted == false }; @@ -91,10 +93,11 @@ namespace IRaCIS.Core.Application.Service } - catch (Exception ) + catch (Exception) { - return ResponseOutput.NotOk("读取模板内容失败, 请将文件另存为docx格式尝试!"); + //---读取模板内容失败, 请将文件另存为docx格式尝试! + return ResponseOutput.NotOk(_localizer["Document_ TemplateRead"]); } diff --git a/IRaCIS.Core.Application/Service/Common/DictionaryService.cs b/IRaCIS.Core.Application/Service/Common/DictionaryService.cs index 0a9095e23..d3c8f65dc 100644 --- a/IRaCIS.Core.Application/Service/Common/DictionaryService.cs +++ b/IRaCIS.Core.Application/Service/Common/DictionaryService.cs @@ -121,9 +121,10 @@ namespace IRaCIS.Application.Services { var verifyExp1 = new EntityVerifyExp() { - VerifyExp = t => t.Code == addOrEditBasic.Code&&t.ParentId== addOrEditBasic.ParentId, - VerifyMsg = $"已有{addOrEditBasic.Code}名称的字典", - IsVerify= addOrEditBasic.ParentId ==null + VerifyExp = t => t.Code == addOrEditBasic.Code && t.ParentId == addOrEditBasic.ParentId, + //---------- $"已有{addOrEditBasic.Code}名称的字典" + VerifyMsg = _localizer["Dictionary_DictionaryName", addOrEditBasic.Code], + IsVerify = addOrEditBasic.ParentId == null }; @@ -138,7 +139,7 @@ namespace IRaCIS.Application.Services //} - if (addOrEditBasic.Id != null && addOrEditBasic.ParentId==null) + if (addOrEditBasic.Id != null && addOrEditBasic.ParentId == null) { await _dicRepository.UpdatePartialFromQueryAsync(t => t.ParentId == addOrEditBasic.Id, c => new Dictionary() { DataTypeEnum = addOrEditBasic.DataTypeEnum }); @@ -174,12 +175,14 @@ namespace IRaCIS.Application.Services if (await _readingCriterionDictionaryRepository.AnyAsync(x => x.DictionaryId == id)) { await _readingCriterionDictionaryRepository.BatchDeleteNoTrackingAsync(t => t.DictionaryId == id); - //return ResponseOutput.NotOk("当前字典在标准中被引用,不允许删除!"); + //---当前字典在标准中被引用,不允许删除! + //return ResponseOutput.NotOk(_localizer["Dictionary_DictionaryDeletion"]); } if (await _dicRepository.AnyAsync(t => t.ParentId == id)) { - return ResponseOutput.NotOk("有子项数据,不允许直接删除!"); + //---有子项数据,不允许直接删除! + return ResponseOutput.NotOk(_localizer["Dictionary_SubitemDeletion"]); } if ((await _doctorDictionaryRepository.AnyAsync(t => t.DictionaryId == id)) || @@ -187,19 +190,22 @@ namespace IRaCIS.Application.Services ) { - return ResponseOutput.NotOk("当前条目已经在阅片人的简历中被引用。"); + //---当前条目已经在阅片人的简历中被引用。 + return ResponseOutput.NotOk(_localizer["Dictionary_ResumeReference"]); } if (await _trialDictionaryRepository.AnyAsync(t => t.DictionaryId == id) || await _trialRepository.AnyAsync(t => t.ReviewModeId == id)) { - return ResponseOutput.NotOk("当前条目已经在项目信息中被引用。"); + //---当前条目已经在项目信息中被引用。 + return ResponseOutput.NotOk(_localizer["Dictionary_ProjectReference"]); } if (await _readingCriterionDictionaryRepository.AnyAsync(x => x.DictionaryId == id)) { await _readingCriterionDictionaryRepository.BatchDeleteNoTrackingAsync(t => t.DictionaryId == id); - //return ResponseOutput.NotOk("当前条目已经在阅片标准中被引用。"); + //---当前条目已经在阅片标准中被引用。 + //return ResponseOutput.NotOk(_localizer["Dictionary_StandardReference"]); } var success = await _dicRepository.BatchDeleteNoTrackingAsync(t => t.Id == id); @@ -243,7 +249,7 @@ namespace IRaCIS.Application.Services /// public async Task> GetBasicConfigSelect(string searchKey) { - var searchList = await _dicRepository.Where(t => t.ConfigDictionary.Code == searchKey && t.ParentId == null && t.IsEnable).ProjectTo(_mapper.ConfigurationProvider).OrderBy(x=>x.ShowOrder).ToListAsync(); + var searchList = await _dicRepository.Where(t => t.ConfigDictionary.Code == searchKey && t.ParentId == null && t.IsEnable).ProjectTo(_mapper.ConfigurationProvider).OrderBy(x => x.ShowOrder).ToListAsync(); return searchList; } @@ -254,12 +260,12 @@ namespace IRaCIS.Application.Services /// public async Task> GetCriterionDictionaryList(GetCriterionDictionaryListInDto inDto) { - var criterionCodes= await _systemCriterionDictionaryCodeRepository.Where(x => x.SystemCriterionId == inDto.SystemCriterionId).ToListAsync(); + var criterionCodes = await _systemCriterionDictionaryCodeRepository.Where(x => x.SystemCriterionId == inDto.SystemCriterionId).ToListAsync(); - var parentCodes = await _readingCriterionDictionaryRepository.Where(x => x.CriterionId== inDto.SystemCriterionId).Select(x => x.ParentCode).ToListAsync(); + var parentCodes = await _readingCriterionDictionaryRepository.Where(x => x.CriterionId == inDto.SystemCriterionId).Select(x => x.ParentCode).ToListAsync(); - var codes = criterionCodes.Select(x=>x.Code).ToList(); + var codes = criterionCodes.Select(x => x.Code).ToList(); var dictionaryList = await _dicRepository.Where(x => codes.Contains(x.Code) && x.ParentId == null) .OrderBy(x => x.ShowOrder).Select(x => new GetCriterionDictionaryListOutDto() @@ -269,7 +275,8 @@ namespace IRaCIS.Application.Services Description = x.Description }).ToListAsync(); - dictionaryList.ForEach(x => { + dictionaryList.ForEach(x => + { x.Count = parentCodes.Count(y => y == x.Code); x.Id = criterionCodes.Where(y => y.Code == x.Code).Select(x => x.Id).FirstOrDefault(); }); @@ -299,7 +306,8 @@ namespace IRaCIS.Application.Services Description = x.Description }).ToListAsync(); - dictionaryList.ForEach(x => { + dictionaryList.ForEach(x => + { x.Count = parentCodes.Count(y => y == x.Code); x.Id = criterionCodes.Where(y => y.Code == x.Code).Select(x => x.Id).FirstOrDefault(); }); @@ -317,8 +325,8 @@ namespace IRaCIS.Application.Services public async Task>> GetCriterionDictionary(GetCriterionDictionaryInDto inDto) { var searchList = await _dicRepository.Where(t => t.ParentId != null && t.IsEnable) - .WhereIf(!inDto.DictionaryCode.IsNullOrEmpty(), x =>x.Parent.Code==inDto.DictionaryCode) - .WhereIf(inDto.DictionaryCodeList.Count()>0, x => inDto.DictionaryCodeList.Contains(x.Parent.Code)) + .WhereIf(!inDto.DictionaryCode.IsNullOrEmpty(), x => x.Parent.Code == inDto.DictionaryCode) + .WhereIf(inDto.DictionaryCodeList.Count() > 0, x => inDto.DictionaryCodeList.Contains(x.Parent.Code)) .ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); var result = searchList.GroupBy(t => t.ParentCode).ToDictionary(g => g.Key, g => g.OrderBy(t => t.ShowOrder).ToList()); @@ -348,7 +356,7 @@ namespace IRaCIS.Application.Services { if (result.ContainsKey(item)) { - result[item] = new List (); + result[item] = new List(); } } @@ -361,7 +369,7 @@ namespace IRaCIS.Application.Services ParentChildCodeEnum = x.Dictionary.Parent.ChildCodeEnum, ShowOrder = x.Dictionary.ShowOrder, ParentCode = x.ParentCode, - CrterionDictionaryGroup=x.CrterionDictionaryGroup, + CrterionDictionaryGroup = x.CrterionDictionaryGroup, Id = x.DictionaryId, ParentId = x.Dictionary.ParentId, Value = x.Dictionary.Value, @@ -380,7 +388,7 @@ namespace IRaCIS.Application.Services result[item.Key] = item.Value; } - + } return result; @@ -396,7 +404,7 @@ namespace IRaCIS.Application.Services [AllowAnonymous] public async Task>> GetBasicDataAllSelect(GetBasicDataAllSelectInDto inDto) { - var searchList = await _dicRepository.Where(t => t.ParentId != null && t.IsEnable ).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); + var searchList = await _dicRepository.Where(t => t.ParentId != null && t.IsEnable).ProjectTo(_mapper.ConfigurationProvider).ToListAsync(); var result = searchList.GroupBy(t => t.ParentCode).ToDictionary(g => g.Key, g => g.OrderBy(t => t.ShowOrder).ToList()); @@ -406,7 +414,7 @@ namespace IRaCIS.Application.Services } else { - List selectCode = await _trialCriterionDictionaryCodeRepository.Where(x => x.TrialCriterionId == inDto.TrialReadingCriterionId).Select(x => x.Code).ToListAsync(); + List selectCode = await _trialCriterionDictionaryCodeRepository.Where(x => x.TrialCriterionId == inDto.TrialReadingCriterionId).Select(x => x.Code).ToListAsync(); var criterionCode = await _dicRepository.Where(x => x.ConfigDictionary.Code == "Reading_eCRF_Criterion").Select(x => x.Code).ToListAsync(); @@ -427,13 +435,13 @@ namespace IRaCIS.Application.Services { ChildGroup = x.Dictionary.ChildGroup, Code = x.Dictionary.Code, - Description=x.Dictionary.Description, + Description = x.Dictionary.Description, DataTypeEnum = x.Dictionary.DataTypeEnum, ParentChildCodeEnum = x.Dictionary.Parent.ChildCodeEnum, ShowOrder = x.Dictionary.ShowOrder, ParentCode = x.ParentCode, Id = x.DictionaryId, - CrterionDictionaryGroup=x.CrterionDictionaryGroup, + CrterionDictionaryGroup = x.CrterionDictionaryGroup, ParentId = x.Dictionary.ParentId, Value = x.Dictionary.Value, ValueCN = x.Dictionary.ValueCN @@ -452,7 +460,7 @@ namespace IRaCIS.Application.Services return result; } - + } #region 稽查相关 diff --git a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs index a58d864f8..ca144f0c6 100644 --- a/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs +++ b/IRaCIS.Core.Application/Service/Common/ExcelExportService.cs @@ -730,7 +730,8 @@ namespace IRaCIS.Core.Application.Service.Common if (criterion.CriterionType != CriterionType.RECIST1Point1) { - throw new Exception("当前标准导出还未支持"); + //---当前标准导出还未支持 + throw new Exception(_localizer["ExcelExport_UnsupportedExport"]); } //产生一致性分析的Subject @@ -811,7 +812,8 @@ namespace IRaCIS.Core.Application.Service.Common if (criterion.CriterionType != CriterionType.RECIST1Point1) { - throw new Exception("当前标准导出还未支持"); +//---当前标准导出还未支持 + throw new Exception(_localizer["ExcelExport_UnsupportedExport"]); } //产生组间一致性分析的Subject @@ -978,7 +980,8 @@ namespace IRaCIS.Core.Application.Service.Common if (criterion.CriterionType != CriterionType.RECIST1Point1 && criterion.CriterionType != CriterionType.PCWG3) { - throw new Exception("当前标准导出还未支持"); +//---当前标准导出还未支持 + throw new Exception(_localizer["ExcelExport_UnsupportedExport"]); } var list = await _repository.Where(t => t.TrialId == queryVisitTask.TrialId && t.TaskState == TaskState.Effect && t.IsAnalysisCreate == false && t.ReadingTaskState == ReadingTaskState.HaveSigned) @@ -1068,7 +1071,8 @@ namespace IRaCIS.Core.Application.Service.Common else { - throw new Exception("当前标准导出还未支持"); +//---当前标准导出还未支持 + throw new Exception(_localizer["ExcelExport_UnsupportedExport"]); } @@ -1184,7 +1188,8 @@ namespace IRaCIS.Core.Application.Service.Common else { - throw new Exception("当前标准导出还未支持"); +//---当前标准导出还未支持 + throw new Exception(_localizer["ExcelExport_UnsupportedExport"]); } diff --git a/IRaCIS.Core.Application/Service/Common/MailService.cs b/IRaCIS.Core.Application/Service/Common/MailService.cs index cdd1685d2..2fb174888 100644 --- a/IRaCIS.Core.Application/Service/Common/MailService.cs +++ b/IRaCIS.Core.Application/Service/Common/MailService.cs @@ -37,7 +37,7 @@ namespace IRaCIS.Application.Services } - public class MailVerificationService : IMailVerificationService + public class MailVerificationService : BaseService, IMailVerificationService { private readonly IRepository _verificationCodeRepository; @@ -100,7 +100,8 @@ namespace IRaCIS.Application.Services //收件地址 messageToSend.To.Add(new MailboxAddress(userName, emailAddress)); //主题 - messageToSend.Subject = "[来自展影IRC] 关于重置邮箱的提醒"; + //---[来自展影IRC] 关于重置邮箱的提醒 + messageToSend.Subject = _localizer["Mail_EmailResetReminder"]; var builder = new BodyBuilder(); @@ -117,8 +118,11 @@ namespace IRaCIS.Application.Services builder.HtmlBody = string.Format(templateInfo, - $" 尊敬的 {userName} , ", - "您正在进行邮箱重置操作", + + //---尊敬的 + _localizer["Mail_Dear", userName], + //---您正在进行邮箱重置操作 + _localizer["Mail_ResettingEmail"], verificationCode ); } @@ -161,7 +165,8 @@ namespace IRaCIS.Application.Services //收件地址 messageToSend.To.Add(new MailboxAddress(String.Empty, emailAddress)); //主题 - messageToSend.Subject = "[来自展影IRC] 关于重置密码的提醒"; + //---[来自展影IRC] 关于重置密码的提醒 + messageToSend.Subject = _localizer["Mail_IRCResettingPassword "]; @@ -180,7 +185,8 @@ namespace IRaCIS.Application.Services builder.HtmlBody = string.Format(templateInfo, "", - "您正在进行邮箱重置密码操作", + //---您正在进行邮箱重置密码操作 + _localizer["Mail_ResettingPassword "], verificationCode ); } @@ -226,7 +232,8 @@ namespace IRaCIS.Application.Services //收件地址 messageToSend.To.Add(new MailboxAddress(String.Empty, emailAddress)); //主题 - messageToSend.Subject = $"[来自展影IRC]的提醒"; + //---[来自展影IRC]的提醒 + messageToSend.Subject = _localizer["Mail_ImagingIRCReminder"]; @@ -246,7 +253,8 @@ namespace IRaCIS.Application.Services builder.HtmlBody = string.Format(templateInfo, "", - "您正在参与展影医疗IRC项目", + //---您正在参与展影医疗IRC项目 + _localizer["Mail_IRCProject"], verificationCode ); } @@ -290,7 +298,8 @@ namespace IRaCIS.Application.Services //收件地址 messageToSend.To.Add(new MailboxAddress(String.Empty, emailAddress)); //主题 - messageToSend.Subject = $"[来自展影IRC] [{researchProgramNo}] 关于中心调研的提醒"; + //$"[来自展影IRC] [{researchProgramNo}] 关于中心调研的提醒"; + messageToSend.Subject = _localizer["Mail_ProjectParticipationReminder", researchProgramNo]; @@ -310,7 +319,8 @@ namespace IRaCIS.Application.Services builder.HtmlBody = string.Format(templateInfo, "", - "您正在参与展影医疗IRC项目中心调研工作", + //---您正在参与展影医疗IRC项目中心调研工作 + _localizer["Mail_CenterResearchReminder"], verificationCode ); } @@ -367,7 +377,8 @@ namespace IRaCIS.Application.Services //收件地址 messageToSend.To.Add(new MailboxAddress(sysUserInfo.FullName, sysUserInfo.EMail)); //主题 - messageToSend.Subject = "[来自展影IRC] 关于创建账户的提醒"; + //---[来自展影IRC] 关于创建账户的提醒 + messageToSend.Subject = _localizer["Mail_AccountCreationReminder"]; @@ -421,7 +432,8 @@ namespace IRaCIS.Application.Services //收件地址 messageToSend.To.Add(new MailboxAddress(sysUserInfo.FullName, sysUserInfo.EMail)); //主题 - messageToSend.Subject = "[来自展影IRC] 关于重置账户密码的提醒"; + //---[来自展影IRC] 关于重置账户密码的提醒 + messageToSend.Subject = _localizer["Mail_AccountPasswordResetReminder"]; @@ -469,7 +481,8 @@ namespace IRaCIS.Application.Services //收件地址 messageToSend.To.Add(new MailboxAddress(sysUserInfo.FullName, sysUserInfo.EMail)); //主题 - messageToSend.Subject = $"[来自展影IRC] [{trialInfo.ResearchProgramNo}]邀请信"; + // $"[来自展影IRC] [{trialInfo.ResearchProgramNo}]邀请信"; + messageToSend.Subject = _localizer["Mail_InvitationEmail", trialInfo.ResearchProgramNo]; @@ -532,7 +545,8 @@ namespace IRaCIS.Application.Services //收件地址 messageToSend.To.Add(new MailboxAddress(String.Empty, sysUserInfo.EMail)); //主题 - messageToSend.Subject = $"[来自展影IRC] [{trialInfo.ResearchProgramNo}]邀请信"; + // $"[来自展影IRC] [{trialInfo.ResearchProgramNo}]邀请信"; + messageToSend.Subject = _localizer["Mail_InvitationEmail", trialInfo.ResearchProgramNo]; var builder = new BodyBuilder(); @@ -644,7 +658,8 @@ namespace IRaCIS.Application.Services //收件地址 messageToSend.To.Add(new MailboxAddress(doctor.FullName, doctor.EMail)); //主题 - messageToSend.Subject = $"[来自展影IRC] [{trialInfo.ResearchProgramNo}]邀请信"; + // $"[来自展影IRC] [{trialInfo.ResearchProgramNo}]邀请信"; + messageToSend.Subject = _localizer["Mail_InvitationEmail", trialInfo.ResearchProgramNo]; var builder = new BodyBuilder(); @@ -701,4 +716,4 @@ namespace IRaCIS.Application.Services } -} \ No newline at end of file +} diff --git a/IRaCIS.Core.Application/Service/Doctor/DoctorService.cs b/IRaCIS.Core.Application/Service/Doctor/DoctorService.cs index 1244af694..ece38e7e0 100644 --- a/IRaCIS.Core.Application/Service/Doctor/DoctorService.cs +++ b/IRaCIS.Core.Application/Service/Doctor/DoctorService.cs @@ -431,7 +431,8 @@ namespace IRaCIS.Application.Services .Select(u => u.Type).ToListAsync(); if (auditResumeParam.ResumeStatus == ResumeStatusEnum.Pass && ((!attachmentList.Contains("Resume")) || (!attachmentList.Contains("Consultant Agreement")))) { - return ResponseOutput.NotOk("Resume & Consultant Agreement must be upload "); + //---Resume & Consultant Agreement must be upload + return ResponseOutput.NotOk(_localizer["Doctor_RequiredDocumentsError"]); } var success = await _doctorRepository.BatchUpdateNoTrackingAsync(o => o.Id == auditResumeParam.Id, u => new Doctor() { @@ -481,7 +482,8 @@ namespace IRaCIS.Application.Services if (await _doctorCriterionFileRepository.AnyAsync(x => inDto.IsEnable && x.DoctorId == inDto.DoctorId && x.FileType == inDto.FileType && x.TrialId==inDto.TrialId &&x.TrialReadingCriterionId==inDto.TrialReadingCriterionId && x.IsEnable && x.CriterionType == inDto.CriterionType && x.Id != inDto.Id)) { - throw new BusinessValidationFailedException("当前标准已添加过此类型文件"); + //-----------当前标准已添加过此类型文件 + throw new BusinessValidationFailedException(_localizer["Doctor_StandardDuplicateFileTypeError"]); } diff --git a/IRaCIS.Core.Application/Service/Document/SystemDocumentService.cs b/IRaCIS.Core.Application/Service/Document/SystemDocumentService.cs index 2f40f256a..d3215a32f 100644 --- a/IRaCIS.Core.Application/Service/Document/SystemDocumentService.cs +++ b/IRaCIS.Core.Application/Service/Document/SystemDocumentService.cs @@ -1,4 +1,4 @@ -//-------------------------------------------------------------------- +//-------------------------------------------------------------------- // 此代码由T4模板自动生成 byzhouhang 20210918 // 生成时间 2022-01-05 09:17:03 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 @@ -55,7 +55,8 @@ namespace IRaCIS.Core.Application.Services if (await _systemDocumentRepository.AnyAsync(t => t.FileTypeId == addOrEditSystemDocument.FileTypeId && t.Name == addOrEditSystemDocument.Name,true)) { - return ResponseOutput.NotOk("系统中已存在同类型的同名文件。"); + //---系统中已存在同类型的同名文件。 + return ResponseOutput.NotOk(_localizer["SystemD_DuplicateFile"]); } await _systemDocumentRepository.AddAsync(entity, true); @@ -70,7 +71,8 @@ namespace IRaCIS.Core.Application.Services if (await _systemDocumentRepository.AnyAsync(t => t.FileTypeId == addOrEditSystemDocument.FileTypeId && t.Name == addOrEditSystemDocument.Name && t.Id != addOrEditSystemDocument.Id, true)) { - return ResponseOutput.NotOk("系统中已存在同类型的同名文件。"); + //---系统中已存在同类型的同名文件。 + return ResponseOutput.NotOk(_localizer["SystemD_DuplicateFile"]); } @@ -114,7 +116,8 @@ namespace IRaCIS.Core.Application.Services if (await _repository.Where(t => t.Id == systemDocumentId).AnyAsync(u => u.SystemDocConfirmedUserList.Any())) { - return ResponseOutput.NotOk("已有用户阅读该文档,并签名,不允许删除。"); + //---已有用户阅读该文档,并签名,不允许删除。 + return ResponseOutput.NotOk(_localizer["SystemD_CannotDeleteSignedFile"]); } var success = await _systemDocumentRepository.DeleteFromQueryAsync(t => t.Id == systemDocumentId,true,true); diff --git a/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs b/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs index 3f7efd91a..a9e2796ec 100644 --- a/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs +++ b/IRaCIS.Core.Application/Service/Document/TrialDocumentService.cs @@ -1,4 +1,4 @@ -//-------------------------------------------------------------------- +//-------------------------------------------------------------------- // 此代码由T4模板自动生成 byzhouhang 20210918 // 生成时间 2022-01-05 09:17:03 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 @@ -400,7 +400,8 @@ namespace IRaCIS.Core.Application.Services if (await _trialDocumentRepository.AnyAsync(t => t.FileTypeId == addOrEditTrialDocument.FileTypeId && t.Name == addOrEditTrialDocument.Name && t.TrialId == addOrEditTrialDocument.TrialId, true)) { - return ResponseOutput.NotOk("该项目中已经存在同类型的同名文件。"); + //---该项目中已经存在同类型的同名文件。 + return ResponseOutput.NotOk(_localizer["TrialD_DuplicateFileInProject"]); } //entity.Id = NewId.NextGuid(); @@ -411,7 +412,8 @@ namespace IRaCIS.Core.Application.Services { if (await _trialDocumentRepository.AnyAsync(t => t.FileTypeId == addOrEditTrialDocument.FileTypeId && t.Name == addOrEditTrialDocument.Name && t.Id != addOrEditTrialDocument.Id && t.TrialId == addOrEditTrialDocument.TrialId, true)) { - return ResponseOutput.NotOk("该项目中已经存在同类型的同名文件。"); + //---该项目中已经存在同类型的同名文件。 + return ResponseOutput.NotOk(_localizer["TrialD_DuplicateFileInProject"]); } var document = (await _trialDocumentRepository.Where(t => t.Id == addOrEditTrialDocument.Id, true).Include(t => t.NeedConfirmedUserTypeList).FirstOrDefaultAsync()).IfNullThrowException(); @@ -464,7 +466,8 @@ namespace IRaCIS.Core.Application.Services { if (await _trialDocumentRepository.AsQueryable(true).Where(t => t.Id == trialDocumentId).AnyAsync(t => t.TrialDocConfirmedUserList.Any())) { - return ResponseOutput.NotOk("已有用户阅读该文档,并签名,不允许删除。"); + //---已有用户阅读该文档,并签名,不允许删除。 + return ResponseOutput.NotOk(_localizer["TrialD_DocumentHasAlready"]); } var success = await _trialDocumentRepository.BatchDeleteNoTrackingAsync(t => t.Id == trialDocumentId); @@ -555,12 +558,14 @@ namespace IRaCIS.Core.Application.Services if(sysDocConfirm.ConfirmTime != null) { - return ResponseOutput.NotOk("该文件已经签名"); + //---该文件已经签名 + return ResponseOutput.NotOk(_localizer["TrialD_FileAlreadySigned"]); } if (sysDocConfirm.IsDeleted) { - return ResponseOutput.NotOk("文件已废除,签署失败!"); + //---文件已废除,签署失败! + return ResponseOutput.NotOk(_localizer["TrialD_ObsoleteFile"]); } @@ -580,12 +585,14 @@ namespace IRaCIS.Core.Application.Services if (trialDocConfirm.ConfirmTime != null) { - return ResponseOutput.NotOk("该文件已经签名"); + //---该文件已经签名 + return ResponseOutput.NotOk(_localizer["TrialD_FileAlreadySigned"]); } if (trialDocConfirm.IsDeleted) { - return ResponseOutput.NotOk("文件已废除,签署失败!"); + //---文件已废除,签署失败! + return ResponseOutput.NotOk(_localizer["TrialD_ObsoleteFile"]); } trialDocConfirm.ConfirmTime = DateTime.Now; diff --git a/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs b/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs index beb3863ed..1330b369b 100644 --- a/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs +++ b/IRaCIS.Core.Application/Service/Document/TrialEmailNoticeConfigService.cs @@ -1,4 +1,4 @@ -//-------------------------------------------------------------------- +//-------------------------------------------------------------------- // 此代码由T4模板自动生成 byzhouhang 20210918 // 生成时间 2022-10-20 11:52:17 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 @@ -328,7 +328,8 @@ namespace IRaCIS.Core.Application.Service } else { - throw new BusinessValidationFailedException("进行邮件发送前,该任务必须已签名完成并已经触发完成相应的任务生成"); + //---进行邮件发送前,该任务必须已签名完成并已经触发完成相应的任务生成 + throw new BusinessValidationFailedException(_localizer["TrialEmailN_TaskNotSigned"]); } @@ -366,7 +367,8 @@ namespace IRaCIS.Core.Application.Service if (toUserList.Count() == 0) { - throw new BusinessValidationFailedException("没有收件人,无法发送邮件"); + //---没有收件人,无法发送邮件 + throw new BusinessValidationFailedException(_localizer["TrialEmailN_NoRecipient"]); } @@ -387,7 +389,8 @@ namespace IRaCIS.Core.Application.Service } else { - throw new BusinessValidationFailedException("项目发件邮箱配置有误,请核实"); + //---项目发件邮箱配置有误,请核实 + throw new BusinessValidationFailedException(_localizer["TrialEmailN_InvalidEmailConfig"]); } foreach (var item in toUserList) @@ -419,7 +422,8 @@ namespace IRaCIS.Core.Application.Service if (!File.Exists(path)) { - throw new BusinessValidationFailedException("找不到该项目标准场景下邮件模板"); + //---找不到该项目标准场景下邮件模板 + throw new BusinessValidationFailedException(_localizer["TrialEmailN_EmailTemplateNotFound"]); } @@ -436,7 +440,7 @@ namespace IRaCIS.Core.Application.Service if (businessScenarioEnum == CommonDocumentBusinessScenario.EnrollConfirmed) { - sendEmailConfig.TopicDescription = $"【入组确认报告】关于{taskInfo.ResearchProgramNo}项目{taskInfo.SubjectCode}受试者"; + sendEmailConfig.TopicDescription = _localizer["TrialEmailN_EnrollmentConfirmation", taskInfo.ResearchProgramNo, taskInfo.SubjectCode]; using (StreamReader SourceReader = System.IO.File.OpenText(pathToFile)) { @@ -444,13 +448,14 @@ namespace IRaCIS.Core.Application.Service sendEmailConfig.HtmlBodyStr = string.Format(templateInfo, - $" 附件为入组确认报告,请查收 " + //--- 附件为疾病进展确认报告,请查收 + _localizer["TrialEmailN_SubjectDiseaseProgression"] ); } } else if (businessScenarioEnum == CommonDocumentBusinessScenario.PDConfirmed) { - sendEmailConfig.TopicDescription = $"【疾病进展确认报告】关于{taskInfo.ResearchProgramNo}项目{taskInfo.SubjectCode}受试者"; + sendEmailConfig.TopicDescription = _localizer["TrialEmailN_PDReport", taskInfo.ResearchProgramNo, taskInfo.SubjectCode]; using (StreamReader SourceReader = System.IO.File.OpenText(pathToFile)) { @@ -458,7 +463,8 @@ namespace IRaCIS.Core.Application.Service sendEmailConfig.HtmlBodyStr = string.Format(templateInfo, - $" 附件为疾病进展确认报告,请查收 " + //--- 附件为疾病进展确认报告,请查收 + _localizer["TrialEmailN_SubjectDiseaseProgression"] ); } } @@ -622,7 +628,8 @@ namespace IRaCIS.Core.Application.Service } else { - throw new BusinessValidationFailedException("发送PD 进展邮件中发现任务数据有问题!"); + //---发送PD 进展邮件中发现任务数据有问题! + throw new BusinessValidationFailedException(_localizer["TrialEmailN_PDProgressEmailTask"]); } @@ -631,7 +638,8 @@ namespace IRaCIS.Core.Application.Service else { - throw new BusinessValidationFailedException("双重有序阅片 没有定义该仲裁规则处理逻辑,请联系业务和后台开发核查!"); + //---双重有序阅片 没有定义该仲裁规则处理逻辑,请联系业务和后台开发核查! + throw new BusinessValidationFailedException(_localizer["TrialEmailN_DoubleBlindedError"]); } @@ -652,7 +660,8 @@ namespace IRaCIS.Core.Application.Service // if (taskInfo.ArbitrationRule != ArbitrationRule.None) // { - // throw new BusinessValidationFailedException("单重有序阅片配置有误(不应该有仲裁对象配置),请核查!"); + //---单重有序阅片配置有误(不应该有仲裁对象配置),请核查! + // throw new BusinessValidationFailedException(_localizer["TrialEmailN_SingleBlindedSet"]); // } @@ -677,7 +686,8 @@ namespace IRaCIS.Core.Application.Service // } // else // { - // throw new BusinessValidationFailedException("单重有序阅片 该类型的任务不应进入此处逻辑,请联系后台开发核查!"); + //---单重有序阅片 该类型的任务不应进入此处逻辑,请联系后台开发核查! + // throw new BusinessValidationFailedException(_localizer["TrialEmailN_SingleBlindedSequenced"]); // } // isNeedSend = await DealMedicalReviewTasKGenerateAndIsSendAsync(taskInfo.TrialId, isHandSend, answer, new List() { visitTaskId }, minUserIdList); @@ -686,7 +696,8 @@ namespace IRaCIS.Core.Application.Service //} //else //{ - // throw new BusinessValidationFailedException("有序阅片配置有误(应为单重或者双重阅片),请核查!"); + //---有序阅片配置有误(应为单重或者双重阅片),请核查! + // throw new BusinessValidationFailedException(_localizer["TrialEmailN_BlindedSequencedReading"]); //} #endregion @@ -748,7 +759,8 @@ namespace IRaCIS.Core.Application.Service // } // else // { - // throw new BusinessValidationFailedException("无序阅片配置有误(应为单重无仲裁对象,双重针对访视仲裁),请核查!"); + //---无序阅片配置有误(应为单重无仲裁对象,双重针对访视仲裁),请核查! + // throw new BusinessValidationFailedException(_localizer["TrialEmailN_UnblindedSequencedReading"]); // } //} @@ -892,13 +904,15 @@ namespace IRaCIS.Core.Application.Service if (trialConfig.IsEnrollementQualificationConfirm == false) { - return ResponseOutput.NotOk("项目未配置入组确认!"); + //---项目未配置入组确认! + return ResponseOutput.NotOk(_localizer["TrialEmailN_InCons"]); } var exisitBaseline = subjectVisitList.FirstOrDefault(t => t.IsEnrollmentConfirm); if (exisitBaseline == null) { - return ResponseOutput.NotOk("不存在配置了入组确认的并且生成任务的基线访视"); + //---不存在配置了入组确认的并且生成任务的基线访视 + return ResponseOutput.NotOk(_localizer["TrialEmailN_NoBaseLine"]); } else { @@ -918,7 +932,8 @@ namespace IRaCIS.Core.Application.Service if (task == null) { - return ResponseOutput.NotOk("做入组确认的阅片人基线任务没有阅片完!"); + //---做入组确认的阅片人基线任务没有阅片完! + return ResponseOutput.NotOk(_localizer["TrialEmailN_IncompBase"]); } else { @@ -926,7 +941,8 @@ namespace IRaCIS.Core.Application.Service if (string.IsNullOrEmpty(filePath)) { - return ResponseOutput.NotOk("邮件手动生成失败,请联系开发核实该场景失败原因"); + //---邮件手动生成失败,请联系开发核实该场景失败原因 + return ResponseOutput.NotOk(_localizer["TrialEmailN_EmailFail"]); } else { @@ -939,7 +955,8 @@ namespace IRaCIS.Core.Application.Service } else { - return ResponseOutput.NotOk("当前未有阅片人读完基线任务!"); + //---当前未有阅片人读完基线任务! + return ResponseOutput.NotOk(_localizer["TrialEmailN_NoReader"]); } @@ -954,7 +971,8 @@ namespace IRaCIS.Core.Application.Service if (trialConfig.IsPDProgressView == false) { - return ResponseOutput.NotOk("项目未配置PD进展!"); + //---项目未配置PD进展! + return ResponseOutput.NotOk(_localizer["TrialEmailN_NoPDConfig"]); } //是否是截止访视 截止访视在全局发 否则就在当前访视发 @@ -963,7 +981,8 @@ namespace IRaCIS.Core.Application.Service if (pdSubjectVisitIdList.Count == 0) { - return ResponseOutput.NotOk("不存在配置了PD进展的并且生成任务的访视"); + //---不存在配置了PD进展的并且生成任务的访视 + return ResponseOutput.NotOk(_localizer["TrialEmailN_NoPDTasks"]); } @@ -1007,7 +1026,8 @@ namespace IRaCIS.Core.Application.Service } else { - return ResponseOutput.NotOk("当前受试者最新PD访视阅片任务完成状态不符合发送条件"); + //---当前受试者最新PD访视阅片任务完成状态不符合发送条件 + return ResponseOutput.NotOk(_localizer["TrialEmailN_PDNotFinished"]); } } @@ -1019,7 +1039,8 @@ namespace IRaCIS.Core.Application.Service if (existReadModule == null) { - return ResponseOutput.NotOk("项目配置了阅片期仲裁,但是当前受试者最新PD访视没有影像学阅片期"); + //---项目配置了阅片期仲裁,但是当前受试者最新PD访视没有影像学阅片期 + return ResponseOutput.NotOk(_localizer["TrialEmailN_PDNoImaging"]); } else { @@ -1053,7 +1074,8 @@ namespace IRaCIS.Core.Application.Service else { - return ResponseOutput.NotOk("当前受试者最新PD访视阅片期任务完成状态不符合发送条件"); + //---当前受试者最新PD访视阅片期任务完成状态不符合发送条件 + return ResponseOutput.NotOk(_localizer["TrialEmailN_PDPhaseNotFinished"]); } } @@ -1061,7 +1083,8 @@ namespace IRaCIS.Core.Application.Service } else { - return ResponseOutput.NotOk("未定义该仲裁规则发送业务逻辑!"); + //---未定义该仲裁规则发送业务逻辑! + return ResponseOutput.NotOk(_localizer["TrialEmailN_NoRuleDefined"]); } } @@ -1119,14 +1142,16 @@ namespace IRaCIS.Core.Application.Service else { - return ResponseOutput.NotOk("当前项目配置,不满足双重有序阅片,不满足发送条件!"); + //---当前项目配置,不满足双重有序阅片,不满足发送条件! + return ResponseOutput.NotOk(_localizer["TrialEmailN_NoDoubleOrder"]); } } else { - return ResponseOutput.NotOk("当前项目配置,未定义发送业务逻辑!"); + //---当前项目配置,未定义发送业务逻辑! + return ResponseOutput.NotOk(_localizer["TrialEmailN_NoSendLogicDefined"]); } @@ -1207,7 +1232,8 @@ namespace IRaCIS.Core.Application.Service //} else { - throw new BusinessValidationFailedException("不应有 除访视、裁判、全局其他类型的任务进行发送邮件,请核查业务逻辑"); + //---不应有 除访视、裁判、全局其他类型的任务进行发送邮件,请核查业务逻辑 + throw new BusinessValidationFailedException(_localizer["TrialEmailN_InvalidTaskTypeForEmailSending"]); } if (answer == OverallAssessment.PD.GetEnumInt()) @@ -1246,7 +1272,8 @@ namespace IRaCIS.Core.Application.Service //} else { - throw new BusinessValidationFailedException("不应有 除访视、裁判、全局其他类型的任务进行发送邮件,请核查业务逻辑"); + //---不应有 除访视、裁判、全局其他类型的任务进行发送邮件,请核查业务逻辑 + throw new BusinessValidationFailedException(_localizer["TrialEmailN_InvalidTaskTypeForEmailSending"]); } if (answer == VisitTumorEvaluation.PD.GetEnumInt()) @@ -1283,7 +1310,8 @@ namespace IRaCIS.Core.Application.Service case CriterionType.IMWG2016: default: - throw new BusinessValidationFailedException("该标准任务还未定义PD获取逻辑,联系业务和后台开发协商后补充"); + //---该标准任务还未定义PD获取逻辑,联系业务和后台开发协商后补充 + throw new BusinessValidationFailedException(_localizer["TrialEmailN_PDLogicNotDefined"]); } @@ -1402,13 +1430,15 @@ namespace IRaCIS.Core.Application.Service if (!config.FromEmail.Contains("@") || string.IsNullOrEmpty(config.FromEmail)) { - throw new BusinessValidationFailedException("项目发件邮箱配置有误,请核实"); + //---项目发件邮箱配置有误,请核实 + throw new BusinessValidationFailedException(_localizer["TrialEmailN_InvalidEmailConfig"]); } if (toUserList.Count() == 0 || toUserList.Where(t => t.EMail.Contains("@")).Count() == 0) { - throw new BusinessValidationFailedException("项目没有有效的收件人,无法发送邮件"); + //---项目没有有效的收件人,无法发送邮件 + throw new BusinessValidationFailedException(_localizer["TrialEmailN_InvalidRecipient"]); } var sendEmailConfig = new SMTPEmailConfig(); @@ -1431,7 +1461,8 @@ namespace IRaCIS.Core.Application.Service + "EmailConfigTest.html"; - sendEmailConfig.TopicDescription = "项目邮件测试"; + //---项目邮件测试 + sendEmailConfig.TopicDescription = _localizer["TrialEmailN_EmailTestMessage"]; using (StreamReader SourceReader = System.IO.File.OpenText(pathToFile)) { @@ -1439,7 +1470,8 @@ namespace IRaCIS.Core.Application.Service sendEmailConfig.HtmlBodyStr = string.Format(templateInfo, - $" 收到此邮件,代表邮件配置正确" + //--- 收到此邮件,代表邮件配置正确 + _localizer["TrialEmailN_ConfigurationCorrect"] ); } @@ -1451,7 +1483,8 @@ namespace IRaCIS.Core.Application.Service catch (Exception ex) { - throw new BusinessValidationFailedException("发件人配置错误,请核对服务器地址或者授权码是否填写有误" + ex.Message); + //---发件人配置错误,请核对服务器地址或者授权码是否填写有误 + throw new BusinessValidationFailedException(_localizer["TrialEmailN_InvalidSenderEmailConfig"] + ex.Message); } diff --git a/IRaCIS.Core.Application/Service/Financial/CalculateService.cs b/IRaCIS.Core.Application/Service/Financial/CalculateService.cs index d4c4c1c53..4fdc05643 100644 --- a/IRaCIS.Core.Application/Service/Financial/CalculateService.cs +++ b/IRaCIS.Core.Application/Service/Financial/CalculateService.cs @@ -11,7 +11,7 @@ using Panda.DynamicWebApi.Attributes; namespace IRaCIS.Application.Services { - public class CalculateService : ICalculateService + public class CalculateService :BaseService, ICalculateService { private readonly IRepository _paymentRepository; private readonly IRepository _trialPaymentRepository; @@ -135,12 +135,14 @@ namespace IRaCIS.Application.Services { if (i == 0 && volumeRewardPriceList[i].Min != 0) { - return ResponseOutput.NotOk("Volume reward data error."); + //---Volume reward data error. + return ResponseOutput.NotOk(_localizer["Cal_VolDataErr"]); } if (i > 0) { if (volumeRewardPriceList[i - 1].Max + 1 != volumeRewardPriceList[i].Min) - return ResponseOutput.NotOk("Volume reward data error."); + //---Volume reward data error. + return ResponseOutput.NotOk(_localizer["Cal_VolDataErr"]); } } diff --git a/IRaCIS.Core.Application/Service/Financial/ExchangeRateService.cs b/IRaCIS.Core.Application/Service/Financial/ExchangeRateService.cs index 6f11fccbc..1b686ac17 100644 --- a/IRaCIS.Core.Application/Service/Financial/ExchangeRateService.cs +++ b/IRaCIS.Core.Application/Service/Financial/ExchangeRateService.cs @@ -30,7 +30,8 @@ namespace IRaCIS.Application.Services var existItem = await _exchangeRateRepository.FirstOrDefaultAsync(u => u.YearMonth == model.YearMonth); if (existItem != null) { - return ResponseOutput.NotOk("The exchange rate of the same month already existed."); + //---The exchange rate of the same month already existed. + return ResponseOutput.NotOk(_localizer["ExR_SameMthExist"]); } var rate = _mapper.Map(model); rate = await _exchangeRateRepository.AddAsync(rate); @@ -68,7 +69,8 @@ namespace IRaCIS.Application.Services if (await _paymentRepository.AnyAsync(t => t.YearMonth == monthInfo.YearMonth)) { - return ResponseOutput.NotOk("The exchange rate has been used in monthly payment"); + //---The exchange rate has been used in monthly payment + return ResponseOutput.NotOk(_localizer["ExR_MthPymtRate"]); } diff --git a/IRaCIS.Core.Application/Service/Financial/PaymentAdjustmentService.cs b/IRaCIS.Core.Application/Service/Financial/PaymentAdjustmentService.cs index 2cd692e76..754ec091a 100644 --- a/IRaCIS.Core.Application/Service/Financial/PaymentAdjustmentService.cs +++ b/IRaCIS.Core.Application/Service/Financial/PaymentAdjustmentService.cs @@ -61,7 +61,8 @@ namespace IRaCIS.Application.Services { if (payment.IsLock) { - return ResponseOutput.NotOk("Doctor payment has confirmed lock"); + //---Doctor payment has confirmed lock + return ResponseOutput.NotOk(_localizer["PayAdj_DocPymtLock"]); } } @@ -310,4 +311,4 @@ namespace IRaCIS.Application.Services } } -} \ No newline at end of file +} diff --git a/IRaCIS.Core.Application/Service/Financial/RankPriceService.cs b/IRaCIS.Core.Application/Service/Financial/RankPriceService.cs index 6ec703692..b5bb009b7 100644 --- a/IRaCIS.Core.Application/Service/Financial/RankPriceService.cs +++ b/IRaCIS.Core.Application/Service/Financial/RankPriceService.cs @@ -73,7 +73,8 @@ namespace IRaCIS.Application.Services if (await _reviewerPayInfoRepository.AnyAsync(t => t.RankId == id)) { - return ResponseOutput.NotOk("This title has been used by reviewer payment information"); + //---This title has been used by reviewer payment information + return ResponseOutput.NotOk(_localizer["RP_TitleUsedByRev"]); } var success = await _rankPriceRepository.BatchDeleteNoTrackingAsync(t => t.Id == id); @@ -101,4 +102,4 @@ namespace IRaCIS.Application.Services } } -} \ No newline at end of file +} diff --git a/IRaCIS.Core.Application/Service/Financial/TrialRevenuesPriceService.cs b/IRaCIS.Core.Application/Service/Financial/TrialRevenuesPriceService.cs index 48968b758..28d088a11 100644 --- a/IRaCIS.Core.Application/Service/Financial/TrialRevenuesPriceService.cs +++ b/IRaCIS.Core.Application/Service/Financial/TrialRevenuesPriceService.cs @@ -44,7 +44,8 @@ namespace IRaCIS.Application.Services if (count <= 0) { - return ResponseOutput.NotOk("Please add meaningful data"); + //---Please add meaningful data + return ResponseOutput.NotOk(_localizer["TRP_AddMeaningful"]); } var trialExistedItem = await _trialRevenuesPriceRepository.FirstOrDefaultAsync(u => u.TrialId == model.TrialId); if (trialExistedItem == null)//insert diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/DicomArchiveService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/DicomArchiveService.cs index 9864b1c07..0af64f1d0 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/DicomArchiveService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/DicomArchiveService.cs @@ -11,7 +11,7 @@ using IRaCIS.Core.Infrastructure; namespace IRaCIS.Core.Application.Services { - public class DicomArchiveService : IDicomArchiveService + public class DicomArchiveService :BaseService, IDicomArchiveService { private readonly IRepository _studyRepository; private readonly IRepository _seriesRepository; @@ -80,7 +80,8 @@ namespace IRaCIS.Core.Application.Services if (anonymize_AddFixedFiledList.Union(anonymize_AddIRCInfoFiledList).Union(anonymize_FixedFieldList).Union(anonymize_IRCInfoFieldList).Count() == 0) { - throw new BusinessValidationFailedException("未取到缓存匿名化配置数据,上传停止,请联系开发人员核实"); + //---未取到缓存匿名化配置数据,上传停止,请联系开发人员核实 + throw new BusinessValidationFailedException(_localizer["DAS_NoAnonCacheData"]); } diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/ImageShareService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/ImageShareService.cs index e16e0b16b..e84fb9df6 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/ImageShareService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/ImageShareService.cs @@ -55,7 +55,8 @@ namespace IRaCIS.Core.Application.Services if (!studyIds.Any()) { - return ResponseOutput.NotOk("当前检查没有影像可以分享。 "); + //---当前检查没有影像可以分享。 + return ResponseOutput.NotOk(_localizer["ISS_NoImgToShare"]); } imageShareCommand.StudyId = studyIds.First(); @@ -93,17 +94,20 @@ namespace IRaCIS.Core.Application.Services if (imageShare == null) { - return ResponseOutput.NotOk("资源不存在。"); + //---资源不存在。 + return ResponseOutput.NotOk(_localizer["ISS_ResNotExists"]); } if (pWord != imageShare.Password.Trim()) { - return ResponseOutput.NotOk("分享密码错误。"); + //---分享密码错误。 + return ResponseOutput.NotOk(_localizer["ISS_SharePwdError"]); } if (DateTime.Now > imageShare.ExpireTime) { - return ResponseOutput.NotOk("资源分享过期。"); + //---资源分享过期。 + return ResponseOutput.NotOk(_localizer["ISS_ShareExpiration"]); } var resource = new ResourceInfo() @@ -128,4 +132,4 @@ namespace IRaCIS.Core.Application.Services } } -} \ No newline at end of file +} diff --git a/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs b/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs index 48e5f0faf..1f836f64c 100644 --- a/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs +++ b/IRaCIS.Core.Application/Service/ImageAndDoc/StudyService.cs @@ -423,16 +423,19 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc if (before != null && waitUploadItem.StudyDate != null && before > waitUploadItem.StudyDate) { - result.Add(new VerifyStudyUploadResult() { ErrorMesseage = $"当前访视检查时间{waitUploadItem.StudyDate?.ToString("yyyy-MM-dd")}不能早于前序访视检查时间{before?.ToString("yyyy-MM-dd")},请核对检查数据是否有误", StudyInstanceUid = waitUploadItem.StudyInstanceUid }); + + // $"当前访视检查时间{waitUploadItem.StudyDate?.ToString("yyyy-MM-dd")}不能早于前序访视检查时间{before?.ToString("yyyy-MM-dd")},请核对检查数据是否有误", + result.Add(new VerifyStudyUploadResult() { ErrorMesseage = _localizer["Study_VisitBeforePrevError", waitUploadItem.StudyDate?.ToString("yyyy-MM-dd"), before?.ToString("yyyy-MM-dd")], StudyInstanceUid = waitUploadItem.StudyInstanceUid }); return; } - + //大于当前访视 最近的最早拍片日期 var after = visitList.Where(u => u.VisitNum > verifyInfo.VisitNum).Min(k => k.EarliestScanDate); if (after != null && waitUploadItem.StudyDate != null && after < waitUploadItem.StudyDate) { - result.Add(new VerifyStudyUploadResult() { ErrorMesseage = $"当前访视检查时间{waitUploadItem.StudyDate?.ToString("yyyy-MM-dd")}不能晚于该访视之后的检查时间{after?.ToString("yyyy-MM-dd")},请核对检查数据是否有误", StudyInstanceUid = waitUploadItem.StudyInstanceUid }); + // $"当前访视检查时间{waitUploadItem.StudyDate?.ToString("yyyy-MM-dd")}不能晚于该访视之后的检查时间{after?.ToString("yyyy-MM-dd")},请核对检查数据是否有误" + result.Add(new VerifyStudyUploadResult() { ErrorMesseage = _localizer["Study_VisitAfterSubseqError", waitUploadItem.StudyDate?.ToString("yyyy-MM-dd"), after?.ToString("yyyy-MM-dd")], StudyInstanceUid = waitUploadItem.StudyInstanceUid }); return; } } @@ -457,7 +460,8 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc result.AllowReUpload = false; result.StudyInstanceUid = studyInstanceUid; - result.ErrorMesseage = "当前有人正在上传归档该检查!"; + //---当前有人正在上传归档该检查! + result.ErrorMesseage = _localizer["Study_UploadArchiving"]; return result; } @@ -468,7 +472,8 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc result.AllowReUpload = false; result.StudyInstanceUid = studyInstanceUid; - result.ErrorMesseage = "受试者访视结束,不允许上传!"; + //---受试者访视结束,不允许上传! + result.ErrorMesseage = _localizer["Study_VisitEndedNotAllowed"]; return result; } @@ -502,7 +507,8 @@ namespace IRaCIS.Core.Application.Service.ImageAndDoc result.AllowReUpload = false; - result.ErrorMesseage = $"此处不可以上传。当前影像检查已经上传给受试者{verifyStudyInfo.SubjectCode}的{verifyStudyInfo.VisitName}"; + //$"此处不可以上传。当前影像检查已经上传给受试者{verifyStudyInfo.SubjectCode}的{verifyStudyInfo.VisitName}" + result.ErrorMesseage = _localizer["Study_ImgAlreadyUploaded", verifyStudyInfo.SubjectCode, verifyStudyInfo.VisitName]; } } result.StudyInstanceUid = studyInstanceUid; diff --git a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs index 2ec831eda..fa7bcb1e9 100644 --- a/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs +++ b/IRaCIS.Core.Application/Service/Inspection/FrontAuditConfigService.cs @@ -1,4 +1,4 @@ -//-------------------------------------------------------------------- +//-------------------------------------------------------------------- // 此代码由T4模板自动生成 byzhouhang 20210918 // 生成时间 2022-03-28 16:46:23 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 @@ -1287,12 +1287,14 @@ namespace IRaCIS.Core.Application.Service if (await _frontAuditConfigRepository.AnyAsync(x => x.Identification != string.Empty && x.Identification == addOrEditFrontAuditConfig.Identification && x.Id != addOrEditFrontAuditConfig.Id && x.ConfigType == "M" && addOrEditFrontAuditConfig.ConfigType == "M")) { - return ResponseOutput.NotOk("标识重复"); + //---标识重复 + return ResponseOutput.NotOk(_localizer["FrontAudit_IdDup"]); } if (await _frontAuditConfigRepository.AnyAsync(x => x.Description == addOrEditFrontAuditConfig.Description && x.Id != addOrEditFrontAuditConfig.Id && x.ConfigType == "M" && addOrEditFrontAuditConfig.ConfigType == "M")) { - return ResponseOutput.NotOk("名称重复"); + //---名称重复 + return ResponseOutput.NotOk(_localizer["FrontAudit_NameDup"]); } if (addOrEditFrontAuditConfig.ConfigType == "C") @@ -1319,7 +1321,8 @@ namespace IRaCIS.Core.Application.Service { if (await _frontAuditConfigRepository.AnyAsync(x => x.ParentId == frontAuditConfigId)) { - return ResponseOutput.NotOk("存在子类 不能删除"); + //---存在子类 不能删除 + return ResponseOutput.NotOk(_localizer["FrontAudit_CannotDelSub"]); } var success = await _repository.BatchDeleteAsync(t => t.Id == frontAuditConfigId); return ResponseOutput.Result(success); diff --git a/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs b/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs index 2828e97b8..4ce983a98 100644 --- a/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs +++ b/IRaCIS.Core.Application/Service/Inspection/InspectionService.cs @@ -252,7 +252,8 @@ namespace IRaCIS.Core.Application.Service.Inspection } else if (user.Status == UserStateEnum.Disable) { - throw new BusinessValidationFailedException("当前用户已被禁用。"); + //---当前用户已被禁用。 + throw new BusinessValidationFailedException(_localizer["Inspection_UserDisabled"]); } return ResponseOutput.Ok(); diff --git a/IRaCIS.Core.Application/Service/Institution/CROService.cs b/IRaCIS.Core.Application/Service/Institution/CROService.cs index 949e6e293..fd00d06dd 100644 --- a/IRaCIS.Core.Application/Service/Institution/CROService.cs +++ b/IRaCIS.Core.Application/Service/Institution/CROService.cs @@ -48,7 +48,8 @@ namespace IRaCIS.Application.Services var exp = new EntityVerifyExp() { VerifyExp = cro => cro.CROName.Equals(addCroCompanyCommand.CROName) , - VerifyMsg = "已经存在同名的CRO,请确认。" + //---已经存在同名的CRO,请确认。 + VerifyMsg = _localizer["CRO_DupName"] }; var cro = await _croRepository.InsertOrUpdateAsync(addCroCompanyCommand, true, exp); @@ -66,7 +67,8 @@ namespace IRaCIS.Application.Services { if (await _trialRepository.AnyAsync(t => t.CROId == cROCompanyId)) { - return ResponseOutput.NotOk("该CRO已经参与项目,不能被删除。"); + //---该CRO已经参与项目,不能被删除。 + return ResponseOutput.NotOk(_localizer["CRO_InProject"]); } //if (_userRepository.Find().Any(t => t.OrganizationId == cROCompanyId)) //{ @@ -77,4 +79,4 @@ namespace IRaCIS.Application.Services return ResponseOutput.Result(success); } } -} \ No newline at end of file +} diff --git a/IRaCIS.Core.Application/Service/Institution/HospitalService.cs b/IRaCIS.Core.Application/Service/Institution/HospitalService.cs index 393b5b571..7df472ba9 100644 --- a/IRaCIS.Core.Application/Service/Institution/HospitalService.cs +++ b/IRaCIS.Core.Application/Service/Institution/HospitalService.cs @@ -31,12 +31,14 @@ namespace IRaCIS.Application.Services var exp = new EntityVerifyExp() { VerifyExp = h => h.HospitalName.Equals(hospitalCommand.HospitalName), - VerifyMsg = "已经存在同名的医院,请确认。" + //---已经存在同名的医院,请确认。 + VerifyMsg = _localizer["Hospital_DupName"] }; if (await _hospitalRepository.AnyAsync(x => x.SiteId == hospitalCommand.SiteId && hospitalCommand.SiteId != null)) { - throw new BusinessValidationFailedException("当前Site已经添加到其他Hospital了"); + //---当前Site已经添加到其他Hospital了 + throw new BusinessValidationFailedException(_localizer["Hospital_SiteAdded"]); } var hospital = await _hospitalRepository.InsertOrUpdateAsync(hospitalCommand, true, exp); @@ -53,7 +55,8 @@ namespace IRaCIS.Application.Services { if (await _doctorRepository.AnyAsync(t => t.Id == hospitalId)) { - return ResponseOutput.NotOk("该医院下已经注册有医生,不可以删除。"); + //---该医院下已经注册有医生,不可以删除。 + return ResponseOutput.NotOk(_localizer["Hospital_HasDoctors"]); } //if (_userRepository.Find().Any(t => t.OrganizationId == hospitalId)) //{ @@ -85,4 +88,4 @@ namespace IRaCIS.Application.Services } } -} \ No newline at end of file +} diff --git a/IRaCIS.Core.Application/Service/Institution/SiteService.cs b/IRaCIS.Core.Application/Service/Institution/SiteService.cs index a01360d7e..2f3cc4391 100644 --- a/IRaCIS.Core.Application/Service/Institution/SiteService.cs +++ b/IRaCIS.Core.Application/Service/Institution/SiteService.cs @@ -53,7 +53,8 @@ namespace IRaCIS.Application.Services var exp = new EntityVerifyExp() { VerifyExp = h => h.SiteName.Equals(siteCommand.SiteName) || h.SiteCode.Equals(siteCommand.SiteCode), - VerifyMsg = "已经存在同名的中心,请确认。" + //---已经存在同名的中心,请确认。 + VerifyMsg = _localizer["Site_DupName"] }; using (await _mutex.LockAsync()) @@ -87,11 +88,12 @@ namespace IRaCIS.Application.Services if (await _trialSiteUserRepository.AnyAsync(t => t.SiteId == siteId)) { - return ResponseOutput.NotOk("该中心已经加入项目,不可以被删除。"); + //---该中心已经加入项目,不可以被删除。 + return ResponseOutput.NotOk(_localizer["Site_InProject"]); } var success = await _siteRepository.BatchDeleteNoTrackingAsync(x => x.Id == siteId); return ResponseOutput.Result(success); } } -} \ No newline at end of file +} diff --git a/IRaCIS.Core.Application/Service/Institution/SponsorService.cs b/IRaCIS.Core.Application/Service/Institution/SponsorService.cs index 9381753dc..287b45d5d 100644 --- a/IRaCIS.Core.Application/Service/Institution/SponsorService.cs +++ b/IRaCIS.Core.Application/Service/Institution/SponsorService.cs @@ -50,7 +50,8 @@ namespace IRaCIS.Application.Services var exp = new EntityVerifyExp() { VerifyExp = h => h.SponsorName.Equals(sponsorCommand.SponsorName), - VerifyMsg = "已经存在同名的申办方,请确认。" + //---已经存在同名的申办方,请确认。 + VerifyMsg = _localizer["Sponsor_DupName"] }; var sponsor = await _sponsorRepository.InsertOrUpdateAsync(sponsorCommand, true, exp); @@ -68,7 +69,8 @@ namespace IRaCIS.Application.Services { if (await _trialRepository.AnyAsync(t => t.CROId == sponsorId)) { - return ResponseOutput.NotOk("该申办方已经加入项目,不允许删除。"); + //---该申办方已经加入项目,不允许删除。 + return ResponseOutput.NotOk(_localizer["Sponsor_InProject"]); } //if (_userRepository.Find().Any(t => t.OrganizationId == sponsorId)) //{ @@ -80,4 +82,4 @@ namespace IRaCIS.Application.Services return ResponseOutput.Result(success); } } -} \ No newline at end of file +} diff --git a/IRaCIS.Core.Application/Service/Management/MenuService.cs b/IRaCIS.Core.Application/Service/Management/MenuService.cs index 51fa9e2f9..a954bbdc3 100644 --- a/IRaCIS.Core.Application/Service/Management/MenuService.cs +++ b/IRaCIS.Core.Application/Service/Management/MenuService.cs @@ -27,7 +27,8 @@ namespace IRaCIS.Application.Services var exp = new EntityVerifyExp() { VerifyExp = u => u.ParentId == menuAddOrUpdateModel.ParentId && u.MenuName == menuAddOrUpdateModel.MenuName, - VerifyMsg = "该父节点下已经存在同名的子节点。" + //---该父节点下已经存在同名的子节点。 + VerifyMsg = _localizer["Menu_ParentDupChild"] }; var menu = await _repository.InsertOrUpdateAsync(menuAddOrUpdateModel, true, exp); @@ -91,7 +92,8 @@ namespace IRaCIS.Application.Services { if (await menuRepository.AnyAsync(t => t.ParentId == menuId)) { - return ResponseOutput.NotOk("该节点存在子节点,请在删除子节点后,再删除该节点。"); + //---该节点存在子节点,请在删除子节点后,再删除该节点。 + return ResponseOutput.NotOk(_localizer["Menu_ChildExist"]); } var success =await menuRepository.BatchDeleteNoTrackingAsync(u => u.Id == menuId); diff --git a/IRaCIS.Core.Application/Service/Management/UserService.cs b/IRaCIS.Core.Application/Service/Management/UserService.cs index 2ae546c0c..94fb79e87 100644 --- a/IRaCIS.Core.Application/Service/Management/UserService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserService.cs @@ -49,7 +49,8 @@ namespace IRaCIS.Application.Services { if (await _userRepository.WhereIf(userId != null, t => t.Id != userId).AnyAsync(t => t.UserName == userName)) { - throw new BusinessValidationFailedException("用户名已经存在。"); + //---用户名已经存在。 + throw new BusinessValidationFailedException(_localizer["User_UsernameExist"]); } } @@ -57,7 +58,8 @@ namespace IRaCIS.Application.Services { if (await _userRepository.WhereIf(userId != null, t => t.Id != userId).AnyAsync(t => (t.Phone == phone && t.UserTypeId == userTypeId))) { - throw new BusinessValidationFailedException("该用户类型中已存在具有相同的电话的用户。"); + //---该用户类型中已存在具有相同的电话的用户。 + throw new BusinessValidationFailedException(_localizer["User_PhoneDup"]); } } @@ -66,7 +68,8 @@ namespace IRaCIS.Application.Services { if (await _userRepository.WhereIf(userId != null, t => t.Id != userId).AnyAsync(t => (t.EMail == email && t.UserTypeId == userTypeId))) { - throw new BusinessValidationFailedException("该用户类型中已存在具有相同邮箱的用户。"); + //---该用户类型中已存在具有相同邮箱的用户。 + throw new BusinessValidationFailedException(_localizer["User_EmailDup"]); } } @@ -79,7 +82,8 @@ namespace IRaCIS.Application.Services if (oldPwd != null && oldPwd == newPwd) { - throw new BusinessValidationFailedException("新密码与旧密码相同。"); + //---新密码与旧密码相同。 + throw new BusinessValidationFailedException(_localizer["User_NewOldPwdSame"]); } @@ -87,12 +91,14 @@ namespace IRaCIS.Application.Services if (oldPwd != null && dbUser.Password != oldPwd) { - throw new BusinessValidationFailedException("旧密码验证失败。"); + //---旧密码验证失败。 + throw new BusinessValidationFailedException(_localizer["User_OldPwdInvalid"]); } if (dbUser.Password == newPwd) { - throw new BusinessValidationFailedException("新密码与旧密码相同。"); + //---新密码与旧密码相同。 + throw new BusinessValidationFailedException(_localizer["User_NewOldPwdSame"]); } @@ -113,7 +119,8 @@ namespace IRaCIS.Application.Services //检查手机或者邮箱是否有效 if (!Regex.IsMatch(email, @"^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$")) { - return ResponseOutput.NotOk("Please input a legal email"); + //---Please input a legal email + return ResponseOutput.NotOk(_localizer["User_LegalEmail"]); } @@ -140,7 +147,8 @@ namespace IRaCIS.Application.Services if (verificationRecord == null) { - return ResponseOutput.NotOk("验证码错误。"); + //---验证码错误。 + return ResponseOutput.NotOk(_localizer["User_VerificationCodeError"]); } else @@ -148,7 +156,8 @@ namespace IRaCIS.Application.Services //检查验证码是否失效 if (verificationRecord.ExpirationTime < DateTime.Now) { - return ResponseOutput.NotOk("验证码已经过期。"); + //---验证码已经过期。 + return ResponseOutput.NotOk(_localizer["User_VerificationCodeExpired"]); } else //验证码正确 并且 没有超时 @@ -267,7 +276,8 @@ namespace IRaCIS.Application.Services } catch (Exception ex) { - throw new BusinessValidationFailedException("请检查邮箱地址或者联系维护人员, 邮件发送失败, 未能创建账户成功"); + //---请检查邮箱地址或者联系维护人员, 邮件发送失败, 未能创建账户成功 + throw new BusinessValidationFailedException(_localizer["User_CreateFailed"]); } @@ -296,7 +306,8 @@ namespace IRaCIS.Application.Services if (!Regex.IsMatch(email, @"^[a-zA-Z0-9_-]+@[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)+$")) { - return ResponseOutput.NotOk("请输入一个正确的邮箱。"); + //---请输入一个正确的邮箱。 + return ResponseOutput.NotOk(_localizer["User_InvalidEmail"]); } @@ -305,7 +316,8 @@ namespace IRaCIS.Application.Services if (!exist) { - return ResponseOutput.NotOk("邮箱错误。"); + //---邮箱错误。 + return ResponseOutput.NotOk(_localizer["User_EmailError"]); } @@ -337,7 +349,8 @@ namespace IRaCIS.Application.Services if (verificationRecord == null) { - throw new BusinessValidationFailedException("验证码错误。"); + //---验证码错误。 + throw new BusinessValidationFailedException(_localizer["User_VerificationCodeError"]); } else { @@ -345,7 +358,8 @@ namespace IRaCIS.Application.Services if (verificationRecord.ExpirationTime < DateTime.Now) { - throw new BusinessValidationFailedException("验证码已经过期。"); + //---验证码已经过期。 + throw new BusinessValidationFailedException(_localizer["User_VerificationCodeExpired"]); } else //验证码正确 并且 没有超时 { @@ -561,7 +575,8 @@ namespace IRaCIS.Application.Services { if (await _userTrialRepository.AnyAsync(t => t.Id == userId)) { - return ResponseOutput.NotOk("该用户已经参加项目,不能够删除。"); + //---该用户已经参加项目,不能够删除。 + return ResponseOutput.NotOk(_localizer["User_InProject"]); } var success = await _userRepository.BatchDeleteNoTrackingAsync(t => t.Id == userId); @@ -625,7 +640,8 @@ namespace IRaCIS.Application.Services if (loginUser.Status == 0) { - return ResponseOutput.NotOk("该用户已经被禁用。", new LoginReturnDTO()); + //---该用户已经被禁用。 + return ResponseOutput.NotOk(_localizer["User_Disabled"], new LoginReturnDTO()); } userLoginReturnModel.BasicInfo = loginUser; diff --git a/IRaCIS.Core.Application/Service/Management/UserTypeService.cs b/IRaCIS.Core.Application/Service/Management/UserTypeService.cs index 8bc59d51e..8cf99be11 100644 --- a/IRaCIS.Core.Application/Service/Management/UserTypeService.cs +++ b/IRaCIS.Core.Application/Service/Management/UserTypeService.cs @@ -1,4 +1,4 @@ -//-------------------------------------------------------------------- +//-------------------------------------------------------------------- // 此代码由T4模板自动生成 byzhouhang 20210918 // 生成时间 2021-11-03 09:38:11 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 @@ -79,7 +79,8 @@ namespace IRaCIS.Core.Application.Contracts { if ( await _repository.AnyAsync(t => t.UserTypeId == userTypeId)) { - return ResponseOutput.NotOk("该用户类型中已存在用户,不能删除"); + //---该用户类型中已存在用户,不能删除 + return ResponseOutput.NotOk(_localizer["UserType_InUse"]); } var success = await userTypeServiceRepository.BatchDeleteNoTrackingAsync(t => t.Id == userTypeId); diff --git a/IRaCIS.Core.Application/Service/QC/ClinicalDataService.cs b/IRaCIS.Core.Application/Service/QC/ClinicalDataService.cs index 3404bc925..a0c73a7f7 100644 --- a/IRaCIS.Core.Application/Service/QC/ClinicalDataService.cs +++ b/IRaCIS.Core.Application/Service/QC/ClinicalDataService.cs @@ -1,4 +1,4 @@ -//-------------------------------------------------------------------- +//-------------------------------------------------------------------- // 此代码由T4模板自动生成 byzhouhang 20210918 // 生成时间 2021-11-22 11:29:44 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 @@ -19,15 +19,17 @@ namespace IRaCIS.Core.Application.Contracts private readonly IRepository _previousSurgeryRepository; private readonly IRepository _previousPdfRepository; private readonly IRepository _subjectVisitRepository; + private readonly QCCommon _qCCommon; - - public ClinicalDataService(IRepository previousHistoryRepository, + public ClinicalDataService(IRepository previousHistoryRepository, IRepository previousOtherRepository, IRepository previousSurgeryRepository, IRepository previousPDFRepository, - IRepository subjectVisitRepository + IRepository subjectVisitRepository, + QCCommon qCCommon ) { + _qCCommon = qCCommon; _previousOtherRepository = previousOtherRepository; _previousHistoryRepository = previousHistoryRepository; _previousSurgeryRepository = previousSurgeryRepository; @@ -96,7 +98,7 @@ namespace IRaCIS.Core.Application.Contracts [HttpPost("{trialId:guid}")] public async Task> AddOrUpdatePreviousHistory(PreviousHistoryAddOrEdit addOrEditPreviousHistory) { - await QCCommon.VerifyIsCRCSubmmitAsync(_repository, _userInfo, addOrEditPreviousHistory.SubjectVisitId); + await _qCCommon.VerifyIsCRCSubmmitAsync(_repository, _userInfo, addOrEditPreviousHistory.SubjectVisitId); var entity = await _previousHistoryRepository.InsertOrUpdateAsync(addOrEditPreviousHistory, true); return ResponseOutput.Ok(entity.Id); @@ -106,7 +108,7 @@ namespace IRaCIS.Core.Application.Contracts [HttpDelete("{trialId:guid}/{subjectVisitId:guid}/{previousHistoryId:guid}")] public async Task DeletePreviousHistory(Guid previousHistoryId,Guid subjectVisitId) { - await QCCommon.VerifyIsCRCSubmmitAsync(_repository, _userInfo, subjectVisitId); + await _qCCommon.VerifyIsCRCSubmmitAsync(_repository, _userInfo, subjectVisitId); await _previousHistoryRepository.DeleteFromQueryAsync(t => t.Id == previousHistoryId,true); return ResponseOutput.Ok(); } @@ -123,7 +125,7 @@ namespace IRaCIS.Core.Application.Contracts [HttpPost("{trialId:guid}")] public async Task> AddOrUpdatePreviousOther(PreviousOtherAddOrEdit addOrEditPreviousOther) { - await QCCommon.VerifyIsCRCSubmmitAsync(_repository, _userInfo, addOrEditPreviousOther.SubjectVisitId); + await _qCCommon.VerifyIsCRCSubmmitAsync(_repository, _userInfo, addOrEditPreviousOther.SubjectVisitId); var entity = await _previousOtherRepository.InsertOrUpdateAsync(addOrEditPreviousOther, true); return ResponseOutput.Ok(entity.Id); @@ -133,7 +135,7 @@ namespace IRaCIS.Core.Application.Contracts [HttpDelete("{trialId:guid}/{subjectVisitId:guid}/{previousOtherId:guid}")] public async Task DeletePreviousOther(Guid previousOtherId, Guid subjectVisitId) { - await QCCommon.VerifyIsCRCSubmmitAsync(_repository, _userInfo, subjectVisitId); + await _qCCommon.VerifyIsCRCSubmmitAsync(_repository, _userInfo, subjectVisitId); await _previousOtherRepository.DeleteFromQueryAsync(t => t.Id == previousOtherId,true); return ResponseOutput.Ok(); @@ -151,7 +153,7 @@ namespace IRaCIS.Core.Application.Contracts [HttpPost("{trialId:guid}")] public async Task> AddOrUpdatePreviousSurgery(PreviousSurgeryAddOrEdit addOrEditPreviousSurgery) { - await QCCommon.VerifyIsCRCSubmmitAsync(_repository, _userInfo, addOrEditPreviousSurgery.SubjectVisitId); + await _qCCommon.VerifyIsCRCSubmmitAsync(_repository, _userInfo, addOrEditPreviousSurgery.SubjectVisitId); var entity = await _previousSurgeryRepository.InsertOrUpdateAsync(addOrEditPreviousSurgery, true); return ResponseOutput.Ok(entity.Id); } @@ -160,7 +162,7 @@ namespace IRaCIS.Core.Application.Contracts [HttpDelete("{trialId:guid}/{subjectVisitId:guid}/{previousSurgeryId:guid}")] public async Task DeletePreviousSurgery(Guid previousSurgeryId, Guid subjectVisitId) { - await QCCommon.VerifyIsCRCSubmmitAsync(_repository, _userInfo, subjectVisitId); + await _qCCommon.VerifyIsCRCSubmmitAsync(_repository, _userInfo, subjectVisitId); var success = await _previousSurgeryRepository.DeleteFromQueryAsync(t => t.Id == previousSurgeryId,true); return ResponseOutput.Ok(); } @@ -177,7 +179,7 @@ namespace IRaCIS.Core.Application.Contracts public async Task AddOrUpdatePreviousPDF(PreviousPDFAddOrEdit addOrEditPreviousPDF) { - await QCCommon.VerifyIsCRCSubmmitAsync(_repository, _userInfo, addOrEditPreviousPDF.SubjectVisitId); + await _qCCommon.VerifyIsCRCSubmmitAsync(_repository, _userInfo, addOrEditPreviousPDF.SubjectVisitId); var entity = await _previousPdfRepository.InsertOrUpdateAsync(addOrEditPreviousPDF, true); return ResponseOutput.Ok(entity.Id); @@ -186,7 +188,7 @@ namespace IRaCIS.Core.Application.Contracts [HttpDelete("{trialId:guid}/{subjectVisitId:guid}/{previousPDFId:guid}")] public async Task DeletePreviousPDF(Guid previousPDFId, Guid subjectVisitId) { - await QCCommon.VerifyIsCRCSubmmitAsync(_repository, _userInfo, subjectVisitId); + await _qCCommon.VerifyIsCRCSubmmitAsync(_repository, _userInfo, subjectVisitId); await _previousPdfRepository.DeleteFromQueryAsync(t => t.Id == previousPDFId,true); return ResponseOutput.Ok(); diff --git a/IRaCIS.Core.Application/Service/QC/NoneDicomStudyService.cs b/IRaCIS.Core.Application/Service/QC/NoneDicomStudyService.cs index c461842c9..fa912838f 100644 --- a/IRaCIS.Core.Application/Service/QC/NoneDicomStudyService.cs +++ b/IRaCIS.Core.Application/Service/QC/NoneDicomStudyService.cs @@ -21,12 +21,14 @@ namespace IRaCIS.Core.Application.Contracts private readonly IRepository _noneDicomStudyRepository; private readonly IRepository _noneDicomStudyFileRepository; private readonly AsyncLock _mutex = new AsyncLock(); + private readonly QCCommon _qCCommon; public NoneDicomStudyService(IRepository noneDicomStudyRepository, - + QCCommon qCCommon, IRepository noneDicomStudyFileRepository) { + _qCCommon = qCCommon; _noneDicomStudyRepository = noneDicomStudyRepository; _noneDicomStudyFileRepository = noneDicomStudyFileRepository; @@ -51,11 +53,11 @@ namespace IRaCIS.Core.Application.Contracts public async Task> AddOrUpdateNoneDicomStudy(NoneDicomStudyAddOrEdit addOrEditNoneDicomStudy) { - await QCCommon.VerifyIsCRCSubmmitAsync(_repository, _userInfo, addOrEditNoneDicomStudy.SubjectVisitId); + await _qCCommon.VerifyIsCRCSubmmitAsync(_repository, _userInfo, addOrEditNoneDicomStudy.SubjectVisitId); if (_repository.Where(t => t.Id == addOrEditNoneDicomStudy.TrialId).Any(t => t.IsVerifyVisitImageDate==true)) { - await QCCommon.VerifyStudyImageDataAsync(_repository, addOrEditNoneDicomStudy.SubjectId, addOrEditNoneDicomStudy.SubjectVisitId, addOrEditNoneDicomStudy.ImageDate); + await _qCCommon.VerifyStudyImageDataAsync(_repository, addOrEditNoneDicomStudy.SubjectId, addOrEditNoneDicomStudy.SubjectVisitId, addOrEditNoneDicomStudy.ImageDate); } @@ -99,7 +101,7 @@ namespace IRaCIS.Core.Application.Contracts //提交了 但是IQC同意的时候 是可以删除的 | 普通提交后也不能删除 - await QCCommon.VerifyIsCRCSubmmitAsync(_repository, _userInfo, subjectVisitId); + await _qCCommon.VerifyIsCRCSubmmitAsync(_repository, _userInfo, subjectVisitId); await _noneDicomStudyRepository.DeleteFromQueryAsync(noneDicomStudyId); @@ -119,7 +121,7 @@ namespace IRaCIS.Core.Application.Contracts public async Task DeleteNoneDicomStudyFile(Guid noneDicomStudyFileId, Guid subjectVisitId) { //提交了 但是IQC同意的时候 是可以删除的 | 普通提交后也不能删除 - await QCCommon.VerifyIsCRCSubmmitAsync(_repository, _userInfo, subjectVisitId); + await _qCCommon.VerifyIsCRCSubmmitAsync(_repository, _userInfo, subjectVisitId); var noneDicomStudyFile = await _noneDicomStudyFileRepository.FirstOrDefaultAsync(t => t.Id == noneDicomStudyFileId); diff --git a/IRaCIS.Core.Application/Service/QC/QCCommon.cs b/IRaCIS.Core.Application/Service/QC/QCCommon.cs index c414e915b..dba63d1bb 100644 --- a/IRaCIS.Core.Application/Service/QC/QCCommon.cs +++ b/IRaCIS.Core.Application/Service/QC/QCCommon.cs @@ -1,11 +1,15 @@ using IRaCIS.Core.Domain.Share; using IRaCIS.Core.Infrastructure; +using Microsoft.Extensions.Localization; using System.Linq.Expressions; namespace IRaCIS.Core.Application.Service { - public static class QCCommon + public class QCCommon: BaseService { + + + /// /// 验证CRC 是否已提交 已提交 就不允许进行任何操作,如果是IQC 那么还验证是否是当前任务领取人 /// @@ -14,7 +18,7 @@ namespace IRaCIS.Core.Application.Service /// /// /// - public static async Task VerifyIsCRCSubmmitAsync(IRepository _repository, IUserInfo _userInfo, Guid? subjectVisitId = null) + public async Task VerifyIsCRCSubmmitAsync(IRepository _repository, IUserInfo _userInfo, Guid? subjectVisitId = null) { if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.ClinicalResearchCoordinator) { @@ -24,7 +28,8 @@ namespace IRaCIS.Core.Application.Service if (await _repository.AnyAsync(t => t.Id == subjectVisitId && t.SubmitState == SubmitStateEnum.Submitted && (!t.QCChallengeList.Any(u => u.ReuploadEnum == QCChanllengeReuploadEnum.QCAgreeUpload)))) { - throw new BusinessValidationFailedException("CRC 已提交影像,不能进行操作。"); + //---CRC 已提交影像,不能进行操作。 + throw new BusinessValidationFailedException(_localizer["QCCommon_CannotOperate"]); } } } @@ -40,22 +45,22 @@ namespace IRaCIS.Core.Application.Service } - public static async Task VerifyIsCanQCAsync(IRepository _repository, IUserInfo _userInfo, SubjectVisit? subjectVisit = null, Guid? subjectVisitId = null) + public async Task VerifyIsCanQCAsync(IRepository _repository, IUserInfo _userInfo, SubjectVisit? subjectVisit = null, Guid? subjectVisitId = null) { if (subjectVisitId != null) { subjectVisit = (await _repository.FirstOrDefaultAsync(t => t.Id == subjectVisitId)).IfNullThrowException(); } - if (subjectVisit!.CurrentActionUserId != _userInfo.Id) { - throw new BusinessValidationFailedException("您不是该质控任务当前领取人,没有操作权限!"); + //---您不是该质控任务当前领取人,没有操作权限! + throw new BusinessValidationFailedException(_localizer["QCCommon_NoPermission"]); } } - public static async Task VerifyStudyImageDataAsync(IRepository _repository, Guid subjectId, Guid subjectVisitId, DateTime imageDate) + public async Task VerifyStudyImageDataAsync(IRepository _repository, Guid subjectId, Guid subjectVisitId, DateTime imageDate) { var visitList = await _repository.Where(t => t.SubjectId == subjectId).Select(t => new { t.VisitNum, t.EarliestScanDate, t.LatestScanDate, t.Id }).ToListAsync(); @@ -68,7 +73,8 @@ namespace IRaCIS.Core.Application.Service if (before != null && before > imageDate) { - throw new BusinessValidationFailedException($"当前访视检查时间{imageDate.ToString("yyyy-MM-dd")}不能早于前序访视检查时间{before?.ToString("yyyy-MM-dd")},请核对检查数据是否有误"); + //当前访视检查时间{imageDate.ToString("yyyy-MM-dd")}不能早于前序访视检查时间{before?.ToString("yyyy-MM-dd")},请核对检查数据是否有误 + throw new BusinessValidationFailedException(_localizer["QCCommon_CheckTimeEarly", imageDate.ToString("yyyy-MM-dd"), before?.ToString("yyyy-MM-dd")]); } @@ -77,7 +83,8 @@ namespace IRaCIS.Core.Application.Service if (after != null && after < imageDate) { - throw new BusinessValidationFailedException($"当前访视检查时间{imageDate.ToString("yyyy-MM-dd")}不能晚于该访视之后的检查时间{after?.ToString("yyyy-MM-dd")},请核对检查数据是否有误"); + //$"当前访视检查时间{imageDate.ToString("yyyy-MM-dd")}不能晚于该访视之后的检查时间{after?.ToString("yyyy-MM-dd")},请核对检查数据是否有误" + throw new BusinessValidationFailedException(_localizer["QCCommon_CheckTimeLate", imageDate.ToString("yyyy-MM-dd"), after?.ToString("yyyy-MM-dd")]); } } diff --git a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs index f3e781cf0..62e0cf191 100644 --- a/IRaCIS.Core.Application/Service/QC/QCOperationService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCOperationService.cs @@ -75,7 +75,8 @@ namespace IRaCIS.Core.Application.Image.QA if (!await _repository.AnyAsync(t => t.SubjectVisitId == subjectVisitId && t.CurrentQCEnum == currentQCType)) { - return ResponseOutput.NotOk("请先核查图像,并保存审核问题,然后再发质疑。"); + //---请先核查图像,并保存审核问题,然后再发质疑。 + return ResponseOutput.NotOk(_localizer["QCOperation_CheckFirst"]); } return ResponseOutput.Ok(); @@ -100,7 +101,8 @@ namespace IRaCIS.Core.Application.Image.QA { if (await _qcChallengeRepository.AnyAsync(t => t.IsClosed == false && t.SubjectVisitId == qaQuestionCommand.SubjectVisitId && t.ReuploadEnum == QCChanllengeReuploadEnum.QCAgreeUpload)) { - throw new BusinessValidationFailedException("当前访视未关闭的质疑已设置了同意CRC重传影像。请在CRC完成影像重传后,先关闭原质疑,再添加新的质疑。"); + //---当前访视未关闭的质疑已设置了同意CRC重传影像。请在CRC完成影像重传后,先关闭原质疑,再添加新的质疑。 + throw new BusinessValidationFailedException(_localizer["QCOperation_QuestionExist"]); } @@ -164,7 +166,8 @@ namespace IRaCIS.Core.Application.Image.QA if (dbQCChallenge.ReuploadEnum == QCChanllengeReuploadEnum.CRCRequestReupload || dbQCChallenge.ReuploadEnum == QCChanllengeReuploadEnum.QCAgreeUpload) { - throw new BusinessValidationFailedException("CRC已申请重传或者QC同意重传,不允许关闭该质疑。请在QC拒绝重传申请或者CRC设置重传影像后,再关闭质疑。"); + //---CRC已申请重传或者QC同意重传,不允许关闭该质疑。请在QC拒绝重传申请或者CRC设置重传影像后,再关闭质疑。 + throw new BusinessValidationFailedException(_localizer["QCOperation_QuestionCannotClose"]); } @@ -182,7 +185,8 @@ namespace IRaCIS.Core.Application.Image.QA SubjectVisitId = dbQCChallenge.SubjectVisitId, UserTypeEnum = (UserTypeEnum)_userInfo.UserTypeEnumInt, QCChallengeId = dbQCChallenge.Id, - TalkContent = "关闭原因: " + input.closeReason + //---关闭原因: + TalkContent = _localizer["QCOperation_CloseReason"] + input.closeReason }); var success = await _qcChallengeRepository.SaveChangesAsync(); @@ -208,7 +212,8 @@ namespace IRaCIS.Core.Application.Image.QA if (await _repository.AnyAsync(t => t.QCChallengeId == qcChallengeId)) { - ResponseOutput.NotOk("当前QC质疑已经回复。"); + //---当前QC质疑已经回复。 + ResponseOutput.NotOk(_localizer["QCOperation_QuestionReplied"]); } var qaRecord = (await _qcChallengeRepository.FirstOrDefaultAsync(t => t.Id == qcChallengeId)).IfNullThrowException(); @@ -289,7 +294,8 @@ namespace IRaCIS.Core.Application.Image.QA } else { - throw new BusinessValidationFailedException("您没有权限回复一致性核查对话。"); + //---您没有权限回复一致性核查对话。 + throw new BusinessValidationFailedException(_localizer["QCOperation_NoPermissionReply"]); } var success = await _repository.SaveChangesAsync(); @@ -311,7 +317,8 @@ namespace IRaCIS.Core.Application.Image.QA if (sv.RequestBackState == RequestBackStateEnum.CRC_RequestBack) { - ResponseOutput.NotOk("当前访视处于申请回退状态, 不允许关闭质疑。"); + //---当前访视处于申请回退状态, 不允许关闭质疑。 + ResponseOutput.NotOk(_localizer["QCOperation_CannotClose"]); } @@ -321,7 +328,8 @@ namespace IRaCIS.Core.Application.Image.QA await _checkChallengeDialogrepository.AddAsync(new CheckChallengeDialog() { SubjectVisitId = input.subjectVisitId, - TalkContent = "原因:" + input.CloseCheckChallenge, + //---原因: + TalkContent = _localizer["QCOperation_Reason"] + input.CloseCheckChallenge, UserTypeEnum = (UserTypeEnum)_userInfo.UserTypeEnumInt, }); @@ -351,12 +359,14 @@ namespace IRaCIS.Core.Application.Image.QA if (sv.RequestBackState == RequestBackStateEnum.PM_AgressBack) { - ResponseOutput.NotOk("当前访视处于回退状态,不允许设置一致性核查通过"); + //---当前访视处于回退状态,不允许设置一致性核查通过 + ResponseOutput.NotOk(_localizer["QCOperation_CannotPass"]); } if (sv.CheckChallengeState != CheckChanllengeTypeEnum.Closed && sv.AuditState == AuditStateEnum.QCPassed) { - ResponseOutput.NotOk("请先关闭一致性核查质疑后,再设置一致性核查通过。"); + //---请先关闭一致性核查质疑后,再设置一致性核查通过。 + ResponseOutput.NotOk(_localizer["QCOperation_PassAfterClose"]); } sv.CheckUserId = _userInfo.Id; @@ -390,7 +400,8 @@ namespace IRaCIS.Core.Application.Image.QA if (sv.CheckState == CheckStateEnum.CVPassed) { - return ResponseOutput.NotOk("当前访视已通过一致性核查,不允许申请回退"); + //---当前访视已通过一致性核查,不允许申请回退 + return ResponseOutput.NotOk(_localizer["QCOperation_Cannotback"]); } var QCChallengeId = await _qcChallengeRepository.Where(x => x.SubjectVisitId == subjectVisitId).Select(x => x.Id).FirstOrDefaultAsync(); @@ -399,7 +410,8 @@ namespace IRaCIS.Core.Application.Image.QA { SubjectVisitId = subjectVisitId, UserTypeEnum = (UserTypeEnum)_userInfo.UserTypeEnumInt, - TalkContent = "CRC申请回退" + //---CRC申请回退 + TalkContent = _localizer["QCOperation_CRCRollback"] }); @@ -411,7 +423,8 @@ namespace IRaCIS.Core.Application.Image.QA } else { - return ResponseOutput.NotOk("其他CRC已申请处理,请刷新页面"); + //---其他CRC已申请处理,请刷新页面 + return ResponseOutput.NotOk(_localizer["QCOperation_OtherCRC"]); } @@ -438,7 +451,8 @@ namespace IRaCIS.Core.Application.Image.QA { sv.RequestBackState = RequestBackStateEnum.PM_NotAgree; - await _repository.AddAsync(new CheckChallengeDialog() { SubjectVisitId = subjectVisitId, TalkContent = "PM/APM拒绝一致性核查回退", UserTypeEnum = (UserTypeEnum)_userInfo.UserTypeEnumInt }); + //---PM/APM拒绝一致性核查回退 + await _repository.AddAsync(new CheckChallengeDialog() { SubjectVisitId = subjectVisitId, TalkContent = _localizer["QCOperation_PMReject"], UserTypeEnum = (UserTypeEnum)_userInfo.UserTypeEnumInt }); await _subjectVisitRepository.SaveChangesAsync(); @@ -446,7 +460,8 @@ namespace IRaCIS.Core.Application.Image.QA } else { - return ResponseOutput.NotOk("您不具备操作权限。"); + //---您不具备操作权限。 + return ResponseOutput.NotOk(_localizer["QCOperation_NoPermission"]); } } @@ -470,7 +485,8 @@ namespace IRaCIS.Core.Application.Image.QA if (sv.CheckState == CheckStateEnum.CVPassed || sv.CheckState == CheckStateEnum.ToCheck) { - return ResponseOutput.NotOk("当前访视还未进行核查或者核查已通过,不允许设置回退。"); + //---当前访视还未进行核查或者核查已通过,不允许设置回退。 + return ResponseOutput.NotOk(_localizer["QCOperation_CannotRollback"]); } //sv.CheckChallengeState = (int)CheckChanllengeTypeEnum.None; @@ -509,7 +525,8 @@ namespace IRaCIS.Core.Application.Image.QA //_qcChallengeRepository.Delete(t => t.SubjectVisitId == subjectVisitId); //_qcChallengeDialogRepository.Delete(t => t.SubjectVisitId == subjectVisitId); //_checkChallengeDialogRepository.Delete(t => t.SubjectVisitId == subjectVisitId); - await _repository.AddAsync(new CheckChallengeDialog() { SubjectVisitId = subjectVisitId, TalkContent = "PM/APM同意一致性核查回退。", UserTypeEnum = (UserTypeEnum)_userInfo.UserTypeEnumInt }); + //---PM/APM同意一致性核查回退。 + await _repository.AddAsync(new CheckChallengeDialog() { SubjectVisitId = subjectVisitId, TalkContent = _localizer["QCOperation_PMAPMConsistency"], UserTypeEnum = (UserTypeEnum)_userInfo.UserTypeEnumInt }); await _repository.BatchDeleteAsync(t => t.SubjectVisitId == subjectVisitId); @@ -684,7 +701,8 @@ namespace IRaCIS.Core.Application.Image.QA { if (await _subjectVisitRepository.AnyAsync(t => t.Id == updateModalityCommand.SubjectVisitId && t.SubmitState == SubmitStateEnum.Submitted)) { - throw new BusinessValidationFailedException("提交之后,不允许修改!"); + //---提交之后,不允许修改! + throw new BusinessValidationFailedException(_localizer["QCOperation_NoModifyAfterSubmit"]); } } @@ -732,7 +750,8 @@ namespace IRaCIS.Core.Application.Image.QA if (await _repository.AnyAsync(t => t.SubjectVisitId == subjectVisitId && t.IsClosed == false)) { - return ResponseOutput.NotOk("当前访视有质疑未关闭,不允许该操作"); + //---当前访视有质疑未关闭,不允许该操作 + return ResponseOutput.NotOk(_localizer["QCOperation_UnresolvedQCQuery"]); } return ResponseOutput.Ok(); } @@ -759,7 +778,8 @@ namespace IRaCIS.Core.Application.Image.QA if (await _subjectVisitRepository.AnyAsync(t => t.Id == subjectVisitId && t.SubmitState == SubmitStateEnum.Submitted && (!t.QCChallengeList.Any(u => u.ReuploadEnum == QCChanllengeReuploadEnum.QCAgreeUpload)))) { - return ResponseOutput.NotOk("CRC已经提交,不允许删除。"); + //---CRC已经提交,不允许删除。 + return ResponseOutput.NotOk(_localizer["QCOperation_CrcNoDelete"]); } var waitDeleteStudyList = await _dicomStudyRepository.Where(x => ids.Contains(x.Id)).ToListAsync(); @@ -853,7 +873,8 @@ namespace IRaCIS.Core.Application.Image.QA if (subjectVisit!.CurrentActionUserId != _userInfo.Id) { - throw new BusinessValidationFailedException("您不是该质控任务当前领取人,没有操作权限!"); + //---您不是该质控任务当前领取人,没有操作权限! + throw new BusinessValidationFailedException(_localizer["QCOperation_NoRecipient"]); } } @@ -871,7 +892,8 @@ namespace IRaCIS.Core.Application.Image.QA if (dbSubjectVisit.CurrentActionUserId == null && dbSubjectVisit.IsTake == false) { - return ResponseOutput.NotOk("当前访视的影像质控任务已被原领取人释放。您可以通过“领取”获得", ApiResponseCodeEnum.NeedTips); + //---当前访视的影像质控任务已被原领取人释放。您可以通过“领取”获得 + return ResponseOutput.NotOk(_localizer["QCOperation_QCImageTaskAlreadyReleased"], ApiResponseCodeEnum.NeedTips); } @@ -916,13 +938,15 @@ namespace IRaCIS.Core.Application.Image.QA { //throw new BusinessValidationFailedException("当前访视已被领取,不允许领取"); - return ResponseOutput.NotOk("当前访视的影像质控任务已被其他QC领取,不允许领取", ApiResponseCodeEnum.NeedTips); + //---当前访视的影像质控任务已被其他QC领取,不允许领取 + return ResponseOutput.NotOk(_localizer["QCOperation_QCTaskNoAccess"], ApiResponseCodeEnum.NeedTips); } if (await _subjectVisitRepository.AnyAsync(t => t.Trial.QCQuestionConfirmedUserId == null && t.Id == subjectVisitId)) { - return ResponseOutput.NotOk("请先配置影像质控审核问题,再领取影像质控任务", ApiResponseCodeEnum.NeedTips); + //---请先配置影像质控审核问题,再领取影像质控任务 + return ResponseOutput.NotOk(_localizer["QCOperation_QCConfigFirst"], ApiResponseCodeEnum.NeedTips); } @@ -940,13 +964,15 @@ namespace IRaCIS.Core.Application.Image.QA if (trialConfig.QCProcessEnum == TrialQCProcess.NotAudit) { - return ResponseOutput.NotOk("项目配置为不审,没有领取QC Task"); + //---项目配置为不审,没有领取QC Task + return ResponseOutput.NotOk(_localizer["QCOperation_NoQC"]); } else if (trialConfig.QCProcessEnum == TrialQCProcess.SingleAudit) { if (dbSubjectVisit.PreliminaryAuditUserId == _userInfo.Id) { - return ResponseOutput.NotOk("初审已通过,不能继续领取"); + //---初审已通过,不能继续领取 + return ResponseOutput.NotOk(_localizer["QCOperation_InitialAuditPassed"]); } if (dbSubjectVisit.SubmitState == SubmitStateEnum.Submitted && dbSubjectVisit.AuditState == AuditStateEnum.ToAudit) @@ -966,7 +992,8 @@ namespace IRaCIS.Core.Application.Image.QA { if (dbSubjectVisit.PreliminaryAuditUserId == _userInfo.Id) { - return ResponseOutput.NotOk("复审不能和初审是同一个人"); + //---复审不能和初审是同一个人 + return ResponseOutput.NotOk(_localizer["QCOperation_NoSameReviewer"]); } //提交 并且初审通过 那么领取后进入 复审中 @@ -985,7 +1012,8 @@ namespace IRaCIS.Core.Application.Image.QA } else { - return ResponseOutput.NotOk("项目配置为复审,不满足提交状态:已提交 或者 审核状态:待审核/QC中, 不允许领取,请刷新界面"); + //---项目配置为复审,不满足提交状态:已提交 或者 审核状态:待审核/QC中, 不允许领取,请刷新界面 + return ResponseOutput.NotOk(_localizer["QCOperation_NoSecondaryAudit"]); } } @@ -1005,13 +1033,15 @@ namespace IRaCIS.Core.Application.Image.QA { if (dbSubjectVisit!.CurrentActionUserId != _userInfo.Id) { - return ResponseOutput.NotOk("您不是该质控任务当前领取人,没有操作权限!", ApiResponseCodeEnum.NeedTips); + //---您不是该质控任务当前领取人,没有操作权限! + return ResponseOutput.NotOk(_localizer["QCOperation_NoRecipient"], ApiResponseCodeEnum.NeedTips); } if (trialConfig.QCProcessEnum == TrialQCProcess.NotAudit) { - return ResponseOutput.NotOk("项目配置影像质控为不审,不需要取消任务功能"); + //---项目配置影像质控为不审,不需要取消任务功能 + return ResponseOutput.NotOk(_localizer["QCOperation_NoQCFunction"]); } else if (trialConfig.QCProcessEnum == TrialQCProcess.SingleAudit) { @@ -1023,7 +1053,8 @@ namespace IRaCIS.Core.Application.Image.QA else { - return ResponseOutput.NotOk("当前访视影像质控任务没有当前领取人,不能释放。"); + //---当前访视影像质控任务没有当前领取人,不能释放。 + return ResponseOutput.NotOk(_localizer["QCOperation_NoTaskOwner"]); } } else if (trialConfig.QCProcessEnum == TrialQCProcess.DoubleAudit) @@ -1042,7 +1073,8 @@ namespace IRaCIS.Core.Application.Image.QA else { - return ResponseOutput.NotOk("当前访视影像质控任务没有当前领取人, 不能释放"); + //---当前访视影像质控任务没有当前领取人,不能释放。 + return ResponseOutput.NotOk(_localizer["QCOperation_NoTaskOwner"]); } } @@ -1076,15 +1108,16 @@ namespace IRaCIS.Core.Application.Image.QA if (nameList.Count() > 0) { - return ResponseOutput.NotOk($"当前访视要求进行疾病进展确认。请在提交当前访视前,先处理未提交的前序访视:{string.Join('、', nameList)}。", 1, ApiResponseCodeEnum.NeedTips); + //$"当前访视要求进行疾病进展确认。请在提交当前访视前,先处理未提交的前序访视:{string.Join('、', nameList)}。" + return ResponseOutput.NotOk(_localizer["QCOperation_DiseaseProgressConfirmation", string.Join('、', nameList)], 1, ApiResponseCodeEnum.NeedTips); } } else { if (nameList.Count() > 0) { - - return ResponseOutput.NotOk($"在提交当前访视后,请尽快处理尚未提交的前序访视:{string.Join('、', nameList)}。", 0, ApiResponseCodeEnum.NeedTips); + //$"在提交当前访视后,请尽快处理尚未提交的前序访视:{string.Join('、', nameList)}。" + return ResponseOutput.NotOk(_localizer["QCOperation_UnsubmittedVisits", string.Join('、', nameList)], 0, ApiResponseCodeEnum.NeedTips); } } } @@ -1092,7 +1125,8 @@ namespace IRaCIS.Core.Application.Image.QA //同时要根据项目有没有配置Subject 级别临床数据 if (dbSubjectVisitList.Any(t => t.IsBaseLine && !t.IsHaveClinicalData)) { - return ResponseOutput.NotOk($"基线没有临床数据,确认提交?", 0, ApiResponseCodeEnum.NeedTips); + //---基线没有临床数据,确认提交? + return ResponseOutput.NotOk(_localizer["QCOperation_NoBaselineData"], 0, ApiResponseCodeEnum.NeedTips); } return ResponseOutput.Ok(); @@ -1131,17 +1165,20 @@ namespace IRaCIS.Core.Application.Image.QA if (dbSubjectVisitList.Any(t => t.SubmitState == SubmitStateEnum.None)) { - return ResponseOutput.NotOk("有访视未上传任何Dicom/非Dicom影像数据,不允许提交"); + //---有访视未上传任何Dicom/非Dicom影像数据,不允许提交 + return ResponseOutput.NotOk(_localizer["QCOperation_NoImageData"]); } //单个提交提示信息 if (dbSubjectVisitList.Count() == 1 && dbSubjectVisitList.First().SubmitState == SubmitStateEnum.Submitted) { - return ResponseOutput.NotOk("当前访视的影像数据,已经由其他CRC提交。", 3, ApiResponseCodeEnum.NeedTips); + //---当前访视的影像数据,已经由其他CRC提交。 + return ResponseOutput.NotOk(_localizer["QCOperation_ImagesSubmitted"], 3, ApiResponseCodeEnum.NeedTips); } else if (dbSubjectVisitList.Any(t => t.SubmitState == SubmitStateEnum.Submitted)) { - return ResponseOutput.NotOk("当前批量提交访视的影像数据,其中部分已由其他CRC提交。", 3, ApiResponseCodeEnum.NeedTips); + //---当前批量提交访视的影像数据,其中部分已由其他CRC提交。 + return ResponseOutput.NotOk(_localizer["QCOperation_BatchImagesSubmitted"], 3, ApiResponseCodeEnum.NeedTips); } //获取确认的临床数据配置 @@ -1154,7 +1191,8 @@ namespace IRaCIS.Core.Application.Image.QA //基线不验证 if (trialConfig.IsHaveFirstGiveMedicineDate && !dbSubjectVisit.IsBaseLine && dbSubjectVisit.Subject.FirstGiveMedicineTime == null) { - return ResponseOutput.NotOk("项目配置了需要填写访视基准日期。但是受试者没有填写访视基准日期,不允许提交"); + //---项目配置了需要填写访视基准日期。但是受试者没有填写访视基准日期,不允许提交 + return ResponseOutput.NotOk(_localizer["QCOperation_MissingBaselineDate"]); } //基线 且配置了临床数据 @@ -1416,7 +1454,8 @@ namespace IRaCIS.Core.Application.Image.QA if (!await _repository.AnyAsync(t => t.TrialId == trialId && t.UserId == _userInfo.Id)) { - return ResponseOutput.NotOk("您已经被移出项目,没有操作权限。"); + //---您已经被移出项目,没有操作权限。 + return ResponseOutput.NotOk(_localizer["QCOperation_RemoveItem"]); } @@ -1425,7 +1464,8 @@ namespace IRaCIS.Core.Application.Image.QA //判断质疑是否都关闭了 if (await _repository.AnyAsync(t => t.SubjectVisitId == subjectVisitId && t.IsClosed == false)) { - return ResponseOutput.NotOk("当前访视有影像质控质疑未关闭,不能进行此操作。"); + //---当前访视有影像质控质疑未关闭,不能进行此操作。 + return ResponseOutput.NotOk(_localizer["QCOperation_QCNotClosed"]); } } @@ -1455,7 +1495,8 @@ namespace IRaCIS.Core.Application.Image.QA if (trialConfig.QCProcessEnum == TrialQCProcess.NotAudit) { - return ResponseOutput.NotOk("项目配置影像质控为不审,不需要设置为影像质控通过。"); + //---项目配置影像质控为不审,不需要设置为影像质控通过。 + return ResponseOutput.NotOk(_localizer["QCOperation_NoQCNeeded"]); } else if (trialConfig.QCProcessEnum == TrialQCProcess.SingleAudit) @@ -1464,7 +1505,8 @@ namespace IRaCIS.Core.Application.Image.QA { if (!await _repository.AnyAsync(t => t.SubjectVisitId == subjectVisitId && t.CurrentQCEnum == CurrentQC.First)) { - return ResponseOutput.NotOk("影像质控审核问题没有保存,不能进行此操作。"); + //---影像质控审核问题没有保存,不能进行此操作。 + return ResponseOutput.NotOk(_localizer["QCOperation_QCNotSaved"]); } // 单审 @@ -1499,7 +1541,8 @@ namespace IRaCIS.Core.Application.Image.QA } else { - return ResponseOutput.NotOk("项目配置影像质控为单审,当前访视影像质控任务不能从当前审核状态变更到 审核通过。"); + //---项目配置影像质控为单审,当前访视影像质控任务不能从当前审核状态变更到 审核通过。 + return ResponseOutput.NotOk(_localizer["QCOperation_NotChangePass"]); } @@ -1514,7 +1557,8 @@ namespace IRaCIS.Core.Application.Image.QA if (!await _repository.AnyAsync(t => t.SubjectVisitId == subjectVisitId && t.CurrentQCEnum == CurrentQC.First)) { - return ResponseOutput.NotOk("影像质控审核问题没有保存,不能进行此操作。"); + //---影像质控审核问题没有保存,不能进行此操作。 + return ResponseOutput.NotOk(_localizer["QCOperation_QCNotSaved"]); } dbSubjectVisit.AuditState = AuditStateEnum.PrimaryQCPassed; @@ -1528,7 +1572,8 @@ namespace IRaCIS.Core.Application.Image.QA if (!await _repository.AnyAsync(t => t.SubjectVisitId == subjectVisitId && t.CurrentQCEnum == CurrentQC.Second)) { - return ResponseOutput.NotOk("影像质控审核问题没有保存,不能进行此操作。"); + //---影像质控审核问题没有保存,不能进行此操作。 + return ResponseOutput.NotOk(_localizer["QCOperation_QCNotSaved"]); } dbSubjectVisit.AuditState = AuditStateEnum.QCPassed; @@ -1560,7 +1605,8 @@ namespace IRaCIS.Core.Application.Image.QA } else { - return ResponseOutput.NotOk($"项目配置影像质控为双审。当前审核状态为 {dbSubjectVisit.AuditState},不能变更到 审核通过。"); + //$"项目配置影像质控为双审。当前审核状态为 {dbSubjectVisit.AuditState},不能变更到 审核通过。" + return ResponseOutput.NotOk(_localizer["QCOperation_CannotChangeToPass", dbSubjectVisit.AuditState]); } } } @@ -1571,7 +1617,8 @@ namespace IRaCIS.Core.Application.Image.QA if (trialConfig.QCProcessEnum == TrialQCProcess.NotAudit) { - return ResponseOutput.NotOk("项目配置影像质控为不审,不允许设置影像质控终止。"); + //---项目配置影像质控为不审,不允许设置影像质控终止。 + return ResponseOutput.NotOk(_localizer["QCOperation_NoQCNeededNotEnd"]); } else if (trialConfig.QCProcessEnum == TrialQCProcess.SingleAudit) { @@ -1584,7 +1631,8 @@ namespace IRaCIS.Core.Application.Image.QA } else { - return ResponseOutput.NotOk("项目配置影像质控为单审,当前审核状态不为 InPrimaryQC,不能变更到 审核终止"); + // 项目配置影像质控为单审,当前审核状态不为 InPrimaryQC,不能变更到 审核终止 + return ResponseOutput.NotOk(_localizer["QCOperation_CannotChangeToStop"]); } } else if (trialConfig.QCProcessEnum == TrialQCProcess.DoubleAudit) @@ -1602,7 +1650,8 @@ namespace IRaCIS.Core.Application.Image.QA } else { - return ResponseOutput.NotOk($"项目配置影像质控为双审,当前审核状态为 {dbSubjectVisit.AuditState},不能变更到 审核终止"); + //$"项目配置影像质控为双审,当前审核状态为 {dbSubjectVisit.AuditState},不能变更到 审核终止" + return ResponseOutput.NotOk(_localizer["QCOperation_CannotChangeStop", dbSubjectVisit.AuditState]); } @@ -1660,7 +1709,8 @@ namespace IRaCIS.Core.Application.Image.QA if (qcChallenge.ReuploadEnum != QCChanllengeReuploadEnum.QCAgreeUpload) { - throw new BusinessValidationFailedException("当前重传状态不为QC同意重传,不允许重传"); + //---当前重传状态不为QC同意重传,不允许重传 + throw new BusinessValidationFailedException(_localizer["QCOperation_InvalidResend"]); } return ResponseOutput.Ok(); } @@ -1684,7 +1734,8 @@ namespace IRaCIS.Core.Application.Image.QA if (trialConfig.QCProcessEnum == TrialQCProcess.NotAudit) { - return ResponseOutput.NotOk("不审操作,不会有需要重传的操作!"); + //---不审操作,不会有需要重传的操作! + return ResponseOutput.NotOk(_localizer["QCOperation_NoResendNeeded"]); } var qcChallenge = (await _qcChallengeRepository.FirstOrDefaultAsync(t => t.Id == qcChallengeId)).IfNullThrowException(); @@ -1696,13 +1747,15 @@ namespace IRaCIS.Core.Application.Image.QA if (qcChallenge.ReuploadEnum != QCChanllengeReuploadEnum.CRCRequestReupload) { - throw new BusinessValidationFailedException("当前重传状态不为CRC申请重传,不允许设置同意重传"); + //---当前重传状态不为CRC申请重传,不允许设置同意重传 + throw new BusinessValidationFailedException(_localizer["QCOperation_InvalidAgreeResend"]); } if (await _qcChallengeRepository.CountAsync(t => t.ReuploadEnum == QCChanllengeReuploadEnum.QCAgreeUpload && t.SubjectVisitId == qcChallenge.SubjectVisitId && t.IsClosed == false) >= 1) { - return ResponseOutput.NotOk("当前访视,有一个未关闭的质疑 QC设置了同意重传,CRC还未完成上传,当前不允许再次设置"); + //---当前访视,有一个未关闭的质疑 QC设置了同意重传,CRC还未完成上传,当前不允许再次设置 + return ResponseOutput.NotOk(_localizer["QCOperation_CannotAgreeResend"]); } @@ -1718,7 +1771,8 @@ namespace IRaCIS.Core.Application.Image.QA SubjectVisitId = qcChallenge.SubjectVisitId, UserTypeEnum = (UserTypeEnum)_userInfo.UserTypeEnumInt, QCChallengeId = qcChallenge.Id, - TalkContent = "QC同意重传" + //---QC同意重传 + TalkContent = _localizer["QCOperation_AgreeResend"] }); //双审 并且是2QC 那么需要回退到1QC 讲1QC数据清除 @@ -1779,7 +1833,8 @@ namespace IRaCIS.Core.Application.Image.QA if (qcChallenge.ReuploadEnum != QCChanllengeReuploadEnum.QCAgreeUpload) { - throw new BusinessValidationFailedException("当前重传状态不为QC同意重传,不允许设置重传完成"); + //---当前重传状态不为QC同意重传,不允许设置重传完成 + throw new BusinessValidationFailedException(_localizer["QCOperation_InvalidCompleteResend"]); } @@ -1788,7 +1843,8 @@ namespace IRaCIS.Core.Application.Image.QA if (await _subjectVisitRepository.Where(t => t.Id == subjectVisitId).SelectMany(t => t.StudyList).CountAsync() == 0 && await _subjectVisitRepository.Where(t => t.Id == subjectVisitId).SelectMany(t => t.NoneDicomStudyList).SelectMany(u => u.NoneDicomFileList).CountAsync() == 0) { - throw new BusinessValidationFailedException("当前没有影像,不允许设置重传完成"); + //---当前没有影像,不允许设置重传完成 + throw new BusinessValidationFailedException(_localizer["QCOperation_NoImageNotAllowed"]); } var trialConfig = await _trialRepository @@ -1822,7 +1878,8 @@ namespace IRaCIS.Core.Application.Image.QA QCChallengeId = qcChallenge.Id, - TalkContent = "CRC已重传完成" + //---CRC已重传完成 + TalkContent = _localizer["QCOperation_CRCTransferCompleted"] }); @@ -1854,7 +1911,8 @@ namespace IRaCIS.Core.Application.Image.QA if (qcChallenge.ReuploadEnum != QCChanllengeReuploadEnum.None && qcChallenge.ReuploadEnum != QCChanllengeReuploadEnum.CRCReuploaded) { - throw new BusinessValidationFailedException("当前质疑重传状态不为初始状态|CRC重传完成状态,不允许申请重传"); + //---当前质疑重传状态不为初始状态|CRC重传完成状态,不允许申请重传 + throw new BusinessValidationFailedException(_localizer["QCOperation_InvalidTransferStatus"]); } @@ -1872,7 +1930,8 @@ namespace IRaCIS.Core.Application.Image.QA SubjectVisitId = qcChallenge.SubjectVisitId, UserTypeEnum = (UserTypeEnum)_userInfo.UserTypeEnumInt, QCChallengeId = qcChallenge.Id, - TalkContent = "CRC申请重传/上传影像" + //---CRC申请重传/上传影像 + TalkContent = _localizer["QCOperation_CRCTransfer"] }); var isSuccess = await _qcChallengeRepository.SaveChangesAsync(); @@ -1902,13 +1961,15 @@ namespace IRaCIS.Core.Application.Image.QA if (await _subjectVisitRepository.Where(t => t.Id == command.SubjectVisitId) .AnyAsync(t => t.SubmitState == SubmitStateEnum.Submitted && t.IsEnrollmentConfirm != command.IsEnrollmentConfirm)) { - return ResponseOutput.NotOk("该访视已提交,不能修改入组确认状态"); + //---该访视已提交,不能修改入组确认状态 + return ResponseOutput.NotOk(_localizer["QCOperation_CannotModifyConfirmation"]); } if (await _subjectVisitRepository.Where(t => t.Id == command.SubjectVisitId) .AnyAsync(t => t.IsEnrollmentConfirm != command.IsEnrollmentConfirm && t.RequestBackState == RequestBackStateEnum.PM_AgressBack)) { - return ResponseOutput.NotOk("该访视为回退访视,不允许修改PD确认状态"); + //---该访视为回退访视,不允许修改PD确认状态 + return ResponseOutput.NotOk(_localizer["QCOperation_CannotModifyPDStatus"]); } dbSubjectVisit.IsEnrollmentConfirm = command.IsEnrollmentConfirm.Value; @@ -1994,7 +2055,8 @@ namespace IRaCIS.Core.Application.Image.QA await _subjectVisitRepository.BatchUpdateNoTrackingAsync(t => t.Id == subjectVisitId, u => new SubjectVisit() { ForwardState = ForwardStateEnum.ForwardFailed }); - return ResponseOutput.NotOk("转发影像失败。" + result.Failures.ToString() + result.ToJson()); + //---转发影像失败。 + return ResponseOutput.NotOk(_localizer["QCOperation_ForwardingFailed"] + result.Failures.ToString() + result.ToJson()); } } } @@ -2024,7 +2086,8 @@ namespace IRaCIS.Core.Application.Image.QA await _subjectVisitRepository.SaveChangesAsync(); - return isSuccess ? ResponseOutput.Ok() : ResponseOutput.NotOk("转发影像失败。"); + //---转发影像失败。 + return isSuccess ? ResponseOutput.Ok() : ResponseOutput.NotOk(_localizer["QCOperation_ForwardingFailed"]); } diff --git a/IRaCIS.Core.Application/Service/QC/QCQuestionService.cs b/IRaCIS.Core.Application/Service/QC/QCQuestionService.cs index 32c51fa35..53abdd826 100644 --- a/IRaCIS.Core.Application/Service/QC/QCQuestionService.cs +++ b/IRaCIS.Core.Application/Service/QC/QCQuestionService.cs @@ -1,4 +1,4 @@ -//-------------------------------------------------------------------- +//-------------------------------------------------------------------- // 此代码由T4模板自动生成 byzhouhang 20210918 // 生成时间 2021-11-11 11:04:54 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 @@ -107,7 +107,8 @@ namespace IRaCIS.Core.Application.Contracts if (await _qcQuestionRepository.AnyAsync(x => x.Id != addOrEditQCQuestionConfigure.Id && x.ShowOrder == addOrEditQCQuestionConfigure.ShowOrder)) { - throw new BusinessValidationFailedException("序号重复,操作失败"); + //---序号重复,操作失败 + throw new BusinessValidationFailedException(_localizer["QCQuestion_DuplicateIndexFailed"]); } @@ -121,7 +122,8 @@ namespace IRaCIS.Core.Application.Contracts { if (await _qcQuestionRepository.AnyAsync(x => x.ParentId == qCQuestionConfigureId)) { - throw new BusinessValidationFailedException("当前任务存在子问题,删除失败"); + //---当前任务存在子问题,删除失败 + throw new BusinessValidationFailedException(_localizer["QCQuestion_HasChildQuestion"]); } await _qcQuestionRepository.DeleteFromQueryAsync(t => t.Id == qCQuestionConfigureId,true); return ResponseOutput.Ok(); diff --git a/IRaCIS.Core.Application/Service/QC/TrialQCQuestionService.cs b/IRaCIS.Core.Application/Service/QC/TrialQCQuestionService.cs index 25d0f02aa..e66c4e18e 100644 --- a/IRaCIS.Core.Application/Service/QC/TrialQCQuestionService.cs +++ b/IRaCIS.Core.Application/Service/QC/TrialQCQuestionService.cs @@ -1,4 +1,4 @@ -//-------------------------------------------------------------------- +//-------------------------------------------------------------------- // 此代码由T4模板自动生成 byzhouhang 20210918 // 生成时间 2021-11-11 11:04:54 // 对此文件的更改可能会导致不正确的行为,并且如果重新生成代码,这些更改将会丢失。 @@ -124,7 +124,8 @@ namespace IRaCIS.Core.Application.Contracts { if (!await _repository.AnyAsync(t => t.Id == trialId && t.QCQuestionConfirmedUserId == null)) { - throw new BusinessValidationFailedException("影像质控审核问题模板已经确认,不允许操作。"); + //---影像质控审核问题模板已经确认,不允许操作。 + throw new BusinessValidationFailedException(_localizer["TrialQCQuestion_TemplateConfirmed"]); } } @@ -250,7 +251,8 @@ namespace IRaCIS.Core.Application.Contracts if (await _trialQcQuestionRepository.AnyAsync(x => x.TrialId == addOrEditTrialQCQuestionConfigure.TrialId && x.Id != addOrEditTrialQCQuestionConfigure.Id && x.ShowOrder == addOrEditTrialQCQuestionConfigure.ShowOrder)) { - throw new BusinessValidationFailedException("序号重复,操作失败"); + //---序号重复,操作失败 + throw new BusinessValidationFailedException(_localizer["TrialQCQuestion_DuplicateIndexFailed"]); } @@ -274,12 +276,14 @@ namespace IRaCIS.Core.Application.Contracts if (await _trialQcQuestionRepository.AnyAsync(t => t.ParentId == trialQCQuestionConfigureId)) { - return ResponseOutput.NotOk("请在删除父问题前,请先删除引用该父问题的子问题。"); + //---请在删除父问题前,请先删除引用该父问题的子问题。 + return ResponseOutput.NotOk(_localizer["TrialQCQuestion_DeleteChildFirst"]); } if (await _repository.AnyAsync(t => t.TrialQCQuestionConfigureId == trialQCQuestionConfigureId)) { - return ResponseOutput.NotOk("该审核问题已被影像质控过程引用,不允许删除。"); + //---该审核问题已被影像质控过程引用,不允许删除 + return ResponseOutput.NotOk(_localizer["TrialQCQuestion_ReferencedByQCProcess"]); } await _trialQcQuestionRepository.DeleteFromQueryAsync(t => t.Id == trialQCQuestionConfigureId, true); diff --git a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs index 2ab0fb67d..e791fd1d2 100644 --- a/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ReadingImageTask/ReadingImageTaskService.cs @@ -940,7 +940,7 @@ namespace IRaCIS.Application.Services List baseLineTableAnswer = new List(); - + List lastTaskTableAnswer = new List(); bool isFirstChangeTask = false; if (inDto.TaskId != null) @@ -956,10 +956,28 @@ namespace IRaCIS.Application.Services && x.TaskState == TaskState.Effect && x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId ).Select(x => x.Id).FirstNotNullAsync(); - baseLineTableAnswer = await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == baselineTaskId).Include(x => x.ReadingTableQuestionTrial).ToListAsync(); + var laskTaskId = await _visitTaskRepository.Where(x => + (x.SubjectId == taskInfo.SubjectId && x.TaskState == TaskState.Effect + && x.IsAnalysisCreate == taskInfo.IsAnalysisCreate + && x.DoctorUserId == taskInfo.DoctorUserId + && x.IsSelfAnalysis == taskInfo.IsSelfAnalysis + && x.VisitTaskNum < taskInfo.VisitTaskNum + && x.ArmEnum == taskInfo.ArmEnum + && x.TrialReadingCriterionId == taskInfo.TrialReadingCriterionId + && x.ReadingCategory == ReadingCategory.Visit)||x.Id==taskInfo.BeforeConvertedTaskId + ).OrderByDescending(x=>x.VisitTaskNum).Select(x => x.Id).FirstOrDefaultAsync(); + if (!criterionInfo.IsReadingTaskViewInOrder) + { + // 无序的话 不要查 + laskTaskId = Guid.NewGuid(); + } + + lastTaskTableAnswer= await _readingTableQuestionAnswerRepository.Where(x => x.VisitTaskId == laskTaskId).Include(x => x.ReadingTableQuestionTrial).ToListAsync(); + + if (taskInfo.IsConvertedTask && !(await _visitTaskRepository.AnyAsync(x => x.IsAnalysisCreate == taskInfo.IsAnalysisCreate && x.IsSelfAnalysis == taskInfo.IsSelfAnalysis @@ -995,7 +1013,7 @@ namespace IRaCIS.Application.Services var pageGroupList = newPageQusetionList.Where(x => x.Type == ReadingQestionType.Group).ToList(); pageGroupList.ForEach(x => { - this.FindChildQuestion(x, newPageQusetionList, tableQuestionList, inDto.TableAnswers, inDto.TableAnsweRowInfos, inDto.OrganInfos, baseLineTableAnswer, isFirstChangeTask); + this.FindChildQuestion(x, newPageQusetionList, tableQuestionList, inDto.TableAnswers, inDto.TableAnsweRowInfos, inDto.OrganInfos, baseLineTableAnswer, isFirstChangeTask, lastTaskTableAnswer); }); page.Childrens = pageGroupList.Where(x => !(x.Type == ReadingQestionType.Group && x.Childrens.Count() == 0)).ToList(); @@ -1012,7 +1030,7 @@ namespace IRaCIS.Application.Services groupList = qusetionList.Where(x => x.Type == ReadingQestionType.Group).ToList(); groupList.ForEach(x => { - this.FindChildQuestion(x, qusetionList, tableQuestionList, inDto.TableAnswers, inDto.TableAnsweRowInfos, inDto.OrganInfos, baseLineTableAnswer, isFirstChangeTask); + this.FindChildQuestion(x, qusetionList, tableQuestionList, inDto.TableAnswers, inDto.TableAnsweRowInfos, inDto.OrganInfos, baseLineTableAnswer, isFirstChangeTask, lastTaskTableAnswer); }); groupList = groupList.Where(x => !(x.Type == ReadingQestionType.Group && x.Childrens.Count() == 0)).ToList(); @@ -1032,7 +1050,7 @@ namespace IRaCIS.Application.Services /// /// /// - private async void FindChildQuestion(TrialReadQuestionData item, List questionlists, List tableQuestionLists, List tableAnswers, List tableAnsweRowInfos, List organInfos, List baseLineTableAnswer,bool isFirstChangeTask) + private async void FindChildQuestion(TrialReadQuestionData item, List questionlists, List tableQuestionLists, List tableAnswers, List tableAnsweRowInfos, List organInfos, List baseLineTableAnswer,bool isFirstChangeTask, List lastTaskTableAnswer) { item.Childrens = questionlists.Where(x => x.ParentId == item.Id || x.GroupId == item.Id).ToList(); item.TableQuestions = new TrialReadTableQuestion(); @@ -1169,6 +1187,7 @@ namespace IRaCIS.Application.Services answers.Add("IsCurrentTaskAdd", rowInfo == null ? false.ToString() : rowInfo.IsCurrentTaskAdd.ToString()); answers.Add("SplitOrMergeLesionName", rowInfo.SplitName.IsNullOrEmpty() ? rowInfo.MergeName : rowInfo.SplitName); answers.Add("SplitOrMergeType", rowInfo.SplitOrMergeType == null ? string.Empty : ((int)rowInfo.SplitOrMergeType).ToString()); + answers.Add("LastTaskState", lastTaskTableAnswer.Where(n=>n.QuestionId== item.Id&&n.ReadingTableQuestionTrial.QuestionMark==QuestionMark.State&&n.RowIndex==x).Select(n=>n.Answer).FirstOrDefault()??string.Empty); if (rowInfo.LesionType == LesionType.BaselineLesions) { answers.Add("BaseLineLesionNumber", baseLineTableAnswer.Where(n => n.ReadingTableQuestionTrial.QuestionMark == QuestionMark.LesionNumber && n.RowIndex == rowInfo.RowIndex).Select(x => x.Answer).FirstIsNullReturnEmpty()); @@ -1182,7 +1201,7 @@ namespace IRaCIS.Application.Services { item.Childrens.ForEach(x => { - this.FindChildQuestion(x, questionlists, tableQuestionLists, tableAnswers, tableAnsweRowInfos, organInfos, baseLineTableAnswer, isFirstChangeTask); + this.FindChildQuestion(x, questionlists, tableQuestionLists, tableAnswers, tableAnsweRowInfos, organInfos, baseLineTableAnswer, isFirstChangeTask, lastTaskTableAnswer); }); } } diff --git a/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs b/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs index 8cf435bfd..2828e69ec 100644 --- a/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs +++ b/IRaCIS.Core.Application/Service/ReadingCalculate/IRECIST1Point1CalculateService.cs @@ -784,6 +784,15 @@ namespace IRaCIS.Core.Application.Service.ReadingCalculate QuestionMark.State, }; + if (taskinfo.IsConvertedTask) + { + notNeedCopyMarks = new List() + { + QuestionMark.MajorAxis, + QuestionMark.ShortAxis, + }; + } + var tableAnswers = copyTableAnswers.Select(x => new ReadingTableQuestionAnswer { Id = NewId.NextGuid(), diff --git a/后端提示语.xlsx b/后端提示语.xlsx index 9ab2e17c8..1d9b077f2 100644 Binary files a/后端提示语.xlsx and b/后端提示语.xlsx differ