diff --git a/IRaCIS.Core.Application/Resources/en-US.json b/IRaCIS.Core.Application/Resources/en-US.json index fdae2eea6..2e15acd41 100644 --- a/IRaCIS.Core.Application/Resources/en-US.json +++ b/IRaCIS.Core.Application/Resources/en-US.json @@ -125,6 +125,8 @@ "ReadModule_SignedDataCannotDelete": "Clinical data has been signed and cannot be deleted.", "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.", + //UserWLTemplateService + "UserWLTS_MaxTemplate": "The same user can add a maximum of 10 templates.", // ------------------------------------------------------------Allocation-------------------------------------------------------------------- //TaskAllocationRuleService diff --git a/IRaCIS.Core.Application/Resources/zh-CN.json b/IRaCIS.Core.Application/Resources/zh-CN.json index 0494bfc44..490dee6d9 100644 --- a/IRaCIS.Core.Application/Resources/zh-CN.json +++ b/IRaCIS.Core.Application/Resources/zh-CN.json @@ -125,6 +125,8 @@ "ReadModule_SignedDataCannotDelete": "临床资料已签名,不允许删除", "ReadModule_TumorExists": "当前访视存在肿瘤学阅片,请先删除肿瘤学阅片", "ReadModule_TaskGenerated": "当前阅片已生成任务,操作失败。", + //UserWLTemplateService + "UserWLTS_MaxTemplate": "同一个用户最多只能添加10个模板", // ------------------------------------------------------------Allocation-------------------------------------------------------------------- //TaskAllocationRuleService diff --git a/IRaCIS.Core.Application/Service/Reading/ShortcutKey/UserWLTemplateService.cs b/IRaCIS.Core.Application/Service/Reading/ShortcutKey/UserWLTemplateService.cs index ae00dc0e0..601f7b0b6 100644 --- a/IRaCIS.Core.Application/Service/Reading/ShortcutKey/UserWLTemplateService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ShortcutKey/UserWLTemplateService.cs @@ -8,6 +8,8 @@ using IRaCIS.Core.Domain.Models; using Microsoft.AspNetCore.Mvc; using IRaCIS.Core.Application.Interfaces; using IRaCIS.Core.Application.ViewModel; +using IRaCIS.Core.Infrastructure; + namespace IRaCIS.Core.Application.Service { /// @@ -49,6 +51,15 @@ namespace IRaCIS.Core.Application.Service public async Task AddOrUpdateUserWLTemplate(UserWLTemplateAddOrEdit addOrEditUserWLTemplate) { addOrEditUserWLTemplate.UserId = _userInfo.Id; + if (addOrEditUserWLTemplate.Id == null) + { + var count = await _userWLTemplateRepository.Where(x => x.UserId == _userInfo.Id).CountAsync(); + if (count >= 10) + { + throw new BusinessValidationFailedException(_localizer["UserWLTS_MaxTemplate"]); + } + + } var entity = await _userWLTemplateRepository.InsertOrUpdateAsync(addOrEditUserWLTemplate, true); return ResponseOutput.Ok(entity.Id.ToString()); } diff --git a/后端提示语.xlsx b/后端提示语.xlsx index d0a608f09..5bc3bd1bd 100644 Binary files a/后端提示语.xlsx and b/后端提示语.xlsx differ