Uat_Study
hang 2023-04-28 09:23:22 +08:00
commit 8c267ec6f4
12 changed files with 157 additions and 82 deletions

View File

@ -11,7 +11,7 @@ namespace IRaCIS.Core.Application.Filter;
public class LimitUserRequestAuthorization : IAsyncAuthorizationFilter
public class LimitUserRequestAuthorization :BaseService, IAsyncAuthorizationFilter
{
@ -50,7 +50,8 @@ public class LimitUserRequestAuthorization : IAsyncAuthorizationFilter
{
context.HttpContext.Response.ContentType = "application/json";
context.HttpContext.Response.StatusCode = StatusCodes.Status200OK;
await context.HttpContext.Response.WriteAsync(JsonConvert.SerializeObject(ResponseOutput.NotOk("当前请求未从Header/Url取到用户Token,请联系开发者")));
//---当前请求未从Header/Url取到用户Token,请联系开发者
await context.HttpContext.Response.WriteAsync(JsonConvert.SerializeObject(ResponseOutput.NotOk(_localizer["LimitUser_AuthTokenMissing"])));
}
//2、在这里取缓存 进行比较 看是否有其他人进行了登陆,如果其他人登陆了,就把之前用户挤掉
@ -76,7 +77,8 @@ public class LimitUserRequestAuthorization : IAsyncAuthorizationFilter
context.HttpContext.Response.ContentType = "application/json";
context.HttpContext.Response.StatusCode = StatusCodes.Status403Forbidden;
await context.HttpContext.Response.WriteAsync(JsonConvert.SerializeObject(ResponseOutput.NotOk("您的账户在其他地方已登陆,您被迫下线。", ApiResponseCodeEnum.LoginInOtherPlace)));
//---您的账户在其他地方已登陆,您被迫下线。
await context.HttpContext.Response.WriteAsync(JsonConvert.SerializeObject(ResponseOutput.NotOk(_localizer["LimitUser_AccountLoggedInElsewhere"], ApiResponseCodeEnum.LoginInOtherPlace)));
}

View File

