Uat_Study
he 2023-06-02 14:22:44 +08:00
parent 7b272a0b21
commit 3626d2e1bf
3 changed files with 6 additions and 1 deletions

View File

@ -128,6 +128,7 @@
//UserWLTemplateService //UserWLTemplateService
"UserWLTS_MaxTemplate": "The same user can add a maximum of 10 templates.", "UserWLTS_MaxTemplate": "The same user can add a maximum of 10 templates.",
"UserWLTS_NameRepeated": "The template name is repeated", "UserWLTS_NameRepeated": "The template name is repeated",
"UserWLTS_ContentRepeated": "The template content is repeated",
// ------------------------------------------------------------Allocation-------------------------------------------------------------------- // ------------------------------------------------------------Allocation--------------------------------------------------------------------
//TaskAllocationRuleService //TaskAllocationRuleService

View File

@ -128,6 +128,7 @@
//UserWLTemplateService //UserWLTemplateService
"UserWLTS_MaxTemplate": "同一个用户最多只能添加10个模板", "UserWLTS_MaxTemplate": "同一个用户最多只能添加10个模板",
"UserWLTS_NameRepeated": "模板名称存在重复", "UserWLTS_NameRepeated": "模板名称存在重复",
"UserWLTS_ContentRepeated": "模板内容存在重复",
// ------------------------------------------------------------Allocation-------------------------------------------------------------------- // ------------------------------------------------------------Allocation--------------------------------------------------------------------
//TaskAllocationRuleService //TaskAllocationRuleService

View File

@ -65,8 +65,11 @@ namespace IRaCIS.Core.Application.Service
{ {
throw new BusinessValidationFailedException(_localizer["UserWLTS_NameRepeated"]); throw new BusinessValidationFailedException(_localizer["UserWLTS_NameRepeated"]);
} }
if (await _userWLTemplateRepository.AnyAsync(x => x.UserId == _userInfo.Id && x.WW == addOrEditUserWLTemplate.WW && x.WL == addOrEditUserWLTemplate.WL && x.Id != addOrEditUserWLTemplate.Id))
{
throw new BusinessValidationFailedException(_localizer["UserWLTS_ContentRepeated"]);
}
var entity = await _userWLTemplateRepository.InsertOrUpdateAsync(addOrEditUserWLTemplate, true); var entity = await _userWLTemplateRepository.InsertOrUpdateAsync(addOrEditUserWLTemplate, true);
return ResponseOutput.Ok(entity.Id.ToString()); return ResponseOutput.Ok(entity.Id.ToString());