Uat_Study
he 2023-06-01 14:55:40 +08:00
parent 865412a551
commit fd478715f3
4 changed files with 11 additions and 1 deletions

View File

@ -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

View File

@ -127,6 +127,7 @@
"ReadModule_TaskGenerated": "当前阅片已生成任务,操作失败。",
//UserWLTemplateService
"UserWLTS_MaxTemplate": "同一个用户最多只能添加10个模板",
"UserWLTS_NameRepeated": "模板名称存在重复",
// ------------------------------------------------------------Allocation--------------------------------------------------------------------
//TaskAllocationRuleService

View File

@ -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());
}

Binary file not shown.