@ -1,15 +1,18 @@
using IRaCIS.Core.Infrastructure.Extention;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.Extensions.Localization;
using Newtonsoft.Json;
namespace IRaCIS.Core.Application.Filter
{
public class ModelActionFilter : ActionFilterAttribute, IActionFilter
{
public override void OnActionExecuting(ActionExecutingContext context)
{
public override void OnActionExecuting(ActionExecutingContext context)
{
if (!context.ModelState.IsValid)
{
@ -19,7 +22,8 @@ namespace IRaCIS.Core.Application.Filter
.Select(e => e.ErrorMessage)
.ToArray();
context.Result = new JsonResult(ResponseOutput.NotOk("提供给接口的参数无效。" +JsonConvert.SerializeObject( validationErrors)));
//---提供给接口的参数无效。
context.Result = new JsonResult(ResponseOutput.NotOk("Invalid parameters provided for the API." + JsonConvert.SerializeObject( validationErrors)));
}
}
}

View File

@ -22,7 +22,8 @@ namespace IRaCIS.Core.Application.Filter
{
if (context.Exception.GetType().Name == "DbUpdateConcurrencyException")
{
context.Result = new JsonResult(ResponseOutput.NotOk("并发更新,当前不允许该操作" + context.Exception.Message));
//---并发更新,当前不允许该操作
context.Result = new JsonResult(ResponseOutput.NotOk("Concurrent update, operation not allowed at this time." + context.Exception.Message));
}
if (context.Exception.GetType() == typeof(BusinessValidationFailedException))
@ -35,7 +36,7 @@ namespace IRaCIS.Core.Application.Filter
}
else
{
context.Result = new JsonResult(ResponseOutput.NotOk(" 程序异常,请联系开发人员。 " + (context.Exception.InnerException is null ? (context.Exception.Message /*+ context.Exception.StackTrace*/)
context.Result = new JsonResult(ResponseOutput.NotOk("程序异常,请联系开发人员。" + (context.Exception.InnerException is null ? (context.Exception.Message /*+ context.Exception.StackTrace*/)
: (context.Exception.InnerException?.Message /*+ context.Exception.InnerException?.StackTrace*/)), ApiResponseCodeEnum.ProgramException));
}

View File

@ -3,6 +3,7 @@ using IRaCIS.Core.Domain.Share;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;
using Microsoft.Extensions.Localization;
using System.Text.RegularExpressions;
using static IRaCIS.Core.Domain.Share.StaticData;
@ -16,17 +17,18 @@ namespace IRaCIS.Core.Application.Filter
private readonly IEasyCachingProvider _provider;
private readonly IUserInfo _userInfo;
private readonly List<string> _trialOptList=new List<string>();
public IStringLocalizer _localizer;
private readonly List<string> _trialOptList=new List<string>();
public TrialResourceFilter(IEasyCachingProvider provider, IUserInfo userInfo, string trialOpt = null, string trialOpt2 = null, string trialOpt3 = null)
public TrialResourceFilter(IEasyCachingProvider provider, IStringLocalizer localizer , IUserInfo userInfo, string trialOpt = null, string trialOpt2 = null, string trialOpt3 = null)
{
_provider = provider;
_userInfo = userInfo;
//_trialOpt = trialOpt;
_localizer = localizer;
//_trialOpt = trialOpt;
if (!string.IsNullOrWhiteSpace(trialOpt)) _trialOptList.Add(trialOpt.Trim());
if (!string.IsNullOrWhiteSpace(trialOpt)) _trialOptList.Add(trialOpt.Trim());
if (!string.IsNullOrWhiteSpace(trialOpt2)) _trialOptList.Add(trialOpt2.Trim());
if (!string.IsNullOrWhiteSpace(trialOpt3)) _trialOptList.Add(trialOpt3.Trim());
@ -56,7 +58,8 @@ namespace IRaCIS.Core.Application.Filter
// 后期列举出具体的类型,其他任何用户类型,都不允许操作
if (_userInfo.UserTypeEnumInt == (int)UserTypeEnum.CRA)
{
context.Result = new JsonResult(ResponseOutput.NotOk("对不起,您的账户没有操作权限。"));
//---对不起,您的账户没有操作权限。
context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["TrialResource_NoAccessPermission"]));
return;
}
@ -94,7 +97,8 @@ namespace IRaCIS.Core.Application.Filter
}
else
{
context.Result = new JsonResult(ResponseOutput.NotOk("正则取请求Refer 中trialId 失败,请联系开发人员核查"));
//---正则取请求Refer 中trialId 失败,请联系开发人员核查
context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["TrialResource_ReferTrialIdFailed"]));
}
}
@ -137,7 +141,8 @@ namespace IRaCIS.Core.Application.Filter
}
else
{
context.Result = new JsonResult(ResponseOutput.NotOk("正则取请求Refer 中trialId 失败,请联系开发人员核查"));
//---正则取请求Refer 中trialId 失败,请联系开发人员核查
context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["TrialResource_ReferTrialIdFailed"]));
}
//使用字符串取 如果是swagger 可能有时取的不对 因为空格的原因
@ -184,7 +189,8 @@ namespace IRaCIS.Core.Application.Filter
// 项目停止、或者完成 不允许操作
else
{
context.Result = new JsonResult(ResponseOutput.NotOk("本次请求被配置规则拦截:项目状态处于进行中时,才允许操作,若此处逻辑有误,请联系开发人员修改"));
//---本次请求被配置规则拦截:项目状态处于进行中时,才允许操作,若此处逻辑有误,请联系开发人员修改
context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["TrialResource_InterceptedProjectStatusRule"]));
}
@ -199,10 +205,11 @@ namespace IRaCIS.Core.Application.Filter
{
//如果项目相关接口没有传递trialId 会来到这里,提醒,以便修改
context.Result = new JsonResult(ResponseOutput.NotOk("该接口参数中,没有传递项目编号,请核对。"));
//---该接口参数中,没有传递项目编号,请核对。
context.Result = new JsonResult(ResponseOutput.NotOk(_localizer["TrialResource_MissingProjectNumber"]));
}
}
}
}
}

View File

