diff --git a/IRaCIS.Core.Application/Resources/en-US.json b/IRaCIS.Core.Application/Resources/en-US.json index b55cb18e0..f6f50df03 100644 --- a/IRaCIS.Core.Application/Resources/en-US.json +++ b/IRaCIS.Core.Application/Resources/en-US.json @@ -127,6 +127,7 @@ "ReadModule_TaskGenerated": "The current review has generated reads, operation failed.", //UserWLTemplateService "UserWLTS_MaxTemplate": "The same user can add a maximum of 10 templates.", + "UserWLTS_NameRepeated": "The template name is repeated", // ------------------------------------------------------------Allocation-------------------------------------------------------------------- //TaskAllocationRuleService diff --git a/IRaCIS.Core.Application/Resources/zh-CN.json b/IRaCIS.Core.Application/Resources/zh-CN.json index 77914d09f..7b0e809de 100644 --- a/IRaCIS.Core.Application/Resources/zh-CN.json +++ b/IRaCIS.Core.Application/Resources/zh-CN.json @@ -127,6 +127,7 @@ "ReadModule_TaskGenerated": "当前阅片已生成任务,操作失败。", //UserWLTemplateService "UserWLTS_MaxTemplate": "同一个用户最多只能添加10个模板", + "UserWLTS_NameRepeated": "模板名称存在重复", // ------------------------------------------------------------Allocation-------------------------------------------------------------------- //TaskAllocationRuleService diff --git a/IRaCIS.Core.Application/Service/Reading/ShortcutKey/UserWLTemplateService.cs b/IRaCIS.Core.Application/Service/Reading/ShortcutKey/UserWLTemplateService.cs index 601f7b0b6..9ae14cf62 100644 --- a/IRaCIS.Core.Application/Service/Reading/ShortcutKey/UserWLTemplateService.cs +++ b/IRaCIS.Core.Application/Service/Reading/ShortcutKey/UserWLTemplateService.cs @@ -60,7 +60,15 @@ namespace IRaCIS.Core.Application.Service } } - var entity = await _userWLTemplateRepository.InsertOrUpdateAsync(addOrEditUserWLTemplate, true); + + if(await _userWLTemplateRepository.AnyAsync(x=> x.UserId == _userInfo.Id&&x.TemplateName== addOrEditUserWLTemplate.TemplateName&&x.Id!= addOrEditUserWLTemplate.Id)) + { + throw new BusinessValidationFailedException(_localizer["UserWLTS_NameRepeated"]); + } + + + + var entity = await _userWLTemplateRepository.InsertOrUpdateAsync(addOrEditUserWLTemplate, true); return ResponseOutput.Ok(entity.Id.ToString()); } diff --git a/后端提示语.xlsx b/后端提示语.xlsx index 126951a04..0d03604bb 100644 Binary files a/后端提示语.xlsx and b/后端提示语.xlsx differ