@ -74,7 +74,7 @@ namespace IRaCIS.Application.Services.BusinessFilter
else if(statusCode != 200&&!(objectResult.Value is IResponseOutput))
{
var apiResponse = ResponseOutput.NotOk("程序错误,请联系开发人员。");
var apiResponse = ResponseOutput.NotOk("Program error, please contact developer.");
objectResult.Value = apiResponse;
objectResult.DeclaredType = apiResponse.GetType();

View File

@ -3,7 +3,6 @@
"RequiredAttribute": "{0} is required",
//-------------------------------------------------------------------------------------Reading-----------------------------------------------------------------
//ReadingGlobalTaskService
"ReadingGlobal_NotGlobal": "System call error. The current read is not a global review read.",
//ReadingImageTaskService
@ -46,6 +45,15 @@
"MedicalReview_NeedSave": "Unable to perform the current operation. Please save the medical review questions and conclusions first.",
"MedicalReview_NotClosed": "Unable to perform the current operation. The current medical inquiry conversation has not been closed.",
"MedicalReview_Finish": "The current medical review is the last one.",
//ReadingMedicineQuestionService
"ReadingMed_QNumDup": "Current problem number has duplicates",
"ReadingMed_HasSubQ": "This problem has sub-problems, please delete them first",
"ReadingMed_NoMedQ": "Medical review question has not been added yet. Please add it first before confirming",
"ReadingMed_MedQNumDup": "The display number of the medical imaging review question cannot be duplicated",
"ReadingMed_ParentNumSmall": "The display number of the parent problem should be smaller than that of the child problem, please confirm",
"ReadingMed_GlobalQNotConfig": "The global reading is enabled in the current standard, but the global medical review question has not been configured",
"ReadingMed_ArbitrateQNotConfig": "Arbitration reading is enabled in the current standard, but the arbitration medical review question has not been configured",
"ReadingMed_TumorQNotConfig": "Oncology reading is enabled in the current standard, but the oncology medical review question has not been configured",
//UserService
"User_CheckNameOrPw": "Please check the username or password.",
//Repository
@ -76,7 +84,6 @@
"ReadModule_TumorExists": "The current visit has a tumor review, please delete the tumor review first.",
"ReadModule_TaskGenerated": "The current review has generated tasks, operation failed.",
// ------------------------------------------------------------Allocation--------------------------------------------------------------------
//TaskAllocationRuleService
"TaskAllocation_DoctorIdNotFound": "Error, the doctor is account Id was not found in the enrollment table.",
@ -132,10 +139,6 @@
"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.",
@ -164,7 +167,6 @@
"Mail_AccountPasswordResetReminder": "[from Film IRC] A reminder about resetting account passwords",
"Mail_InvitationEmail": "[from Extensive Imaging IRC][{0}]Invitation",
// ------------------------------------------------------------Doctor--------------------------------------------------------------------
//DoctorService
"Doctor_DupPhoneOrEmail": "current phone or email number already existed",
@ -173,8 +175,6 @@
"Doctor_StandardDuplicateFileTypeError": "This type of file has already been added to the current criterion.",
"Doctor_RequiredDocumentsError": "Resume & Consultant Agreement must be upload ",
// ------------------------------------------------------------Document--------------------------------------------------------------------
//SystemDocumentService
"SystemD_DuplicateFile": "A file of the same type and name already exists in the system.",
@ -220,7 +220,6 @@
"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.",
@ -234,7 +233,6 @@
//TrialRevenuesPriceService
"TRP_AddMeaningful": "Please add meaningful data",
// ------------------------------------------------------------ImageAndDoc--------------------------------------------------------------------
//DicomArchiveService
"DAS_NoAnonCacheData": "The cache data for anonymous config is not obtained, and the upload stops. Please contact the developer for verification.",
@ -250,8 +248,6 @@
"Study_VisitEndedNotAllowed": "Subject visit is over, and uploading is not allowed!",
"Study_ImgAlreadyUploaded": "Uploading is not allowed above here.The current image check has been uploaded to {1} of subject {0}",
// ------------------------------------------------------------Inspection--------------------------------------------------------------------
//FrontAuditConfigService
"FrontAudit_IdDup": "The identifier is duplicated.",
@ -260,7 +256,6 @@
//InspectionService
"Inspection_UserDisabled": "The current user has been disabled.",
// ------------------------------------------------------------Institution--------------------------------------------------------------------
//CROService
"CRO_DupName": "CRO with the same name already exists.Please confirm",
@ -276,9 +271,6 @@
"Sponsor_DupName": "Sponsor with the same name already exists.Please confirm.",
"Sponsor_InProject": "The sponsor has been added to the project and it is not allowed to delete.",
// ------------------------------------------------------------Management--------------------------------------------------------------------
//MenuService
"Menu_ParentDupChild": "A child node with the same name already exists under the parent node.",
@ -300,8 +292,6 @@
//UserTypeService
"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.",
@ -330,9 +320,7 @@
"QCOperation_UnresolvedQCQuery": "This operation is not allowed, because the inquiry of the current visitis is not closed. ",
"QCOperation_CrcNoDelete": "The CRC has been committed and cannot be deleted.",
"QCOperation_NoRecipient": "You are not the current recipient of the quality control task, no operation authority!",
"QCOperation_QCImageTaskAlreadyReleased": "The image quality control task of the current visit has been released by the original recipient. You can get it by ",
"pick",
"up\".\"",
"QCOperation_QCImageTaskAlreadyReleased": "The image quality control task of the current visit has been released by the original recipient. You can get it by 'pick up'.",
"QCOperation_QCTaskNoAccess": "The image quality control task of the current visit has been claimed by other QC, so it is not allowed to pick up.",
"QCOperation_QCConfigFirst": "Please configure the image quality control review question before receiving the image quality control task.",
"QCOperation_NoQC": "The project configuration of image QC process was not check, and the QC Task was not picked up.",
@ -381,7 +369,6 @@
"TrialQCQuestion_DeleteChildFirst": "Before deleting the parent question, delete the child question that references the parent question.",
"TrialQCQuestion_ReferencedByQCProcess": "This review question has been cited by the image quality control process and is not allowed to be deleted.",
// ------------------------------------------------------------QC--------------------------------------------------------------------
// ------------------------------------------------------------SiteSurvey--------------------------------------------------------------------
@ -412,7 +399,6 @@
"TrialSiteUser_NoTestUserForFormal": "It is Formal and training projects that are not allowed to add test users.",
"TrialSiteUser_NoFormalUserForTest": "It is the test project that regular users are not allowed in.",
// ------------------------------------------------------------Stat--------------------------------------------------------------------
// ------------------------------------------------------------TrialSiteUser--------------------------------------------------------------------
@ -466,8 +452,6 @@
"TrialSite_CannotDeleteAssociatedSubject": "The subjects has been added to this site, and couldn't be deleted.",
"TrialSite_CannotDeleteUploadedData": "The site has been uploaded study, and couldn't be deleted.",
// ------------------------------------------------------------Visit--------------------------------------------------------------------
//SubjectService
"Subject_NoConfirmedPlan": "The visit plan of the project is not confirmed. Please contact the program Manager to confirm the visit plan before adding subjects.",
@ -498,7 +482,6 @@
"VisitPlan_CheckExport": "Check and export _{0}.xlsx",
"VisitPlan_Assigned": "The visit plan has been assigned to the subjects and executed.",
// ------------------------------------------------------------WorkLoad--------------------------------------------------------------------
//DoctorWorkloadService
"DoctorWorkload_AssignType": "A task has been assigned and does not allow you to reduce the reading type.",
@ -509,7 +492,6 @@
"Enroll_EmailFormat": "The {0} mailbox format is faulty.",
"Enroll_CannotRollback": "Reviewers with workload cannot go back",
// ------------------------------------------------------------Triggers--------------------------------------------------------------------
//AddlTrialUserTrigger
"AddlTrialUser_NoTestUser": "It is Formal and training projects that are not allowed to add test users.",
@ -518,5 +500,23 @@
"SubjectState_CannotSetCurrentAsLastVisit": "The subject has already had a visit set as the last visit, and the current visit is not allowed to be set as the last visit.",
"SubjectState_CannotSetAsLastVisitWithImage": "The image of the subject's visit after the current visit has been uploaded, and the current visit is not allowed to be set as the last visit.",
//SubjectVisitFinalVisitTrigger
"SubjectVisit_CannotSetAsLastVisit": "The subject's follow-up visits has uploaded images or submitted , and the current visit is not allowed to be set as the last visit."
"SubjectVisit_CannotSetAsLastVisit": "The subject's follow-up visits has uploaded images or submitted , and the current visit is not allowed to be set as the last visit.",
// ------------------------------------------------------------Helper--------------------------------------------------------------------
//LimitUserRequestAuthorization
"LimitUser_AuthTokenMissing": "User token was not retrieved from Header/URL, please contact developer",
"LimitUser_AccountLoggedInElsewhere": "User token was not retrieved from Header/URL, please contact developer",
//ModelActionFilter
"ModelAction_InvalidAPIParameter": "Invalid parameters provided for the API.",
//ProjectExceptionFilter
"ProjectException_ConcurrentUpdateNotAllowed": "Concurrent update, operation not allowed at this time.",
"Project_ExceptionContactDeveloper": "Program exception, please contact developer.",
//TrialResourceFilter
"TrialResource_NoAccessPermission": "Sorry, your account does not have operation permissions.",
"TrialResource_ReferTrialIdFailed": "Regular expression failed to fetch trialId from request Refer, please contact developer to check",
"TrialResource_InterceptedProjectStatusRule": "This request was blocked by configured rules: only operations allowed when project status is in progress, please contact developer if this logic is incorrect and needs to be modified",
"TrialResource_MissingProjectNumber": "Project number not passed in the API parameters, please verify.",
//UnifiedApiResultFilter
"UnifiedAPI_ProgramError": "Program error, please contact developer."
}

View File

@ -45,6 +45,15 @@
"MedicalReview_NeedSave": "无法执行当前操作,请先保存医学审核问题和结论。",
"MedicalReview_NotClosed": "无法执行当前操作,当前医学质询对话未关闭。",
"MedicalReview_Finish": "当前医学审核任务为最后一个任务。",
//ReadingMedicineQuestionService
"ReadingMed_QNumDup": "当前问题序号存在重复",
"ReadingMed_HasSubQ": "此问题存在子问题,请先删除子问题",
"ReadingMed_NoMedQ": "当前未添加医学审核问题。请先添加医学审核问题,再进行确认。",
"ReadingMed_MedQNumDup": "影像医学审核问题显示序号不能重复。",
"ReadingMed_ParentNumSmall": "父问题的显示序号要比子问题的显示序号小,请确认。",
"ReadingMed_GlobalQNotConfig": "当前标准启用了全局阅片,但未配置全局医学审核问题",
"ReadingMed_ArbitrateQNotConfig": "当前标准启用了仲裁阅片,但未配置仲裁医学审核问题",
"ReadingMed_TumorQNotConfig": "当前标准启用了肿瘤学阅片,但未配置肿瘤学医学审核问题",
//UserService
"User_CheckNameOrPw": "请检查用户名或者密码。",
//Repository
@ -75,7 +84,6 @@
"ReadModule_TumorExists": "当前访视存在肿瘤学阅片,请先删除肿瘤学阅片",
"ReadModule_TaskGenerated": "当前阅片已生成任务,操作失败。",
// ------------------------------------------------------------Allocation--------------------------------------------------------------------
//TaskAllocationRuleService
"TaskAllocation_DoctorIdNotFound": "错误未在入组表中找到该医生的账号Id",
@ -131,7 +139,6 @@
"VisitTask_NoConsistencyReturn": "不允许退回一致性分析任务",
"VisitTask_VisitTypeTaskAllowedForPMOnly": "仅仅访视类型的任务支持PM退回",
// ------------------------------------------------------------Common--------------------------------------------------------------------
//CommonDocumentService
"Document_CodeDuplication": "文档的Code不能够重复。",
@ -159,14 +166,15 @@
"Mail_AccountCreationReminder": "[来自展影IRC] 关于创建账户的提醒",
"Mail_AccountPasswordResetReminder": "[来自展影IRC] 关于重置账户密码的提醒",
"Mail_InvitationEmail": "[来自展影IRC] [{0}]邀请信",
// ------------------------------------------------------------Doctor--------------------------------------------------------------------
//DoctorService
"Doctor_DupPhoneOrEmail": "当前的电话或电子邮件号码已经存在",
"Doctor_DupPhone": "当前的电话号码已经存在!",
"Doctor_DupEmail": "当前的邮箱已经存在!",
"Doctor_StandardDuplicateFileTypeError": "当前标准已添加过此类型文件",
"Doctor_RequiredDocumentsError": "简历及顾问协议必须上传",
// ------------------------------------------------------------Document--------------------------------------------------------------------
//SystemDocumentService
"SystemD_DuplicateFile": "系统中已存在同类型的同名文件。",
@ -225,7 +233,6 @@
//TrialRevenuesPriceService
"TRP_AddMeaningful": "请添加有意义的数据",
// ------------------------------------------------------------ImageAndDoc--------------------------------------------------------------------
//DicomArchiveService
"DAS_NoAnonCacheData": "未取到缓存匿名化配置数据,上传停止,请联系开发人员核实",
@ -285,7 +292,6 @@
//UserTypeService
"UserType_InUse": "该用户类型中已存在用户,不能删除。",
// ------------------------------------------------------------QC--------------------------------------------------------------------
//QCCommon
"QCCommon_CannotOperate": "CRC 已提交影像,不能进行操作。",
@ -446,7 +452,6 @@
"TrialSite_CannotDeleteAssociatedSubject": "受试者已经添加,不能删除",
"TrialSite_CannotDeleteUploadedData": "中心已经上传调研,无法删除",
// ------------------------------------------------------------Visit--------------------------------------------------------------------
//SubjectService
"Subject_NoConfirmedPlan": "项目访视计划没有确认。请联系项目经理确认项目访视计划后,再添加受试者。",
@ -495,6 +500,23 @@
"SubjectState_CannotSetCurrentAsLastVisit": "该受试者已经有访视被设置为末次访视,不允许将当前访视设置为末次访视。",
"SubjectState_CannotSetAsLastVisitWithImage": "该受试者当前访视后有访视的影像已上传,当前访视不允许设置为末次访视。",
//SubjectVisitFinalVisitTrigger
"SubjectVisit_CannotSetAsLastVisit": "该受试者已有后续访视已上传影像或已提交,当前访视不允许设置为末次访视。"
"SubjectVisit_CannotSetAsLastVisit": "该受试者已有后续访视已上传影像或已提交,当前访视不允许设置为末次访视。",
// ------------------------------------------------------------Helper--------------------------------------------------------------------
//LimitUserRequestAuthorization
"LimitUser_AuthTokenMissing": "当前请求未从Header/Url取到用户Token,请联系开发者",
"LimitUser_AccountLoggedInElsewhere": "您的账户在其他地方已登陆,您被迫下线。",
//ModelActionFilter
"ModelAction_InvalidAPIParameter": "提供给接口的参数无效。",
//ProjectExceptionFilter
"ProjectException_ConcurrentUpdateNotAllowed": "并发更新,当前不允许该操作",
"Project_ExceptionContactDeveloper": "程序异常,请联系开发人员。 ",
//TrialResourceFilter
"TrialResource_NoAccessPermission": "对不起,您的账户没有操作权限。",
"TrialResource_ReferTrialIdFailed": "正则取请求Refer 中trialId 失败,请联系开发人员核查",
"TrialResource_InterceptedProjectStatusRule": "本次请求被配置规则拦截:项目状态处于进行中时,才允许操作,若此处逻辑有误,请联系开发人员修改",
"TrialResource_MissingProjectNumber": "该接口参数中,没有传递项目编号,请核对。",
//UnifiedApiResultFilter
"UnifiedAPI_ProgramError": "程序错误,请联系开发人员。"
}

View File

@ -1,4 +1,4 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc;
using IRaCIS.Core.Application.ViewModel;
using IRaCIS.Core.Infra.EFCore.Common;
using MassTransit;
@ -107,7 +107,8 @@ namespace IRaCIS.Core.Application.Service
if (await existsQuery.AnyAsync())
{
return ResponseOutput.NotOk("当前问题序号存在重复");
//---当前问题序号存在重复
return ResponseOutput.NotOk(_localizer["ReadingMed_QNumDup"]);
}
//inDto.CriterionEnumStr = $"|{String.Join('|', inDto.CriterionEnumList)}|";
@ -127,7 +128,8 @@ namespace IRaCIS.Core.Application.Service
{
if (await _readingMedicineSystemQuestionRepository.AnyAsync(x => x.ParentId == id))
{
return ResponseOutput.NotOk("此问题存在子问题,请先删除子问题");
//---此问题存在子问题,请先删除子问题
return ResponseOutput.NotOk(_localizer["ReadingMed_HasSubQ"]);
}
var success = await _readingMedicineSystemQuestionRepository.DeleteFromQueryAsync(t => t.Id == id);
var result = await _readingMedicineSystemQuestionRepository.SaveChangesAsync();
@ -234,7 +236,8 @@ namespace IRaCIS.Core.Application.Service
if (await existsQuery.AnyAsync())
{
return ResponseOutput.NotOk("当前问题序号存在重复");
//---当前问题序号存在重复
return ResponseOutput.NotOk(_localizer["ReadingMed_QNumDup"]);
}
var entity = await _readingMedicineTrialQuestionRepository.InsertOrUpdateAsync(inDto);
await _readingMedicineTrialQuestionRepository.SaveChangesAsync();
@ -253,7 +256,8 @@ namespace IRaCIS.Core.Application.Service
{
if (await _readingMedicineTrialQuestionRepository.AnyAsync(x => x.ParentId == inDto.Id))
{
return ResponseOutput.NotOk("此问题存在子问题,请先删除子问题");
//---此问题存在子问题,请先删除子问题
return ResponseOutput.NotOk(_localizer["ReadingMed_HasSubQ"]);
}
var success = await _readingMedicineTrialQuestionRepository.DeleteFromQueryAsync(t => t.Id == inDto.Id);
var result = await _readingMedicineTrialQuestionRepository.SaveChangesAsync();
@ -289,18 +293,21 @@ namespace IRaCIS.Core.Application.Service
}).ToListAsync();
if (readingMedicineQuestionList.Count == 0)
{
throw new BusinessValidationFailedException("当前未添加医学审核问题。请先添加医学审核问题,再进行确认。");
//---当前未添加医学审核问题。请先添加医学审核问题,再进行确认。
throw new BusinessValidationFailedException(_localizer["ReadingMed_NoMedQ"]);
}
if (readingMedicineQuestionList.Count() != readingMedicineQuestionList.Select(t => t.ShowOrder).Distinct().Count())
{
throw new BusinessValidationFailedException("影像医学审核问题显示序号不能重复。");
//---影像医学审核问题显示序号不能重复。
throw new BusinessValidationFailedException(_localizer["ReadingMed_MedQNumDup"]);
}
if (readingMedicineQuestionList.Where(t => t.ParentShowOrder != null).Any(t => t.ParentShowOrder > t.ShowOrder))
{
throw new BusinessValidationFailedException("父问题的显示序号要比子问题的显示序号小,请确认。");
//---父问题的显示序号要比子问题的显示序号小,请确认。
throw new BusinessValidationFailedException(_localizer["ReadingMed_ParentNumSmall"]);
}
var criterionInfo = await _readingQuestionCriterionTrialRepository.Where(x => x.Id == inDto.TrialReadingCriterionId).Select(x => new
@ -316,17 +323,20 @@ namespace IRaCIS.Core.Application.Service
if (criterionInfo.IsGlobalReading && !readingMedicineQuestionList.Any(x => x.ReadingCategory == ReadingCategory.Global))
{
throw new BusinessValidationFailedException("当前标准启用了全局阅片,但未配置全局医学审核问题");
//---当前标准启用了全局阅片,但未配置全局医学审核问题
throw new BusinessValidationFailedException(_localizer["ReadingMed_GlobalQNotConfig"]);
}
if (criterionInfo.IsArbitrationReading && !readingMedicineQuestionList.Any(x => x.ReadingCategory == ReadingCategory.Judge))
{
throw new BusinessValidationFailedException("当前标准启用了仲裁阅片,但未配置仲裁医学审核问题");
//---当前标准启用了仲裁阅片,但未配置仲裁医学审核问题
throw new BusinessValidationFailedException(_localizer["ReadingMed_ArbitrateQNotConfig"]);
}
if (criterionInfo.IsOncologyReading && !readingMedicineQuestionList.Any(x => x.ReadingCategory == ReadingCategory.Oncology))
{
throw new BusinessValidationFailedException("当前标准启用了肿瘤学阅片,但未配置肿瘤学医学审核问题");
//---当前标准启用了肿瘤学阅片,但未配置肿瘤学医学审核问题
throw new BusinessValidationFailedException(_localizer["ReadingMed_TumorQNotConfig"]);
}
return ResponseOutput.Ok();
@ -356,18 +366,21 @@ namespace IRaCIS.Core.Application.Service
}).ToListAsync();
if (readingMedicineQuestionList.Count == 0)
{
throw new BusinessValidationFailedException("当前未添加医学审核问题。请先添加医学审核问题,再进行确认。");
//---当前未添加医学审核问题。请先添加医学审核问题,再进行确认。
throw new BusinessValidationFailedException(_localizer["ReadingMed_NoMedQ"]);
}
if (readingMedicineQuestionList.Count() != readingMedicineQuestionList.Select(t => t.ShowOrder).Distinct().Count())
{
throw new BusinessValidationFailedException("影像医学审核问题显示序号不能重复。");
//---影像医学审核问题显示序号不能重复。
throw new BusinessValidationFailedException(_localizer["ReadingMed_MedQNumDup"]);
}
if (readingMedicineQuestionList.Where(t => t.ParentShowOrder != null).Any(t => t.ParentShowOrder > t.ShowOrder))
{
throw new BusinessValidationFailedException("父问题的显示序号要比子问题的显示序号小,请确认。");
//---父问题的显示序号要比子问题的显示序号小,请确认。
throw new BusinessValidationFailedException(_localizer["ReadingMed_ParentNumSmall"]);
}
@ -375,17 +388,20 @@ namespace IRaCIS.Core.Application.Service
if (criterionInfo.IsGlobalReading && !readingMedicineQuestionList.Any(x => x.ReadingCategory == ReadingCategory.Global))
{
throw new BusinessValidationFailedException("当前项目启用了全局阅片,但未配置全局医学审核问题");
//---当前标准启用了全局阅片,但未配置全局医学审核问题
throw new BusinessValidationFailedException(_localizer["ReadingMed_GlobalQNotConfig"]);
}
if (criterionInfo.IsArbitrationReading && !readingMedicineQuestionList.Any(x => x.ReadingCategory == ReadingCategory.Judge))
{
throw new BusinessValidationFailedException("当前项目启用了仲裁阅片,但未配置仲裁医学审核问题");
//---当前标准启用了仲裁阅片,但未配置仲裁医学审核问题
throw new BusinessValidationFailedException(_localizer["ReadingMed_ArbitrateQNotConfig"]);
}
if (criterionInfo.IsOncologyReading && !readingMedicineQuestionList.Any(x => x.ReadingCategory == ReadingCategory.Oncology))
{
throw new BusinessValidationFailedException("当前项目启用了肿瘤学阅片,但未配置肿瘤学医学审核问题");
//---当前标准启用了肿瘤学阅片,但未配置肿瘤学医学审核问题
throw new BusinessValidationFailedException(_localizer["ReadingMed_TumorQNotConfig"]);
}

View File

@ -848,7 +848,6 @@ namespace IRaCIS.Application.Services
var organIds = tableAnsweRowInfos.Where(x => x.OrganInfoId != null).Select(x => x.OrganInfoId).Distinct().ToList();
var organList = await _organInfoRepository.Where(x => organIds.Contains(x.Id)).ToListAsync();
return (await this.GetReadingTableQuestion(
new GetReadingTableQuestionOrAnswerInDto()
{
TrialReadingCriterionId = taskInfo.TrialReadingCriterionId,
@ -921,9 +920,17 @@ namespace IRaCIS.Application.Services
}
if (inDto.TaskId != null && !taskInfo.IsConvertedTask)
if (inDto.TaskId != null )
{
qusetionList = qusetionList.Where(x => x.QuestionType != QuestionType.IsConverted).OrderBy(x => x.ShowOrder).ToList();
if (taskInfo.IsConvertedTask)
{
qusetionList = qusetionList.Where(x => x.ConvertShowType == ConvertShowType.All || x.ConvertShowType == ConvertShowType.AfterShow).OrderBy(x => x.ShowOrder).ToList();
}
else
{
qusetionList = qusetionList.Where(x => x.ConvertShowType == ConvertShowType.All || x.ConvertShowType == ConvertShowType.BeforeShow).OrderBy(x => x.ShowOrder).ToList();
}
}
var usedGuropIds = qusetionList.Where(x => x.Type == ReadingQestionType.Table).Select(x => x.GroupId).ToList();
@ -1178,7 +1185,7 @@ namespace IRaCIS.Application.Services
});
answers.Add("LesionType", rowInfo.LesionType.ToString());
answers.Add("LesionType", rowInfo.LesionType.GetEnumNullInt());
answers.Add("BlindName", rowInfo.BlindName);
answers.Add("IsFirstChangeTask", isFirstChangeTask.ToString());
answers.Add("FromMark", rowInfo.FromMark);

View File

@ -1472,10 +1472,7 @@ namespace IRaCIS.Core.Domain.Share
/// </summary>
IsBrainMetastasis =43,
/// <summary>
/// 是否转变之后表格问题
/// </summary>
IsConverted = 44,
}
/// <summary>

View File

@ -158,7 +158,26 @@ namespace IRaCIS.Core.Infra.EFCore.Common
/// <typeparam name="T"></typeparam>
/// <param name="value"></param>
/// <returns></returns>
public static string GetEnumInt<T>(this T value) where T : Enum
public static string GetEnumNullInt<T>(this T? value) where T : struct, Enum
{
if (value == null)
{
return string.Empty;
}
else
{
return ((int)(object)value).ToString();
}
}
/// <summary>
/// 获取枚举Int值
/// </summary>
/// <typeparam name="T"></typeparam>
/// <param name="value"></param>
/// <returns></returns>
public static string GetEnumInt<T>(this T value) where T : Enum
{
return ((int)(object)value).ToString();

Binary file not shown.